diff options
author | unknown <monty@mysql.com> | 2004-10-06 01:24:21 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-10-06 01:24:21 +0300 |
commit | 0d76cb7ea4a20570342d51136a6da598fb553800 (patch) | |
tree | 0acac4cf9ee4cc804d6d4376b33bfb1b7f99efce /sql/ha_myisam.cc | |
parent | c0364263d9dcc9f122529804576f65640587acd4 (diff) | |
download | mariadb-git-0d76cb7ea4a20570342d51136a6da598fb553800.tar.gz |
Reverted patch for new usage of open_count as it caused more problems than it solved
Cleaned up patch for checking locks for multi-table updates
myisam/mi_close.c:
Reverted patch for new usage of open_counts
myisam/mi_locking.c:
Reverted patch for new usage of open_counts
sql/ha_myisam.cc:
Reverted patch for new usage of open_counts
sql/handler.cc:
Removed compiler warning
sql/sql_acl.cc:
Removed compiler warning
sql/sql_table.cc:
No need to unlock after failed call to external_lock()
sql/sql_update.cc:
Cleaned up (and made it more secure) patch for checking locks for multi-table updates
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r-- | sql/ha_myisam.cc | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 2b7b8f436b1..3bfee7cdd79 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -998,32 +998,14 @@ int ha_myisam::delete_table(const char *name) return mi_delete_table(name); } + int ha_myisam::external_lock(THD *thd, int lock_type) { - int rc; - - while ((! (rc= mi_lock_database(file, !table->tmp_table ? - lock_type : ((lock_type == F_UNLCK) ? - F_UNLCK : F_EXTRA_LCK)))) && - mi_is_crashed(file) && (myisam_recover_options != HA_RECOVER_NONE)) - { - /* - check_and_repair() implicitly write locks the table, unless a - LOCK TABLES is in effect. It should be safer to always write lock here. - The implicit lock by check_and_repair() will then be a no-op. - check_and_repair() does not restore the original lock, but unlocks the - table. So we have to get the requested lock type again. And then to - check, if the table has been crashed again meanwhile by another server. - If anything fails, we break. - */ - if (((lock_type != F_WRLCK) && (rc= mi_lock_database(file, F_WRLCK))) || - (rc= check_and_repair(thd))) - break; - } - return rc; + return mi_lock_database(file, !table->tmp_table ? + lock_type : ((lock_type == F_UNLCK) ? + F_UNLCK : F_EXTRA_LCK)); } - THR_LOCK_DATA **ha_myisam::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) |