summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorpetr/cps@mysql.com/owlet.local <>2006-10-13 17:26:46 +0400
committerpetr/cps@mysql.com/owlet.local <>2006-10-13 17:26:46 +0400
commit6846f8d9c4f5f3d3573ed6fe961125f0172c23ae (patch)
treed9ddce943269971a31abcd891f5801ef0afea94f /storage
parentfaad25233682a040c8d726dbfba6fedc2d4f0b6b (diff)
downloadmariadb-git-6846f8d9c4f5f3d3573ed6fe961125f0172c23ae.tar.gz
Fix for Bug #17544 "Cannot do atomic log rotate",
Bug #21785 "Server crashes after rename of the log table" and Bug #21966 "Strange warnings on create like/repair of the log tables" According to the patch, from now on, one should use RENAME to perform a log table rotation (this should also be reflected in the manual). Here is a sample: use mysql; CREATE TABLE IF NOT EXISTS general_log2 LIKE general_log; RENAME TABLE general_log TO general_log_backup, general_log2 TO general_log; The rules for Rename of the log tables are following: IF 1. Log tables are enabled AND 2. Rename operates on the log table and nothing is being renamed to the log table. DO 3. Throw an error message. ELSE 4. Perform rename. The very RENAME query will go the the old (backup) table. This is consistent with the behavoiur we have with binlog ROTATE LOGS statement. Other problems, which are solved by the patch are: 1) Now REPAIR of the log table is exclusive operation (as it should be), this also eliminates lock-related warnings. and 2) CREATE LIKE TABLE now usese usual read lock on the source table rather then name lock, which is too restrictive. This way we get rid of another log table-related warning, which occured because of the above fact (as a side-effect, name lock resulted in a warning).
Diffstat (limited to 'storage')
-rw-r--r--storage/csv/ha_tina.cc4
-rw-r--r--storage/myisam/ha_myisam.cc8
2 files changed, 6 insertions, 6 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 2fe2afeb470..5a7a15e93c5 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -817,9 +817,9 @@ void ha_tina::update_status()
bool ha_tina::check_if_locking_is_allowed(uint sql_command,
ulong type, TABLE *table,
uint count,
- bool called_by_logger_thread)
+ bool called_by_privileged_thread)
{
- if (!called_by_logger_thread)
+ if (!called_by_privileged_thread)
return check_if_log_table_locking_is_allowed(sql_command, type, table);
return TRUE;
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 209478ee9a5..321ebab29e7 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -255,7 +255,7 @@ err:
bool ha_myisam::check_if_locking_is_allowed(uint sql_command,
ulong type, TABLE *table,
uint count,
- bool called_by_logger_thread)
+ bool called_by_privileged_thread)
{
/*
To be able to open and lock for reading system tables like 'mysql.proc',
@@ -273,10 +273,10 @@ bool ha_myisam::check_if_locking_is_allowed(uint sql_command,
/*
Deny locking of the log tables, which is incompatible with
- concurrent insert. Unless called from a logger THD:
- general_log_thd or slow_log_thd.
+ concurrent insert. Unless called from a logger THD (general_log_thd
+ or slow_log_thd) or by a privileged thread.
*/
- if (!called_by_logger_thread)
+ if (!called_by_privileged_thread)
return check_if_log_table_locking_is_allowed(sql_command, type, table);
return TRUE;