From: Maitrayi Sabaratnam Date: September 18 2012 12:09pm Subject: bzr push into mysql-5.1-telco-7.0 branch (maitrayi.sabaratnam:4977 to 4978) Bug#14578595 List-Archive: http://lists.mysql.com/commits/144786 X-Bug: 14578595 Message-Id: <20120918120910.14304.35832.4978@asator03-z7.no.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4978 Maitrayi Sabaratnam 2012-09-18 Bug#14578595 - CONCURRENT ALTER TABLE WITH DML GIVES: GOT ERROR -1 'UNKNOWN ERROR CODE' FROM NDB added: mysql-test/suite/ndb/r/ndb_alter_table_dml.result mysql-test/suite/ndb/t/ndb_alter_table_dml.test modified: storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp storage/ndb/src/ndbapi/ndberror.c 4977 Frazer Clement 2012-09-13 [merge] Merge 6.3->7.0 added: mysql-test/suite/ndb/r/ndb_backup_rate.result mysql-test/suite/ndb/t/ndb_backup_rate.cnf mysql-test/suite/ndb/t/ndb_backup_rate.test modified: storage/ndb/src/kernel/blocks/backup/Backup.cpp storage/ndb/src/kernel/blocks/backup/Backup.hpp === added file 'mysql-test/suite/ndb/r/ndb_alter_table_dml.result' --- a/mysql-test/suite/ndb/r/ndb_alter_table_dml.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/ndb/r/ndb_alter_table_dml.result 2012-09-18 12:00:01 +0000 @@ -0,0 +1,43 @@ +call mtr.add_suppression(".*NDB_SHARE.*Moving away for safety, but possible memleak"); +use test; +create table parent(a int primary key, b int, key(b)) engine=ndb; +create table child(a int primary key, b int) engine=ndb; +insert into parent values (1,1), (2,2), (3,3), (4,4); +insert into parent select a+4, b+4 from parent; +insert into parent select a+8, b+8 from parent; +insert into parent select a+16, b+16 from parent; +insert into parent select a+32, b+32 from parent; +insert into parent select a+64, b+64 from parent; +insert into parent select a+128, b+128 from parent; +insert into parent select a+256, b+256 from parent; +insert into parent select a+512, b+512 from parent; +insert into parent select a+1024, b+1024 from parent; +insert into parent select a+2048, b+2048 from parent; +insert into parent select a+4096, b+4096 from parent; +insert into child select * from parent; +explain +select count(*) +from parent join child +on (parent.b = child.a) +where parent.b > 5; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE parent range b b 5 NULL 819 Using where with pushed condition +1 SIMPLE child eq_ref PRIMARY PRIMARY 4 test.parent.b 1 +show variables like 'server_id'; +Variable_name Value +server_id 1 +Starting engines... +call queryload(10); +call queryload(10); +call queryload(10); +call queryload(10); +show variables like 'server_id'; +Variable_name Value +server_id 2 +Beginning alter table child partition by key(a) partitions 4; +alter table child partition by key(a) partitions 4; +Completed. +Ending test. Droping table parent +drop table parent; +drop table child; +drop procedure queryload; === added file 'mysql-test/suite/ndb/t/ndb_alter_table_dml.test' --- a/mysql-test/suite/ndb/t/ndb_alter_table_dml.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/ndb/t/ndb_alter_table_dml.test 2012-09-18 12:00:01 +0000 @@ -0,0 +1,111 @@ +--source include/have_multi_ndb.inc +connect (j1,localhost,root,,test); +connect (j2,localhost,root,,test); +connect (j3,localhost,root,,test); +connect (j4,localhost,root,,test); + +connect (ddl,localhost,root,,test); + +connection ddl; +call mtr.add_suppression(".*NDB_SHARE.*Moving away for safety, but possible memleak"); + +use test; + +create table parent(a int primary key, b int, key(b)) engine=ndb; +create table child(a int primary key, b int) engine=ndb; + +insert into parent values (1,1), (2,2), (3,3), (4,4); +insert into parent select a+4, b+4 from parent; +insert into parent select a+8, b+8 from parent; +insert into parent select a+16, b+16 from parent; +insert into parent select a+32, b+32 from parent; +insert into parent select a+64, b+64 from parent; +insert into parent select a+128, b+128 from parent; +insert into parent select a+256, b+256 from parent; +insert into parent select a+512, b+512 from parent; +insert into parent select a+1024, b+1024 from parent; +insert into parent select a+2048, b+2048 from parent; +insert into parent select a+4096, b+4096 from parent; + +insert into child select * from parent; + +connection j1; + +explain + select count(*) + from parent join child + on (parent.b = child.a) + where parent.b > 5; + +show variables like 'server_id'; + +--disable_query_log +delimiter %; +create procedure queryload (seconds int) +begin + set @x=time_to_sec(current_time()) + seconds; + repeat + select count(*) + from parent join child + on (parent.b = child.a) + where parent.b > 5; + until @x <= time_to_sec(current_time()) + end repeat; +end% + +delimiter ;% +--enable_query_log + +--echo Starting engines... + +connection j1; +send call queryload(10); + +connection j2; +send call queryload(10); + +connection j3; +send call queryload(10); + +connection j4; +send call queryload(10); + +sleep 3; + +connection server2; +show variables like 'server_id'; +--echo Beginning alter table child partition by key(a) partitions 4; + +alter table child partition by key(a) partitions 4; + +--echo Completed. + +connection j1; +--disable_result_log +--error 0,ER_NO_SUCH_TABLE +reap; +--enable_result_log + +connection j2; +--disable_result_log +--error 0,ER_NO_SUCH_TABLE +reap; +--enable_result_log + +connection j3; +--disable_result_log +--error 0,ER_NO_SUCH_TABLE +reap; +--enable_result_log + +connection j4; +--disable_result_log +--error 0,ER_NO_SUCH_TABLE +reap; +--enable_result_log + +connection ddl; +--echo Ending test. Droping table parent +drop table parent; +drop table child; +drop procedure queryload; === modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp' --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2012-09-12 14:18:33 +0000 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2012-09-18 12:00:01 +0000 @@ -3130,7 +3130,7 @@ Dblqh::get_table_state_error(Ptr