diff options
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 5010d115a6c..171c880db3e 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -68,9 +68,12 @@ TODO: #include "mysql_priv.h" #include <hash.h> -#include <assert.h> - -extern HASH open_cache; +#include "ha_myisammrg.h" +#ifndef MASTER +#include "../srclib/myisammrg/myrg_def.h" +#else +#include "../myisammrg/myrg_def.h" +#endif static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table,uint count, bool unlock, TABLE **write_locked); @@ -156,6 +159,7 @@ retry: sql_lock=0; } } + thd->lock_time(); DBUG_RETURN (sql_lock); } @@ -431,8 +435,12 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, return 0; } } + THR_LOCK_DATA **org_locks = locks; locks=table->file->store_lock(thd, locks, get_old_locks ? TL_IGNORE : lock_type); + if (locks) + for ( ; org_locks != locks ; org_locks++) + (*org_locks)->debug_print_param= (void *) table; } return sql_lock; } @@ -487,7 +495,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) { TABLE *table; char key[MAX_DBKEY_LENGTH]; - char *db= table_list->db ? table_list->db : (thd->db ? thd->db : (char*) ""); + char *db= table_list->db; uint key_length; DBUG_ENTER("lock_table_name"); DBUG_PRINT("enter",("db: %s name: %s", db, table_list->real_name)); @@ -519,7 +527,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) table->locked_by_name=1; table_list->table=table; - if (hash_insert(&open_cache, (byte*) table)) + if (my_hash_insert(&open_cache, (byte*) table)) { my_free((gptr) table,MYF(0)); DBUG_RETURN(-1); |