diff options
author | unknown <monty@donna.mysql.com> | 2000-08-29 12:31:01 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2000-08-29 12:31:01 +0300 |
commit | 52046a7ba3c00111bf27195197b486a9ef558416 (patch) | |
tree | 8c9e3c031400ac400edcf6561fe51f4bdbd69369 /sql/lock.cc | |
parent | 844c92364e04fb17371c4a71dee52f179f8ad253 (diff) | |
download | mariadb-git-52046a7ba3c00111bf27195197b486a9ef558416.tar.gz |
Bug fixes for 3.23.23
myisam/mi_debug.c:
***MISSING WEAVE***
Docs/internals.texi:
Added coding guidelines
Docs/manual.texi:
Changelog update + Win32 -> Windows
client/mysql.cc:
Changed --no-named-commands to be on by default
client/mysqlimport.c:
Bug fix
include/config-win.h:
Update of supported functions
include/global.h:
Removed compiler warning
libmysql/libmysql.c:
Fix for Ia64
myisam/ChangeLog:
Changelog
myisam/Makefile.am:
Added file mi_dbug.c
myisam/ft_stopwords.c:
Fix for Ia64
myisam/mi_delete_table.c:
Extra debugging
myisam/mi_rename.c:
Extra debugging
myisam/mi_rnext.c:
Fixed bug with MIN and concurrent insert
myisam/mi_rprev.c:
Fixed bug with MAX and concurrent insert
myisam/mi_search.c:
Fixed bug with DECIMAL/NUMERIC keys
myisam/myisamdef.h:
Extra debugging
scripts/make_binary_distribution.sh:
Added thread safe mysql library
sql/ha_heap.cc:
Fix of HEAP bug with range keys
sql/ha_heap.h:
Fix of HEAP bug with range keys
sql/handler.cc:
Optimizing
sql/handler.h:
Optimizing
sql/lock.cc:
More DEBUG + fix of RENAME bug
sql/mini_client.cc:
Fix for Ia64
sql/mysql_priv.h:
Fix for name locks
sql/mysqld.cc:
Shorter message if wrong options
sql/opt_range.cc:
Added TODO
sql/sql_base.cc:
Fix for DROP TABLE
sql/sql_parse.cc:
Fix of permission checking for CHECK TABLE
sql/sql_select.cc:
Fix of using LEFT JOIN with empty table
sql/table.h:
Fix for name locks
tests/fork_test.pl:
Fixed typo
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index a2e4daa4590..eba1851bae0 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -407,15 +407,17 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) TABLE *table; char key[MAX_DBKEY_LENGTH]; uint key_length; - key_length=(uint) (strmov(strmov(key,table_list->db)+1,table_list->name)-key)+ - 1; + DBUG_ENTER("lock_table_name"); + + key_length=(uint) (strmov(strmov(key,table_list->db)+1,table_list->name) + -key)+ 1; /* Only insert the table if we haven't insert it already */ for (table=(TABLE*) hash_search(&open_cache,(byte*) key,key_length) ; table ; table = (TABLE*) hash_next(&open_cache,(byte*) key,key_length)) if (table->in_use == thd) - return 0; + DBUG_RETURN(0); /* Create a table entry with the right key and with an old refresh version */ /* Note that we must use my_malloc() here as this is freed by the table @@ -423,17 +425,18 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list) if (!(table= (TABLE*) my_malloc(sizeof(*table)+key_length, MYF(MY_WME | MY_ZEROFILL)))) - return -1; + DBUG_RETURN(-1); memcpy((table->table_cache_key= (char*) (table+1)), key, key_length); table->key_length=key_length; table->in_use=thd; + table->locked_by_name=1; table_list->table=table; if (hash_insert(&open_cache, (byte*) table)) - return -1; + DBUG_RETURN(-1); if (remove_table_from_cache(thd, table_list->db, table_list->name)) - return 1; // Table is in use - return 0; + DBUG_RETURN(1); // Table is in use + DBUG_RETURN(0); } void unlock_table_name(THD *thd, TABLE_LIST *table_list) @@ -446,7 +449,7 @@ static bool locked_named_table(THD *thd, TABLE_LIST *table_list) { for ( ; table_list ; table_list=table_list->next) { - if (table_list->table && table_is_used(table_list->table)) + if (table_list->table && table_is_used(table_list->table,0)) return 1; } return 0; // All tables are locked @@ -456,6 +459,7 @@ static bool locked_named_table(THD *thd, TABLE_LIST *table_list) bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list) { bool result=0; + DBUG_ENTER("wait_for_locked_table_names"); while (locked_named_table(thd,table_list)) { @@ -467,5 +471,5 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list) wait_for_refresh(thd); pthread_mutex_lock(&LOCK_open); } - return result; + DBUG_RETURN(result); } |