diff options
author | unknown <hf@deer.(none)> | 2003-07-14 12:40:58 +0500 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2003-07-14 12:40:58 +0500 |
commit | 5e2939525b3abe6fea78b5bae54dc81520f7d2a4 (patch) | |
tree | 68da54f595c64ddbe52b1d77fcc1a9febbe0b56b /sql/ha_myisam.cc | |
parent | f3b5cbcb82f8e62aea826cddc7d60bf23af11353 (diff) | |
download | mariadb-git-5e2939525b3abe6fea78b5bae54dc81520f7d2a4.tar.gz |
Proposed bugfix for #712
Monty revoked any locks for temporary tables in
ha_myisam::external_lock()
But further code bans using write cache on nonlocked tables
this makes operations much slower
myisam/mi_locking.c:
Handling of MI_TEMPORARY_TABLE lock
myisam/myisamdef.h:
defining of MI_TEMPORARY_TABLE
sql/ha_myisam.cc:
now we lock temporary tables using MI_TEMPORARY_TABLE lock
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r-- | sql/ha_myisam.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 595123f7ac1..969fa3232c3 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -559,7 +559,8 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize) strmov(fixed_name,file->filename); // Don't lock tables if we have used LOCK TABLE - if (!thd->locked_tables && mi_lock_database(file,F_WRLCK)) + if (!thd->locked_tables && + mi_lock_database(file, table->tmp_table ? MI_TEMPORARY_TABLE : F_WRLCK)) { mi_check_print_error(¶m,ER(ER_CANT_LOCK),my_errno); DBUG_RETURN(HA_ADMIN_FAILED); @@ -999,9 +1000,9 @@ int ha_myisam::delete_table(const char *name) int ha_myisam::external_lock(THD *thd, int lock_type) { - if (!table->tmp_table) - return mi_lock_database(file,lock_type); - return 0; + return mi_lock_database(file, !table->tmp_table ? + lock_type : ((lock_type == F_UNLCK) ? + F_UNLCK : MI_TEMPORARY_TABLE)); } |