3688 Rohit Kalhans 2011-12-26 [merge]
upmerge from mysql-5.5 to mysql-trunk
modified:
mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
3687 Praveenkumar Hulakund 2011-12-26
BUG#11764724 - 57586: UNKNOWN TABLE WHEN TRYING TO DROP A TABLE AND NO AVAILABLE UNDO
SLOTS LEFT
Description:
If you attempt to drop an existing InnoDB table, but you do not have any
available undo slots open, then you will receive an "unknown table" error.
mysql> DROP TABLE test.innodb_table_monitor;
ERROR 1051 (42S02): Unknown table 'innodb_table_monitor'
How To Repeat:
<first> make sure max_connections > 1024 </first>
use test;
create table t (id int) engine=innodb;
create table innodb_table_monitor (id int) engine=innodb;
Run following script:
<?
$db_arr=array();
for ($i = 1; $i <= 1024; $i++) {
$db=$db_arr[$i]=mysql_connect("localhost:3307","root","pass",1);
mysql_select_db("test",$db);
mysql_query("BEGIN",$db) or die(mysql_error());
mysql_query("INSERT INTO t VALUES ($i)",$db) or die(mysql_error());
}
$db=$db_arr[$i]=mysql_connect("localhost:3307","root","pass",1);
mysql_select_db("test",$db);
mysql_query("DROP TABLE test.innodb_table_monitor",$db) or die(mysql_error());
sleep(60);
?>
After the above script, it will throw the following error:
Unknown table 'innodb_table_monitor'
Analysis:
Here, max number of concurrent transactions/connections are started and then the
next transaction to drop a table is initiated. Since, system has already max number
of transactions running, next transaction to "drop table" was not started and innodb
returned error "DB_TOO_MANY_CONCURRENT_TRXS". But this error was not handled properly
in sql layer because of which "drop table" operation was throwing wrong error message.
Fix:
As a fix, I have added check in sql (in function "mysql_rm_table_part2") to handle error
code "HA_ERR_TOO_MANY_CONCURRENT_TRXS" and throw proper error message.
Ouput of drop command after fix (with max number of concurrent transaction running)
mysql> drop table test;
ERROR 177 (HY000): Too many active concurrent transactions
To reproduce this issue, max_connections should be set to value greater than 1024 and
1024 connections/transactions need to be started. Since, this process consumes lot of
time and resource, I havent added test case in mysql_test. But I will update but list
with request of QA assistance to verify fix.
modified:
sql/sql_table.cc
=== modified file 'mysql-test/suite/rpl/r/rpl_known_bugs_detection.result'
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result 2011-11-19 08:08:03 +0000
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result 2011-12-26 17:21:34 +0000
@@ -3,6 +3,7 @@ Warnings:
Note 1756 Sending passwords in plain text without SSL/TLS is extremely insecure.
Note 1757 Storing MySQL user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MySQL Manual for more about this issue and possible alternatives.
[connection master]
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
UNIQUE(b));
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
=== modified file 'mysql-test/suite/rpl/t/rpl_known_bugs_detection.test'
--- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test 2011-09-29 10:42:53 +0000
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test 2011-12-26 17:21:34 +0000
@@ -8,6 +8,8 @@ source include/have_debug.inc;
source include/have_binlog_checksum_off.inc;
source include/master-slave.inc;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+
# Currently only statement-based-specific bugs are here
-- source include/have_binlog_format_statement.inc
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (rohit.kalhans:3687 to 3688) | Rohit Kalhans | 29 Dec |