diff options
author | hf@deer.(none) <> | 2003-07-14 12:40:58 +0500 |
---|---|---|
committer | hf@deer.(none) <> | 2003-07-14 12:40:58 +0500 |
commit | 9b4ebf3d295ff7b8a3501ec113e3bdd67703fdb6 (patch) | |
tree | 68da54f595c64ddbe52b1d77fcc1a9febbe0b56b /sql/ha_myisam.cc | |
parent | f7570df170baad076fe6eabda60399e0bf7833fb (diff) | |
download | mariadb-git-9b4ebf3d295ff7b8a3501ec113e3bdd67703fdb6.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
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)); } |