#At file:///Users/shulga/projects/mysql/mysql-5.5-bugteam/ based on revid:zhenxing.he@stripped
3261 Dmitry Shulga 2010-11-08 [merge]
Auto-merge from mysql-5.1-bugteam for bug#47924.
modified:
mysql-test/r/log_tables.result
mysql-test/t/log_tables.test
sql/sql_rename.cc
=== modified file 'mysql-test/r/log_tables.result'
--- a/mysql-test/r/log_tables.result 2009-12-22 11:02:52 +0000
+++ b/mysql-test/r/log_tables.result 2010-11-07 18:06:22 +0000
@@ -896,6 +896,16 @@ TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#3
TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2
DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
+use mysql;
+drop table if exists renamed_general_log;
+drop table if exists renamed_slow_log;
+RENAME TABLE general_log TO renamed_general_log;
+ERROR HY000: Cannot rename 'general_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'general_log'
+RENAME TABLE slow_log TO renamed_slow_log;
+ERROR HY000: Cannot rename 'slow_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'slow_log'
+use test;
+flush tables with read lock;
+unlock tables;
SET @@session.long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
=== modified file 'mysql-test/t/log_tables.test'
--- a/mysql-test/t/log_tables.test 2009-11-24 11:08:04 +0000
+++ b/mysql-test/t/log_tables.test 2010-11-07 18:06:22 +0000
@@ -1034,6 +1034,25 @@ DROP TABLE t1;
TRUNCATE TABLE mysql.slow_log;
+#
+# Bug #47924 main.log_tables times out sporadically
+#
+
+use mysql;
+# Should result in error
+--disable_warnings
+drop table if exists renamed_general_log;
+drop table if exists renamed_slow_log;
+--enable_warnings
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE general_log TO renamed_general_log;
+--error ER_CANT_RENAME_LOG_TABLE
+RENAME TABLE slow_log TO renamed_slow_log;
+
+use test;
+flush tables with read lock;
+unlock tables;
+
SET @@session.long_query_time= @old_long_query_time;
SET @@global.log_output= @old_log_output;
=== modified file 'sql/sql_rename.cc'
--- a/sql/sql_rename.cc 2010-09-16 09:11:13 +0000
+++ b/sql/sql_rename.cc 2010-11-07 18:06:22 +0000
@@ -108,7 +108,7 @@ bool mysql_rename_tables(THD *thd, TABLE
*/
my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), ren_table->table_name,
ren_table->table_name);
- DBUG_RETURN(1);
+ goto err;
}
}
else
@@ -121,7 +121,7 @@ bool mysql_rename_tables(THD *thd, TABLE
*/
my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), ren_table->table_name,
ren_table->table_name);
- DBUG_RETURN(1);
+ goto err;
}
else
{
@@ -139,7 +139,7 @@ bool mysql_rename_tables(THD *thd, TABLE
else
my_error(ER_CANT_RENAME_LOG_TABLE, MYF(0), rename_log_table[1],
rename_log_table[1]);
- DBUG_RETURN(1);
+ goto err;
}
}
Attachment: [text/bzr-bundle] bzr/dmitry.shulga@oracle.com-20101107180622-19snaulo1lrnw2pn.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5-bugteam branch (Dmitry.Shulga:3261) Bug#47924 | Dmitry Shulga | 7 Nov |