From: Date: August 14 2008 10:19am Subject: bzr commit into mysql-6.0 branch (hezx:2685) Bug#18817 Bug#37302 Bug#37884 Bug#38290 Bug#38296 Bug#38369 Bug#38486 List-Archive: http://lists.mysql.com/commits/51605 X-Bug: 18817,37302,37884,38290,38296,38369,38486 Message-Id: <200808140819.m7E8JSTt003509@mail.hezx.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///media/sda3/work/mysql/bzrwork/merge/6.0-rpl-testfixes/ 2685 He Zhenxing 2008-08-14 [merge] Merge 5.1-rpl-testfixes -> 6.0-rpl-testfixes modified: mysql-test/extra/rpl_tests/rpl_row_basic.test mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result sql/sql_binlog.cc sql/sql_cursor.cc tests/mysql_client_test.c === modified file 'mysql-test/extra/rpl_tests/rpl_row_basic.test' --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test 2008-07-25 15:10:14 +0000 +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test 2008-08-14 08:18:06 +0000 @@ -309,46 +309,46 @@ sync_slave_with_master; # 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8 connection master; -CREATE TABLE t1 (i INT NOT NULL, - c CHAR(16) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); - -CREATE TABLE t2 (i INT NOT NULL, - c CHAR(16) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t1 (i INT NOT NULL, + c CHAR(16) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; + +eval CREATE TABLE t2 (i INT NOT NULL, + c CHAR(16) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t3 (i INT NOT NULL, - c CHAR(128) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t3 (i INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t4 (i INT NOT NULL, - c CHAR(128) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); - -CREATE TABLE t5 (i INT NOT NULL, - c CHAR(255) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t4 (i INT NOT NULL, + c CHAR(128) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; + +eval CREATE TABLE t5 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t6 (i INT NOT NULL, - c CHAR(255) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t6 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; sync_slave_with_master; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; connection master; -CREATE TABLE t7 (i INT NOT NULL, - c CHAR(255) CHARACTER SET utf8 NOT NULL, - j INT NOT NULL); +eval CREATE TABLE t7 (i INT NOT NULL, + c CHAR(255) CHARACTER SET utf8 NOT NULL, + j INT NOT NULL) ENGINE = $type ; --echo [expecting slave to replicate correctly] connection master; @@ -356,6 +356,8 @@ INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); sync_slave_with_master; +sync_slave_with_master; + let $diff_table_1=master:test.t1; let $diff_table_2=slave:test.t1; source include/diff_tables.inc; @@ -366,6 +368,8 @@ INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); sync_slave_with_master; +sync_slave_with_master; + let $diff_table_1=master:test.t2; let $diff_table_2=slave:test.t2; source include/diff_tables.inc; @@ -381,7 +385,11 @@ let $last_error = query_get_value("SHOW disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +connection master; +RESET MASTER; +connection slave; +STOP SLAVE; +RESET SLAVE; START SLAVE; source include/wait_for_slave_to_start.inc; @@ -391,6 +399,8 @@ INSERT INTO t4 VALUES (1, "", 1); INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); sync_slave_with_master; +sync_slave_with_master; + let $diff_table_1=master:test.t4; let $diff_table_2=slave:test.t4; source include/diff_tables.inc; @@ -406,7 +416,11 @@ let $last_error = query_get_value("SHOW disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +connection master; +RESET MASTER; +connection slave; +STOP SLAVE; +RESET SLAVE; START SLAVE; source include/wait_for_slave_to_start.inc; @@ -421,7 +435,11 @@ let $last_error = query_get_value("SHOW disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +connection master; +RESET MASTER; +connection slave; +STOP SLAVE; +RESET SLAVE; START SLAVE; source include/wait_for_slave_to_start.inc; @@ -431,6 +449,8 @@ INSERT INTO t7 VALUES (1, "", 1); INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); sync_slave_with_master; +sync_slave_with_master; + let $diff_table_1=master:test.t7; let $diff_table_2=slave:test.t7; source include/diff_tables.inc; === modified file 'mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result' --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result 2008-07-21 03:55:09 +0000 +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result 2008-08-14 08:18:06 +0000 @@ -453,29 +453,29 @@ a b c DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'MYISAM' ; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); @@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 512, test.t3 on slave has size 65. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); @@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 1020, test.t5 on slave has size 65. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 1020, test.t6 on slave has size 513. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); === modified file 'mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result' --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result 2008-07-21 03:55:09 +0000 +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result 2008-08-14 08:18:06 +0000 @@ -453,29 +453,29 @@ a b c DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; CREATE TABLE t1 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t2 (i INT NOT NULL, c CHAR(16) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t3 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t4 (i INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; CREATE TABLE t5 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; CREATE TABLE t6 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, -j INT NOT NULL); +j INT NOT NULL) ENGINE = 'INNODB' ; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); @@ -489,7 +489,9 @@ INSERT INTO t3 VALUES (1, "", 1); INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 512, test.t3 on slave has size 65. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t4 VALUES (1, "", 1); @@ -500,14 +502,18 @@ INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 1020, test.t5 on slave has size 65. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to stop] INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error Table definition on master and slave does not match: Column 1 size mismatch - master has size 1020, test.t6 on slave has size 513. Master's column size should be <= the slave's column size. -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=8; +RESET MASTER; +STOP SLAVE; +RESET SLAVE; START SLAVE; [expecting slave to replicate correctly] INSERT INTO t7 VALUES (1, "", 1); === modified file 'mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test' --- a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test 2008-06-26 05:18:28 +0000 +++ b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test 2008-08-14 08:18:06 +0000 @@ -1,6 +1,6 @@ # Same test as rpl_truncate_7ndb.test, but with mixed mode # This is marked with 'big_test' just because the rpl_truncate_7ndb test is # so slow... - +--source include/have_binlog_format_mixed.inc --source include/big_test.inc --source suite/rpl_ndb/t/rpl_truncate_7ndb.test === modified file 'mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result' --- a/mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result 2008-06-27 12:39:40 +0000 +++ b/mysql-test/suite/rpl_ndb_big/r/rpl_row_basic_7ndb.result 2008-08-14 08:18:06 +0000 @@ -437,7 +437,7 @@ SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 set @@global.slave_exec_mode= default; Last_SQL_Error -0 + SELECT COUNT(*) FROM t1 ORDER BY c1,c2; COUNT(*) 0 **** Test for BUG#37076 **** @@ -451,3 +451,72 @@ SELECT * FROM t1; a b c 2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14 DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8; +CREATE TABLE t1 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +CREATE TABLE t2 (i INT NOT NULL, +c CHAR(16) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t3 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t4 (i INT NOT NULL, +c CHAR(128) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +CREATE TABLE t5 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t6 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; +CREATE TABLE t7 (i INT NOT NULL, +c CHAR(255) CHARACTER SET utf8 NOT NULL, +j INT NOT NULL) ENGINE = 'NDB' ; +[expecting slave to replicate correctly] +INSERT INTO t1 VALUES (1, "", 1); +INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t1 and slave:test.t1 +[expecting slave to replicate correctly] +INSERT INTO t2 VALUES (1, "", 1); +INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); +Comparing tables master:test.t2 and slave:test.t2 +[expecting slave to stop] +INSERT INTO t3 VALUES (1, "", 1); +INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +RESET MASTER; +STOP SLAVE; +RESET SLAVE; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t4 VALUES (1, "", 1); +INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2); +Comparing tables master:test.t4 and slave:test.t4 +[expecting slave to stop] +INSERT INTO t5 VALUES (1, "", 1); +INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +RESET MASTER; +STOP SLAVE; +RESET SLAVE; +START SLAVE; +[expecting slave to stop] +INSERT INTO t6 VALUES (1, "", 1); +INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); +Last_SQL_Error +Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +RESET MASTER; +STOP SLAVE; +RESET SLAVE; +START SLAVE; +[expecting slave to replicate correctly] +INSERT INTO t7 VALUES (1, "", 1); +INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2); +Comparing tables master:test.t7 and slave:test.t7 +drop table t1, t2, t3, t4, t5, t6, t7; === modified file 'sql/sql_binlog.cc' --- a/sql/sql_binlog.cc 2008-05-23 13:54:03 +0000 +++ b/sql/sql_binlog.cc 2008-08-14 08:18:06 +0000 @@ -208,6 +208,7 @@ void mysql_client_binlog_statement(THD* #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) if (apply_event_and_update_pos(ev, thd, thd->rli_fake, FALSE)) { + delete ev; /* TODO: Maybe a better error message since the BINLOG statement now contains several events. === modified file 'sql/sql_cursor.cc' --- a/sql/sql_cursor.cc 2008-08-11 13:45:45 +0000 +++ b/sql/sql_cursor.cc 2008-08-14 08:18:06 +0000 @@ -155,6 +155,7 @@ int mysql_open_cursor(THD *thd, uint fla if (! (sensitive_cursor= new (thd->mem_root) Sensitive_cursor(thd, result))) { delete result_materialize; + result_materialize= NULL; return 1; } @@ -212,6 +213,7 @@ int mysql_open_cursor(THD *thd, uint fla if ((rc= materialized_cursor->open(0))) { delete materialized_cursor; + materialized_cursor= NULL; goto err_open; } === modified file 'tests/mysql_client_test.c' --- a/tests/mysql_client_test.c 2008-08-11 13:45:45 +0000 +++ b/tests/mysql_client_test.c 2008-08-14 08:18:06 +0000 @@ -17881,6 +17881,35 @@ static void test_wl4284_1() DBUG_VOID_RETURN; } +/** + Bug#38486 Crash when using cursor protocol +*/ + +static void test_bug38486(void) +{ + MYSQL_STMT *stmt; + unsigned long type= CURSOR_TYPE_READ_ONLY; + + DBUG_ENTER("test_bug38486"); + myheader("test_bug38486"); + + stmt= mysql_stmt_init(mysql); + mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); + stmt_text= "CREATE TABLE t1 (a INT)"; + mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + mysql_stmt_execute(stmt); + mysql_stmt_close(stmt); + + stmt= mysql_stmt_init(mysql); + mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (void*)&type); + stmt_text= "INSERT INTO t1 VALUES (1)"; + mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + mysql_stmt_execute(stmt); + mysql_stmt_close(stmt); + + DBUG_VOID_RETURN; +} + /* Read and parse arguments and MySQL options from my.cnf */ @@ -18193,6 +18222,7 @@ static struct my_tests_st my_tests[]= { { "test_wl4166_4", test_wl4166_4 }, { "test_bug36004", test_bug36004 }, { "test_wl4284_1", test_wl4284_1 }, + { "test_bug38486", test_bug38486 }, { 0, 0 } };