From f66a3c0427f15fc89d1fcc61b4c2339da9d037f7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Apr 2007 16:26:32 +0200 Subject: [PATCH 001/227] Reapplied patch for bug18198 --- mysql-test/r/partition_error.result | 8 ++-- mysql-test/r/partition_hash.result | 14 ------- mysql-test/r/partition_mgm.result | 6 +-- mysql-test/r/partition_pruning.result | 58 +++++++++++++++++++++------ mysql-test/r/partition_range.result | 34 ++++++++-------- mysql-test/t/partition_error.test | 8 ++-- mysql-test/t/partition_hash.test | 12 ------ mysql-test/t/partition_mgm.test | 2 +- mysql-test/t/partition_pruning.test | 58 +++++++++++++++++++-------- mysql-test/t/partition_range.test | 26 ++++++------ sql/item.h | 18 ++++----- sql/item_cmpfunc.h | 14 ------- sql/item_func.h | 31 ++------------ sql/item_strfunc.h | 14 ------- sql/item_timefunc.h | 17 +------- sql/item_xmlfunc.h | 1 - sql/partition_info.cc | 43 ++++++++------------ sql/sql_partition.cc | 2 + sql/sql_yacc.yy | 3 +- 19 files changed, 163 insertions(+), 206 deletions(-) diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 4b01b759902..41829216178 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -25,7 +25,7 @@ partitions 3 (partition x1 values in (1,2,9,4) tablespace ts1, partition x2 values in (3, 11, 5, 7) tablespace ts2, partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3); -ERROR HY000: The PARTITION function returns the wrong type +ERROR HY000: This partition function is not allowed CREATE TABLE t1 ( a int not null, b int not null, @@ -89,7 +89,7 @@ partitions 3 (partition x1 tablespace ts1, partition x2 tablespace ts2, partition x3 tablespace ts3); -ERROR HY000: The PARTITION function returns the wrong type +ERROR HY000: This partition function is not allowed CREATE TABLE t1 ( a int not null, b int not null, @@ -422,7 +422,7 @@ partition by range (sin(a)) partitions 2 (partition x1 values less than (4), partition x2 values less than (5)); -ERROR HY000: The PARTITION function returns the wrong type +ERROR HY000: This partition function is not allowed CREATE TABLE t1 ( a int not null, b int not null, @@ -619,4 +619,4 @@ partition by range (a + (select count(*) from t1)) ERROR HY000: This partition function is not allowed create table t1 (a char(10)) partition by hash (extractvalue(a,'a')); -ERROR HY000: The PARTITION function returns the wrong type +ERROR HY000: This partition function is not allowed diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result index 7ef3ee5c6c8..9a82a36d902 100644 --- a/mysql-test/r/partition_hash.result +++ b/mysql-test/r/partition_hash.result @@ -1,18 +1,4 @@ drop table if exists t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin) -partition by hash(length(a)) -partitions 10; -insert into t1 values (''),(' '),('a'),('a '),('a '); -explain partitions select * from t1 where a='a '; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where -explain partitions select * from t1 where a='a'; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where -explain partitions select * from t1 where a='a ' OR a='a'; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where -drop table t1; create table t1 (a int unsigned) partition by hash(a div 2) partitions 4; diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result index 9b5a34bda50..04ac603fea7 100644 --- a/mysql-test/r/partition_mgm.result +++ b/mysql-test/r/partition_mgm.result @@ -10,13 +10,13 @@ subpartition sp01, subpartition sp02)); ERROR HY000: Wrong number of subpartitions defined, mismatch with previous setting drop table t1; CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30)) -PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2; +PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 2 */ hello/master-data/test/t1#P#p0.MYD hello/master-data/test/t1#P#p0.MYI hello/master-data/test/t1#P#p1.MYD @@ -29,7 +29,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `f_date` date DEFAULT NULL, `f_varchar` varchar(30) DEFAULT NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 1 */ +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 1 */ hello/master-data/test/t1#P#p0.MYD hello/master-data/test/t1#P#p0.MYI hello/master-data/test/t1.frm diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index 5fc0058356d..1143b1e4296 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -677,13 +677,12 @@ f_int1 f_int2 9 9 drop table t1; create table t1 (a char(10) binary) -partition by list(length(a)) -(partition p1 values in (1), -partition p2 values in (2), -partition p3 values in (3), -partition p4 values in (4), -partition p5 values in (5) -); +partition by list(ascii(a)) +(partition p1 values in (ascii('a')), +partition p2 values in (ascii('b')), +partition p3 values in (ascii('c')), +partition p4 values in (ascii('d')), +partition p5 values in (ascii('e'))); insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); select * from t1 where a>='a' and a <= 'dddd'; a @@ -848,22 +847,57 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; create table t1 (a int) -partition by range((a & 0xFF) << 56) ( -partition p0 values less than (0x40 << 56), -partition p1 values less than (0x80 << 56), -partition p2 values less than (0xFF << 56) +partition by range(a) ( +partition p0 values less than (64), +partition p1 values less than (128), +partition p2 values less than (255) +); +create table t2 (a int) +partition by range(a+0) ( +partition p0 values less than (64), +partition p1 values less than (128), +partition p2 values less than (255) ); insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); +insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); explain partitions select * from t1 where a=0; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t2 where a=0; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where explain partitions select * from t1 where a=0xFE; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where -explain partitions select * from t1 where a>0xFE and a<= 0xFF; +explain partitions select * from t2 where a=0xFE; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t1 where a > 0xFE AND a <= 0xFF; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +explain partitions select * from t2 where a > 0xFE AND a <= 0xFF; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p2 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p2 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t1 where a < 64 AND a >= 63; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t2 where a < 64 AND a >= 63; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p0 ALL NULL NULL NULL NULL 2 Using where +explain partitions select * from t1 where a <= 64 AND a >= 63; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where +explain partitions select * from t2 where a <= 64 AND a >= 63; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t2 p0,p1 ALL NULL NULL NULL NULL 4 Using where drop table t1; +drop table t2; create table t1(a bigint unsigned not null) partition by range(a+0) ( partition p1 values less than (10), partition p2 values less than (20), diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index d39b39f413a..e9ebd5ba2cf 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -1,36 +1,36 @@ drop table if exists t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (length(a) * b) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (ascii(a) * b) +(partition p0 values less than (2), partition p1 values less than (4000)); insert into t1 values ('a ', 2),('a',3); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (b* length(a) * b) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (b* ascii(a) * b) +(partition p0 values less than (2), partition p1 values less than (4000)); insert into t1 values ('a ', 2),('a',3); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b varchar(10) charset latin1 collate latin1_bin) -partition by range (length(b) * length(a)) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (ascii(b) * ascii(a)) +(partition p0 values less than (2), partition p1 values less than (40000)); insert into t1 values ('a ', 'b '),('a','b'); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b varchar(10) charset latin1 collate latin1_bin) -partition by range (length(a) * length(b)) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (ascii(a) * ascii(b)) +(partition p0 values less than (2), partition p1 values less than (40000)); insert into t1 values ('a ', 'b '),('a','b'); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (length(a) * c) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (ascii(a) * c) +(partition p0 values less than (2), partition p1 values less than (4000)); insert into t1 values ('a ', 'b ', 2),('a','b', 3); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (c * length(a)) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (c * ascii(a)) +(partition p0 values less than (2), partition p1 values less than (4000)); insert into t1 values ('a ', 'b ', 2),('a','b', 3); drop table t1; create table t1 (a int unsigned) @@ -109,7 +109,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 pnull_pnullsp0,pnull_pnullsp1,p0_p0sp0,p0_p0sp1 ALL NULL NULL NULL NULL 4 Using where explain partitions select * from t1 where a > 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1_p1sp0,p1_p1sp1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; CREATE TABLE t1 ( a int not null, @@ -744,7 +744,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 18 Using where DROP TABLE t1; create table t1 (a varchar(20)) -partition by range (crc32(md5(a))) +partition by range (ascii(a)) (partition p0 values less than (100), partition p1 values less than maxvalue); insert into t1 values ("12345678901234567890"); @@ -761,16 +761,16 @@ B2345678901234567890 1234567890123456 explain partitions select * from t1 where a = "12345678901234567890"; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where explain partitions select * from t1 where a = "12345678901234567890" OR a = "A2345678901234567890" OR a = "B2345678901234567890" OR a = "C2345678901234567890"; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where explain partitions select * from t1 where a = "01234567890123456"; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 5 Using where +1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where select * from t1 where a = "01234567890123456"; a select * from t1 where a = "12345678901234567890" OR diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index 20703b979f1..fa5055b2981 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -33,7 +33,7 @@ partitions 2; # # Partition by key list, wrong result type # ---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 ( a int not null, b int not null, @@ -109,7 +109,7 @@ partitions 3 # # Partition by hash, invalid result type # ---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 ( a int not null, b int not null, @@ -533,7 +533,7 @@ partitions 2 # # Partition by range, wrong result type of partition function # ---error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED CREATE TABLE t1 ( a int not null, b int not null, @@ -790,7 +790,7 @@ partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00'))); create table t1 (a int) partition by range (a + (select count(*) from t1)) (partition p1 values less than (1)); --- error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (a char(10)) partition by hash (extractvalue(a,'a')); diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test index d3f1a5f4892..3304f30fb1a 100644 --- a/mysql-test/t/partition_hash.test +++ b/mysql-test/t/partition_hash.test @@ -9,18 +9,6 @@ drop table if exists t1; --enable_warnings -# -# BUG 18198: Partition functions handling -# -create table t1 (a varchar(10) charset latin1 collate latin1_bin) -partition by hash(length(a)) -partitions 10; -insert into t1 values (''),(' '),('a'),('a '),('a '); -explain partitions select * from t1 where a='a '; -explain partitions select * from t1 where a='a'; -explain partitions select * from t1 where a='a ' OR a='a'; -drop table t1; - # # More partition pruning tests, especially on interval walking # diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test index 8458d47d634..a06f8d1aee5 100644 --- a/mysql-test/t/partition_mgm.test +++ b/mysql-test/t/partition_mgm.test @@ -20,7 +20,7 @@ subpartition sp01, subpartition sp02)); drop table t1; CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30)) -PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2; +PARTITION BY HASH(YEAR(f_date)) PARTITIONS 2; SHOW CREATE TABLE t1; --replace_result $MYSQLTEST_VARDIR "hello" diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index a60846f18ff..cef57bd9356 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -539,13 +539,12 @@ drop table t1; # part2: bug in pruning code create table t1 (a char(10) binary) -partition by list(length(a)) - (partition p1 values in (1), - partition p2 values in (2), - partition p3 values in (3), - partition p4 values in (4), - partition p5 values in (5) -); +partition by list(ascii(a)) + (partition p1 values in (ascii('a')), + partition p2 values in (ascii('b')), + partition p3 values in (ascii('c')), + partition p4 values in (ascii('d')), + partition p5 values in (ascii('e'))); insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); select * from t1 where a>='a' and a <= 'dddd'; explain partitions select * from t1 where a>='a' and a <= 'dddd'; @@ -692,20 +691,47 @@ explain partitions select * from t1 where a = 18446744073709551000; explain partitions select * from t1 where a = 18446744073709551613; explain partitions select * from t1 where a = 18446744073709551614; drop table t1; - -create table t1 (a int) - partition by range((a & 0xFF) << 56) ( - partition p0 values less than (0x40 << 56), - partition p1 values less than (0x80 << 56), - partition p2 values less than (0xFF << 56) +# +# Test all variants of usage for interval_via_mapping +# and interval_via_walking +# +# t1 will use interval_via_mapping since it uses a +# monotonic function, whereas t2 will use +# interval_via_walking since the intervals are short +# and the function isn't monotonic (it is, but it isn't +# discovered in this version). +# + create table t1 (a int) + partition by range(a) ( + partition p0 values less than (64), + partition p1 values less than (128), + partition p2 values less than (255) ); -insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); +create table t2 (a int) + partition by range(a+0) ( + partition p0 values less than (64), + partition p1 values less than (128), + partition p2 values less than (255) +); + +insert into t1 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); +insert into t2 values (0x20), (0x20), (0x41), (0x41), (0xFE), (0xFE); explain partitions select * from t1 where a=0; +explain partitions select * from t2 where a=0; explain partitions select * from t1 where a=0xFE; -explain partitions select * from t1 where a>0xFE and a<= 0xFF; +explain partitions select * from t2 where a=0xFE; +explain partitions select * from t1 where a > 0xFE AND a <= 0xFF; +explain partitions select * from t2 where a > 0xFE AND a <= 0xFF; +explain partitions select * from t1 where a >= 0xFE AND a <= 0xFF; +explain partitions select * from t2 where a >= 0xFE AND a <= 0xFF; +explain partitions select * from t1 where a < 64 AND a >= 63; +explain partitions select * from t2 where a < 64 AND a >= 63; +explain partitions select * from t1 where a <= 64 AND a >= 63; +explain partitions select * from t2 where a <= 64 AND a >= 63; drop table t1; - +drop table t2; + create table t1(a bigint unsigned not null) partition by range(a+0) ( partition p1 values less than (10), partition p2 values less than (20), diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 84f67febe8b..219637d6f81 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -13,42 +13,42 @@ drop table if exists t1; # BUG 18198: Various tests for partition functions # create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (length(a) * b) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (ascii(a) * b) +(partition p0 values less than (2), partition p1 values less than (4000)); insert into t1 values ('a ', 2),('a',3); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (b* length(a) * b) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (b* ascii(a) * b) +(partition p0 values less than (2), partition p1 values less than (4000)); insert into t1 values ('a ', 2),('a',3); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b varchar(10) charset latin1 collate latin1_bin) -partition by range (length(b) * length(a)) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (ascii(b) * ascii(a)) +(partition p0 values less than (2), partition p1 values less than (40000)); insert into t1 values ('a ', 'b '),('a','b'); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b varchar(10) charset latin1 collate latin1_bin) -partition by range (length(a) * length(b)) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (ascii(a) * ascii(b)) +(partition p0 values less than (2), partition p1 values less than (40000)); insert into t1 values ('a ', 'b '),('a','b'); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (length(a) * c) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (ascii(a) * c) +(partition p0 values less than (2), partition p1 values less than (4000)); insert into t1 values ('a ', 'b ', 2),('a','b', 3); drop table t1; create table t1 (a varchar(10) charset latin1 collate latin1_bin, b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (c * length(a)) -(partition p0 values less than (2), partition p1 values less than (400)); +partition by range (c * ascii(a)) +(partition p0 values less than (2), partition p1 values less than (4000)); insert into t1 values ('a ', 'b ', 2),('a','b', 3); drop table t1; @@ -734,7 +734,7 @@ DROP TABLE t1; # Bug 18198: Try with a couple of cases using VARCHAR fields in # partition function. create table t1 (a varchar(20)) -partition by range (crc32(md5(a))) +partition by range (ascii(a)) (partition p0 values less than (100), partition p1 values less than maxvalue); diff --git a/sql/item.h b/sql/item.h index 09c118a2e14..80aa72e746b 100644 --- a/sql/item.h +++ b/sql/item.h @@ -839,8 +839,7 @@ public: german character for double s is equal to 2 s. The default is that an item is not allowed - in a partition function. However all mathematical functions, string - manipulation functions, date functions are allowed. Allowed functions + in a partition function. Allowed functions can never depend on server version, they cannot depend on anything related to the environment. They can also only depend on a set of fields in the table itself. They cannot depend on other tables and @@ -1425,7 +1424,7 @@ public: bool is_null() { return 1; } void print(String *str) { str->append(STRING_WITH_LEN("NULL")); } Item *safe_charset_converter(CHARSET_INFO *tocs); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} + bool check_partition_func_processor(byte *int_arg) { return FALSE;} }; class Item_null_result :public Item_null @@ -1610,6 +1609,7 @@ public: uint decimal_precision() const { return (uint)(max_length - test(value < 0)); } bool eq(const Item *, bool binary_cmp) const; + bool check_partition_func_processor(byte *bool_arg) { return FALSE;} }; @@ -1627,6 +1627,7 @@ public: void print(String *str); Item_num *neg (); uint decimal_precision() const { return max_length; } + bool check_partition_func_processor(byte *bool_arg) { return FALSE;} }; @@ -1669,6 +1670,7 @@ public: uint decimal_precision() const { return decimal_value.precision(); } bool eq(const Item *, bool binary_cmp) const; void set_decimal_value(my_decimal *value_par); + bool check_partition_func_processor(byte *bool_arg) { return FALSE;} }; @@ -1729,7 +1731,6 @@ public: {} void print(String *str) { str->append(func_name); } Item *safe_charset_converter(CHARSET_INFO *tocs); - bool check_partition_func_processor(byte *int_arg) {return TRUE;} }; @@ -1807,7 +1808,7 @@ public: void print(String *str); // to prevent drop fixed flag (no need parent cleanup call) void cleanup() {} - bool check_partition_func_processor(byte *int_arg) {return FALSE;} + bool check_partition_func_processor(byte *bool_arg) { return FALSE;} }; @@ -1822,7 +1823,7 @@ public: {} Item *safe_charset_converter(CHARSET_INFO *tocs); void print(String *str) { str->append(func_name); } - bool check_partition_func_processor(byte *int_arg) {return TRUE;} + bool check_partition_func_processor(byte *bool_arg) { return TRUE;} }; @@ -1835,7 +1836,6 @@ public: &my_charset_bin) { max_length=19;} enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } - bool check_partition_func_processor(byte *int_arg) {return TRUE;} }; class Item_empty_string :public Item_string @@ -1858,7 +1858,6 @@ public: unsigned_flag=1; } enum_field_types field_type() const { return int_field_type; } - bool check_partition_func_processor(byte *int_arg) {return TRUE;} }; @@ -1882,7 +1881,7 @@ public: void cleanup() {} bool eq(const Item *item, bool binary_cmp) const; virtual Item *safe_charset_converter(CHARSET_INFO *tocs); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} + bool check_partition_func_processor(byte *bool_arg) { return FALSE;} }; @@ -2119,7 +2118,6 @@ public: } Item *clone_item(); virtual Item *real_item() { return ref; } - bool check_partition_func_processor(byte *int_arg) {return TRUE;} }; #ifdef MYSQL_SERVER diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 4a1519a5498..c5c67371a8a 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -261,7 +261,6 @@ public: } Item *neg_transformer(THD *thd); virtual Item *negated_item(); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} bool subst_argument_checker(byte **arg) { return TRUE; } }; @@ -273,7 +272,6 @@ public: enum Functype functype() const { return NOT_FUNC; } const char *func_name() const { return "not"; } Item *neg_transformer(THD *thd); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} void print(String *str); }; @@ -499,7 +497,6 @@ public: bool is_bool_func() { return 1; } CHARSET_INFO *compare_collation() { return cmp_collation.collation; } uint decimal_precision() const { return 1; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -511,7 +508,6 @@ public: optimize_type select_optimize() const { return OPTIMIZE_NONE; } const char *func_name() const { return "strcmp"; } void print(String *str) { Item_func::print(str); } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -574,7 +570,6 @@ public: const char *func_name() const { return "ifnull"; } Field *tmp_table_field(TABLE *table); uint decimal_precision() const; - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -615,7 +610,6 @@ public: void print(String *str) { Item_func::print(str); } table_map not_null_tables() const { return 0; } bool is_null(); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; /* Functions to handle the optimized IN */ @@ -1006,7 +1000,6 @@ public: void print(String *str); Item *find_item(String *str); CHARSET_INFO *compare_collation() { return cmp_collation.collation; } - bool check_partition_func_processor(byte *bool_arg) { return FALSE;} void cleanup() { uint i; @@ -1081,7 +1074,6 @@ public: bool nulls_in_row(); bool is_bool_func() { return 1; } CHARSET_INFO *compare_collation() { return cmp_collation.collation; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; /* Functions used by where clause */ @@ -1124,7 +1116,6 @@ public: optimize_type select_optimize() const { return OPTIMIZE_NULL; } Item *neg_transformer(THD *thd); CHARSET_INFO *compare_collation() { return args[0]->collation.collation; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; /* Functions used by HAVING for rewriting IN subquery */ @@ -1151,7 +1142,6 @@ public: */ table_map used_tables() const { return used_tables_cache | RAND_TABLE_BIT; } - bool check_partition_func_processor(byte *int_arg) {return TRUE;} }; @@ -1174,7 +1164,6 @@ public: void print(String *str); CHARSET_INFO *compare_collation() { return args[0]->collation.collation; } void top_level_item() { abort_on_null=1; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -1213,7 +1202,6 @@ public: const char *func_name() const { return "like"; } bool fix_fields(THD *thd, Item **ref); void cleanup(); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; #ifdef USE_REGEX @@ -1236,7 +1224,6 @@ public: const char *func_name() const { return "regexp"; } void print(String *str) { print_op(str); } CHARSET_INFO *compare_collation() { return cmp_collation.collation; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; #else @@ -1293,7 +1280,6 @@ public: Item *transform(Item_transformer transformer, byte *arg); void traverse_cond(Cond_traverser, void *arg, traverse_order order); void neg_arguments(THD *thd); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} bool subst_argument_checker(byte **arg) { return TRUE; } Item *compile(Item_analyzer analyzer, byte **arg_p, Item_transformer transformer, byte *arg_t); diff --git a/sql/item_func.h b/sql/item_func.h index 3306b059097..342880d65c5 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -253,7 +253,6 @@ public: void fix_num_length_and_dec(); void find_num_type(); String *str_op(String *str) { DBUG_ASSERT(0); return 0; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -317,7 +316,6 @@ public: { max_length=args[0]->max_length; unsigned_flag=0; } void print(String *str); uint decimal_precision() const { return args[0]->decimal_precision(); } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -351,7 +349,6 @@ public: void fix_length_and_dec() {}; const char *func_name() const { return "decimal_typecast"; } void print(String *); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -448,6 +445,7 @@ public: void fix_length_and_dec(); void fix_num_length_and_dec(); uint decimal_precision() const { return args[0]->decimal_precision(); } + bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -460,6 +458,7 @@ public: my_decimal *decimal_op(my_decimal *); const char *func_name() const { return "abs"; } void fix_length_and_dec(); + bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; // A class to handle logarithmic and trigonometric functions @@ -494,7 +493,6 @@ public: Item_func_exp(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "exp"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -504,7 +502,6 @@ public: Item_func_ln(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "ln"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -515,7 +512,6 @@ public: Item_func_log(Item *a,Item *b) :Item_dec_func(a,b) {} double val_real(); const char *func_name() const { return "log"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -525,7 +521,6 @@ public: Item_func_log2(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "log2"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -535,7 +530,6 @@ public: Item_func_log10(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "log10"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -545,7 +539,6 @@ public: Item_func_sqrt(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "sqrt"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -555,7 +548,6 @@ public: Item_func_pow(Item *a,Item *b) :Item_dec_func(a,b) {} double val_real(); const char *func_name() const { return "pow"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -565,7 +557,6 @@ public: Item_func_acos(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "acos"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_asin :public Item_dec_func @@ -574,7 +565,6 @@ public: Item_func_asin(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "asin"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_atan :public Item_dec_func @@ -584,7 +574,6 @@ public: Item_func_atan(Item *a,Item *b) :Item_dec_func(a,b) {} double val_real(); const char *func_name() const { return "atan"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_cos :public Item_dec_func @@ -593,7 +582,6 @@ public: Item_func_cos(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "cos"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_sin :public Item_dec_func @@ -602,7 +590,6 @@ public: Item_func_sin(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "sin"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_tan :public Item_dec_func @@ -611,7 +598,6 @@ public: Item_func_tan(Item *a) :Item_dec_func(a) {} double val_real(); const char *func_name() const { return "tan"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_integer :public Item_int_func @@ -639,6 +625,7 @@ public: longlong int_op(); double real_op(); my_decimal *decimal_op(my_decimal *); + bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -650,6 +637,7 @@ public: longlong int_op(); double real_op(); my_decimal *decimal_op(my_decimal *); + bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; /* This handles round and truncate */ @@ -690,7 +678,6 @@ public: Item_func_sign(Item *a) :Item_int_func(a) {} const char *func_name() const { return "sign"; } longlong val_int(); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -705,7 +692,6 @@ public: const char *func_name() const { return name; } void fix_length_and_dec() { decimals= NOT_FIXED_DEC; max_length= float_length(decimals); } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -723,7 +709,6 @@ public: my_decimal *val_decimal(my_decimal *); void fix_length_and_dec(); enum Item_result result_type () const { return cmp_type; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_min :public Item_func_min_max @@ -749,7 +734,6 @@ public: longlong val_int(); const char *func_name() const { return "length"; } void fix_length_and_dec() { max_length=10; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_bit_length :public Item_func_length @@ -769,7 +753,6 @@ public: longlong val_int(); const char *func_name() const { return "char_length"; } void fix_length_and_dec() { max_length=10; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_coercibility :public Item_int_func @@ -793,7 +776,6 @@ public: longlong val_int(); void fix_length_and_dec(); void print(String *str); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -828,7 +810,6 @@ public: Item_func_ord(Item *a) :Item_int_func(a) {} longlong val_int(); const char *func_name() const { return "ord"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_find_in_set :public Item_int_func @@ -842,7 +823,6 @@ public: longlong val_int(); const char *func_name() const { return "find_in_set"; } void fix_length_and_dec(); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; /* Base class for all bit functions: '~', '|', '^', '&', '>>', '<<' */ @@ -854,7 +834,6 @@ public: Item_func_bit(Item *a) :Item_int_func(a) {} void fix_length_and_dec() { unsigned_flag= 1; } void print(String *str) { print_op(str); } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_bit_or :public Item_func_bit @@ -880,7 +859,6 @@ public: longlong val_int(); const char *func_name() const { return "bit_count"; } void fix_length_and_dec() { max_length=2; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_shift_left :public Item_func_bit @@ -1321,7 +1299,6 @@ public: longlong val_int(); const char *func_name() const { return "inet_aton"; } void fix_length_and_dec() { decimals= 0; max_length= 21; maybe_null= 1; unsigned_flag= 1;} - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index ae11e001551..41466eb92cf 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -50,7 +50,6 @@ public: String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "md5"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -94,7 +93,6 @@ public: String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "concat"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_concat_ws :public Item_str_func @@ -116,7 +114,6 @@ public: String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "reverse"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -154,7 +151,6 @@ protected: public: Item_str_conv(Item *item) :Item_str_func(item) {} String *val_str(String *); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -455,7 +451,6 @@ public: String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "soundex"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -549,7 +544,6 @@ public: String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "rpad"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -562,7 +556,6 @@ public: String *val_str(String *); void fix_length_and_dec(); const char *func_name() const { return "lpad"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -577,7 +570,6 @@ public: collation.set(default_charset()); max_length= 64; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -594,7 +586,6 @@ public: decimals=0; max_length=args[0]->max_length*2*collation.collation->mbmaxlen; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_unhex :public Item_str_func @@ -610,7 +601,6 @@ public: decimals=0; max_length=(1+args[0]->max_length)/2; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -634,7 +624,6 @@ public: } void print(String *str); const char *func_name() const { return "cast_as_binary"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -674,7 +663,6 @@ public: String* val_str(String* str); const char *func_name() const { return "inet_ntoa"; } void fix_length_and_dec() { decimals = 0; max_length=3*8+7; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_quote :public Item_str_func @@ -689,7 +677,6 @@ public: collation.set(args[0]->collation); max_length= args[0]->max_length * 2 + 2; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_conv_charset :public Item_str_func @@ -790,7 +777,6 @@ public: const char *func_name() const { return "crc32"; } void fix_length_and_dec() { max_length=10; } longlong val_int(); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_uncompressed_length : public Item_int_func diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index e53826ce3df..e83ebe46f1d 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -38,7 +38,6 @@ public: { max_length=6*MY_CHARSET_BIN_MB_MAXLEN; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -53,7 +52,6 @@ public: decimals=0; max_length=6*MY_CHARSET_BIN_MB_MAXLEN; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -129,6 +127,7 @@ public: max_length=10*my_charset_bin.mbmaxlen; maybe_null=1; } + bool check_partition_func_processor(byte *int_arg) {return TRUE;} }; @@ -224,7 +223,6 @@ public: max_length=2*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_yearweek :public Item_int_func @@ -303,6 +301,7 @@ class Item_func_dayname :public Item_func_weekday max_length=9*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } + bool check_partition_func_processor(byte *int_arg) {return TRUE;} }; @@ -319,7 +318,6 @@ public: decimals=0; max_length=10*MY_CHARSET_BIN_MB_MAXLEN; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -602,7 +600,6 @@ public: void fix_length_and_dec(); uint format_length(const String *format); bool eq(const Item *item, bool binary_cmp) const; - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -621,7 +618,6 @@ class Item_func_from_unixtime :public Item_date_func const char *func_name() const { return "from_unixtime"; } void fix_length_and_dec(); bool get_date(TIME *res, uint fuzzy_date); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -685,7 +681,6 @@ public: } const char *func_name() const { return "sec_to_time"; } bool result_as_longlong() { return TRUE; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -708,7 +703,6 @@ public: bool get_date(TIME *res, uint fuzzy_date); bool eq(const Item *item, bool binary_cmp) const; void print(String *str); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -763,7 +757,6 @@ public: max_length=args[0]->max_length; maybe_null= 1; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -783,7 +776,6 @@ public: String *val_str(String *a); void fix_length_and_dec(); void print(String *str); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -885,7 +877,6 @@ public: max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; } longlong val_int(); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -908,7 +899,6 @@ public: } void print(String *str); const char *func_name() const { return "add_time"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} my_decimal *val_decimal(my_decimal *decimal_value) { DBUG_ASSERT(fixed == 1); @@ -949,7 +939,6 @@ public: :Item_str_timefunc(a, b ,c) {} String *val_str(String *str); const char *func_name() const { return "maketime"; } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; class Item_func_microsecond :public Item_int_func @@ -981,7 +970,6 @@ public: maybe_null=1; } void print(String *str); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; @@ -1028,7 +1016,6 @@ public: { return tmp_table_field_from_field_type(table, 1); } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; diff --git a/sql/item_xmlfunc.h b/sql/item_xmlfunc.h index 9f2860ef403..278c98baf7c 100644 --- a/sql/item_xmlfunc.h +++ b/sql/item_xmlfunc.h @@ -41,7 +41,6 @@ public: Item_func_xml_extractvalue(Item *a,Item *b) :Item_xml_str_func(a,b) {} const char *func_name() const { return "extractvalue"; } String *val_str(String *); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} }; diff --git a/sql/partition_info.cc b/sql/partition_info.cc index a7f9bd413c6..3af79f453ad 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -880,7 +880,6 @@ bool partition_info::set_up_charset_field_preps() Field *field, **ptr; char **char_ptrs; unsigned i; - bool found; size_t size; uint tot_fields= 0; uint tot_part_fields= 0; @@ -893,7 +892,6 @@ bool partition_info::set_up_charset_field_preps() { ptr= part_field_array; /* Set up arrays and buffers for those fields */ - i= 0; while ((field= *(ptr++))) { if (field_is_partition_charset(field)) @@ -929,7 +927,7 @@ bool partition_info::set_up_charset_field_preps() } part_charset_field_array[i]= NULL; } - if (is_sub_partitioned() && list_of_subpart_fields && + if (is_sub_partitioned() && !list_of_subpart_fields && check_part_func_fields(subpart_field_array, FALSE)) { /* Set up arrays and buffers for those fields */ @@ -937,7 +935,10 @@ bool partition_info::set_up_charset_field_preps() while ((field= *(ptr++))) { if (field_is_partition_charset(field)) + { tot_subpart_fields++; + tot_fields++; + } } size= tot_subpart_fields * sizeof(char*); if (!(char_ptrs= (char**)sql_calloc(size))) @@ -953,7 +954,6 @@ bool partition_info::set_up_charset_field_preps() i= 0; while ((field= *(ptr++))) { - unsigned j= 0; CHARSET_INFO *cs; char *field_buf; LINT_INIT(field_buf); @@ -962,28 +962,16 @@ bool partition_info::set_up_charset_field_preps() continue; cs= ((Field_str*)field)->charset(); size= field->pack_length(); - found= FALSE; - for (j= 0; j < tot_part_fields; j++) - { - if (field == part_charset_field_array[i]) - found= TRUE; - } - if (!found) - { - tot_fields++; - if (!(field_buf= sql_calloc(size))) - goto error; - } + if (!(field_buf= sql_calloc(size))) + goto error; + subpart_charset_field_array[i]= field; subpart_field_buffers[i++]= field_buf; } - if (!(char_ptrs= (char**)sql_calloc(size))) - goto error; - restore_subpart_field_ptrs= char_ptrs; + subpart_charset_field_array[i]= NULL; } if (tot_fields) { - uint j,k,l; - + uint k; size= tot_fields*sizeof(char**); if (!(char_ptrs= (char**)sql_calloc(size))) goto error; @@ -1001,11 +989,12 @@ bool partition_info::set_up_charset_field_preps() full_part_field_buffers[i]= part_field_buffers[i]; } k= tot_part_fields; - l= 0; for (i= 0; i < tot_subpart_fields; i++) { + uint j; + bool found= FALSE; field= subpart_charset_field_array[i]; - found= FALSE; + for (j= 0; j < tot_part_fields; j++) { if (field == part_charset_field_array[i]) @@ -1013,12 +1002,12 @@ bool partition_info::set_up_charset_field_preps() } if (!found) { - full_part_charset_field_array[l]= subpart_charset_field_array[k]; - full_part_field_buffers[l]= subpart_field_buffers[k]; - k++; l++; + full_part_charset_field_array[k]= subpart_charset_field_array[i]; + full_part_field_buffers[k]= subpart_field_buffers[i]; + k++; } } - full_part_charset_field_array[tot_fields]= NULL; + full_part_charset_field_array[k]= NULL; } DBUG_RETURN(FALSE); error: diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 923e851c0ff..b5e9855be27 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -2890,6 +2890,8 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info, } if (unsigned_flag) part_func_value-= 0x8000000000000000ULL; + if (left_endpoint && !include_endpoint) + part_func_value++; while (max_part_id > min_part_id) { loc_part_id= (max_part_id + min_part_id + 1) >> 1; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 424fd98c4fc..9fdb1874e1d 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3956,8 +3956,7 @@ part_bit_expr: } Lex->part_info->curr_part_elem->has_null_value= TRUE; } - else if (part_expr->result_type() != INT_RESULT && - !part_expr->null_value) + else if (part_expr->result_type() != INT_RESULT) { yyerror(ER(ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR)); YYABORT; From ec4b50b54f436e45ab0d37eb67e7bf919ab8b02a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Apr 2007 14:10:37 +0200 Subject: [PATCH 002/227] merge error --- mysql-test/r/partition_pruning.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index 1143b1e4296..80a24bc7065 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -846,7 +846,7 @@ explain partitions select * from t1 where a = 18446744073709551614; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables drop table t1; -create table t1 (a int) +create table t1 (a int) partition by range(a) ( partition p0 values less than (64), partition p1 values less than (128), From 2ad7512a57f5a6e33d7d0f56d8067ef45df23b94 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Apr 2007 20:34:36 +0200 Subject: [PATCH 003/227] More test cases mysql-test/t/partition_charset.test: New test case from bug report mysql-test/t/partition_list.test: New test case from bug report mysql-test/r/partition_bug18198.result: New test case mysql-test/t/partition_bug18198.test: New test case --- mysql-test/r/partition_bug18198.result | 205 ++++++++++++++++++++ mysql-test/t/partition_bug18198.test | 252 +++++++++++++++++++++++++ mysql-test/t/partition_charset.test | 7 + mysql-test/t/partition_list.test | 4 + 4 files changed, 468 insertions(+) create mode 100644 mysql-test/r/partition_bug18198.result create mode 100644 mysql-test/t/partition_bug18198.test diff --git a/mysql-test/r/partition_bug18198.result b/mysql-test/r/partition_bug18198.result new file mode 100644 index 00000000000..091de9fb853 --- /dev/null +++ b/mysql-test/r/partition_bug18198.result @@ -0,0 +1,205 @@ +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +create table t1 (a char(5) character set koi8r) +partition by list (ascii(a) mod 3) +subpartition by hash(ascii(a)) +subpartitions 3 +(partition p1 values in (1), +partition p2 values in (2), +partition p0 values in (0)); +insert into t1 values ('a'); +explain partitions select * from t1 where a = 'a'; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p2_p2sp2 system NULL NULL NULL NULL 1 +select * from t1 where a = 'a'; +a +a +drop table t1; +create table t1 (a char(5) character set cp1251) +partition by list (ascii(a)) (partition pn values in (null)); +drop table t1; +create table t1 (col1 datetime) +partition by range(datediff(col1,col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +drop table t1; +create table t1 (a char(5) character set big5) +partition by list (ascii(a)) (partition pn values in (null)); +ERROR HY000: This partition function is not allowed +create table t1 (a char(1)) +partition by list(ascii(a)) +(partition p1 values in (ascii('i'))); +drop table t1; +create table t1 (s1 char(5) character set latin5) +partition by list (ascii(s1)) +(partition p1 values in (1)); +set names utf8; +drop table t1; +create table t1 (col1 int) +partition by range(greatest(col1,10)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(isnull(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(least(col1,12)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(case when col1>0 then 10 else 20 end) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(ifnull(col1,5)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(nullif(col1,5)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(bit_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(bit_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(char_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(char_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(character_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(find_in_set(col1,1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(find_in_set(col1,'1')) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(instr(col1,3)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(instr(col1,'3')) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(locate(1,col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(locate(1,col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(octet_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(position(1 in col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(position(1 in col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 char(5)) +partition by range(strcmp(col1,2)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(strcmp(col1,2)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(crc32(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(round(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(sign(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 datetime) +partition by range(period_add(col1,5)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 datetime, col2 datetime) +partition by range(period_diff(col1,col2)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int, col2 int) +partition by range(period_diff(col1,col2)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 datetime) +partition by range(timestampdiff(day,5,col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 date) +partition by range(unix_timestamp(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 datetime) +partition by range(week(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 varchar(25)) +partition by range(cast(col1 as signed)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 varchar(25)) +partition by range(convert(col1,unsigned)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 | 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 & 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 ^ 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 << 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(col1 >> 20) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(~col1) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(bit_count(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed +create table t1 (col1 int) +partition by range(inet_aton(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +ERROR HY000: This partition function is not allowed diff --git a/mysql-test/t/partition_bug18198.test b/mysql-test/t/partition_bug18198.test new file mode 100644 index 00000000000..2d36ea4665e --- /dev/null +++ b/mysql-test/t/partition_bug18198.test @@ -0,0 +1,252 @@ +-- source include/have_partition.inc +--disable warnings +drop table if exists t1; +--enable warnings + +create table t1 (a char(5) character set koi8r) +partition by list (ascii(a) mod 3) +subpartition by hash(ascii(a)) +subpartitions 3 +(partition p1 values in (1), + partition p2 values in (2), + partition p0 values in (0)); +insert into t1 values ('a'); +explain partitions select * from t1 where a = 'a'; +select * from t1 where a = 'a'; +drop table t1; + +create table t1 (a char(5) character set cp1251) +partition by list (ascii(a)) (partition pn values in (null)); +drop table t1; + +create table t1 (col1 datetime) +partition by range(datediff(col1,col1)) +(partition p0 values less than (10), partition p1 values less than (30)); +drop table t1; + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (a char(5) character set big5) +partition by list (ascii(a)) (partition pn values in (null)); + +create table t1 (a char(1)) +partition by list(ascii(a)) +(partition p1 values in (ascii('i'))); +#insert into t1 values ('i'); +drop table t1; + +create table t1 (s1 char(5) character set latin5) +partition by list (ascii(s1)) +(partition p1 values in (1)); +set names utf8; +#insert into tn values ('¿¿'); +drop table t1; + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(greatest(col1,10)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(isnull(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(least(col1,12)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(case when col1>0 then 10 else 20 end) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(ifnull(col1,5)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(nullif(col1,5)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(bit_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(bit_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(char_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(char_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(character_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(find_in_set(col1,1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(find_in_set(col1,'1')) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(instr(col1,3)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(instr(col1,'3')) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(locate(1,col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(locate(1,col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(octet_length(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(position(1 in col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(position(1 in col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 char(5)) +partition by range(strcmp(col1,2)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(strcmp(col1,2)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(crc32(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(round(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(sign(col1)) +(partition p0 values less than (2), partition p1 values less than (6)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 datetime) +partition by range(period_add(col1,5)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 datetime, col2 datetime) +partition by range(period_diff(col1,col2)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int, col2 int) +partition by range(period_diff(col1,col2)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 datetime) +partition by range(timestampdiff(day,5,col1)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 date) +partition by range(unix_timestamp(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 datetime) +partition by range(week(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 varchar(25)) +partition by range(cast(col1 as signed)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 varchar(25)) +partition by range(convert(col1,unsigned)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 | 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 & 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 ^ 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 << 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(col1 >> 20) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(~col1) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(bit_count(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); + +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED +create table t1 (col1 int) +partition by range(inet_aton(col1)) +(partition p0 values less than (10), partition p1 values less than (30)); diff --git a/mysql-test/t/partition_charset.test b/mysql-test/t/partition_charset.test index 27d0dc87b89..5e8f128e87a 100644 --- a/mysql-test/t/partition_charset.test +++ b/mysql-test/t/partition_charset.test @@ -19,3 +19,10 @@ flush tables; set names latin1; select * from t1; drop table t1; + +create table t1 (a varchar(1), primary key (a)) +partition by list (ascii(a)) +(partition p1 values in (65)); +insert into t1 values ('A'); +replace into t1 values ('A'); +drop table t1; diff --git a/mysql-test/t/partition_list.test b/mysql-test/t/partition_list.test index 1e420cfe6ed..7d71d66f2d9 100644 --- a/mysql-test/t/partition_list.test +++ b/mysql-test/t/partition_list.test @@ -179,4 +179,8 @@ insert into t1 values (null); select * from t1; drop table t1; +-- error ER_PARTITION_FUNC_NOT_ALLOWED +create table t1 (a char(1)) +partition by list (ascii(ucase(a))) +(partition p1 values in (2)); From 2a2b1ea8258a151f2420e8b6226b3fad629956ad Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Apr 2007 18:35:16 +0200 Subject: [PATCH 004/227] BUG#18198 Added new test cases, fixed bugs in relation to those mysql-test/r/partition_charset.result: New test case mysql-test/r/partition_list.result: New test case mysql-test/t/partition_list.test: New test case sql/partition_info.cc: Missing initialisation sql/sql_partition.cc: key_restore made use of field->ptr in VARCHAR fields and when used with REPLACE it caused the key_restore to become against table->record[0] when buf pointed to table->record[1] --- mysql-test/r/partition_charset.result | 6 ++++++ mysql-test/r/partition_list.result | 4 ++++ mysql-test/t/partition_list.test | 2 +- sql/partition_info.cc | 1 + sql/sql_partition.cc | 15 ++++++++++++--- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/partition_charset.result b/mysql-test/r/partition_charset.result index 665e5d55f8f..bb6cb5e3bef 100644 --- a/mysql-test/r/partition_charset.result +++ b/mysql-test/r/partition_charset.result @@ -16,3 +16,9 @@ s1 1 3 drop table t1; +create table t1 (a varchar(1), primary key (a)) +partition by list (ascii(a)) +(partition p1 values in (65)); +insert into t1 values ('A'); +replace into t1 values ('A'); +drop table t1; diff --git a/mysql-test/r/partition_list.result b/mysql-test/r/partition_list.result index e64a7a8d154..a68a67c6386 100644 --- a/mysql-test/r/partition_list.result +++ b/mysql-test/r/partition_list.result @@ -295,3 +295,7 @@ select * from t1; a 100 drop table t1; +create table t1 (a char(1)) +partition by list (ascii(ucase(a))) +(partition p1 values in (2)); +ERROR HY000: This partition function is not allowed diff --git a/mysql-test/t/partition_list.test b/mysql-test/t/partition_list.test index 7d71d66f2d9..1c76de9d55a 100644 --- a/mysql-test/t/partition_list.test +++ b/mysql-test/t/partition_list.test @@ -179,7 +179,7 @@ insert into t1 values (null); select * from t1; drop table t1; --- error ER_PARTITION_FUNC_NOT_ALLOWED +--error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (a char(1)) partition by list (ascii(ucase(a))) (partition p1 values in (2)); diff --git a/sql/partition_info.cc b/sql/partition_info.cc index 3af79f453ad..6dfedde7116 100644 --- a/sql/partition_info.cc +++ b/sql/partition_info.cc @@ -951,6 +951,7 @@ bool partition_info::set_up_charset_field_preps() if (!(char_ptrs= (char**)sql_alloc(size))) goto error; subpart_charset_field_array= (Field**)char_ptrs; + ptr= subpart_field_array; i= 0; while ((field= *(ptr++))) { diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 86068cc5c0d..c02beee350c 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3315,13 +3315,16 @@ static uint32 get_sub_part_id_from_key(const TABLE *table,byte *buf, uint32 part_id; DBUG_ENTER("get_sub_part_id_from_key"); - key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length); if (likely(rec0 == buf)) + { + key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length); part_id= part_info->get_subpartition_id(part_info); + } else { Field **part_field_array= part_info->subpart_field_array; set_field_ptr(part_field_array, buf, rec0); + key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length); part_id= part_info->get_subpartition_id(part_info); set_field_ptr(part_field_array, rec0, buf); } @@ -3358,14 +3361,17 @@ bool get_part_id_from_key(const TABLE *table, byte *buf, KEY *key_info, longlong func_value; DBUG_ENTER("get_part_id_from_key"); - key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length); if (likely(rec0 == buf)) + { + key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length); result= part_info->get_part_partition_id(part_info, part_id, &func_value); + } else { Field **part_field_array= part_info->part_field_array; set_field_ptr(part_field_array, buf, rec0); + key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length); result= part_info->get_part_partition_id(part_info, part_id, &func_value); set_field_ptr(part_field_array, rec0, buf); @@ -3405,14 +3411,17 @@ void get_full_part_id_from_key(const TABLE *table, byte *buf, longlong func_value; DBUG_ENTER("get_full_part_id_from_key"); - key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length); if (likely(rec0 == buf)) + { + key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length); result= part_info->get_partition_id(part_info, &part_spec->start_part, &func_value); + } else { Field **part_field_array= part_info->full_part_field_array; set_field_ptr(part_field_array, buf, rec0); + key_restore(buf, (byte*)key_spec->key, key_info, key_spec->length); result= part_info->get_partition_id(part_info, &part_spec->start_part, &func_value); set_field_ptr(part_field_array, rec0, buf); From e0c0cdc3faa34546479dd7d81099bc90126484d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Apr 2007 18:46:12 +0200 Subject: [PATCH 005/227] Removed warnings --- mysql-test/r/partition_bug18198.result | 2 -- mysql-test/t/partition_bug18198.test | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/partition_bug18198.result b/mysql-test/r/partition_bug18198.result index 091de9fb853..2071545dbca 100644 --- a/mysql-test/r/partition_bug18198.result +++ b/mysql-test/r/partition_bug18198.result @@ -1,6 +1,4 @@ drop table if exists t1; -Warnings: -Note 1051 Unknown table 't1' create table t1 (a char(5) character set koi8r) partition by list (ascii(a) mod 3) subpartition by hash(ascii(a)) diff --git a/mysql-test/t/partition_bug18198.test b/mysql-test/t/partition_bug18198.test index 2d36ea4665e..caf9bd560c0 100644 --- a/mysql-test/t/partition_bug18198.test +++ b/mysql-test/t/partition_bug18198.test @@ -1,7 +1,7 @@ -- source include/have_partition.inc ---disable warnings +--disable_warnings drop table if exists t1; ---enable warnings +--enable_warnings create table t1 (a char(5) character set koi8r) partition by list (ascii(a) mod 3) From 59f309c8586ae7ff2d62ce3ac7c9c1b567da61ff Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Jun 2007 16:12:02 +0200 Subject: [PATCH 006/227] manual merge --- sql/item.h | 6 +++--- sql/item_func.h | 8 ++++---- sql/item_timefunc.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sql/item.h b/sql/item.h index 2c380fc2f69..fb2ccb6b2c9 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1627,7 +1627,7 @@ public: uint decimal_precision() const { return (uint)(max_length - test(value < 0)); } bool eq(const Item *, bool binary_cmp) const; - bool check_partition_func_processor(byte *bool_arg) { return FALSE;} + bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} }; @@ -1645,7 +1645,7 @@ public: void print(String *str); Item_num *neg (); uint decimal_precision() const { return max_length; } - bool check_partition_func_processor(byte *bool_arg) { return FALSE;} + bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} }; @@ -1688,7 +1688,7 @@ public: uint decimal_precision() const { return decimal_value.precision(); } bool eq(const Item *, bool binary_cmp) const; void set_decimal_value(my_decimal *value_par); - bool check_partition_func_processor(byte *bool_arg) { return FALSE;} + bool check_partition_func_processor(uchar *bool_arg) { return FALSE;} }; diff --git a/sql/item_func.h b/sql/item_func.h index dc53a63bfe8..8b4b66c1410 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -439,7 +439,7 @@ public: void fix_length_and_dec(); void fix_num_length_and_dec(); uint decimal_precision() const { return args[0]->decimal_precision(); } - bool check_partition_func_processor(byte *int_arg) {return FALSE;} + bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; @@ -452,7 +452,7 @@ public: my_decimal *decimal_op(my_decimal *); const char *func_name() const { return "abs"; } void fix_length_and_dec(); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} + bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; // A class to handle logarithmic and trigonometric functions @@ -619,7 +619,7 @@ public: longlong int_op(); double real_op(); my_decimal *decimal_op(my_decimal *); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} + bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; @@ -631,7 +631,7 @@ public: longlong int_op(); double real_op(); my_decimal *decimal_op(my_decimal *); - bool check_partition_func_processor(byte *int_arg) {return FALSE;} + bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; /* This handles round and truncate */ diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index bdf3560a55d..32f5bcf8e52 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -127,7 +127,7 @@ public: max_length=10*my_charset_bin.mbmaxlen; maybe_null=1; } - bool check_partition_func_processor(byte *int_arg) {return TRUE;} + bool check_partition_func_processor(uchar *int_arg) {return TRUE;} }; @@ -301,7 +301,7 @@ class Item_func_dayname :public Item_func_weekday max_length=9*MY_CHARSET_BIN_MB_MAXLEN; maybe_null=1; } - bool check_partition_func_processor(byte *int_arg) {return TRUE;} + bool check_partition_func_processor(uchar *int_arg) {return TRUE;} }; From ed3ff663f3dc4aa87e24c60a35ffe7e9f77ac119 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Jun 2007 16:40:29 +0200 Subject: [PATCH 007/227] Already fixed by bug27123 fix --- sql/sql_partition.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 799127995bd..edc59cad6a1 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3294,16 +3294,15 @@ static uint32 get_sub_part_id_from_key(const TABLE *table,uchar *buf, uint32 part_id; DBUG_ENTER("get_sub_part_id_from_key"); + key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); if (likely(rec0 == buf)) { - key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); part_id= part_info->get_subpartition_id(part_info); } else { Field **part_field_array= part_info->subpart_field_array; set_field_ptr(part_field_array, buf, rec0); - key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); part_id= part_info->get_subpartition_id(part_info); set_field_ptr(part_field_array, rec0, buf); } @@ -3340,9 +3339,9 @@ bool get_part_id_from_key(const TABLE *table, uchar *buf, KEY *key_info, longlong func_value; DBUG_ENTER("get_part_id_from_key"); + key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); if (likely(rec0 == buf)) { - key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); result= part_info->get_part_partition_id(part_info, part_id, &func_value); } @@ -3350,7 +3349,6 @@ bool get_part_id_from_key(const TABLE *table, uchar *buf, KEY *key_info, { Field **part_field_array= part_info->part_field_array; set_field_ptr(part_field_array, buf, rec0); - key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); result= part_info->get_part_partition_id(part_info, part_id, &func_value); set_field_ptr(part_field_array, rec0, buf); @@ -3390,9 +3388,9 @@ void get_full_part_id_from_key(const TABLE *table, uchar *buf, longlong func_value; DBUG_ENTER("get_full_part_id_from_key"); + key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); if (likely(rec0 == buf)) { - key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); result= part_info->get_partition_id(part_info, &part_spec->start_part, &func_value); } @@ -3400,7 +3398,6 @@ void get_full_part_id_from_key(const TABLE *table, uchar *buf, { Field **part_field_array= part_info->full_part_field_array; set_field_ptr(part_field_array, buf, rec0); - key_restore(buf, (uchar*)key_spec->key, key_info, key_spec->length); result= part_info->get_partition_id(part_info, &part_spec->start_part, &func_value); set_field_ptr(part_field_array, rec0, buf); From ff3f8990e74e8133fb68bea7b85a60b055c9feb9 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Jun 2007 17:28:59 +0200 Subject: [PATCH 008/227] Disabled ascii-function mysql-test/r/partition_bug18198.result: Disabled a lot of test cases using ascii-function mysql-test/r/partition_charset.result: Disabled a lot of test cases using ascii-function mysql-test/r/partition_error.result: Disabled a lot of test cases using ascii-function mysql-test/r/partition_pruning.result: Disabled a lot of test cases using ascii-function mysql-test/r/partition_range.result: Disabled a lot of test cases using ascii-function mysql-test/t/partition_bug18198.test: Disabled a lot of test cases using ascii-function mysql-test/t/partition_charset.test: Disabled a lot of test cases using ascii-function mysql-test/t/partition_error.test: Disabled a lot of test cases using ascii-function mysql-test/t/partition_pruning.test: Disabled a lot of test cases using ascii-function mysql-test/t/partition_range.test: Disabled a lot of test cases using ascii-function --- mysql-test/r/partition_bug18198.result | 30 ------- mysql-test/r/partition_charset.result | 4 +- mysql-test/r/partition_error.result | 2 +- mysql-test/r/partition_pruning.result | 18 ---- mysql-test/r/partition_range.result | 76 ---------------- mysql-test/t/partition_bug18198.test | 33 ------- mysql-test/t/partition_charset.test | 7 +- mysql-test/t/partition_error.test | 3 +- mysql-test/t/partition_pruning.test | 22 ++--- mysql-test/t/partition_range.test | 116 ++++++++++++------------- sql/item_func.h | 1 - 11 files changed, 76 insertions(+), 236 deletions(-) diff --git a/mysql-test/r/partition_bug18198.result b/mysql-test/r/partition_bug18198.result index 2071545dbca..18d7d904bb0 100644 --- a/mysql-test/r/partition_bug18198.result +++ b/mysql-test/r/partition_bug18198.result @@ -1,38 +1,8 @@ drop table if exists t1; -create table t1 (a char(5) character set koi8r) -partition by list (ascii(a) mod 3) -subpartition by hash(ascii(a)) -subpartitions 3 -(partition p1 values in (1), -partition p2 values in (2), -partition p0 values in (0)); -insert into t1 values ('a'); -explain partitions select * from t1 where a = 'a'; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p2_p2sp2 system NULL NULL NULL NULL 1 -select * from t1 where a = 'a'; -a -a -drop table t1; -create table t1 (a char(5) character set cp1251) -partition by list (ascii(a)) (partition pn values in (null)); -drop table t1; create table t1 (col1 datetime) partition by range(datediff(col1,col1)) (partition p0 values less than (10), partition p1 values less than (30)); drop table t1; -create table t1 (a char(5) character set big5) -partition by list (ascii(a)) (partition pn values in (null)); -ERROR HY000: This partition function is not allowed -create table t1 (a char(1)) -partition by list(ascii(a)) -(partition p1 values in (ascii('i'))); -drop table t1; -create table t1 (s1 char(5) character set latin5) -partition by list (ascii(s1)) -(partition p1 values in (1)); -set names utf8; -drop table t1; create table t1 (col1 int) partition by range(greatest(col1,10)) (partition p0 values less than (2), partition p1 values less than (6)); diff --git a/mysql-test/r/partition_charset.result b/mysql-test/r/partition_charset.result index bb6cb5e3bef..f8f75e8bee7 100644 --- a/mysql-test/r/partition_charset.result +++ b/mysql-test/r/partition_charset.result @@ -19,6 +19,4 @@ drop table t1; create table t1 (a varchar(1), primary key (a)) partition by list (ascii(a)) (partition p1 values in (65)); -insert into t1 values ('A'); -replace into t1 values ('A'); -drop table t1; +ERROR HY000: This partition function is not allowed diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index 41829216178..7952c8df609 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -600,7 +600,7 @@ ERROR HY000: Partition constant is out of partition function domain create table t1 (v varchar(12)) partition by range (ascii(v)) (partition p0 values less than (10)); -drop table t1; +ERROR HY000: This partition function is not allowed create table t1 (a int) partition by hash (rand(a)); ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result index 80a24bc7065..9595676016c 100644 --- a/mysql-test/r/partition_pruning.result +++ b/mysql-test/r/partition_pruning.result @@ -676,24 +676,6 @@ f_int1 f_int2 8 8 9 9 drop table t1; -create table t1 (a char(10) binary) -partition by list(ascii(a)) -(partition p1 values in (ascii('a')), -partition p2 values in (ascii('b')), -partition p3 values in (ascii('c')), -partition p4 values in (ascii('d')), -partition p5 values in (ascii('e'))); -insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); -select * from t1 where a>='a' and a <= 'dddd'; -a -a -bb -ccc -dddd -explain partitions select * from t1 where a>='a' and a <= 'dddd'; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1,p2,p3,p4,p5 ALL NULL NULL NULL NULL 5 Using where -drop table t1; create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2))) subpartition by hash(f_int1) subpartitions 2 ( diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index e9ebd5ba2cf..a61006e87a4 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -1,38 +1,4 @@ drop table if exists t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (ascii(a) * b) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (b* ascii(a) * b) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, -b varchar(10) charset latin1 collate latin1_bin) -partition by range (ascii(b) * ascii(a)) -(partition p0 values less than (2), partition p1 values less than (40000)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, -b varchar(10) charset latin1 collate latin1_bin) -partition by range (ascii(a) * ascii(b)) -(partition p0 values less than (2), partition p1 values less than (40000)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, -b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (ascii(a) * c) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, -b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (c * ascii(a)) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; create table t1 (a int unsigned) partition by range (a) (partition pnull values less than (0), @@ -743,45 +709,3 @@ WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p407,p408,p409,p507,p508,p509 ALL NULL NULL NULL NULL 18 Using where DROP TABLE t1; -create table t1 (a varchar(20)) -partition by range (ascii(a)) -(partition p0 values less than (100), -partition p1 values less than maxvalue); -insert into t1 values ("12345678901234567890"); -insert into t1 values ("A2345678901234567890"); -insert into t1 values ("B2345678901234567890"); -insert into t1 values ("1234567890123456789"); -insert into t1 values ("1234567890123456"); -select * from t1; -a -12345678901234567890 -A2345678901234567890 -B2345678901234567890 -1234567890123456789 -1234567890123456 -explain partitions select * from t1 where a = "12345678901234567890"; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where -explain partitions select * from t1 where a = "12345678901234567890" OR -a = "A2345678901234567890" OR -a = "B2345678901234567890" OR -a = "C2345678901234567890"; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where -explain partitions select * from t1 where a = "01234567890123456"; -id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 5 Using where -select * from t1 where a = "01234567890123456"; -a -select * from t1 where a = "12345678901234567890" OR -a = "A2345678901234567890" OR -a = "B2345678901234567890" OR -a = "C2345678901234567890"; -a -12345678901234567890 -A2345678901234567890 -B2345678901234567890 -select * from t1 where a = "12345678901234567890"; -a -12345678901234567890 -drop table t1; diff --git a/mysql-test/t/partition_bug18198.test b/mysql-test/t/partition_bug18198.test index caf9bd560c0..7f071c6ec9e 100644 --- a/mysql-test/t/partition_bug18198.test +++ b/mysql-test/t/partition_bug18198.test @@ -3,44 +3,11 @@ drop table if exists t1; --enable_warnings -create table t1 (a char(5) character set koi8r) -partition by list (ascii(a) mod 3) -subpartition by hash(ascii(a)) -subpartitions 3 -(partition p1 values in (1), - partition p2 values in (2), - partition p0 values in (0)); -insert into t1 values ('a'); -explain partitions select * from t1 where a = 'a'; -select * from t1 where a = 'a'; -drop table t1; - -create table t1 (a char(5) character set cp1251) -partition by list (ascii(a)) (partition pn values in (null)); -drop table t1; - create table t1 (col1 datetime) partition by range(datediff(col1,col1)) (partition p0 values less than (10), partition p1 values less than (30)); drop table t1; --- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED -create table t1 (a char(5) character set big5) -partition by list (ascii(a)) (partition pn values in (null)); - -create table t1 (a char(1)) -partition by list(ascii(a)) -(partition p1 values in (ascii('i'))); -#insert into t1 values ('i'); -drop table t1; - -create table t1 (s1 char(5) character set latin5) -partition by list (ascii(s1)) -(partition p1 values in (1)); -set names utf8; -#insert into tn values ('¿¿'); -drop table t1; - -- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (col1 int) partition by range(greatest(col1,10)) diff --git a/mysql-test/t/partition_charset.test b/mysql-test/t/partition_charset.test index 5e8f128e87a..6842e5268fa 100644 --- a/mysql-test/t/partition_charset.test +++ b/mysql-test/t/partition_charset.test @@ -20,9 +20,10 @@ set names latin1; select * from t1; drop table t1; +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(1), primary key (a)) partition by list (ascii(a)) (partition p1 values in (65)); -insert into t1 values ('A'); -replace into t1 values ('A'); -drop table t1; +#insert into t1 values ('A'); +#replace into t1 values ('A'); +#drop table t1; diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index fa5055b2981..5fc2097cc52 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -769,10 +769,11 @@ partition by range (a) # # Bug 18198 Partitions: Verify that erroneus partition functions doesn't work # +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (v varchar(12)) partition by range (ascii(v)) (partition p0 values less than (10)); -drop table t1; +#drop table t1; -- error 1064 create table t1 (a int) diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index cef57bd9356..12951c9232a 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -538,17 +538,17 @@ select * from t1 where f_int1 between 5 and 15 order by f_int1; drop table t1; # part2: bug in pruning code -create table t1 (a char(10) binary) -partition by list(ascii(a)) - (partition p1 values in (ascii('a')), - partition p2 values in (ascii('b')), - partition p3 values in (ascii('c')), - partition p4 values in (ascii('d')), - partition p5 values in (ascii('e'))); -insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); -select * from t1 where a>='a' and a <= 'dddd'; -explain partitions select * from t1 where a>='a' and a <= 'dddd'; -drop table t1; +#create table t1 (a char(10) binary) +#partition by list(ascii(a)) +# (partition p1 values in (ascii('a')), +# partition p2 values in (ascii('b')), +# partition p3 values in (ascii('c')), +# partition p4 values in (ascii('d')), +# partition p5 values in (ascii('e'))); +#insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); +#select * from t1 where a>='a' and a <= 'dddd'; +#explain partitions select * from t1 where a>='a' and a <= 'dddd'; +#drop table t1; # BUG#18659: Assertion failure when subpartitioning is used and partition is # "IS NULL" diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 219637d6f81..50d850913bc 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -12,45 +12,45 @@ drop table if exists t1; # # BUG 18198: Various tests for partition functions # -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (ascii(a) * b) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) +#partition by range (ascii(a) * b) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 2),('a',3); +#drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (b* ascii(a) * b) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) +#partition by range (b* ascii(a) * b) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 2),('a',3); +#drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin) -partition by range (ascii(b) * ascii(a)) -(partition p0 values less than (2), partition p1 values less than (40000)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin) +#partition by range (ascii(b) * ascii(a)) +#(partition p0 values less than (2), partition p1 values less than (40000)); +#insert into t1 values ('a ', 'b '),('a','b'); +#drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin) -partition by range (ascii(a) * ascii(b)) -(partition p0 values less than (2), partition p1 values less than (40000)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin) +#partition by range (ascii(a) * ascii(b)) +#(partition p0 values less than (2), partition p1 values less than (40000)); +#insert into t1 values ('a ', 'b '),('a','b'); +#drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (ascii(a) * c) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin, c int) +#partition by range (ascii(a) * c) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 'b ', 2),('a','b', 3); +#drop table t1; -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (c * ascii(a)) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin, c int) +#partition by range (c * ascii(a)) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 'b ', 2),('a','b', 3); +#drop table t1; # # More checks for partition pruning @@ -733,29 +733,27 @@ DROP TABLE t1; # # Bug 18198: Try with a couple of cases using VARCHAR fields in # partition function. -create table t1 (a varchar(20)) -partition by range (ascii(a)) -(partition p0 values less than (100), - partition p1 values less than maxvalue); +#create table t1 (a varchar(20)) +#partition by range (ascii(a)) +#(partition p0 values less than (100), +# partition p1 values less than maxvalue); -insert into t1 values ("12345678901234567890"); -insert into t1 values ("A2345678901234567890"); -insert into t1 values ("B2345678901234567890"); -insert into t1 values ("1234567890123456789"); -insert into t1 values ("1234567890123456"); -select * from t1; -explain partitions select * from t1 where a = "12345678901234567890"; -explain partitions select * from t1 where a = "12345678901234567890" OR - a = "A2345678901234567890" OR - a = "B2345678901234567890" OR - a = "C2345678901234567890"; -explain partitions select * from t1 where a = "01234567890123456"; -select * from t1 where a = "01234567890123456"; -select * from t1 where a = "12345678901234567890" OR - a = "A2345678901234567890" OR - a = "B2345678901234567890" OR - a = "C2345678901234567890"; -select * from t1 where a = "12345678901234567890"; - - -drop table t1; +#insert into t1 values ("12345678901234567890"); +#insert into t1 values ("A2345678901234567890"); +#insert into t1 values ("B2345678901234567890"); +#insert into t1 values ("1234567890123456789"); +#insert into t1 values ("1234567890123456"); +#select * from t1; +#explain partitions select * from t1 where a = "12345678901234567890"; +#explain partitions select * from t1 where a = "12345678901234567890" OR +# a = "A2345678901234567890" OR +# a = "B2345678901234567890" OR +# a = "C2345678901234567890"; +#explain partitions select * from t1 where a = "01234567890123456"; +#select * from t1 where a = "01234567890123456"; +#select * from t1 where a = "12345678901234567890" OR +# a = "A2345678901234567890" OR +# a = "B2345678901234567890" OR +# a = "C2345678901234567890"; +#select * from t1 where a = "12345678901234567890"; +#drop table t1; diff --git a/sql/item_func.h b/sql/item_func.h index 8b4b66c1410..568effb2f63 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -832,7 +832,6 @@ public: longlong val_int(); const char *func_name() const { return "ascii"; } void fix_length_and_dec() { max_length=3; } - bool check_partition_func_processor(uchar *int_arg) {return FALSE;} }; class Item_func_ord :public Item_int_func From 0a91dbcf53e021155e56c02ee50b4314ffad7ccd Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Jun 2007 03:22:40 +0500 Subject: [PATCH 009/227] BUG#28971 - ALTER TABLE followed by UPDATE for a CSV table make server crash UPDATE against CSV table may cause server crash or update a table with wrong values. CSV can write only a whole row at once. That means it must read all columns, that it is not going to update, and write them along with updated columns. But only limited set of columns was read, those that were needed for the UPDATE query. With this fix all columns are read in case we're performing an UPDATE. mysql-test/r/csv.result: A test case for BUG#28971. mysql-test/t/csv.test: A test case for BUG#28971. Flush tables is here just to make crash more probable. If we remove it, fields will have old values from previous query and server won't crash. storage/csv/ha_tina.cc: CSV engine is not capable to update single column, because it can only write a row at once. Thus we must read all columns if a table is opened for update. --- mysql-test/r/csv.result | 8 ++++++++ mysql-test/t/csv.test | 11 +++++++++++ storage/csv/ha_tina.cc | 5 ++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index ede5d9a32fd..1196a264fd3 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -5240,3 +5240,11 @@ CREATE TABLE `bug21328` ( insert into bug21328 values (1,NULL,NULL); alter table bug21328 engine=myisam; drop table bug21328; +create table t1(a blob, b int) engine=csv; +insert into t1 values('a', 1); +flush tables; +update t1 set b=2; +select * from t1; +a b +a 2 +drop table t1; diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 62482d576b2..922fbb0d3f1 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1653,3 +1653,14 @@ CREATE TABLE `bug21328` ( insert into bug21328 values (1,NULL,NULL); alter table bug21328 engine=myisam; drop table bug21328; + +# +# BUG#28971 - ALTER TABLE followed by UPDATE for a CSV table make server +# crash +# +create table t1(a blob, b int) engine=csv; +insert into t1 values('a', 1); +flush tables; +update t1 set b=2; +select * from t1; +drop table t1; diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 9eead7a059c..c0790d69888 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -590,6 +590,7 @@ int ha_tina::find_current_row(uchar *buf) int eoln_len; my_bitmap_map *org_bitmap; int error; + bool read_all; DBUG_ENTER("ha_tina::find_current_row"); /* @@ -601,6 +602,8 @@ int ha_tina::find_current_row(uchar *buf) local_saved_data_file_length, &eoln_len)) == 0) DBUG_RETURN(HA_ERR_END_OF_FILE); + /* We must read all columns in case a table is opened for update */ + read_all= !bitmap_is_clear_all(table->write_set); /* Avoid asserts in ::store() for columns that are not going to be updated */ org_bitmap= dbug_tmp_use_all_columns(table, table->write_set); error= HA_ERR_CRASHED_ON_USAGE; @@ -678,7 +681,7 @@ int ha_tina::find_current_row(uchar *buf) goto err; } - if (bitmap_is_set(table->read_set, (*field)->field_index)) + if (read_all || bitmap_is_set(table->read_set, (*field)->field_index)) (*field)->store(buffer.ptr(), buffer.length(), system_charset_info); } next_position= end_offset + eoln_len; From 9dc00e97cfbf1ee57251d14a65c38743a3525baf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Jun 2007 09:23:27 +0000 Subject: [PATCH 010/227] BUG#25941 Output warning messages from stdout to stderr when abitrator warnings exist ndb/src/mgmsrv/ConfigInfo.cpp: Outpout warning to stderr when there are abitrator warnings --- ndb/src/mgmsrv/ConfigInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 0cf37b5f874..3600dfdeab3 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -3761,9 +3761,9 @@ check_node_vs_replicas(Vector§ions, } } if (db_host_count > 1 && node_group_warning.length() > 0) - ndbout_c("Cluster configuration warning:\n%s",node_group_warning.c_str()); + ctx.reportWarning("Cluster configuration warning:\n%s",node_group_warning.c_str()); if (db_host_count > 1 && arbitration_warning.length() > 0) - ndbout_c("Cluster configuration warning:%s%s",arbitration_warning.c_str(), + ctx.reportWarning("Cluster configuration warning:%s%s",arbitration_warning.c_str(), "\n Running arbitrator on the same host as a database node may" "\n cause complete cluster shutdown in case of host failure."); } From 1901d1b5daac1def7a99e43717815bf7c45a2c6c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Jun 2007 17:42:03 +0200 Subject: [PATCH 011/227] Bug#18415 known problem when mysql-test-run.pl run ActiveState perl for windows - Select STDOUT as default handle after having cloned the child - Disable check for "$error eq $output" to ptoperly redirect $error mysql-test/lib/mtr_process.pl: Restore output to STDOUT after forking the child Since STDOUT is not redirected disable to check to see if $output is equal to $error so STDERR is properly opened to $error --- mysql-test/lib/mtr_process.pl | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index ac2e049a67c..2b6abcf004d 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -142,6 +142,7 @@ sub spawn_impl ($$$$$$$) { if ( $pid ) { + select(STDOUT) if $::glob_win32_perl; return spawn_parent_impl($pid,$mode,$path); } else @@ -163,9 +164,6 @@ sub spawn_impl ($$$$$$$) { { # Don't redirect stdout on ActiveState perl since this is # just another thread in the same process. - # Should be fixed so that the thread that is created with fork - # executes the exe in another process and wait's for it to return. - # In the meanwhile, we get all the output from mysqld's to screen } elsif ( ! open(STDOUT,$log_file_open_mode,$output) ) { @@ -175,7 +173,7 @@ sub spawn_impl ($$$$$$$) { if ( $error ) { - if ( $output eq $error ) + if ( !$::glob_win32_perl and $output eq $error ) { if ( ! open(STDERR,">&STDOUT") ) { @@ -184,15 +182,7 @@ sub spawn_impl ($$$$$$$) { } else { - if ( $::glob_win32_perl ) - { - # Don't redirect stdout on ActiveState perl since this is - # just another thread in the same process. - # Should be fixed so that the thread that is created with fork - # executes the exe in another process and wait's for it to return. - # In the meanwhile, we get all the output from mysqld's to screen - } - elsif ( ! open(STDERR,$log_file_open_mode,$error) ) + if ( ! open(STDERR,$log_file_open_mode,$error) ) { mtr_child_error("can't redirect STDERR to \"$error\": $!"); } From e148eb473222babd262eb7200621a1e1cd2b4938 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Jun 2007 15:34:21 +0500 Subject: [PATCH 012/227] mtr_report.pl: Ignore warning about file name having question marks. mysql-test/lib/mtr_report.pl: Ignore warning about file name having question marks. --- mysql-test/lib/mtr_report.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 096840eb559..84d813ca918 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -359,6 +359,10 @@ sub mtr_report_stats ($) { /skip-name-resolve mode/ or /slave SQL thread aborted/ or /Slave: .*Duplicate entry/ or + # Special case for Bug #26402 in show_check.test + # Question marks are not valid file name parts + # on Windows platforms. Ignore this error message. + /\QCan't find file: '.\test\????????.frm'\E/ or # Special case, made as specific as possible, for: # Bug #28436: Incorrect position in SHOW BINLOG EVENTS causes # server coredump From aeddf24a2f100aaef22ec807fce3f11edb9be70b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Jun 2007 14:00:28 +0200 Subject: [PATCH 013/227] configure.in: Added --with-system-type= and --with-machine-type= options, to be able to override the one detected, for --version strings field.cc, field.h, listener.cc: C++ compatibility change for IBM VisualAge 6 and i5/OS configure.in: Added --with-system-type= and --with-machine-type= options, to be able to override the one detected, for --version strings server-tools/instance-manager/listener.cc: C++ compatibility change for IBM VisualAge 6 and i5/OS sql/field.cc: C++ compatibility change for IBM VisualAge 6 and i5/OS sql/field.h: C++ compatibility change for IBM VisualAge 6 and i5/OS --- configure.in | 16 ++++++++++++---- server-tools/instance-manager/listener.cc | 4 +++- sql/field.cc | 1 + sql/field.h | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index e7e9aa58c9b..6cf8dbd4e47 100644 --- a/configure.in +++ b/configure.in @@ -100,14 +100,22 @@ AC_DEFINE_UNQUOTED([NDB_VERSION_STATUS], ["$NDB_VERSION_STATUS"], # Canonicalize the configuration name. -SYSTEM_TYPE="$host_vendor-$host_os" -MACHINE_TYPE="$host_cpu" + +# Check whether --with-system-type or --without-system-type was given. +AC_ARG_WITH(system-type, + [ --with-system-type Set the system type, like "sun-solaris10"], + [SYSTEM_TYPE="$withval"], + [SYSTEM_TYPE="$host_vendor-$host_os"]) +AC_ARG_WITH(machine-type, + [ --with-machine-type Set the machine type, like "powerpc"], + [MACHINE_TYPE="$withval"], + [MACHINE_TYPE="$host_cpu"]) AC_SUBST(SYSTEM_TYPE) AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"], - [Name of system, eg solaris]) + [Name of system, eg sun-solaris]) AC_SUBST(MACHINE_TYPE) AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"], - [Machine type name, eg sun10]) + [Machine type name, eg sparc]) # Detect intel x86 like processor BASE_MACHINE_TYPE=$MACHINE_TYPE diff --git a/server-tools/instance-manager/listener.cc b/server-tools/instance-manager/listener.cc index a055d98656c..a950ecf4ed3 100644 --- a/server-tools/instance-manager/listener.cc +++ b/server-tools/instance-manager/listener.cc @@ -67,7 +67,7 @@ public: ~Listener_thread(); void run(); private: - static const int LISTEN_BACK_LOG_SIZE= 5; /* standard backlog size */ + static const int LISTEN_BACK_LOG_SIZE; ulong total_connection_count; Thread_info thread_info; @@ -80,6 +80,8 @@ private: int create_unix_socket(struct sockaddr_un &unix_socket_address); }; +const int Listener_thread::LISTEN_BACK_LOG_SIZE = 5; /* standard backlog size */ + Listener_thread::Listener_thread(const Listener_thread_args &args) : Listener_thread_args(args.thread_registry, args.options, args.user_map, diff --git a/sql/field.cc b/sql/field.cc index c8c6014b92c..87f1a815e24 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6267,6 +6267,7 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table, is 2. ****************************************************************************/ +const uint Field_varstring::MAX_SIZE= UINT_MAX16; int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs) { diff --git a/sql/field.h b/sql/field.h index fb6534b7b55..fbf402ab5c3 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1116,7 +1116,7 @@ public: The maximum space available in a Field_varstring, in bytes. See length_bytes. */ - static const uint MAX_SIZE= UINT_MAX16; + static const uint MAX_SIZE; /* Store number of bytes used to store length (1 or 2) */ uint32 length_bytes; Field_varstring(char *ptr_arg, From 9b8b0000cea134136d5a097629a792da593e35e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Jun 2007 19:22:27 +0300 Subject: [PATCH 014/227] Allow multiple calls to mysql_server_end() (Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit) Give correct error message if InnoDB table is not found (This allows us to drop a an innodb table that is not in the InnoDB registery) BitKeeper/etc/ignore: added include/abi_check libmysql/libmysql.c: Allow multiple calls to mysql_server_end() (Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit) mysql-test/r/innodb_mysql.result: Test case for drop of table that only has a .frm file mysql-test/t/innodb_mysql.test: Test case for drop of table that only has a .frm file sql/ha_innodb.cc: Give correct error message if InnoDB table is not found. (This allows us to drop a an innodb table that is not in the InnoDB registery) --- .bzrignore | 3 +++ libmysql/libmysql.c | 15 +++++++++++++++ mysql-test/r/innodb_mysql.result | 8 ++++++++ mysql-test/t/innodb_mysql.test | 14 ++++++++++++++ sql/ha_innodb.cc | 2 +- 5 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.bzrignore b/.bzrignore index 8c632f8f890..e7a7a1c27dc 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1341,3 +1341,6 @@ win/vs71cache.txt win/vs8cache.txt zlib/*.ds? zlib/*.vcproj +debian/control +debian/defs.mk +include/abi_check diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e426d2c549e..121167763ed 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -168,8 +168,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), } +/* + Free all memory and resources used by the client library + + NOTES + When calling this there should not be any other threads using + the library. + + To make things simpler when used with windows dll's (which calls this + function automaticly), it's safe to call this function multiple times. +*/ + + void STDCALL mysql_server_end() { + if (!mysql_client_init) + return; + #ifdef EMBEDDED_LIBRARY end_embedded_server(); #endif diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 34eb831e7db..4720c7c2e2e 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -625,4 +625,12 @@ t1 CREATE TABLE `t1` ( `a` int(11) default NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='123' drop table t1; +create table t1 (a int) engine=innodb; +select * from t2; +ERROR 42S02: Table 'test.t2' doesn't exist +drop table t1; +drop table t2; +ERROR 42S02: Unknown table 't2' +create table t2 (a int); +drop table t2; End of 5.0 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index e6d94fe1627..578a81f355e 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -605,4 +605,18 @@ alter table t1 comment '123'; show create table t1; drop table t1; +# +# Test bug when trying to drop data file which no InnoDB directory entry +# + +create table t1 (a int) engine=innodb; +copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/t2.frm; +--error 1146 +select * from t2; +drop table t1; +--error 1051 +drop table t2; +create table t2 (a int); +drop table t2; + --echo End of 5.0 tests diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 455c0968050..a3676bd7e1b 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -504,7 +504,7 @@ convert_error_code_to_mysql( } else if (error == (int) DB_TABLE_NOT_FOUND) { - return(HA_ERR_KEY_NOT_FOUND); + return(HA_ERR_NO_SUCH_TABLE); } else if (error == (int) DB_TOO_BIG_RECORD) { From f8034d36ba5670e72374d61ca4901a71adbd6d9f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Jun 2007 08:58:39 +0200 Subject: [PATCH 015/227] Steal part of fix for bug#25621 from monty for 5.0.44. libmysql/libmysql.c: mysql_server_end() can be called multiple times. --- libmysql/libmysql.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e426d2c549e..121167763ed 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -168,8 +168,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), } +/* + Free all memory and resources used by the client library + + NOTES + When calling this there should not be any other threads using + the library. + + To make things simpler when used with windows dll's (which calls this + function automaticly), it's safe to call this function multiple times. +*/ + + void STDCALL mysql_server_end() { + if (!mysql_client_init) + return; + #ifdef EMBEDDED_LIBRARY end_embedded_server(); #endif From ae587cfb0c810a1ea09cc343e4a6d58cf0984985 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Jun 2007 17:12:40 +0500 Subject: [PATCH 016/227] Fix for bug #29079: Semantics of "bigint" depend on platform specifics (size, signedness of char ?) Problem: long and long long types mess in a comparison may lead to wrong results on some platforms. Fix: prefer [unsigned] long long as [u]longlong as it's used unconditionally in many places. include/my_global.h: Fix for bug #29079: Semantics of "bigint" depend on platform specifics (size, signedness of char ?) - use [unsigned] long long as [u]longlong if sizeof(long long) == 8, to avoid type mess, as we use [unsigned] long long unconditionally in many places, for example in constants with [U]LL suffix. --- include/my_global.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/my_global.h b/include/my_global.h index b7b200fdcf4..5e31a66e5e3 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -828,7 +828,12 @@ error "Neither int or long is of 4 bytes width" typedef unsigned long ulong; /* Short for unsigned long */ #endif #ifndef longlong_defined -#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8 +/* + Using [unsigned] long long is preferable as [u]longlong because we use + [unsigned] long long unconditionally in many places, + for example in constants with [U]LL suffix. +*/ +#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8 typedef unsigned long long int ulonglong; /* ulong or unsigned long long */ typedef long long int longlong; #else From b3b8d5165d76de270532120dd8ce2a216308c0bd Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 24 Jun 2007 19:44:54 +0500 Subject: [PATCH 017/227] BUG#15787 - MySQL crashes when archive table exceeds 2GB Max compressed file size was calculated incorretly causing server crash on INSERT. With this patch we use proper max file size provided by zlib. Affects 5.0 only. sql/ha_archive.cc: When calculating max compressed file size, use the real offset size that is provided by zlib, instead of sizeof(z_off_t), which may be different from actual offset size. When we're about to write and the data file is almost full flush gzio buffer to get accurate real file size. mysql-test/r/archive-big.result: New BitKeeper file ``mysql-test/r/archive-big.result'' mysql-test/t/archive-big.test: New BitKeeper file ``mysql-test/t/archive-big.test'' --- mysql-test/r/archive-big.result | 19 +++++++++++++++++++ mysql-test/t/archive-big.test | 25 +++++++++++++++++++++++++ sql/ha_archive.cc | 3 ++- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/archive-big.result create mode 100644 mysql-test/t/archive-big.test diff --git a/mysql-test/r/archive-big.result b/mysql-test/r/archive-big.result new file mode 100644 index 00000000000..7dbdb490017 --- /dev/null +++ b/mysql-test/r/archive-big.result @@ -0,0 +1,19 @@ +CREATE TABLE t1(a BLOB) ENGINE=ARCHIVE; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +DROP TABLE t1; diff --git a/mysql-test/t/archive-big.test b/mysql-test/t/archive-big.test new file mode 100644 index 00000000000..414b689b180 --- /dev/null +++ b/mysql-test/t/archive-big.test @@ -0,0 +1,25 @@ +--source include/big_test.inc +--source include/have_archive.inc +CREATE TABLE t1(a BLOB) ENGINE=ARCHIVE; +--disable_query_log +INSERT INTO t1 VALUES('gt:Y;V(Wh/DM;z\'@Scyb^2u*b:8GBTan./A;D(7x(PB98IL%ipw0x=^H,>8=i%m\'heEdN:pR*o%Ywtf&x]H2[]Ex\\Bn1>\'EhfGmw56OpkO(n$VpXE2d.M#Z*XevKM$`Er;euB&2e3d-HdFlw;RobzhxMQ3EFn&aCf`5y79V/\"UmMt-t36S(aAY&Ekt.w@m4Q!G,@@]?\\:D.R;j1Kj[j*&\"n8cq6Me>@fgW_Wx$821=#0fAM@75D7\'Wi2T8W32B96C2kQ5MiO2C>NP-(!fms!;I?Biu7F?G*6o[Z54D?LCJ/H\\#+M,-;$?Rd\'-Ii`+GfW_\\5-zRc\'.M%dV`dYpOv2,\"`L;\"3u(Xk9pU8Ry79Z?fo\"K=-b7#FxX0!OS6Oma\"uZ@m1C?Q]c\\*P=z\")Hq/(xSsrd\"j&n(m{J9x#4y:KM%cSV7LZft=gzUtse$tM`#zsV35Oqsrf,=0u-q#H-@=Qc(1\\ddM6`gke>>^F{fmt(Zuey[9G=;O_tRx1zH2[Z9E5rjDL8j<)RIVX<\\Bq@\'<cbFq2;qS+q*lprp_gnv/t0$`Ep4HP>$4w-iWW35Lc7{8zxpK`+KyLKs.{Si>3#PR.,.@>Uqd%zj(wRpe,@Cm)q4D<>caAZ+[qQy9HCT_e_3sy0qw,b6#Fz`QT7Qv+a4v\'N;xxudtC+FcJ%p9``Cjt0)vJKt7JO5T10<\"-\\qK_#&2iIke<7?tY@m4Os$H((0TC/[did@K<)TU0)vJJq(eO;uj6aq>u_Z*Yi+1S6Pqo`qA*Fg\\u`_ChmkXU&SU8Pod.M{Q[[:LR=rR&\\)L.;\"1l\\i\"Z0u1)s;a_>Q^k&js+lkYY7B*FbEkr&U`hljR9cp01GUYAtRw/qz8>m:k=)M3Oy>`OMr\"Bju6A\'<:LUKWV.yJ>9Axft@va`Be\\#,RC5#EwV)]&<@gr-zQavV-ox56L_!wh&uM\\k,0Ia7\'YrYI?>W&N<{)L*).JmlZ]H0S9[I9!5)i`,N.7d\"m/:r\\UutlDH#hp!F#rIO4Q&\\*TNiO-0GWeyY/v59``ChiYbf]#,O6W8Ayk1EN;xwpQ$Vi9unNu-q#I1Q/1HZoHRGL+,<-gL\'p1;pQ\"MERQ#OO{J<-fFh^%2kP08h2T:\\LDQNpty*V\\NO(lu1(o+xMS=qMhL\"Y\'K-9tlDJ,8q`it4:g%q=sW8KWU,mng:)Yl=#3sz3\"MFWexSpauQod-G_4z;KL{Sg4c$xb`B`Dp6OpnZU$Er;er8T(^.`(:/u33ECbL5`hq%S[TsmLmkUGARYNXV*b>I:#G.Ii\\rPs\"0omXQkN&gb8+i[n@.`\'5qjERPy>Y.oty.iSD;:M[ccM6`kyI8z.gIq,vAv[Cx`Y!-\\oEDeV`dXk:uj8lFTX@qGJzW#;D(7x)UX?m2FM6][4.*%tJR@+O5T0.5_e`81./?4%Ywtcp6NjUIK\"\\512I[qOrw\'N9oOyAk%gb;:PiF]*M-3XJJp&Yxvl=&B\\0qtx(K)&#tU*hX`]4(eRHTQv,fK%l$]6/*!bYwqU5A.[j++4d*:\'OA7.yMMyI8x%>LG]\'ASczfo!G*8x&CcRPw44D>J=0s\'Wh0H`2n`uSz8@v^Sd%{n\'AWupW@v`\\/jWRv)WexSrjCK1LosuwvpS-zRf3^hu:X309h1O#WrcxX0yG0S:bf\\zyucn(jmiKs1/4YLP/4W@wcheFid=Ak&hiZft?qIRD=Cxa[*SJ[k3S.&n+zVz1t)]\'ATe(.Kq$QQ)n#PS5GJzW$Be[vi2R-$ggUS$NFPGO(Eg]#)BVmKfK#cUajs+kfBRZO[aZ$95?yqPu)\\#/`%)@G*7rh6h7oU;`]611A71-/CGwQjIj`)=>\\=X-j^tW4:euD-O1A6*h[mUsmKjZdmw9KQ9aggO7_`G!fjfFcGtAzoD>I9z0ne5mR3A2og<0v6=pIVX=_QU\'D`A^=P`rGEdO>(HvE1_sL]pD?OR3?)IvC&.R>xm?.c4n]c_5\'[%81)t@ym9C(9)[woJ_%1e5mT=m;rZJCPMornXKP3IXdp.(wTv#:?l.4\\Z2&cL0I_+N.8k@738`cRP{G+<0t+i\\oB7,r+mt&M=)N4V^H+:&J)\'\'-N&inm\\dfV]Re+>7;`Y#7-xH:(RPu.q\"DsC1f;-j[j-5`m-+/JlfAJ6h6kESR(fUU23FJ%m)tA#%.VMa*@F&#w_Xxz$5z9C+E\\*REB\\.fGjhM(vMWQpjCL9r`ggVW7GCXsctG@I2ZW)[uez]Cn1?*M1EL1I`.Zdls%PJb7&QOx:Oa$%*D\\)L.;{,YfvG<3*s8S\"Co4HTNjReh_)CWqZP_rGFjiVPna{l2HXdr8U-w@m5S,vAtS#I-BG$o8_\\63;mA6)dK+,>4)lptvwxwoLgIq-zP^hvAw^Q[Y0zH4c&&,Jt6GCZ#3w1#Ui;&Em{J;&I&vSv&GyY0xAm.5]\\-]wh)%xb_;D&*?CrB,N-1Kka*@F#o;j6am)uB&0[fo&^5&XpU7Nd6w\'I%r?zu^Y\'M6`jwAp?&8*b@R`l+\"da;=_NG[vh+3\\_I3YRmVE7#Ciq&Xr]Z0u1(lx=^I1S9^TkGXi0I`2lYW,i[j-7h7oV>n=yyueyW(Xi2R-#dYqW?n8cr>pHSK[l7cuLUHK\"\\9B#{u]Q^gnv1$[*SNkY[BsIO2EJ*)1XRpd+;.nlYU$FzbYvoNqw,a5w*]{{{\"$-WT%RS/-0JhTMb/XT#Fy[;QiEVez`OKiVRx1{I8vulDFs>qK^{vbgb<qJX^Sg3_j!Vsh3[Y0w;Sv&GxQiBJ3WF7z63;nFN7csC-SC5x1x)L-7kA@Z-gM++3]edK,4^edJ$jyH7rh8raq:clw9M\\i&o.-5c!izRe0SQavV*eK%n+{]@aQR*q,xH<2#Te)2\\aUd#o:h,4`p(J%m)q4D=E&*<3-#d[z\")Hp+r13LhN+($uT%OH\\vf\"bXoP#QXICUf((2`vW0#Z+[rT*mqssj>/l`{qISJWY@l-2Q+u>l4S.%hi\\pHQA2pkMx@m3J`,O2DCeYoIZk6_cYqU7M_{rQu)[uduHBQT4C:47W7HFeUV6F@LCJ.?60/7g.BH&x]F*7rj=/mc/TC2kQ4K_#(==Y1\"R_k\"X$?Q_n2B::Su#>P\\_NGXg\'!i\"[0t,nsw\'J*,=4*q,wF1^o:j3R01EI%o4IXbgc@NKj^yk3Ow7B*GgYg#hp#L?5+q,vC\"wdks([z#/_yl6][64@*L*\'$yen\"MFTXC%\'6uz,^\"{yoHRHQC95;h\'zaWq[TqbwX1&eXg%sHGkjY^QYNZ_QWF8$FuKO/6_d_1kVL[guAxeo)knkS=qNl^rIRB5#G&#v\\J=0qx0s&T\\TnVC.UJQ;pPv2)r6KZg{Z1\"OQ,#aPMnjLv<]I7mO\"QYN[dg]ysYC\"tS%S[Qd-HfO:oMnkQ1=TrkFWcq8V2/7ctG@J7oWF8\">Vx\'Fp/.9oS/-2Q,ySlO&fZnDB_?X(O@3u*`1jO,)(*:*]$1gBL:y(Gp,wIAI0KorsnP)lu/xArFBVmKgM,/GYm@3w0yF*8y-d>DwW-r(^/gDZy\"*L+*0P+yUw%AY%Cf]%6\"Bjt38\\NR6R!Co3FJ%o2@.^zqMfBRZO[aYz%:7D4qlMt/\"Wwy\".`&3jIke=(Go(g]\"$-TJRD;<[:E2b(4kN{OS6Pt#AaOCDks(^/e<7>n@-Ydkr\"Bir+ox6:]PYQh?=TpasE;8D0`yh{[50/;z\'DaGwQg<0v3/2KhP6ZKF]+P.fBR[Trh8rcwU%L7j>0olVGAONw;V(YnEK+.DPI]{yt\\P[Z7>oC:8IL\'o,$gja*FbCbL3XG:+eGp(ha0a(7x,a0c-Jt39cp16]X%GwQiDT]X&H!aTal%`AaM<&@UmMr$J3YO_sMa(9+dFhc<;SrlLoqpbzdh`-R@)Ho$VlCFtD0_sOjQ5Nnf8z2zCsGD^3x56OkXV+fO7aip\"Ex\\Bm-.>1t(Wg(%zl1FN9oNrz:E0[aWr`hkhIoz?`NFSPw56PplQ05WB!sU-u8Og?@d^0iM\'n&cL2P$Wsf\'&\'1^n6XByk/>/iP3IZk3T4C91*zW&M9oQ)jhQ;l?-^zsU.#]8;]KAAcWh.@;G6ri;%@UpZRjHa80&f\\z{\"(BTd\"j&m$[,_(<8F:-ortrd\"l+(\'\'0Z[=Z67R!Bit6C2iJnsy0t)_/b-N+%rB-R@*K#aK6d#qC7&SXB\"wclv6?vbhfM/;z)K&p4HSIVW48[I=4+u?m6[Qax^ONw;V(Zvj6`l\'ku0%dU^Z.jY`Z&B^;F2c\'0ZZ;Ttwy#0f@EzaZ{*N6ZJCRT5EAR\\]@bUcuIGh]xj2Nu/{OS9[H4e.Lv<]I6jBFvMWQqlN#UnP\'eTT/\'o,#cXmEL1Jb9.s/%bN@4\"G)0T>u_\\3&\\*RFJ#bUbn-)&\"p?\'@OP)q/,/FV`dZt`f_1jR:fyUy0omZY406ZNWOb*?@d_3v+b;:PiEXmEJ(\"k(uJIq(dL.=-b5v&GuG=;MXU\'Xk=\'Ejmg@F$rFATe(,DVdz^H-BH\'&&+CUf)/N%cOC?R`q?yu__?Z/prqbwW.t22A3u\'RQ$R[W\'PDEm#R_k$^=Rd,@Biq%UcuJL\"[0t+gSIRFFkoqnVB(;42?\'@PWF8&OB;C\"v\\LFWg+5d)1\\bZ#5&Vg.CI+5e.HdEf\\xqPu-nof6nU>qJX`[,`,O2EGuE1^qD9/\"Vq_gljR;l=$7,nt%I)*8z2v.t1+$m*wNXRstnO!LETW?n8bl$[-c9,liM&kt0&hgN3LgKzRe.Kpy;LS>ucn(knlWN^tU+i^\"\"!!!\"$/^rMd8%L5]_F$rGFjgM)z^I.H`3u$BbRP\"J8sh6g4`q?!#)EbGwO`w\\G0R8W9PlTA&5u#=NQ2?,X_Wsh2T9]NN{NMu5=qMgJt8Ne7x*Xcm\"OS4DcaA\\3#NH\\yvexTtvtg+5g6lKmiM$_Cinqqg3_m0;xwnIYh))/Q4HP>$5z:F4lR4GN3Q\'cK.<\'J%p7U0+&uM^qFDaCdYmDFo*u?nDzhzRh;)TV5A+O3LhM*%rC3mZZ8E3lS8ZCygt>k.8nP\"PVA\"zqNma#zn>&>I9z.gGh_\':1%bK/CI*,ACl#Xz+UU0(r7Rz=Tri=-eD].d:.r(]+TNjQ8[MN$\\1t\'U_`H&{k,/CJ,7oWE4kO)q3@*K#`I,:#:?j\'tD2hDT^^Bgjc6w(PEGt=j*\'&\'1^p?$2lVJO2GRKa,KzSh;)SNng?>X+`0c1^l0?1ohADsD5u\"6-yNS9_[0omYU#Bgi]u]OUA\'6x.k`{rMe;2*vE1_sL^wes8T\'Zyxtaipx2&aCe[xrWW%I&vV(Zvj5^bWk<%>MKnrrmLpy529h/EQMk\\i$hmne4i@>Usj@9>j(xTy0ptw$;BvY9LWU)b>K@>W%Fs?u]OTW#8=h$hkf@I3]da@Ti<*XclzG.JnqrmNw;Sw\'N:r^_DsC/\\hxLLwAuT#G\'%$#!xj/BCdYpOt)\\\"+O4S+q,wC\'/XSy3&`?TkGZrV6HJyOXOe5nVE5soZRjF\\&:8GAOLorrh8tmJc>Dx`Tf,;*Zm=%<@n5QzAjzOVF:.q\"Ey`QUn9i1Lnof4d,CMA9<`VmH\\zyubhi[i&sC0]n:j4[V#=P\\bYws]Y*ZoIYg{]@cZxvi/CI(%yfq-#aNA98L\\k0A:=b_;C#yl4R)ls#FxY1$\\0qtx%?PWG?DxZ9KM)vIGeQD>LG^)JyQazi$feK&r=pHRGJ$ip#K7nP$Xx{)Ht=h\"`L9pYLP/7bsB*GjhN/8lDH\"da=H4g5kESV:V.u5?zvf\"d_4{?aPKgL(xUz613J_(=@eeO9l?1rv%En*s9U+h[k4WAwbbL6`l%dV_^>TqatKR?$0e9)Yl?.c3mWKQ7[NR4IVX9PjKr,p%Vi7kCH#j!Up\\Z54D;=]E\"on=!(EeUZF.N%dU]W!3{DwW/xAqB0c/TD7&PKeAR[V#?X&J(&$\"wep/+,:\"4\"I3ZV%K3XG=9E1c*;0v46S&WlDGuE5pd)4g7rf,?=Qe0S.b4pd,AEtHFfUW;W/{NO(kqy3*s6JTJVW34Lc5sq`m,\'y`Tap9]Q_j\"Y)SNl^sOiM$`G\"glnhCPLjX\\H2\\_K;%BaI*/Mw?i\"[2#R]aPNu1(n%]1s\"=Qb%\"wchc=An5Pw2*vD.S=sYC\"sOl\\fmw43D=G.Jnsy/l_yi&o2?+RFFjmg@Cn1j*\'$yh$ebhyOYU%L8mH\\wi.@89S{>V{4)g\\t\\OXMZ_Tf,=4*p\'cJ*+7tmLnm[aZ!+UPqrjA@]:D*AK:xz&=F,BK4_iv?l1B>LJkd7#AaM>.e@K;%AZ-c8+hVX9Of:*^*K\"\\8;`Xy\'DdTT/)wO`xceUX?k,.?76E?J:$=KEXoNqtx&CaFvMWQph=2#S^edJ#d\\&;=\\Ahr,u:W1*xO[_ONx@j!Vvxz&:8JM)wN]k,+5e-DQOw9IGh\\rR#NEPGRGP=z\")EbFs>qK[m8h.AChlhKxF/Q4Ka/XY9JL$e[yxrV8Nb,Js0*{`NDH$n0;vl?1okN#Z*UY@n7[LMzLHcAWrcvRn\\aWmGWcm$Y$=H8x(K-7kAA^>W#=LKs0(r:_Xx$833HQD@R`n0;uk;x{\'ATe)2[^K:!1ppc%{pB7(_2pmT;g\"bUais-v=caA]:D*=;NZ^K>3#PT7NiLzOU@!xm?,Ydo(jiSE?LCI+5h9y)O:oLiVQrtp[Sqd%!qGJ\"`H*0R6R$NFSQz@fi`*EbDe[xqT-yNT>rS%Vg.CI((-HgW\\NN\"R`m.2Nu/zMIiZg\"`J3ZSqh9wz&?OP+zW$A_BggSHP`QS28bl\"RasHEcHyW(TZH<2$Y\"3x7\",UOl[`Td{ejiQ8afa6&RV=fs7L\\pEATi:z,Ydq15W>l1EL/DH#l&jqz;NWNb*>:F4lR3EBZ&En$Y!/e>@c\\)IzVy,_)BVi:wwtctD2f:)Yk6an/3Q(fZnA7/%bOCCbM9oT2:i/CH$o5Q!F\'(3e/R7U.\"Y(QFL,3ZRnZX.s)cDeV_]89W34GL.;#6)fUS&WoNs(Zvh/DK1Mt.t4j)z_K9uqZP^m/:r\\W%H\"glmb(7x,a2kQ3D@R_k$`Er;fxNZ]G-BJ/Ib931:nJb8+gTMc6uw\"1ne4h<.lc1_rHJyP_p_K;$>MLt0)tB%-R>xnB:=_PQ+wKHgW]Q[X.s)aK@?\\:D,KxF1YX2+xNWOc.R8]Sf2ZV$FwQkP+!^Co4IUU,r-xF1[aVlBBdXl=\'Eg`2kS>sW;Y6D{k*&ycbFr7Pruy(J#d^0iM$`Do1;pR(fXdr9[G1ZW-ot{5.#_Dn-)%vX6=m:qU5FBWr^bVdwQjLu7E9/w?j$dXlA7/&jr(^0jP1=%+TQu\'SR)kk[emx:N^o?&8,mpmT?wetB%,N--<*V[I;+b6#EvQmXPe7tsf*3_m/8kA;D*;1zH2ZW)^+N3Mlc-Jr-xF/TA*GjfHlrz8;a\\.d;417bn*wLQ5NkYZ>aTcvOb)9\'ST.$e](ATf+;*Xg&vT\"?X)Xi-:z*SK]sU.\"Y%Elw;Su{2u+dC[-_\':0zK@=Rg7re)0WKQ;mA5%T`jt4_MA=MQ07`hov+cAS`l(o,#dZxrZJDUakyE)5o]aTam*xPb%$$)?Ezfp(dO?*P=!&:6?vbild6trd$vX44JYgzX(SR%YvqW?pD;=\\@dbC`BcU__Dn.-9r`ju7GCZ#4z;O`w\\F*:\'O?0jTE=An3FL/A>P\\`PNx>aXr]Z.nlWN_wbaFtE3hCNCCfa90%bN<\"-]tV34K`+Jv?o>z{#+K$cWf\'\"o:i1KhSHO4S.%fb?LCL5`n/3P#Saq[:JJp&[\'CaGwRlP,$ir(bC`Be])Hr4B2m[`Uf,<,b6z8>k0B@X%B`Ckw<[?bZy{&8.xD%\'0\\hvC&-M%dVco17cq:_[.iUKVRx1zG-EVdyZ9D2d.N\'m$Y\"3x7>oD=D#tS!AgliQ8]TjEQKb3n_m2CAZ,_)D\\*SLc4nZW*_.\\n=\")FjiSFD^85@%1gBNCCgc@Q[W*]&8+gRFGr3?&;7D3lVF<7@xi*)0Q3D@Sd$vZ?gp&Z\"-]sT*je>?bYtg)-DSYI?Ae`81*z\\>Y.pty,^#)AQVA$&4n]flojKt23HUU.yLHdHuC*?Cp:fyW&L6e$uT%OGV_\\4)ieAOP%[*UV4:euE3jIi[j0A;IDVg,9{0nhBL:y%95;h\'yaWpV>j+*2YSqh:$>P\\aVh4^efQB7,nt%H\'!k){aRXIAI/Ha945Le==X,gO7^\\513LjVPm^j\'p3A3v*\\yt]Up]`PLk^sRz>[67OjQ7X@qFDbHz^Cr?yrR#MEM:th0Ib<@j!Wy+Xclx@k(r8V33HSK^xl6^aNDH!bVg+7re\'\'-Jp%Vi7j=-b3n^i!Vx#70(s;dm{I7rd\"k(tC-R>xnBj(xW(YnEK**3_l.1Nu0&eWcp03P!J9wxz&<=^J5e*8w\"3v-j_yn>\'@R_it5>wh*-AEr=m>&>H3_l*$m--;\"3x8B%.UL[gvG:*^)D_9;X44GM0A=LIhYdo*q-zSjDQNpro[W(TYG5o[Y0w=^I3[Z53?(BXx\"-\\pFFkqw,d?J;\'L0EN;wtajv8HHnzBp8^Y\'I&vStw!/gGeQFGq/.5`m*{]>Z1zI5g4d*:\'M6cvQjMyG3ayfp(g\\vfz[8@wep/-2Q,zX&H$n/5][53=yvi0FTW>gu=gu>m6YF3f4f2[^G+8x(M2Mprqf,@?Z3&aCdVbn+!]?[7\\\\=Uy.jXZ<[;Ob%&0Z_PR18csA$*CYy$5#H)0T@zu]UmP\'g\\zvg&uOf=65HN4Q#RYO]i#^@`H*3]egXabM:tg+4d(0VIIs5C5{=RiBFxV%J,:#97JP7]UtoS14S-zTnWG<8@zpJXa`AaK4ZSnZW*a90%aGyZ7:JJq*mrx/oph;)V_\\4)ha2hDWk<&CbL6cwT{:F5o_k&jr\'XpR)jhO2HVZE,CPNs(Ztcq7R{@ecDf[t`bN@6.{SjAAcVbo/1FRKb3lR7U/#_?Z0u/xBtPoe/P-+-BFwTy/ophu`aK1NzG/O(m#Tg0O&dTV8OiJr+p\']/gFbEilf@F$sL]pEB[-`,M*$m.1JeFifFh_\'<:O`xbbH#jzLKow/s(^0iN+\'y^J8rbuOd3f7usd#m.4WA!u[I<0v32={\'?MGZucp18g)+:(RNqroZUz2\"J:z+VZE)6rh:z.c6z63DzhwG7x(N7e\"ixG7trbsE7#EsD2f9#>Sh=1u-pzJ=0s&RS.\'sA#&6y2\"K>4)h_)D\\-_%-TGGls#Fz_MCI&ya[&AWwwuh.BDl\"Sc\"n5S*mt\'U`ghURx52=wl?0jRzvg%sF>DwZ;SrlLot#@[4)lr\"Bgi[k0CCe[yxoIYh&vPiHeL+/GZs^Y)SR$RXG9)[xrX>gu?pC946T*jd;7>oB7-s.{TkG[wnDB_AaM=)PA1m`vY:Rn^k)xRmUA#(<:MWQqkIfO6YG9&K0Ic?K>4)kk]m6\\SkJhUQw.orrh9vuj:xyz\"*JwI>=V\":@qGJyRiABe^.\\oB6%SYKKv<^NKj]qJYer4B3qnYRnYSsp[V%FxTttnQ\'bFs?tW8LY\\F)5kIdDcK0EPGSLb1e3f4d)7uwwr[Qc&*?@d^1m^m2FM6][79X8IIq*lrx-iTIRA0f@DvSuy,^#)ANH^+M,-?612EGt@yk3Q\'bGuD/Y[Al*zZ53>$2n^n7\\Rd)6p_j!UpZRjG`3sw%CcODGuF8%J/GXg(\'*:+c?H2YTw\'J*.EVdxV#AcTZKGa:9MZbaEm%`@Y(QHRIW]OR4GJ\"_FxZ8D2e6p_iwBw`Y$98M^sOlZ^J:$>MN$\\0qw*Yl:q[P^j&js-u8M\\i&o2@-[m9i1P)o\'aDgb<=]G)1[^K<*Xet@xg\"`MALIgTLb.SA+N.6dzefW`]:AuY;V&PKd?G*8z/jXX6%7)a;QawZ>_L@;D\'1_rIO5U6GGkniGcDdSPy=Y1#Sd&#v^Tf/IhX^Ti=.gIs6IM-2T8V/#\\2yAixE-HgXadRQ{F%{n:j7g.DPJb5v(PC@UnR.)#k%gc@PVB(:-pw.mjN\'kv6>uadVcp4GK(xZ7(Gq0/<$834JZl7dxY54GJ\"`K4_iu8Nc/VKTGGlqv\'OA6,p$RYMR9af`3rtpZO]hu>j(xW*^,SEAUkDL5^aRT27__BghZh%m*yW$BdZt`dYqT26U25R\'^2v,gO8aipw2%^6,u=dhc90!PXLTE;9HD\\+SMc5uw#4z>Y.ot{4)h^$-VOjP2A6(`82/3T4@,UMd8%K4ZSmU?t[KCL9q]Z1!K?:D)9*a5x1\"PT9\\I:&Hz\\=Uy0omYU$FwQkO\'iiWV/#[,b3oc&);2%^5,s39blyCxb_;C$\"xj-7i;#86B.[guAw`\\.iR=t]Wx$:=^NH_/^u[H6p^efQA3w.opkLr&Vi5_gmrw\'K-;%>NO\'ij]pC8/!Sg4bycaA[.gL\'q6Pt\"1t)_0e9(V`e^*K#`K4\\\\J>63:k:ulB=I>8=i%l&dU[OYStuulBB`FyZ7?sS\'[#1lYY8F<9F7\"@[5/.5an/3P\"LBFvKQ9adYpNon_o:g%sF>DwX46OoiF]*L)$sGBWr^^Bhow1$Y\"3w2)myBo9cp16[Qaxa\\.d=>^H-CL:umFQFJ\'y^I3^gnv1$Y%?PXN^qFBY{,Zh#fdJ$jv:RrmS8U.zP[\\?bUe#l-/DI))0S=oDB[-b6!=P^n4Ou-nnb\'1[b_98M\\l3LiVPog8w#5%RV=gvG:+`2lXSuz.d;56Prv#9:W-r)eM4S00>*SMgFa@UpYLP3GOeh\\wg\"d]+SJVU.!Sg3]dbDeXg)(-Jp!DvStw\"3v,fK$hnruy(K(y^K9x#5&Ubo3EDcM9mI^&7%NCBaJ/GYnFN7csB)?F&%\'4n[]Ezfmu-py:G<67PplQ04U6GHq/)!d_5$OI_+L)y\\@bXoOx=Y2)p+u?o=wmA70+&tJN/9mH\\yqS(aAZ(N9lApHQA2qo^iu<^OP%_=KF\\\'@R_jyH9!5)jfD\\,Yckqy4-$ggRC947U1/6bsD5v$?Ww\"3u\'SV9U(\\$4w.oqlNzLFWg((.Kt22C?PYQh@Cm)r7Qv+c?K@?X\'L3S01FM7dy^H,>63>!&90$[-b3lVJM\'p4EC]3!G,?I7rf-BFwU!:E.Q8\\OXPe4iDOEJ*,>5/+*.HcDbI\'\"k)xUx,_+L%iow.noe0S:dq3?\'@QZUy.gK#^@_EwSu\"5+o#PP%\\/hM\'q6Oog;+^&8+gUS%RWAzqJYfuE0[b]/iO.4[SlO&bK1Nw8G@H/MxBw\\E$ygyRg7sj@;D+BMBA`EuJL#^>Vy*VX>fp(ePC;>c_:;[@jzNT>qMfCUg/H_.]rNgGfSLa+JwD\'1`yi$e`7*fRHQ@-[j-7i8q\\Z3*s5GFhb7(Ys^Z0u/xBvW/\"WvulCEn(jk_yi*),@Bhmm^pA,TISHM-5_hp\"H,<.iVRw/qy67OiM%eZs]UtmLle9&K0JeFh`0b+BOJeEdQGP>&qNjTD91&f\\zxqR$QUY-jZchdAQVB(8(YqT0-.>4\'_71-/B@[0r$H)/N#Wwy$7*dJ$is,t4!&;8G?E\"o*SLc4n]c^1ne5jG^-WX7F>Am,+0P+ySnVE7!;I>=TsoVA{tY>dh_)BUe).Lt5`PR-\"^BffP=!\'?K>2\"NJfM/:wtcs@ypJZk5YIBOH[t]TlLr&Ubq:aaGy[8B&3iEYqV:Z=[>]Cq>wi,5c{izTnWF8$EuHCUf)0S;fwMVM[gvE0YZwh*.Hb?KACiq#H+9y(K*)0T>t\\MN\"Tj@`PMpw,eEaDjoqo[X.r$M>0ojJlkWSy2%Z%@Th8qap8YC#xgyRjG^+RD=D#uY\"*Is5E@NMv7C.WT&RVzxrV5C3roZV$Eq6Om_rGGn#S^aRU8Sz=Vy.fGic:0!OT:^Vq^cYs`gfN3P#OO\"NMw<\\@gozBn09j<#7.xF/S>sYBzk.:wsakyF+@BkzMMzJ>9@rMe=:KM\'o-%kyH8vy&?MHa:6?zubij^u\\J?bZ!+RFDbGxTv$>P[Z69ZD\"qHM/=\'Df^(?J:$>P\\`S[SlO&dSPw6:`^:@pB2n`tRtz2w42=z$2nb\"rMc2d-Ks1,,4^fi^\"\"%2hCPKfKzUslGXj4WD/WQoaxa]3{Cq?{xoGP@-\\qIVU.xG4iCK4\\[:G<3-&p6Rz=X,iVU,nv.ou&L6bsD4pg6mR05U6GIu?qHP;nI\\vco+vC)=pFIxP_o:h+4_m-.=-c8\'Vbm\'jmf?Bl\'ks*gVV0)t?tV37YC$!uZD%%\'6x.jWV/!RarE<G0S;fxP`vZ?egZm;ug((.M$]8;\\G,@AcZxrZKF_1m_tPod/O)t@v_Y&Df`2lVLVRw,dATf-@@_FxZ9F7#BfdDcPCAY\'K+.DQNr{:G7w\'L1Lk]pEAUj>1t)[{$/`%,L#^=Qaxb_m8bq6Rz@c[$4y9D-N)vKL#^=NVIK{VuumFRKa0a$#\"ztZH5mQ/2KgN/:sdxY2)q14Nr\">X&I\'\"oRg5jESS-yMQ08g+5i<*Yi+2WHBQS3@*M.9oS3;pOv1$[-a1c.O.1H\\wk8h4]aSZPb#uZ@m2DDf^)EeTT/&kv9MZccM8h0Lq\"Cn1;r[Rh;+\\vewN]hxKJnrttoS/-4[W\'OB>MMxCzh![4,yRf1YV\'U]W\"6/\'p18dwSpf1T?xmc`=G1\\b\\*P>\'?NMu6?xnB821?-\\qK_#\'7%NA86C1g@DtJM*%rB,O4Ml^sOjO/7ctGAPQ,zTp]bYtdwTy/prqc!k(uF;2(lt-p{Aiv;Y6;fvH>>Y1#R^fgW\\KEU^[4,wI>=TrjBDn,\"_G$sKVQt#=NT>rR%S[RkJkc2c.LzMN%aEr:^RbwZl2Jb7$J/FV`cU_`H\'$xdlu/zLHa:6A)BR[Uv#84=t\\NS9[J?elr!=Qe/N&e[t`dXj7i6i<(L1GXi.?4&[(K\'vN`zo@,TMd6tusbsA\'8(Zt`bPIZnC@RbyaXtg+4d\'+AK6i;$>LHdGq.(vMXX5:``Cjt1,\'y^I4bzgs4?$0b*AL?5,u=dg^$-THM,0JfM-5`m,(\"l+(%yenzDydg[sYBw^R_k#\\5+s6E=BrD5y64D931:oOt,i]u\\LFXnHUX<\\F(-Jq%T_ggWZCxcdO@3v/r\'[z%5y8dh^$,O2FL1KiUOkUGD\\+VX:Sv\'M7cxX/x@n3LeBTd#qC3od-Ij`(==Z3-\'tF:/w>c_71-0EM9nMopf6nV@yl6_e^-Zg{Z2&_MMyG1ZY6;er4D:7C/[gt:Y;Ty1x=[;Qg;+a3ob\"rMb-O1?-\\rOoh??[7:ZBrHIt:Y9MY[@k&ku48[I<1zE&(6uvwtcr=nA4y69X7D6{;H??^EwSuz1pqh=/niIi^ypHRFI{[50/<#2sz2!H.JljS>vf#hq&Z\".a)=;N\\gv@tS%PLld6uuq\\Y+_-VQt{4(dN9j;\"2sy/lb*?Cq=rU0+$l&geFieBVkA>SjDNA:?izUuse\'&)9\'RPx7B\'7#CkzMKov)[wmA5$POyCx_QYMWQpe1ZW)])Fhb5w-iUPm_p>yvg\'zfms#EvPe6qbyb^6+p$S\\X+`/_wchdC\\-a.WSz8=i)\"k&inplQ05XC&-O-0I_-UPn_sMa);402I^&5x1w8G?F$w\\F*:(UYB{pD;>aVkA:@o>\"\'=An5Pw3..7kBA_Er:G:,fJ!Z.k_zoC948ZF-Ks.\"X\"722B;@n7[LLw@n7[NS;h(#qB/^tU,p%T_ffN7_bQPzF&$###%/]m5W?m5T0-1NyBrE=@j!Vvxy!(C]4&[\'C`A_Dq8ZBvX7E8&RR)kl^sPqpbw[>^J5f-CL7i:z,Zg#ea=F.Ks0(r7Qt!76IP;oKd;6>pGK*\'#w^PWIE_4\"Ezb\\+TPqsp]aRVE$yh{X)V__@^Ae^._zrNl]k)\"fib1c,E\\&$5{=V#?X\'M9mFO@1ma!rL`\'7#BgfO7^^AcXmFN;tez`RV?tU,q\'_4#I2VE4n\\_LA=MP-*,;*Yi0EPEJ(\"m/9mH[t_]:B#!vadWco//@5*kjUJQ?&<3%Yws^^BghW[F-Jns\">Rh;*[rU0*!bWlDHz\\=V!87KYa`BaL7g0O%_?UqasF@J7mP(knkS:dr6Me=NO*uB##%/Y]LCK4YNZ]F\')8{5.#`I-=/ngAI.CL7g.FWe!c^1nc,GcC_>TmQ,$iox54B5#H*3`rD9-s,ox7>qL`(9+eJ\"^Cm*yUx+\\sZE)8#?X%ChgPoD=D\"tQu&M;xvmB?Se+<0u1)tA{sU/#[0ry4-\"];JGbAX\"2sz5,xLKr)dJ%l(n&aCfb:6?wj/@:@pA0e;1#Scyb[\'Gp/-2P)mw9HCXr^aM?4\'].d:-lhHjfDYxwnI[pLd:.s,p{Bl&josw$>OVD1d/TB.XZ>c_97F?I5e-DT\\Uvy$81*yV\";H9#@Y*Yl9oOy@gp&\\)L,1R05U6GHs7KX\\G1XOd2b#xcga4stram,\'vQlUD2g>I5f3`p?_L?3\"L@;F1[`R\\X+b;;Sv#99T#Dp7U0)xRlP+zW%Fs?sV21?+VW8IJvD\'3f9\"9=elt+hYdo(jk^sOnb&*@H-AEtHCVj;!/d:-osv\"5(dJ%n09mGV\\OUC.UM_xh\"bRV=i%m)s:]LFWg*1S:beWeyW(Wf#k%cPI]yrS*ic7\"AbU^^AfdGq/-1NyD#w`Xy%:9Pg@Cn-)(*:*]$.X\\H4d+=Vz2x;QkN%bM7e\'&*>;NXSw+]$0c0\\ddPB;>dgZl:nMniJq%Vh0Ls)bBZ(L.=,]xn@/f@H-DQLiVPlYX1$]4(fUU23IYer7Rw0x>bXuj7g2YPd.N(n(lt+iZi)&!m4R)id=@eeM5WB#$)ANFU\\Rg6kFXj6cxZ:LQ8^Y(QHVW9Nb,HkiO1A70\'n(koob%%(8$G{c],ZfxNZ\\Dx^OLqz:IDWnKeCXvr\\W{2x8E6y1w7@!xl;tdxUz75C5y52:k:r_d]\'BXwxxug(\'+@Cn-,4^gmpn]c`97GCZ%>LEWf&zdg[rU36S*lme5lP,\"bVcuKR>yt^Wx&AXy\'Gq16W@rJTNf?ExY7@xl8h/ETYE-Kt38_]8:X7D2iIkhKv?m5T0.6ao3C;@l,,8tmJdAPR.*&{k*$o5Qz>^F#n6U4>wj4WC(:0x@k\'p19i1O\"OS6L`&0`yj-3ZSo]dbCcQKb6y4*o$Ui9uoR,yQd+<2$Yy$5$NEO@2sy/la\'1_rIP8dwQkM{PVE7!:E-N\'n\'hc;9JKzRc&);-lgBOIa5z7;`[+[oDCaEr;fuE0Z_QU>oD?LDNA;AsNgDYte!eeP?*O9j6d{fo{E#rFD`?Re.HdEf\\xoHVYBvX47V6B0b+F_4y;MXSu$A_Ciou&K3U*Q@/d5soYO`xdhd>E%\"tS#J3[W)Xl;y{&:45OohAH\'\'+CPMr{=SlP*vH>9AzoA0hGcGt@va_?UtnP&bGvKN*yY0wys[MO)q3@,UNf>=W(SV7JTL^wbf^\'<;Rpb\"o>ywj5^aPMprrf/Ls.yKCOFPEGq15XAv_UlH[uexSpc&%(6w%DhiZgzX*[wj2P%[+Xdp//;z&@PUA\"zrQx6;bdU\\Q^l)yW)Xj3U,XaaEr&=CxaZ$95=sX=aYxyz$0e:-j^uZAo=s\\Si=0ry5/,.BDkxBw[Ap;m@0jSA,R>\"(APT:]NP)p-#cWh,9wz)M0B=LIhYesVw#95A)BUh2XJL!UoXJHia.WU&T[RiBG\"iyMMyF,BNDK-;%CbK2Q+wG8z2!H.G`5{?\\vevLP4J[oEEjnlYY42>$4w-j\\m7_cXj8nNt-p!Cp8[J@Ae`6\'Ys__G\"ixH;-hQ=xpLfDZ\".`\'4oavX59^VunOw9JL\"Z-gL\'q7U/%eZqR%VmHYj5[UuupV60.6ap7U1-/CFuHCT`ir)dM1GWblxBrF?I7qbsF?I2WJIr.$bQKc;45K]tY?izUre+8utlB>P\\bZ#1na{n;pQ$S_hov.r(],X_Y%@WvvpT4B0d6v\"4\"I0O&eU[NR4HREC^;D&.P3IW\\OS7S&Vi6f.G\\{%7&T]X(ROt\'SU5C3ro[Z69[G0VGANI`1hGeM2KgKzUrf/Mv;U$H((/S(Eg^\'=An3GQEEf^%6\"@`J0Nx@l.5]\\9E1a#xgxMS=qPv.q!Ahpz@ea>I:%FtB(:/v7D3n_qA+N.4\\[9D.Q9``H$q@%2hEZyyuez_I0Mv8HFdL2MoqnXMWQpg9y(K+/JgRB5\"Bl&f]#.Y_WrcuKP7[MQ1:qV9S\"Co09lCDgeHq12FN9k?2t\'V`e`4u&N;y#/d7x,b7\'T[NVKQ:h*-BJ2R04S.%ggSHO7__EvOb\'2d-IlkZ_R^bT^`L;z)L*)/O)r8S$NFSS(aA[0psslH[uduG<55IQC7,ov.r$M@85B0a\'4nZX0\"QZRn\\`OLlb,KxI=5/.7i7mKkb,Jq+nv/u48\\MN$]738af`4w-ka\'2g>:E3f6p^gox56La+GfTQv/u1+{^Dq=oEGq01DGtB(;2)p+vE-LxH9\"8:V*fO9i3U;dkr$J3[W(TV;Z?dbB_AaL8oS2;pOrz500@4\"H/IdGn{G.G`7,nv,iZgwKJr+q(dK-7mKk_yl8ez`QS02Ja3mXQn]gp$S\\W\'PEHzY.oqo\\`OIa6#G\"j#^?Z1w:Pf8y,`,Q;k7h1O\'eWdq5K]u[G1[\\Bn0:pU9T&T]X)U[LKr+mrx.iSB2oc\'-Kv?l/;xxs^\\9@uX:T{9A{rPt#@[2\"LABdXmEJ($sM_{sS\'Zz$5y8?qL^{t[H6rf-BH\'$v[E%$$&1a%(7\"?Z-gO3Mk[ft9W31\\?_G\'&\'0Z_PT9X9MZb_;C%&-P4Kc7$FvPd1]hu>h![50/9pWAxh&q:adTX?n9f&wX305XC(7y/mg?@aPKgM-1KmiJp#L=-c7%K4[V$Cjt/%cROs&PKeE`2y=Z7=m:nHZk7cvQkQ2?*P;qT0/7g/JiZgzY,gM-1Mt,p\"G\'*9%Erl2I\\ubkt.v=aXsctHCXuj:uk?2v/u5;g\"cYs^]:F3h>77OkUGCYz)J{Z1x>aVj<&A[.hM)yY3+yP_rHK#aK6f-CN@4%TcuM[djk[gvE1\\fp)kmc0XU$I.ABe])Fkoph=1x=\\=Y.pv(ST/\'q6Mc4mVD5ssj?4(eRIW^Wvuj9q]\\8?tU,ox8C*CUf,;)TT,t6GFg[tZH:&I%sE:2-)#o8``Gy\\AgkjTE;7B)?F%zl4Px;Pe4g7tmKka&1`xdmw7@#\'8*dFigO2HV\\NP,&tHDZ#3w/s([#0f@F\"k(vMYZ?`MCFr:a_=OYV(YnGRJYesQ^hr-zP^hs1/7g/IeGo%[(J#fgSK\\oC948]Q`o7X>gvC%*BS[Vz0qv%Em%_pGO7cr=l7dy\\@ecEheGmw7@ynA4zY-iYbbI%rC1c/VM[emv2*vH=8B%-Q7ZH8x*UW8Nb+E^1plR4ISL`&4n^izP\\aTbtHFfUV4=sW;Z>^H/Lt1+\"d^/d9*^)EdO=$4y9B&2f8{5*kjVOiLwC#wa^9=dieCWq\\Y+b92*ySpasGCZ%=F.Ks.\"Z*ZmA3w2)mv46Prv$>OUD1b(6v!1rx-eEbDgeGls&RQ\'cJ(%yceTR\'].b3iFZyvk7f+7q`m,(\"l/8j=)P?,VU.wAsL]rPpmWKR>wl9nKeEa@Wy)M1HZpNomVG@K:\"6,s23GQDB[+Yh\'xZ8C,L$dXi2S18e{aSZPaxaZ\'Fp-%m\'jopjFZug\'#rGGknkR9acSR)ia1f;.oro]da=F,DSYH;1zH2]efVYBuV/!Sd(0UC2gAF!hv?n:i1Lpu%G{`NEO?0l\\fp\'`=I:(QKb2iHeN6ZNXPf<4,xMP07ctGBRXIDXr\\TnWG?DuM^rNf>>\\=W$Dku5>sW;[?c^0iN*z\\%:5:et?qK^wfvIDVi7i;#6+ox9F9(YpMme5p`p:g$n1xoIW_Y$n=\")EfYi.=-c9+fO9i0Kle;2\'dQIYg#feN7am\'jmf?Bjw@p?#+M*$n4K`)?G,ADp4IVY?hxJBL:y$820:r\\Uvwxvl>-_%/\\h\"\\:D.R=rU38^Y&I&wX/yH3aycdQFI\"`K7j>2x8D1a\"uX:QmYW+eK$iq$QQ(g\\xl:r]X&L3T7OlXRrqbwV*b;=`RYNYW-ow0yApoC95>sYAuX5:es;bfZqPw303P#PQ)o(ha1c0XSy2!K>600=%;=_QXG;2)o&]2t&M<$:9Of;.mjM%dVahke<7?rPqrmO{KADo..;z)N5ZKImpo^hr0,,4bwW-q&XoNr\"@aPKhR>\"\'<X+`2m]hvAuX8GAOOzG,BI-AAbTYJCRS16XBzn={&:59_X!2w1$[*TQw418csB\'7$I-=/la&/XT!>X)YnEHyW$Er;bg`1f<52;qS,u>hyQax`Wr_gi\\pGM/?1s#Ckw?i!X$>OVF:0\"Q[[9E4o`q?#+KzSjCJ.BEs@\"zt[I:)Wcn(lw7B*CWnLla&/VNa&1`xbbK-8sf+6lLpx2$Z$;@n7ZI?@cXpQ%WqZP_rGHo$Te(+>SjERR\'cH{^Co3DBZ)TPv-oqqd\'(5pby`WpVQauSy4,xJF_2pkMxBsMa(9(Xi1Mu0%dU[LIja-P3Ka0^tS\"Bl(o)o(fYg%sD3oc%$%,Js1/6bq=oGP=#1hHjc6z4,vB\"u\\I;,b7([{%7)^0e>>Y2$Z(L0DK.=-eBRZPazj+*2[[;NZ^NIb9/\"Vsg/G^+P*N2KgN/;y#0gBNDK0FUZH9&L3S3>{#.Zeo%Z%>KDRQ$Td{flon^j#_Dm\'igO7[Q`uRt{4(dL.=*VX>gq.%fcAWr`hnrv!2v1#Wsg.FYnGQEDdSQ\"I1UC+Jt8PlWOf:,c?I4b{k*#l,\'{gp\'a@VtnMqx1zH0P-)%yen\"LBEr;chfIwH<3+uB{sS#K9tj<%AZ)QDB[.hN.4[SnWIE`:<^L@=OYTz64@*IwH;-j^tV34IW^TkGXk9nKeFha1gAH,=0t)`7*hYfuE2e5kHc?MIfM/<&C`Cjq%PMqx2#QYO`xa[)RGM1HYj1KhQ;pQzDvSv%Dku49_\\2zBn2D@WuqZLP1?-]sT,q\'^2t%K1NzF*7w%@Wur`is0\'lx>dcHzY.oqnWJJu;\\DzgtejgJv@rL]qJYdn$Z$96D7\'Ve#k&iorqe+9$CgeGp*ny>^F$w\\F)3f4c(/S>vds?rOojKox3*s6HM+,;&I\"d`7/#[.gL\'r;fxNZ\\CvSy2$XuoNt+fN2Lk\\k/<$7.xG5kIdC_=KF\\&<=_L?75D:6LFXmC@Wy&B_>P^k\'q7R{@aQP{I4c#rIP8dtD0_tRx4.(y\\@ecFlw;Tz4)mt)](Fhc;5;clx?eh]zwg\"d]*Q?&=BtOg?BjwAtRu%Eq5HQC:6A&5x/nkQ3GL.;$96A+M*\"goy=Z4.+-=.k\\k-3WC,LzRc&&+CVi4^fgX_Z(L1KhRA-XZ@l.3WB$&1d0VLXZ>_NJc?J<+]zveuD/Z]I6lMr&Wi5bwU$I+7nU>pEEg^%5z78Rw0x@iyLLw@n6V7JRC7*gVW6C3n]gq+r/)yZ52;pPw7B\'7$GzbWpS/+),=63sT-u9PjO,)).Ks-u:U(Zuh/CFvNZ`Uh4^fgXclw9KP6T0,-9wxz#-X[F+?@cXmDHyV!9?l1FN:r\\SmR19h0Lnm^l,,8tlGWae](D`@Z,a0c1]i\"[2{G-F\\$2lWPkO)s:]NMv;U\"?Y-gM++3_n3FK($rD8*dHt;`Y{-_$,M)yX-j\\n={&8-s.zOT>sU.\"Y%ElzG1VIGjeAQWC)@G\'(4iDRS.&n*t=h!\\;JE]+SISKZi)#m0:scr>t\\LF\\$5z:F6tvtg,:#;D\'/WRro\\_I1Q.**1UB)@J7mMt.w>dg]{yrU37YD&+DWoOv59[F0T>uadWg))1YV(ZueyX+dEdPC@Vsi8q\\Y-hSEBVpYLN(q6KZh&rA%/Z`XvpT3=wnFL1I^(@K>5+t:Y:QlR6Pt&PFM3S16XB{pEBY%?Rby`Ui8q\\Z4-%ju7GD\\*RFGr7M`&1b(3g:(SQ\"J7oWD/VM_v_X!1ng=529exV$G\"hq)h^!ztZG3b!n8`fa:5;h)(,AI.DOEL1Llc1_qB2kSG+>8?sQw/t0$]9*P=z#,UM`%.ULZb`@W!4$RXG:,gPP]dbDe[tae[vi2O\"PS4FFkqw-iWW1,\'xZ;Ob\'/TA*FgZm@0hIp%XsdwRmWJN,+3[[9D0^p?&:6@!ypHTQw0w;Tx/njO*zZ4-#cWj7h3ZSrjCI)-EU`fdEeV]Vur_cWk:wui3XHBNGXg&wX3/0ADydg]ypKa.XY8E6y2\"MFXh-:\"4\"F$uV-r)cGr4C90\'ij^u\\LDRR\'cL0FQJ\\rS&Z!+RC;:Pf:)ZoI[pK^\"zvdq5GHs:[D{k.6cy`TcwW,kb.RH1VF>?cZy\"*JyO\\b\\*REB[*W^UmNzI7sj?5-xH9$Ciml[aYxz&;9KSB1f?AffQC;<[>\\@cZz$2lYU&QNqx/nmZZ:LUHIt;\\H4d*:)V]TnT7Ry7;dkorri=-eD\\+XbeYk8h4\\^H+7rf,=3(h_\':1&f[vg&vRqlKnog8z.eBQXF7y2x;Sqg4e+;*]\")CY!.`(;69ZBw]MG]%4suwy{\'@PS5KZgzX)Xf#j{Q`o9co-%kzLEVbl$]727YD&.S@\':3..8pZNVLXX6@#(>CuPkR6T*jfE_70(s:JHh]wi+/IdFiiTHM/:ti7j>1t)\\%5z:H@EzdeRK`+Jv?m3Noo`sHK#bRT01@4{Cq;i,3[Z53>$3rrjBEo..:unLjWX5:cjq\"Co2>\'C_;E.O-.=-a.VPn`uU*dFjnm\\cbElzF+>9C*@F$vZ=]CsHIq+s4?#,P7\\Si>4,vC%*CVh2TV!74>xoHUU.{Sg6lIb:48ZE+AI/H`3rqd)1XRpg6kGZucq5HO9j7i8p[TtrbtIHmu-ml\\dg[rR%WoOzCsJQ;l>+US%S\\Y/pt{4(fVZF/P1J<,c9/xC!o?%5zLH`6(\\&)L.;!.c4pe/N&eZoIZk6^bQQ&]0kWT#H\'&(3g=4,yRg6lMu33DAY%@WvvqW>k/>-^\"!ysV7IO2EJ&rB.WV+ja.UL[fs9W2/5XF6tuoR+u?n:l>*SLa*Ea?Q\\^H+:\'N;vlA86B1e8#>TmQ.-5_hp\"H,>8.gK!W{2v-nrsnP\'eV\\P[]E!k(vLUHGjhQ;oJ^#\':3-*\'&(3g9#?TmNzH4g5f3`p;j1Kj\\k/;!.a*E].c4pd*8y+Zj2Nt,mm^pA/`$\'7!;JDUdxX/t/$]77M_zrMgHkiR>yt^Z,b5v&H#hp$PQ*s7OhHh[pGL-7j>1v1%`BdZrZJBNB?TmNyE(/R;h*-ACm&dRPv1\'jk]rK]rOnc)9$Es>rPu\'SR*knhBK7i9wxwoLhN,,8re%w[Cx]J:\"5\'^1nc,GdIzV{5*nzCrE:2*uD/WOf;0x>`PP$VoS3@)It9V.u8JO2FK-9sh2U@zrOqqg4d(1ZY6=n?+SHO8bp3A4w-le;0xAn4Ld==Y2&bHz^Ezca@UnS5HO7__Fzb[&>I:&GwQg=63=xoK`-Q:h),<0s(\\$4x0w8E9*cATf,<.mhEYuf&y`Ui:x\"-[m:oNs%N@4$QR/-5_it24LfE_6,r/(s@yl8e!fkhL&kw;X/w>b]0l[ccK,3\\^F#n8^X$>QawY6>pK^yoC(Ht?oA/b/Y[@j{TmP&`BbNA:>hxIAH+9z.d<8E6u{0nhCPJa4suupS0/l2KgM*&yaYy\",UOjQ4LeAPP&`A\\63:k8i6e\'+>:H>?`L<%@Vrcy`QV=l3Ox9KR=rU4;i0I`2m]fmu+fN4T0/8kA:BxbbJ+2XMVOiHi^zrR!E{hwC\'0\\emt)`4x3(koqjEU^^AaQNqy4*p(eTQ{Cp7X?k)\"iu:T$I+8tnO{I4d*6rf.HcC`?Uqczb[\'EijZdkqv(TW;\\Cw[Aj$`FvLS@%4stq_fgUS#J6j?5+s6FC]0l]n7^\\514Nqty+Zi,5czejfGid>Ak$_A_F{ddJ(zc^2rw&Eo-%k{NQ/2Moph=0r\"AcVe$o7X>fq,vB#zpFFks\'Vf$rD8)`7)dI{[528ahiZep/,->5-yOYTy2zCvU\'Wg(*6nUA\"#\':1\'jmf>;N[`S]_I0N\"Sc!j$dYqS,wD)9\'SS+o$Uf)/Q1t[I:%GwNYZVy-a.Y]LCH\'#sKX^PVD/WSx2#SbtLVQrpatJO4Orz63>zyucn(iiVS{=Uv!1nf;+`/]n=xs[OVIIq-zQbzhxLLyJ@?Z0s*cDdRMl`zn;s\\Rd*8\"86HK$fcC_;C#!u[F,EZuj6br@%2hF[#2m^m3IYfzY.mjO.0FRNmc,HfTOpmWKO.4WB$(;3-(zaXpV=fr5FEeSPx9H@I1S6Psx+]\"$+N-2P$Y\"1oiDRT13I[pIX`_A^AaOFQIYevG;3,\"_DsC1b*>zveuF8%I*/MxCzi$fc@Sc!k)xTx*Xcm%^:>fr27[MN\'ij]sS$NDK0H]#,R@,RA/a\'6x-gK!Y*Yj2Q*s7OhFaj*\'%#zoCE\'*>=Uux#6\'Z{(BY$::Sv\'L2R-%js+lmb(6soWF7x,b8(YpQ%Z\"-^xh(zdcGuE3iF]\'?LBH$q>vewN[b^7.#_@_Fy^I4_l+%p8[KCOFPDB^:C#yn?(D`@W!3y^Ex[?aRU;a]6-yMN&dUZJCOFPEI\"bT][4+t<`Z%@UoXICS][4-$geL-4[W%J,9y(IyTrh7pZSo\\^H+:\'O?-^xk1KfJxKIll^pB3str`l(q3>$2m]hwH8#=MQ1=#1jQ6V4:h+0MxC!n8dtF9,kb0[cdO!&;7D3jKp#L<)O=#2oh?;JDUcvN`xcfZpMkY]LCJ/ERNqw*\\vg%o6R%UcvRrlNyE\'-LxE+??_H,;*[rS(a@Vsf,<-eEcI%q\'C`A\\76GGlrz9C(:-nm^o=ubjr%SZLM$_Be]\'@OO%\\0qssj?3$Tao5MfDXui3ZPd-Kr*jgGic:2,$is-v>fnxi\'r=n>(Hs:[F)6smKkb-M%dXi1NxAl.1Ms&Ucs@#%0^tT)b@R^fh^ztYAuU*dHt:F6v#725Q\"J5d(/Q5MiO2C?OUA$)AOLqy529g)+:&J)(,BNCFq6NiN,(\"n5S*ny,[oFHvF8!9?pC934J\\pGO8f((1YU&OGRMgJs4@%5y64D:48X=ca@VrczdfTT*lmd3d+=7n>%8,ll]l0A7/%geIt>j+*3]b[&?MIcC]2x:LR=sZH;*]$0`%*AK;&Fq3?(AUlEM9pS26ZH:)YnDB`CgdGmzF)2]iyMR4IUS%RU9Y:Su\"88Ne7v#723HRISMd8\'SW<`Yz*P>#0d6w%B_AbSU6JSHK%l$]611C>OU?u^VtlFQHSMiN-0EQLeCVj>-d:2,$jv=`WnOzG,AH\'$zm6YH<4//<$95>u``G{aVj8pWC(7#BgfM.8mLmiKt24Lc7$I,;\'K/ASjDM;z(Flr%M?2w419i5^bVf\'$yfs6IQ>!\'=CtM_ym8dyZ9E6v$?Si>3&[(J#d^/e>>\\CrB+L&o.-4[Y2%^9:X45JZi(y_NGZrWrR\"F$tNc1_rHK#cU`e]\'@Q[W\'SS,wE-Jp%WlEM7cwStvxz%6\'[\"*M.8lFQIZm;tf%sIN-1Nv6@\"!zveuE3jHfO9g+6jBEs?vclv6=oEGq2;pNpssi<)RHSJZi*()3e0UE7#EsC.XX32>\'AUlGWds>pISITNjR9co,#d[\"+N3Ml_xdkr$K5asGBUg/Hc@R]aS[SmT=m=!(C\\,^zvdo-(xW,hWY=`R\\Y/q{=SlP+zVy-eAPQ*q00?/gIq)g\\sW:T\"Ad]*L(z_NEPCB]9=eo$Tf+7rh4^fkjTF@ONyD{l0A99Rsurcy\\Aj\"Vsg1T;dlx@iyKEYqV9T$I.ESU3:i0FU^X&Fr9[H6nU=j-4_jxD(4lO(n&aBbNA71-,7nS3?(EeTU25Py;Pf8y-c8)^*J\"^@aPKd@NJgRA0d4lQ1:nI^%3m[^I3\\_MBA_Cl#Wvuk?2v0\"Q]`NGV_];G7w&Dga6#EvPhBM>0ng=4-&o/0CFsgq-\"Z,b6\"Ae^/e;1#Te*7uth2T:_Xx\"1l\\dg\\veuC-O.3U;baFuF;2\'eXh))2]gp%Vi8oV>m7bo/1FO?+UT)bB\\1r{;H>;KM$`FwRmVD4ob#tT%OGUYC%(9\'TZLJnqsq_jwByfq.&o19i2R2:l=\'Eij]qJWY>b^4$OJc3&\\,]u^Vsh4aq=sX=a\\.b4n]ca?Q^fkjWT$I,<,b7\'XlA71.2Q*s6HM.7g2VB\'5v&FtD/XX45JZi+/H`3qnVF:0yF-HdFmx?ddL-7kEN<\"/c4n\\_NFTW;\\F(.P0;tdxTy0ptvz(Ht%:8KP7[OXQjJpy;Pb#zm;qW?m5U6F@OO%\\/k\\j(wPg0mc/R:cm#WrcvPe7uumKfJzTqasHIp*lomXPiF[z%5y4-&o1:nHV^X\"6.zP]efTR{Cp8[I>9@v^Q]d_7,q&\\\'DeXh*.Hb>I7rf-ADq9]Q\\_MBA^@`G&zfp*p)kl^qGIvC);3,{Z1{J9z,\\rPu+fK&n..:wvoKfGlrx0u/zMKot{5.$dZtafb>F+=3+t=ep)ifHo%Ywtey\\Aiu:W.v:RsskEPEI$l(o,ySlMxAoxnB:;V+gTLb/XU\'VctD2hCNA=NS8X<_ONx@k)wPb\'/TC1f:,fK$ggTOnd-ImokO(n&bGwQg:\'M8lCDlyF-F](Go(fYh*,<,d?I5g4e*9!5)jgIp(bGr9[F,EWj:umHXf#gkfD[%;?izSjDN@7/\'p18bn,&sB,N,+4`p=pNl]k-3XJInw43C8.v>gs6HJzUrg0Q19k:uk>0md2azj*\'\"qD<=]G(/O)s=j*(*:&K1JfL&o1$2pkJiZh#eafq/(uG=:KO0:sbq:acQKa2hCQS.&m\'ijZfr6HL+*2[]Cp;h)\'&(5pbx]F*7skCFwPd.M$`DkxBvY;Tw\'N:pS12GRIX_[0ppe0Q3C:9M^qIQ>\"+O6ZKIhYfuD.R=qPt(Wi0Kk`&/Z]J:$>PZV%I,7oYLR;i/DJ*.HdEf[uae\\{#*JyP\\b].a+Io\"J9uq\\Y+_,THL+*1VF;42Y-iVRx3*s5FBXxxyvj5]`J3\\[8?rMe;42;r[OYW+dEg^\'=@gmt&ODDks)a97D5w*ZoGO;saiq&UcuLVNd4mU?wh(#n4LhN,+2XMXW.w>caAZ,b5w,eC[&CaH\"glmb):+b90&e[tagdBZ(L.:y$6\'\\(DdTU4>xqOqtuulCEp02Kd>E#tPlXRpg6nU>qMf@J5e,ACk!R_k$`Dm&cN<#3t{60/;ws^]=Pb\"rMa,Jt5A*Ho$S]^Bl(n(h`0a%(:/t/\"X\"4$PP%]2u+fK&p3EEf]\"(@LAA`H%w\\E$w_VoT7Pnc\'1\\ca?Si<*V\\Q^jzQ^j\"Y\'M7ctIJt7KXZ>aXsdwRpb!l1DGuF8&L8kA1u-ov,eEdQHTQz=W&N=\'C`BdWg+2ZW*b:59^X\"5)eQDAXy\'Fm\"NLpx4-$hjb1b)9\'PEJ&vRpg5h;)TU37YD&+F_6,p&Yws^[2!J:%@Y\'L/CEo/2I^$-THJzVy.d=?aUd!fid;419i2U*P>$3rpbx]G.G])Gn\"ONw=^I1TP\\_L?88PkT@%/^uW35MiR>vg&uOe9%H\"fi_%/\\k,->2\"L@=P_m2FN8e#o7X@n;mA6,r/\'n*r4B3sw$9C&1c);.px3(ha1e9&M:r_bQPzF(.M#\\5+q-yOZW*`3pkKpzY+_,QoA0e=9G<69Y<[0omWM[dkmd4kKq#H,=2\"LA@];IBL:x\"/b.TFAS`l(o*s8Qsw#838^Z,b6!>UsnP&bJ*+9#:>hyO[\\CuOe9%FwQiEUaip\"DtJM(wO_rHM/=(HvH@G&$\"wabJ+1U@{u``EtB*FcHxP`w\\H3bx`Wsbq:bf_-UPog:\'M8kA:AtS#I.FXk8j=,`*D]1ppb!m5S*nw6=oC<@l-1Lnm[^J:{0kYY9LVNb,Jq(a>KCL9se&zhwH;0x>c_6*jfBS_hov,hUQt\"deSOpn[[CsHGkk\\l3Mmg>;MS?!\"&7\'Xk<\"1kXV)]*M/;y&.e@I1UA$)APP&'); +--enable_query_log +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +INSERT INTO t1 SELECT * FROM t1; +--error 0,1114 +INSERT INTO t1 SELECT * FROM t1; +DROP TABLE t1; diff --git a/sql/ha_archive.cc b/sql/ha_archive.cc index e2a2211259f..6e18f2e1e01 100644 --- a/sql/ha_archive.cc +++ b/sql/ha_archive.cc @@ -205,7 +205,7 @@ bool archive_db_init() else { zoffset_size= 2 << ((zlibCompileFlags() >> 6) & 3); - switch (sizeof(z_off_t)) { + switch (zoffset_size) { case 2: max_zfile_size= INT_MAX16; break; @@ -676,6 +676,7 @@ int ha_archive::real_write_row(byte *buf, gzFile writer) total_row_length+= ((Field_blob*) table->field[*ptr])->get_length(); if (share->approx_file_size > max_zfile_size - total_row_length) { + gzflush(writer, Z_SYNC_FLUSH); info(HA_STATUS_TIME); share->approx_file_size= (ulong) data_file_length; if (share->approx_file_size > max_zfile_size - total_row_length) From 279529c11c124918c2c5b82b66c00c01c5339ade Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jun 2007 11:34:23 +0200 Subject: [PATCH 018/227] Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB fix binlog-writing so that end_log_pos is given correctly even within transactions for both SHOW BINLOG and SHOW MASTER STATUS, that is as absolute values (from log start) rather than relative values (from transaction's start). --- Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint into sin.intern.azundris.com:/home/tnurnberg/22540/50-22540 mysql-test/r/binlog.result: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions. show that SHOW MASTER STATUS returns correct values while in transactions (so that mysqldump --master-data will work correctly). also remove bdb dependency. --- manual merge mysql-test/t/binlog.test: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions. show that SHOW MASTER STATUS returns correct values while in transactions (so that mysqldump --master-data will work correctly). also remove bdb dependency. sql/log.cc: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB fix output for SHOW BINLOG EVENTS so that end_log_pos is given correctly even within transactions. do this by rewriting the commit-buffer in place. --- mysql-test/r/binlog.result | 122 ++++++++++++++++++++++++++++++++++++- mysql-test/t/binlog.test | 93 +++++++++++++++++++++++++++- sql/log.cc | 63 +++++++++++++++++-- 3 files changed, 269 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/binlog.result b/mysql-test/r/binlog.result index 6807da16e66..41c75a2067b 100644 --- a/mysql-test/r/binlog.result +++ b/mysql-test/r/binlog.result @@ -1,6 +1,6 @@ drop table if exists t1, t2; reset master; -create table t1 (a int) engine=bdb; +create table t1 (a int) engine=innodb; create table t2 (a int) engine=innodb; begin; insert t1 values (5); @@ -10,11 +10,11 @@ insert t2 values (5); commit; show binlog events from 98; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=bdb +master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert t1 values (5) -master-bin.000001 # Query 1 # use `test`; COMMIT +master-bin.000001 # Xid 1 # COMMIT /* XID */ master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; insert t2 values (5) master-bin.000001 # Xid 1 # COMMIT /* XID */ @@ -133,3 +133,119 @@ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 show binlog events in 'master-bin.000002' from 98; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query 1 # use `test`; drop table t1 +set @ac = @@autocommit; +set autocommit= 0; +reset master; +create table t1(n int) engine=innodb; +begin; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 +master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=innodb +master-bin.000001 197 Query 1 265 use `test`; BEGIN +master-bin.000001 265 Query 1 353 use `test`; insert into t1 values (1) +master-bin.000001 353 Query 1 441 use `test`; insert into t1 values (2) +master-bin.000001 441 Query 1 529 use `test`; insert into t1 values (3) +master-bin.000001 529 Xid 1 556 COMMIT /* XID */ +master-bin.000001 556 Query 1 632 use `test`; drop table t1 +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 +master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=innodb +master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (1) +master-bin.000001 285 Xid 1 312 COMMIT /* XID */ +master-bin.000001 312 Query 1 400 use `test`; insert into t1 values (2) +master-bin.000001 400 Xid 1 427 COMMIT /* XID */ +master-bin.000001 427 Query 1 515 use `test`; insert into t1 values (3) +master-bin.000001 515 Xid 1 542 COMMIT /* XID */ +master-bin.000001 542 Query 1 618 use `test`; drop table t1 +reset master; +create table t1(n int) engine=myisam; +begin; +insert into t1 values (4); +insert into t1 values (5); +insert into t1 values (6); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 +master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=myisam +master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (4) +master-bin.000001 285 Query 1 373 use `test`; insert into t1 values (5) +master-bin.000001 373 Query 1 461 use `test`; insert into t1 values (6) +master-bin.000001 461 Query 1 537 use `test`; drop table t1 +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 197 +insert into t1 values (1); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 312 +insert into t1 values (2); +insert into t1 values (3); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 542 +commit; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 542 +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 +master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=innodb +master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (1) +master-bin.000001 285 Xid 1 312 COMMIT /* XID */ +master-bin.000001 312 Query 1 400 use `test`; insert into t1 values (2) +master-bin.000001 400 Xid 1 427 COMMIT /* XID */ +master-bin.000001 427 Query 1 515 use `test`; insert into t1 values (3) +master-bin.000001 515 Xid 1 542 COMMIT /* XID */ +master-bin.000001 542 Query 1 618 use `test`; drop table t1 +set autocommit= 0; +reset master; +create table t1(n int) engine=myisam; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 197 +insert into t1 values (4); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 285 +insert into t1 values (5); +insert into t1 values (6); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 461 +commit; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 461 +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 +master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=myisam +master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (4) +master-bin.000001 285 Query 1 373 use `test`; insert into t1 values (5) +master-bin.000001 373 Query 1 461 use `test`; insert into t1 values (6) +master-bin.000001 461 Query 1 537 use `test`; drop table t1 +set session autocommit = @ac; +End of 5.0 tests diff --git a/mysql-test/t/binlog.test b/mysql-test/t/binlog.test index accfa6a577f..6271a8f95a8 100644 --- a/mysql-test/t/binlog.test +++ b/mysql-test/t/binlog.test @@ -3,7 +3,6 @@ # -- source include/have_log_bin.inc -- source include/not_embedded.inc --- source include/have_bdb.inc -- source include/have_innodb.inc -- source include/have_log_bin.inc @@ -12,7 +11,7 @@ drop table if exists t1, t2; --enable_warnings reset master; -create table t1 (a int) engine=bdb; +create table t1 (a int) engine=innodb; create table t2 (a int) engine=innodb; begin; insert t1 values (5); @@ -49,3 +48,93 @@ show binlog events in 'master-bin.000001' from 98; --replace_column 2 # 5 # show binlog events in 'master-bin.000002' from 98; +# +# Bug#22540 - Incorrect value in column End_log_pos of +# SHOW BINLOG EVENTS using InnoDB +# + +# the following tests will show that certain queries now return +# absolute offsets (from binlog start, rather than relative to +# the beginning of the current transaction). under what +# conditions it should be allowed / is sensible to put the +# slider into the middle of a transaction is not our concern +# here; we just guarantee that if and when it's done, the +# user has valid offsets to use. if the setter function still +# wants to throw a "positioning into middle of transaction" +# warning, that's its prerogative and handled elsewhere. + +set @ac = @@autocommit; + +# first show this to work for SHOW BINLOG EVENTS + +set autocommit= 0; +reset master; +create table t1(n int) engine=innodb; +begin; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +reset master; +create table t1(n int) engine=myisam; +begin; +insert into t1 values (4); +insert into t1 values (5); +insert into t1 values (6); +commit; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +# now show this also works for SHOW MASTER STATUS +# as this is what "mysqldump --master-data=1" uses. + +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +show master status; +insert into t1 values (1); +show master status; +insert into t1 values (2); +insert into t1 values (3); +show master status; +commit; +show master status; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +set autocommit= 0; +reset master; +create table t1(n int) engine=myisam; +show master status; +insert into t1 values (4); +show master status; +insert into t1 values (5); +insert into t1 values (6); + +show master status; +commit; +show master status; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +set session autocommit = @ac; + +--echo End of 5.0 tests diff --git a/sql/log.cc b/sql/log.cc index 818828f9557..465d694ba10 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -134,7 +134,7 @@ static int binlog_commit(THD *thd, bool all) // we're here because trans_log was flushed in MYSQL_LOG::log_xid() DBUG_RETURN(0); } - if (all) + if (all) { Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE); qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE) @@ -1835,7 +1835,9 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) if (likely(is_open())) // Should always be true { - uint length; + uint length, group, carry, hdr_offs; + long val; + byte header[LOG_EVENT_HEADER_LEN]; /* Log "BEGIN" at the beginning of the transaction. @@ -1867,13 +1869,66 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) /* Read from the file used to cache the queries .*/ if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) goto err; - length=my_b_bytes_in_cache(cache); + + length= my_b_bytes_in_cache(cache); DBUG_EXECUTE_IF("half_binlogged_transaction", length-=100;); + + group= my_b_tell(&log_file); + hdr_offs= carry= 0; + do { + if (likely(carry > 0)) + { + DBUG_ASSERT(carry < LOG_EVENT_HEADER_LEN); + + memcpy(&header[carry], (char *)cache->read_pos, LOG_EVENT_HEADER_LEN - carry); + + val= uint4korr(&header[LOG_POS_OFFSET]) + group; + int4store(&header[LOG_POS_OFFSET], val); + + if (my_b_write(&log_file, header, carry)) + goto err; + + memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry); + + hdr_offs = LOG_EVENT_HEADER_LEN - carry + + uint4korr(&header[EVENT_LEN_OFFSET]); + + carry= 0; + } + + if(likely(length > 0)) + { + do { + DBUG_ASSERT((hdr_offs + max(EVENT_LEN_OFFSET, LOG_POS_OFFSET) + 4) <= length); + + val= uint4korr((char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET) + group; + int4store((char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET, val); + hdr_offs += uint4korr((char *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET); + + /* header beyond current read-buffer? */ + if (hdr_offs >= length) + { + hdr_offs -= length; + break; + } + + /* split header? */ + if (hdr_offs + LOG_EVENT_HEADER_LEN > length) + { + carry= length - hdr_offs; + + memcpy(header, (char *)cache->read_pos + hdr_offs, carry); + length -= carry; + } + + } while (hdr_offs < length); + } + /* Write data to the binary log file */ if (my_b_write(&log_file, cache->read_pos, length)) - goto err; + goto err; cache->read_pos=cache->read_end; // Mark buffer used up DBUG_EXECUTE_IF("half_binlogged_transaction", goto DBUG_skip_commit;); } while ((length=my_b_fill(cache))); From afa96081ab05efae0a82fee86aee59a595073946 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jun 2007 11:37:10 +0200 Subject: [PATCH 019/227] Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB fix binlog-writing so that end_log_pos is given correctly even within transactions for both SHOW BINLOG and SHOW MASTER STATUS, that is as absolute values (from log start) rather than relative values (from transaction's start). --- Merge sin.intern.azundris.com:/home/tnurnberg/22540/50-22540 into sin.intern.azundris.com:/home/tnurnberg/22540/51-22540 --- Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-maint into sin.intern.azundris.com:/home/tnurnberg/22540/51-22540 mysql-test/extra/binlog_tests/binlog.test: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions. show that SHOW MASTER STATUS returns correct values while in transactions (so that mysqldump --master-data will work correctly). also remove bdb dependency. manual merge mysql-test/r/binlog_stm_binlog.result: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions. show that SHOW MASTER STATUS returns correct values while in transactions (so that mysqldump --master-data will work correctly). also remove bdb dependency. manual merge sql/log.cc: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB fix output for SHOW BINLOG EVENTS so that end_log_pos is given correctly even within transactions. do this by rewriting the commit-buffer in place. manual merge --- mysql-test/extra/binlog_tests/binlog.test | 92 +++++++++++++++++ mysql-test/r/binlog_stm_binlog.result | 118 +++++++++++++++++++++- sql/log.cc | 60 ++++++++++- 3 files changed, 267 insertions(+), 3 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index e838acbed35..02d5a92ea38 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -49,6 +49,98 @@ show binlog events in 'master-bin.000001' from 106; --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// show binlog events in 'master-bin.000002' from 106; + +# +# Bug#22540 - Incorrect value in column End_log_pos of +# SHOW BINLOG EVENTS using InnoDB +# + +# the following tests will show that certain queries now return +# absolute offsets (from binlog start, rather than relative to +# the beginning of the current transaction). under what +# conditions it should be allowed / is sensible to put the +# slider into the middle of a transaction is not our concern +# here; we just guarantee that if and when it's done, the +# user has valid offsets to use. if the setter function still +# wants to throw a "positioning into middle of transaction" +# warning, that's its prerogative and handled elsewhere. + +set @ac = @@autocommit; + +# first show this to work for SHOW BINLOG EVENTS + +set autocommit= 0; +reset master; +create table t1(n int) engine=innodb; +begin; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +reset master; +create table t1(n int) engine=myisam; +begin; +insert into t1 values (4); +insert into t1 values (5); +insert into t1 values (6); +commit; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +# now show this also works for SHOW MASTER STATUS +# as this is what "mysqldump --master-data=1" uses. + +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +show master status; +insert into t1 values (1); +show master status; +insert into t1 values (2); +insert into t1 values (3); +show master status; +commit; +show master status; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +set autocommit= 0; +reset master; +create table t1(n int) engine=myisam; +show master status; +insert into t1 values (4); +show master status; +insert into t1 values (5); +insert into t1 values (6); + +show master status; +commit; +show master status; +drop table t1; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ +show binlog events from 0; + +set session autocommit = @ac; + +--echo End of 5.0 tests + # Test of a too big SET INSERT_ID: see if the truncated value goes # into binlog (right), or the too big value (wrong); we look at the # binlog further down with SHOW BINLOG EVENTS. diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result index 66fe3e40270..1bc7430fde0 100644 --- a/mysql-test/r/binlog_stm_binlog.result +++ b/mysql-test/r/binlog_stm_binlog.result @@ -7,7 +7,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 4 Format_desc 1 106 Server ver: #, Binlog ver: # master-bin.000001 106 Query 1 213 use `test`; create table t1 (a int, b int) engine=innodb master-bin.000001 213 Query 1 281 use `test`; BEGIN -master-bin.000001 281 Query 1 90 use `test`; insert into t1 values (1,2) +master-bin.000001 281 Query 1 371 use `test`; insert into t1 values (1,2) master-bin.000001 371 Xid 1 398 COMMIT /* XID */ drop table t1; drop table if exists t1, t2; @@ -145,6 +145,122 @@ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 show binlog events in 'master-bin.000002' from 106; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query 1 # use `test`; drop table t1 +set @ac = @@autocommit; +set autocommit= 0; +reset master; +create table t1(n int) engine=innodb; +begin; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Query 1 273 use `test`; BEGIN +master-bin.000001 273 Query 1 361 use `test`; insert into t1 values (1) +master-bin.000001 361 Query 1 449 use `test`; insert into t1 values (2) +master-bin.000001 449 Query 1 537 use `test`; insert into t1 values (3) +master-bin.000001 537 Xid 1 564 COMMIT /* XID */ +master-bin.000001 564 Query 1 640 use `test`; drop table t1 +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Query 1 293 use `test`; insert into t1 values (1) +master-bin.000001 293 Xid 1 320 COMMIT /* XID */ +master-bin.000001 320 Query 1 408 use `test`; insert into t1 values (2) +master-bin.000001 408 Xid 1 435 COMMIT /* XID */ +master-bin.000001 435 Query 1 523 use `test`; insert into t1 values (3) +master-bin.000001 523 Xid 1 550 COMMIT /* XID */ +master-bin.000001 550 Query 1 626 use `test`; drop table t1 +reset master; +create table t1(n int) engine=myisam; +begin; +insert into t1 values (4); +insert into t1 values (5); +insert into t1 values (6); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=myisam +master-bin.000001 205 Query 1 293 use `test`; insert into t1 values (4) +master-bin.000001 293 Query 1 381 use `test`; insert into t1 values (5) +master-bin.000001 381 Query 1 469 use `test`; insert into t1 values (6) +master-bin.000001 469 Query 1 545 use `test`; drop table t1 +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 205 +insert into t1 values (1); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 320 +insert into t1 values (2); +insert into t1 values (3); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 550 +commit; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 550 +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Query 1 293 use `test`; insert into t1 values (1) +master-bin.000001 293 Xid 1 320 COMMIT /* XID */ +master-bin.000001 320 Query 1 408 use `test`; insert into t1 values (2) +master-bin.000001 408 Xid 1 435 COMMIT /* XID */ +master-bin.000001 435 Query 1 523 use `test`; insert into t1 values (3) +master-bin.000001 523 Xid 1 550 COMMIT /* XID */ +master-bin.000001 550 Query 1 626 use `test`; drop table t1 +set autocommit= 0; +reset master; +create table t1(n int) engine=myisam; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 205 +insert into t1 values (4); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 293 +insert into t1 values (5); +insert into t1 values (6); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 469 +commit; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 469 +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=myisam +master-bin.000001 205 Query 1 293 use `test`; insert into t1 values (4) +master-bin.000001 293 Query 1 381 use `test`; insert into t1 values (5) +master-bin.000001 381 Query 1 469 use `test`; insert into t1 values (6) +master-bin.000001 469 Query 1 545 use `test`; drop table t1 +set session autocommit = @ac; +End of 5.0 tests reset master; create table t1 (id tinyint auto_increment primary key); set insert_id=128; diff --git a/sql/log.cc b/sql/log.cc index 6dc204265b0..de5d94a2e93 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3945,9 +3945,65 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log) if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) return ER_ERROR_ON_WRITE; - uint bytes= my_b_bytes_in_cache(cache); + uint bytes= my_b_bytes_in_cache(cache), group, carry, hdr_offs; + long val; + uchar header[LOG_EVENT_HEADER_LEN]; + + group= my_b_tell(&log_file); + hdr_offs= carry= 0; + do { + if (likely(carry > 0)) + { + DBUG_ASSERT(carry < LOG_EVENT_HEADER_LEN); + + memcpy(&header[carry], (char *)cache->read_pos, LOG_EVENT_HEADER_LEN - carry); + + val= uint4korr(&header[LOG_POS_OFFSET]) + group; + int4store(&header[LOG_POS_OFFSET], val); + + if (my_b_write(&log_file, header, carry)) + return ER_ERROR_ON_WRITE; + + memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry); + + hdr_offs = LOG_EVENT_HEADER_LEN - carry + + uint4korr(&header[EVENT_LEN_OFFSET]); + + carry= 0; + } + + if(likely(bytes > 0)) + { + do { + DBUG_ASSERT((hdr_offs + max(EVENT_LEN_OFFSET, LOG_POS_OFFSET) + 4) <= bytes); + + val= uint4korr((char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET) + group; + int4store((char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET, val); + hdr_offs += uint4korr((char *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET); + + /* header beyond current read-buffer? */ + if (hdr_offs >= bytes) + { + hdr_offs -= bytes; + break; + } + + /* split header? */ + if (hdr_offs + LOG_EVENT_HEADER_LEN > bytes) + { + carry= bytes - hdr_offs; + + memcpy(header, (char *)cache->read_pos + hdr_offs, carry); + bytes -= carry; + } + + } while (hdr_offs < bytes); + } + + /* Write data to the binary log file */ + if (my_b_write(&log_file, cache->read_pos, bytes)) return ER_ERROR_ON_WRITE; cache->read_pos= cache->read_end; @@ -4028,7 +4084,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) if ((write_error= write_cache(cache, false, false))) goto err; - + if (commit_event && commit_event->write(&log_file)) goto err; if (flush_and_sync()) From b2de7a6ee6fa37805d9066ed92ca831499902d12 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jun 2007 14:42:35 +0500 Subject: [PATCH 020/227] BUG#28026 - Falcon: crash if partitions and select for update Assertion failure may happen with falcon + partition + select for update. This may affect other engines as well. Though assertion failure is fixed with this patch, falcon still deadlocks when running falcon_bug_28026.test. sql/ha_partition.cc: In case rnd_next fails, we must call ha_rnd_end. This is done conditionally (NO_CURRENT_PART_ID != m_part_spec.start_part) in ha_partition::ha_rnd_end. Thus we may not reset m_part_spec.start_part in case rnd is not ended. --- sql/ha_partition.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 0c4f3cf708f..37e42f7a850 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3117,7 +3117,7 @@ int ha_partition::rnd_next(uchar *buf) continue; // Probably MyISAM if (result != HA_ERR_END_OF_FILE) - break; // Return error + goto end_dont_reset_start_part; // Return error /* End current partition */ late_extra_no_cache(part_id); @@ -3143,6 +3143,7 @@ int ha_partition::rnd_next(uchar *buf) end: m_part_spec.start_part= NO_CURRENT_PART_ID; +end_dont_reset_start_part: table->status= STATUS_NOT_FOUND; DBUG_RETURN(result); } From fa6ae59d1d11bf53a8dcab046e983deab1b21dac Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 25 Jun 2007 18:41:17 +0200 Subject: [PATCH 021/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB end_log_pos data within a transaction are relative to the start of the transaction rather than absolute. we fix those groups in situ before writing the log out. additional comments and handling for groups with very large single events, as suggested by Guilhem. --- sql/log.cc | 90 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 22 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 465d694ba10..a5c5f42a393 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1835,8 +1835,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) if (likely(is_open())) // Should always be true { - uint length, group, carry, hdr_offs; - long val; + uint length, group, carry, hdr_offs, val; byte header[LOG_EVENT_HEADER_LEN]; /* @@ -1873,57 +1872,104 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) length= my_b_bytes_in_cache(cache); DBUG_EXECUTE_IF("half_binlogged_transaction", length-=100;); + /* + The events in the buffer have incorrect end_log_pos data + (relative to beginning of group rather than absolute), + so we'll recalculate them in situ so the binlog is always + correct, even in the middle of a group. This is possible + because we now know the start position of the group (the + offset of this cache in the log, if you will); all we need + to do is to find all event-headers, and add the position of + the group to the end_log_pos of each event. This is pretty + straight forward, except that we read the cache in segments, + so an event-header might end up on the cache-border and get + split. + */ + group= my_b_tell(&log_file); hdr_offs= carry= 0; do { - if (likely(carry > 0)) + + /* + if we only got a partial header in the last iteration, + get the other half now and process a full header. + */ + if (unlikely(carry > 0)) { DBUG_ASSERT(carry < LOG_EVENT_HEADER_LEN); + /* assemble both halves */ memcpy(&header[carry], (char *)cache->read_pos, LOG_EVENT_HEADER_LEN - carry); + /* fix end_log_pos */ val= uint4korr(&header[LOG_POS_OFFSET]) + group; int4store(&header[LOG_POS_OFFSET], val); + /* write the first half of the split header */ if (my_b_write(&log_file, header, carry)) goto err; + /* + copy fixed second half of header to cache so the correct + version will be written later. + */ memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry); + /* next event header at ... */ hdr_offs = LOG_EVENT_HEADER_LEN - carry + uint4korr(&header[EVENT_LEN_OFFSET]); carry= 0; } + /* if there is anything to write, process it. */ + if(likely(length > 0)) { - do { - DBUG_ASSERT((hdr_offs + max(EVENT_LEN_OFFSET, LOG_POS_OFFSET) + 4) <= length); + /* + next header beyond current read-buffer? we'll get it later + (though not necessarily in the very next iteration). + */ - val= uint4korr((char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET) + group; - int4store((char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET, val); - hdr_offs += uint4korr((char *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET); + if (hdr_offs >= length) + hdr_offs -= length; + else + { - /* header beyond current read-buffer? */ - if (hdr_offs >= length) - { - hdr_offs -= length; - break; - } + /* process all event-headers in this (partial) cache. */ - /* split header? */ - if (hdr_offs + LOG_EVENT_HEADER_LEN > length) - { - carry= length - hdr_offs; + do { - memcpy(header, (char *)cache->read_pos + hdr_offs, carry); - length -= carry; - } + /* + partial header only? save what we can get, process once + we get the rest. + */ - } while (hdr_offs < length); + if (hdr_offs + LOG_EVENT_HEADER_LEN > length) + { + carry= length - hdr_offs; + memcpy(header, (char *)cache->read_pos + hdr_offs, carry); + length= hdr_offs; + } + else + { + /* we've got a full event-header, and it came in one piece */ + + char *log_pos= cache->read_pos + hdr_offs + LOG_POS_OFFSET; + + /* fix end_log_pos */ + val= uint4korr(log_pos) + group; + int4store(log_pos, val); + + /* next event header at ... */ + log_pos= (char *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET; + hdr_offs += uint4korr(log_pos); + + } + } while (hdr_offs < length); + } } /* Write data to the binary log file */ From 6437c0356a1d9730213183a7b8ed1dd24c3bf318 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jun 2007 12:26:21 +0200 Subject: [PATCH 022/227] Bug#25657 mysql-test-run.pl kill itself under ActiveState perl - Various fixes for running mysql-test-run.pl on ActiveState perl for windows. Reading it's source in win32/win32.c helps... mysql-test/lib/mtr_process.pl: Use "real_pid" when killing the process on ActiveState perl for windows Wait blocking for the pseudo pid to exit. Change "sleep_until_file_created" to return 1 when pidfile has been created - this should avoid early wakeup if $pid was 0 mysql-test/lib/mtr_timer.pl: Wake timer process with signal 15 to avoid to avoid resource leak on ActiveState perl for windows. Install signal handler in timer process to exit gracefully mysql-test/mysql-test-run.pl: Read "real_pid" of process from pid_file - to be used when killing the process on ActiveState perl Drop the --console option to mysqld Pass "real_pid" to mtr_check_stop_server so it can select to use it Correct two argument declarations --- mysql-test/lib/mtr_process.pl | 17 ++++++++++++++++- mysql-test/lib/mtr_timer.pl | 9 +++++++-- mysql-test/mysql-test-run.pl | 27 ++++++++++++++++++--------- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index e4fd3390c5f..57f9cf571bb 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -611,6 +611,11 @@ sub mtr_check_stop_servers ($) { if ( $pid ) { # Server is still alive, put it in list to be hard killed + if ($::glob_win32_perl) + { + # Kill the real process if it's known + $pid= $srv->{'real_pid'} if ($srv->{'real_pid'}); + } $kill_pids{$pid}= 1; # Write a message to the process's error log (if it has one) @@ -664,6 +669,16 @@ sub mtr_check_stop_servers ($) { } } + if ($::glob_win32_perl and $srv->{'real_pid'}) + { + # Wait for the pseudo pid - if the real_pid was known + # the pseudo pid has not been waited for yet, wai blocking + # since it's "such a simple program" + mtr_verbose("Wait for pseudo process $srv->{'pid'}"); + my $ret_pid= waitpid($srv->{'pid'}, 0); + mtr_verbose("Pseudo process $ret_pid died"); + } + $srv->{'pid'}= 0; } } @@ -1041,7 +1056,7 @@ sub sleep_until_file_created ($$$) { { if ( -r $pidfile ) { - return $pid; + return 1; } # Check if it died after the fork() was successful diff --git a/mysql-test/lib/mtr_timer.pl b/mysql-test/lib/mtr_timer.pl index 523799f7cf5..86a9f58514f 100644 --- a/mysql-test/lib/mtr_timer.pl +++ b/mysql-test/lib/mtr_timer.pl @@ -97,9 +97,14 @@ sub mtr_timer_start($$$) { # clearing the signal handler. $SIG{INT}= 'DEFAULT'; + $SIG{TERM}= sub { + mtr_verbose("timer woke up, exiting!"); + exit(0); + }; + $0= "mtr_timer(timers,$name,$duration)"; - mtr_verbose("timer child $name, sleep $duration"); sleep($duration); + mtr_verbose("timer expired after $duration seconds"); exit(0); } } @@ -118,7 +123,7 @@ sub mtr_timer_stop ($$) { # FIXME as Cygwin reuses pids fast, maybe check that is # the expected process somehow?! - kill(9, $tpid); + kill(15, $tpid); # As the timers are so simple programs, we trust them to terminate, # and use blocking wait for it. We wait just to avoid a zombie. diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 08090e5b96f..c58ed308bd8 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2579,10 +2579,19 @@ sub ndbcluster_wait_started($$){ sub mysqld_wait_started($){ my $mysqld= shift; - my $res= sleep_until_file_created($mysqld->{'path_pid'}, - $mysqld->{'start_timeout'}, - $mysqld->{'pid'}); - return $res == 0; + if (sleep_until_file_created($mysqld->{'path_pid'}, + $mysqld->{'start_timeout'}, + $mysqld->{'pid'}) == 0) + { + # Failed to wait for pid file + return 1; + } + + # Get the "real pid" of the process, it will be used for killing + # the process in ActiveState's perl on windows + $mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'}); + + return 0; } @@ -3720,7 +3729,6 @@ sub mysqld_arguments ($$$$) { mtr_add_arg($args, "%s--no-defaults", $prefix); - mtr_add_arg($args, "%s--console", $prefix); mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir); mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir); @@ -4093,6 +4101,7 @@ sub stop_all_servers () { push(@kill_pids,{ pid => $mysqld->{'pid'}, + real_pid => $mysqld->{'real_pid'}, pidfile => $mysqld->{'path_pid'}, sockfile => $mysqld->{'path_sock'}, port => $mysqld->{'port'}, @@ -4300,6 +4309,7 @@ sub run_testcase_stop_servers($$$) { push(@kill_pids,{ pid => $mysqld->{'pid'}, + real_pid => $mysqld->{'real_pid'}, pidfile => $mysqld->{'path_pid'}, sockfile => $mysqld->{'path_sock'}, port => $mysqld->{'port'}, @@ -4351,6 +4361,7 @@ sub run_testcase_stop_servers($$$) { push(@kill_pids,{ pid => $mysqld->{'pid'}, + real_pid => $mysqld->{'real_pid'}, pidfile => $mysqld->{'path_pid'}, sockfile => $mysqld->{'path_sock'}, port => $mysqld->{'port'}, @@ -4775,12 +4786,10 @@ sub run_mysqltest ($) { mtr_add_arg($args, "%s", $_) for @args_saved; } - mtr_add_arg($args, "--test-file"); - mtr_add_arg($args, $tinfo->{'path'}); + mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'}); if ( defined $tinfo->{'result_file'} ) { - mtr_add_arg($args, "--result-file"); - mtr_add_arg($args, $tinfo->{'result_file'}); + mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'}); } if ( $opt_record ) From ae398d995a925e8bc2fe096f4c6fe55618a58543 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jun 2007 13:15:43 +0200 Subject: [PATCH 023/227] Bug #29245: Bad Merge Caused Error Codes Conflict between 5.0/5.1 Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/backup.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/events_bugs.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/events_trans.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/ndb_dd_basic.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/ndb_dd_ddl.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/ndb_gis.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/ndb_row_format.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_extraCol_innodb.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_extraCol_myisam.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_incident.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_ndb_extraCol.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_row_tabledefs_2myisam.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_row_tabledefs_3innodb.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/rpl_sp.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/select.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/show_check.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/sp.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/sp_gis.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/sp_trans.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/type_timestamp.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/warnings.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/r/xml.result: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/t/grant.test: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 mysql-test/t/partition_grant.test: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 sql/mysql_priv.h: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 sql/share/errmsg.txt: Fix some error messages so that all error codes are equivalent in 5.0 and 5.1 --- mysql-test/r/backup.result | 2 +- mysql-test/r/events_bugs.result | 16 ++--- mysql-test/r/events_trans.result | 2 +- mysql-test/r/ndb_dd_basic.result | 6 +- mysql-test/r/ndb_dd_ddl.result | 2 +- mysql-test/r/ndb_gis.result | 4 +- mysql-test/r/ndb_row_format.result | 2 +- mysql-test/r/rpl_extraCol_innodb.result | 28 ++++---- mysql-test/r/rpl_extraCol_myisam.result | 28 ++++---- mysql-test/r/rpl_incident.result | 4 +- mysql-test/r/rpl_ndb_extraCol.result | 28 ++++---- mysql-test/r/rpl_row_tabledefs_2myisam.result | 16 ++--- mysql-test/r/rpl_row_tabledefs_3innodb.result | 16 ++--- mysql-test/r/rpl_sp.result | 2 +- mysql-test/r/select.result | 2 +- mysql-test/r/show_check.result | 2 +- mysql-test/r/sp.result | 8 +-- mysql-test/r/sp_gis.result | 4 +- mysql-test/r/sp_trans.result | 2 +- mysql-test/r/type_timestamp.result | 14 ++-- mysql-test/r/warnings.result | 2 +- mysql-test/r/xml.result | 18 ++--- mysql-test/t/grant.test | 2 +- mysql-test/t/partition_grant.test | 4 +- sql/mysql_priv.h | 2 +- sql/share/errmsg.txt | 68 +++++++++++-------- 26 files changed, 146 insertions(+), 138 deletions(-) diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result index 154b577e61f..4de599f3af7 100644 --- a/mysql-test/r/backup.result +++ b/mysql-test/r/backup.result @@ -36,7 +36,7 @@ restore table t1 from '../bogus'; Table Op Msg_type Msg_text t1 restore error Failed copying .frm file Warnings: -Warning 1543 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead +Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X) restore table t1 from '../tmp'; Table Op Msg_type Msg_text diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index fae530f556b..541502607c1 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -31,7 +31,7 @@ create event e_55 on schedule at 10000101000000 do drop table t; ERROR HY000: Incorrect AT value: '10000101000000' create event e_55 on schedule at 20000101000000 do drop table t; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created show events; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t; @@ -457,22 +457,22 @@ CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' DO SELECT 1; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00' DISABLE DO SELECT 1; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO SELECT 1; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE DO SELECT 1; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1585 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 @@ -482,19 +482,19 @@ The following should succeed giving a warning. ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE; Warnings: -Note 1533 Event execution time is in the past. Event has been disabled +Note 1541 Event execution time is in the past. Event has been disabled CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00' ON COMPLETION PRESERVE DO SELECT 1; Warnings: -Note 1533 Event execution time is in the past. Event has been disabled +Note 1541 Event execution time is in the past. Event has been disabled CREATE EVENT e5 ON SCHEDULE AT '1999-01-01 00:00:00' ON COMPLETION PRESERVE DO SELECT 1; Warnings: -Note 1533 Event execution time is in the past. Event has been disabled +Note 1541 Event execution time is in the past. Event has been disabled The following should succeed without warnings. ALTER EVENT e2 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'; ALTER EVENT e3 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' diff --git a/mysql-test/r/events_trans.result b/mysql-test/r/events_trans.result index a9829db0c61..1f87bcea68e 100644 --- a/mysql-test/r/events_trans.result +++ b/mysql-test/r/events_trans.result @@ -63,7 +63,7 @@ begin work; insert into t1 (a) values ("OK: create event if not exists"); create event if not exists e1 on schedule every 2 day do select 2; Warnings: -Note 1526 Event 'e1' already exists +Note 1534 Event 'e1' already exists rollback work; select * from t1; a diff --git a/mysql-test/r/ndb_dd_basic.result b/mysql-test/r/ndb_dd_basic.result index 7aeb156869b..bc1762ce407 100644 --- a/mysql-test/r/ndb_dd_basic.result +++ b/mysql-test/r/ndb_dd_basic.result @@ -5,20 +5,20 @@ INITIAL_SIZE 16M UNDO_BUFFER_SIZE = 1M ENGINE=MYISAM; Warnings: -Error 1466 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP' +Error 1475 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP' ALTER LOGFILE GROUP lg1 ADD UNDOFILE 'undofile02.dat' INITIAL_SIZE = 4M ENGINE=XYZ; Warnings: Warning 1286 Unknown table engine 'XYZ' -Error 1466 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP' +Error 1475 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP' CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' USE LOGFILE GROUP lg1 INITIAL_SIZE 12M; Warnings: -Error 1466 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP' +Error 1475 Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP' set storage_engine=ndb; CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undofile.dat' diff --git a/mysql-test/r/ndb_dd_ddl.result b/mysql-test/r/ndb_dd_ddl.result index 67857d39ab6..55f1f56fd0c 100644 --- a/mysql-test/r/ndb_dd_ddl.result +++ b/mysql-test/r/ndb_dd_ddl.result @@ -16,7 +16,7 @@ ERROR HY000: Failed to create LOGFILE GROUP SHOW WARNINGS; Level Code Message Error 1296 Got error 1514 'Currently there is a limit of one logfile group' from NDB -Error 1516 Failed to create LOGFILE GROUP +Error 1525 Failed to create LOGFILE GROUP CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undofile.dat' INITIAL_SIZE 1M diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/r/ndb_gis.result index 3af7b71d72d..54f1fc23489 100644 --- a/mysql-test/r/ndb_gis.result +++ b/mysql-test/r/ndb_gis.result @@ -463,7 +463,7 @@ drop table t1; End of 4.1 tests CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); Warnings: -Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); @@ -1013,7 +1013,7 @@ drop table t1; End of 4.1 tests CREATE TABLE t1 (name VARCHAR(100), square GEOMETRY); Warnings: -Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' +Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Binlog of table with BLOB attribute and no PK' INSERT INTO t1 VALUES("center", GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))')); INSERT INTO t1 VALUES("small", GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))')); INSERT INTO t1 VALUES("big", GeomFromText('POLYGON (( 0 0, 0 3, 3 3, 3 0, 0 0))')); diff --git a/mysql-test/r/ndb_row_format.result b/mysql-test/r/ndb_row_format.result index ae165d87c5c..37c239986f6 100644 --- a/mysql-test/r/ndb_row_format.result +++ b/mysql-test/r/ndb_row_format.result @@ -8,7 +8,7 @@ ENGINE=NDB; ERROR HY000: Can't create table 'test.t1' (errno: 138) SHOW WARNINGS; Level Code Message -Error 1466 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute' +Error 1475 Table storage engine 'ndbcluster' does not support the create option 'Row format FIXED incompatible with variable sized attribute' Error 1005 Can't create table 'test.t1' (errno: 138) CREATE TABLE t1 ( a INT KEY, diff --git a/mysql-test/r/rpl_extraCol_innodb.result b/mysql-test/r/rpl_extraCol_innodb.result index cfce12b594e..c3159987b30 100644 --- a/mysql-test/r/rpl_extraCol_innodb.result +++ b/mysql-test/r/rpl_extraCol_innodb.result @@ -72,7 +72,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 Skip_Counter 0 Exec_Master_Log_Pos # @@ -90,7 +90,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -134,7 +134,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 Skip_Counter 0 Exec_Master_Log_Pos # @@ -152,7 +152,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -196,7 +196,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 Skip_Counter 0 Exec_Master_Log_Pos # @@ -214,7 +214,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -257,7 +257,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 Skip_Counter 0 Exec_Master_Log_Pos # @@ -275,7 +275,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** @@ -369,7 +369,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 Skip_Counter 0 Exec_Master_Log_Pos # @@ -387,7 +387,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -430,7 +430,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 Skip_Counter 0 Exec_Master_Log_Pos # @@ -448,7 +448,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -755,7 +755,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 Skip_Counter 0 Exec_Master_Log_Pos # @@ -773,7 +773,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/r/rpl_extraCol_myisam.result b/mysql-test/r/rpl_extraCol_myisam.result index b250911368c..9d6c3ed5d33 100644 --- a/mysql-test/r/rpl_extraCol_myisam.result +++ b/mysql-test/r/rpl_extraCol_myisam.result @@ -72,7 +72,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 Skip_Counter 0 Exec_Master_Log_Pos # @@ -90,7 +90,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -134,7 +134,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 Skip_Counter 0 Exec_Master_Log_Pos # @@ -152,7 +152,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -196,7 +196,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 Skip_Counter 0 Exec_Master_Log_Pos # @@ -214,7 +214,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -257,7 +257,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 Skip_Counter 0 Exec_Master_Log_Pos # @@ -275,7 +275,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** @@ -369,7 +369,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 Skip_Counter 0 Exec_Master_Log_Pos # @@ -387,7 +387,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -430,7 +430,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 Skip_Counter 0 Exec_Master_Log_Pos # @@ -448,7 +448,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -755,7 +755,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 Skip_Counter 0 Exec_Master_Log_Pos # @@ -773,7 +773,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/r/rpl_incident.result b/mysql-test/r/rpl_incident.result index 9d82798b5f4..84fd9c0ee4f 100644 --- a/mysql-test/r/rpl_incident.result +++ b/mysql-test/r/rpl_incident.result @@ -44,7 +44,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1586 +Last_Errno 1587 Last_Error The incident LOST_EVENTS occured on the master. Message: Skip_Counter 0 Exec_Master_Log_Pos # @@ -62,7 +62,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1586 +Last_SQL_Errno 1587 Last_SQL_Error The incident LOST_EVENTS occured on the master. Message: SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; diff --git a/mysql-test/r/rpl_ndb_extraCol.result b/mysql-test/r/rpl_ndb_extraCol.result index 5afc9c1db77..edb4dfbf392 100644 --- a/mysql-test/r/rpl_ndb_extraCol.result +++ b/mysql-test/r/rpl_ndb_extraCol.result @@ -72,7 +72,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 Skip_Counter 0 Exec_Master_Log_Pos # @@ -90,7 +90,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -134,7 +134,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 Skip_Counter 0 Exec_Master_Log_Pos # @@ -152,7 +152,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -196,7 +196,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 Skip_Counter 0 Exec_Master_Log_Pos # @@ -214,7 +214,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -257,7 +257,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 Skip_Counter 0 Exec_Master_Log_Pos # @@ -275,7 +275,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** @@ -369,7 +369,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 Skip_Counter 0 Exec_Master_Log_Pos # @@ -387,7 +387,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -430,7 +430,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 Skip_Counter 0 Exec_Master_Log_Pos # @@ -448,7 +448,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -756,7 +756,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 Skip_Counter 0 Exec_Master_Log_Pos # @@ -774,7 +774,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/r/rpl_row_tabledefs_2myisam.result b/mysql-test/r/rpl_row_tabledefs_2myisam.result index d8ff1907e28..eb0c1cdc81d 100644 --- a/mysql-test/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/r/rpl_row_tabledefs_2myisam.result @@ -165,7 +165,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Table width mismatch - received 2 columns, test.t2 has 1 columns Skip_Counter 0 Exec_Master_Log_Pos # @@ -183,7 +183,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Table width mismatch - received 2 columns, test.t2 has 1 columns SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -208,7 +208,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 Skip_Counter 0 Exec_Master_Log_Pos # @@ -226,7 +226,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -251,7 +251,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 Skip_Counter 0 Exec_Master_Log_Pos # @@ -269,7 +269,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -294,7 +294,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 Skip_Counter 0 Exec_Master_Log_Pos # @@ -312,7 +312,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/r/rpl_row_tabledefs_3innodb.result b/mysql-test/r/rpl_row_tabledefs_3innodb.result index 17c591327c2..287ab072e3d 100644 --- a/mysql-test/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/r/rpl_row_tabledefs_3innodb.result @@ -165,7 +165,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Table width mismatch - received 2 columns, test.t2 has 1 columns Skip_Counter 0 Exec_Master_Log_Pos # @@ -183,7 +183,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Table width mismatch - received 2 columns, test.t2 has 1 columns SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -208,7 +208,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 Skip_Counter 0 Exec_Master_Log_Pos # @@ -226,7 +226,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 3, test.t4 has type 4 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -251,7 +251,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 Skip_Counter 0 Exec_Master_Log_Pos # @@ -269,7 +269,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 1 type mismatch - received type 3, test.t5 has type 4 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -294,7 +294,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1523 +Last_Errno 1532 Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 Skip_Counter 0 Exec_Master_Log_Pos # @@ -312,7 +312,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error -Last_SQL_Errno 1523 +Last_SQL_Errno 1532 Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 3, test.t6 has type 4 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 208c46c5fab..323926e2a9e 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -181,7 +181,7 @@ end| ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) set global log_bin_trust_routine_creators=1; Warnings: -Warning 1543 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead +Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead set global log_bin_trust_function_creators=0; set global log_bin_trust_function_creators=1; set global log_bin_trust_function_creators=1; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 92ceca2162f..a148d1029df 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3492,7 +3492,7 @@ SELECT 0.9888889889 * 1.011111411911; 0.9998769417899202067879 prepare stmt from 'select 1 as " a "'; Warnings: -Warning 1548 Leading spaces are removed from name ' a ' +Warning 1466 Leading spaces are removed from name ' a ' execute stmt; a 1 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 66cd929ee05..c07aadff042 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -712,7 +712,7 @@ drop database mysqltest; show full plugin; show warnings; Level Code Message -Warning 1543 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead +Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead show plugin; show plugins; create database `mysqlttest\1`; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 98d73f7536c..558daec5c30 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5665,7 +5665,7 @@ drop function if exists pi; create function pi() returns varchar(50) return "pie, my favorite desert."; Warnings: -Note 1581 This function 'pi' has the same name as a native function +Note 1582 This function 'pi' has the same name as a native function SET @save_sql_mode=@@sql_mode; SET SQL_MODE='IGNORE_SPACE'; select pi(), pi (); @@ -5714,15 +5714,15 @@ use test; create function `database`() returns varchar(50) return "Stored function database"; Warnings: -Note 1581 This function 'database' has the same name as a native function +Note 1582 This function 'database' has the same name as a native function create function `current_user`() returns varchar(50) return "Stored function current_user"; Warnings: -Note 1581 This function 'current_user' has the same name as a native function +Note 1582 This function 'current_user' has the same name as a native function create function md5(x varchar(50)) returns varchar(50) return "Stored function md5"; Warnings: -Note 1581 This function 'md5' has the same name as a native function +Note 1582 This function 'md5' has the same name as a native function SET SQL_MODE='IGNORE_SPACE'; select database(), database (); database() database () diff --git a/mysql-test/r/sp_gis.result b/mysql-test/r/sp_gis.result index fddf2a6bc18..b4fe0872d64 100644 --- a/mysql-test/r/sp_gis.result +++ b/mysql-test/r/sp_gis.result @@ -7,11 +7,11 @@ return 1; create function x() returns int return 2; Warnings: -Note 1581 This function 'x' has the same name as a native function +Note 1582 This function 'x' has the same name as a native function create function y() returns int return 3; Warnings: -Note 1581 This function 'y' has the same name as a native function +Note 1582 This function 'y' has the same name as a native function select a(); a() 1 diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index a0d687e565b..abd454ac907 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -535,7 +535,7 @@ use db_bug7787| CREATE PROCEDURE p1() SHOW INNODB STATUS; | Warnings: -Warning 1543 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead +Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost| DROP DATABASE db_bug7787| drop user user_bug7787@localhost| diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index c075a199dae..7caf7e78fe9 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -101,13 +101,13 @@ create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6), t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), t14 timestamp(14)); Warnings: -Warning 1543 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1543 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1543 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1543 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1543 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1543 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead -Warning 1543 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead +Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead insert t1 values (0,0,0,0,0,0,0), ("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index 01b1c77887f..2929328a9b1 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -168,7 +168,7 @@ max_error_count 10 drop table t1; set table_type=MYISAM; Warnings: -Warning 1543 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead +Warning 1287 The syntax 'table_type' is deprecated and will be removed in MySQL 5.2. Please use 'storage_engine' instead create table t1 (a int); insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); update t1 set a='abc'; diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index f71b8cadabb..95ad19a886f 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -647,32 +647,32 @@ select extractValue('a','/a'); extractValue('a','/a') NULL Warnings: -Warning 1513 Incorrect XML value: 'parse error at line 1 pos 5: unexpected END-OF-INPUT' +Warning 1522 Incorrect XML value: 'parse error at line 1 pos 5: unexpected END-OF-INPUT' select extractValue('a<','/a'); extractValue('a<','/a') NULL Warnings: -Warning 1513 Incorrect XML value: 'parse error at line 1 pos 6: END-OF-INPUT unexpected (ident or '/' wanted)' +Warning 1522 Incorrect XML value: 'parse error at line 1 pos 6: END-OF-INPUT unexpected (ident or '/' wanted)' select extractValue('aaaa' wanted)' +Warning 1522 Incorrect XML value: 'parse error at line 1 pos 8: END-OF-INPUT unexpected ('>' wanted)' select extractValue('a','/a'); extractValue('a','/a') NULL Warnings: -Warning 1513 Incorrect XML value: 'parse error at line 1 pos 12: '' unexpected (END-OF-INPUT wanted)' +Warning 1522 Incorrect XML value: 'parse error at line 1 pos 12: '' unexpected (END-OF-INPUT wanted)' select extractValue('a','/a'); extractValue('a','/a') NULL Warnings: -Warning 1513 Incorrect XML value: 'parse error at line 1 pos 7: '>' unexpected (ident or string wanted)' +Warning 1522 Incorrect XML value: 'parse error at line 1 pos 7: '>' unexpected (ident or string wanted)' select extractValue('1','position()'); ERROR HY000: XPATH syntax error: '' select extractValue('1','last()'); @@ -723,17 +723,17 @@ select extractValue('<01>10:39:15<02>140','//* extractValue('<01>10:39:15<02>140','//*') NULL Warnings: -Warning 1513 Incorrect XML value: 'parse error at line 1 pos 13: unknown token unexpected (ident or '/' wanted)' +Warning 1522 Incorrect XML value: 'parse error at line 1 pos 13: unknown token unexpected (ident or '/' wanted)' select extractValue('<.>test','//*'); extractValue('<.>test','//*') NULL Warnings: -Warning 1513 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)' +Warning 1522 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)' select extractValue('<->test','//*'); extractValue('<->test','//*') NULL Warnings: -Warning 1513 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)' +Warning 1522 Incorrect XML value: 'parse error at line 1 pos 2: unknown token unexpected (ident or '/' wanted)' select extractValue('<:>test','//*'); extractValue('<:>test','//*') test diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 17c5f1bbe8f..e33712e1ebf 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1271,6 +1271,6 @@ grant select on test.* to юзер_юзер@localhost; --exec $MYSQL --default-character-set=utf8 --user=юзер_юзер -e "select user()" revoke all on test.* from юзер_юзер@localhost; drop user юзер_юзер@localhost; ---error 1573 +--error ER_WRONG_STRING_LENGTH grant select on test.* to очень_длинный_юзер@localhost; set names default; diff --git a/mysql-test/t/partition_grant.test b/mysql-test/t/partition_grant.test index 0d30ad01c7a..cf944e507fd 100644 --- a/mysql-test/t/partition_grant.test +++ b/mysql-test/t/partition_grant.test @@ -63,13 +63,13 @@ insert into t1 values (1); grant alter on mysqltest_1.* to mysqltest_1@localhost; connect (conn4,localhost,mysqltest_1,,mysqltest_1); connection conn4; ---error 1514 +--error ER_NO_PARTITION_FOR_GIVEN_VALUE alter table t1 partition by list (s1) (partition p1 values in (2)); connection default; grant select, alter on mysqltest_1.* to mysqltest_1@localhost; disconnect conn4; connect (conn5,localhost,mysqltest_1,,mysqltest_1); ---error 1514 +--error ER_NO_PARTITION_FOR_GIVEN_VALUE alter table t1 partition by list (s1) (partition p1 values in (2)); disconnect conn5; connection default; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 5a50b03282f..e6455a82c33 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -98,7 +98,7 @@ char* query_table_status(THD *thd,const char *db,const char *table_name); DBUG_ASSERT(strncmp(Ver, MYSQL_SERVER_VERSION, sizeof(Ver)-1) > 0); \ if (((uchar*)Thd) != NULL) \ push_warning_printf(((THD *)Thd), MYSQL_ERROR::WARN_LEVEL_WARN, \ - ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX), \ + ER_WARN_DEPRECATED_SYNTAX, ER(ER_WARN_DEPRECATED_SYNTAX_WITH_VER), \ (Old), (Ver), (New)); \ else \ sql_print_warning("The syntax '%s' is deprecated and will be removed " \ diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 1dde977800b..37176a04c32 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -1478,6 +1478,8 @@ ER_DUP_KEYNAME 42000 S1009 spa "Nombre de clave duplicado '%-.192s'" swe "Nyckelnamn '%-.192s' finns flera gånger" ukr "äÕÂÌÀÀÞÅ ¦Í'Ñ ËÌÀÞÁ '%-.192s'" +# When using this error code, please use ER(ER_DUP_ENTRY_WITH_KEY_NAME) +# for the message string. See, for example, code in handler.cc. ER_DUP_ENTRY 23000 S1009 cze "Zdvojen-Bý klíè '%-.192s' (èíslo klíèe %d)" dan "Ens værdier '%-.192s' for indeks %d" @@ -5022,7 +5024,9 @@ ER_UNKNOWN_STORAGE_ENGINE 42000 ger "Unbekannte Speicher-Engine '%s'" por "Motor de tabela desconhecido '%s'" spa "Desconocido motor de tabla '%s'" -ER_UNUSED_1 +# When using this error code, use ER(ER_WARN_DEPRECATED_SYNTAX_WITH_VER) +# for the message string. See, for example, code in mysql_priv.h. +ER_WARN_DEPRECATED_SYNTAX eng "'%s' is deprecated; use '%s' instead" ger "'%s' ist veraltet. Bitte benutzen Sie '%s'" por "'%s' é desatualizado. Use '%s' em seu lugar" @@ -5606,8 +5610,6 @@ ER_SP_RECURSION_LIMIT ER_SP_PROC_TABLE_CORRUPT eng "Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)" ger "Routine %-.192s konnte nicht geladen werden. Die Tabelle mysql.proc fehlt, ist beschädigt, oder enthält fehlerhaften Daten (interner Code: %d)" -ER_FOREIGN_SERVER_EXISTS - eng "The foreign server, %s, you are trying to create already exists." ER_SP_WRONG_NAME 42000 eng "Incorrect routine name '%-.192s'" ger "Ungültiger Routinenname '%-.192s'" @@ -5629,6 +5631,34 @@ ER_NON_GROUPING_FIELD_USED 42000 ER_TABLE_CANT_HANDLE_SPKEYS eng "The used table type doesn't support SPATIAL indexes" ger "Der verwendete Tabellentyp unterstützt keine SPATIAL-Indizes" +ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA + eng "Triggers can not be created on system tables" + ger "Trigger können nicht auf Systemtabellen erzeugt werden" +ER_REMOVED_SPACES + eng "Leading spaces are removed from name '%s'" + ger "Führende Leerzeichen werden aus dem Namen '%s' entfernt" +ER_AUTOINC_READ_FAILED + eng "Failed to read auto-increment value from storage engine" + ger "Lesen des Autoincrement-Werts von der Speicher-Engine fehlgeschlagen" +ER_USERNAME + eng "user name" + ger "Benutzername" +ER_HOSTNAME + eng "host name" + ger "Hostname" +ER_WRONG_STRING_LENGTH + eng "String '%-.70s' is too long for %s (should be no longer than %d)" + ger "String '%-.70s' ist zu lang für %s (sollte nicht länger sein als %d)" +ER_NON_INSERTABLE_TABLE + eng "The target table %-.100s of the %s is not insertable-into" + ger "Die Zieltabelle %-.100s von %s ist nicht einfügbar" +ER_ADMIN_WRONG_MRG_TABLE + eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist" +ER_FOREIGN_SERVER_EXISTS + eng "The foreign server, %s, you are trying to create already exists." +ER_FOREIGN_SERVER_DOESNT_EXIST + eng "The foreign server name you are trying to reference does not exist. Data source error: %-.64s" + ger "Die externe Verbindung, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: %-.64s" ER_ILLEGAL_HA_CREATE_OPTION eng "Table storage engine '%-.64s' does not support the create option '%.64s'" ger "Speicher-Engine '%-.64s' der Tabelle unterstützt die Option '%.64s' nicht" @@ -5848,9 +5878,6 @@ ER_BINLOG_ROW_WRONG_TABLE_DEF ER_BINLOG_ROW_RBR_TO_SBR eng "Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events" ger "Slave, die mit --log-slave-updates laufen, müssen zeilenbasiertes Loggen verwenden, um zeilenbasierte Binärlog-Ereignisse loggen zu können" -ER_FOREIGN_SERVER_DOESNT_EXIST - eng "The foreign server name you are trying to reference does not exist. Data source error: %-.64s" - ger "Die externe Verbindung, auf die Sie zugreifen wollen, existiert nicht. Datenquellenfehlermeldung: %-.64s" ER_EVENT_ALREADY_EXISTS eng "Event '%-.192s' already exists" ger "Event '%-.192s' existiert bereits" @@ -5901,7 +5928,9 @@ ER_EVENT_DATA_TOO_LONG ER_DROP_INDEX_FK eng "Cannot drop index '%-.192s': needed in a foreign key constraint" ger "Kann Index '%-.192s' nicht löschen: wird für einen Fremdschlüssel benötigt" -ER_WARN_DEPRECATED_SYNTAX +# When using this error message, use the ER_WARN_DEPRECATED_SYNTAX error +# code. See, for example, code in mysql_priv.h. +ER_WARN_DEPRECATED_SYNTAX_WITH_VER eng "The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead" ger "Die Syntax '%s' ist veraltet und wird in MySQL %s entfernt. Bitte benutzen Sie statt dessen %s" ER_CANT_WRITE_LOCK_LOG_TABLE @@ -5916,9 +5945,6 @@ ER_FOREIGN_DUPLICATE_KEY 23000 S1009 ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE eng "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysql_upgrade to fix this error." ger "Spaltenanzahl von mysql.%s falsch. %d erwartet, aber %d erhalten. Erzeugt mit MySQL %d, jetzt unter %d. Bitte benutzen Sie mysql_upgrade, um den Fehler zu beheben" -ER_REMOVED_SPACES - eng "Leading spaces are removed from name '%s'" - ger "Führende Leerzeichen werden aus dem Namen '%s' entfernt" ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR eng "Cannot switch out of the row-based binary log format when the session has open temporary tables" ger "Kann nicht aus dem zeilenbasierten Binärlog-Format herauswechseln, wenn die Sitzung offene temporäre Tabellen hat" @@ -5975,9 +6001,6 @@ ER_BASE64_DECODE_ERROR eng "Decoding of base64 string failed" swe "Avkodning av base64 sträng misslyckades" ger "Der Server hat keine zeilenbasierte Replikation" -ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA - eng "Triggers can not be created on system tables" - ger "Trigger können nicht auf Systemtabellen erzeugt werden" ER_EVENT_RECURSION_FORBIDDEN eng "Recursion of EVENT DDL statements is forbidden when body is present" ger "Rekursivität von EVENT-DDL-Anweisungen ist unzulässig wenn ein Hauptteil (Body) existiert" @@ -5987,27 +6010,12 @@ ER_EVENTS_DB_ERROR ER_ONLY_INTEGERS_ALLOWED eng "Only integers allowed as number here" ger "An dieser Stelle sind nur Ganzzahlen zulässig" -ER_AUTOINC_READ_FAILED - eng "Failed to read auto-increment value from storage engine" - ger "Lesen des Autoincrement-Werts von der Speicher-Engine fehlgeschlagen" -ER_USERNAME - eng "user name" - ger "Benutzername" -ER_HOSTNAME - eng "host name" - ger "Hostname" -ER_WRONG_STRING_LENGTH - eng "String '%-.70s' is too long for %s (should be no longer than %d)" - ger "String '%-.70s' ist zu lang für %s (sollte nicht länger sein als %d)" ER_UNSUPORTED_LOG_ENGINE eng "This storage engine cannot be used for log tables"" ger "Diese Speicher-Engine kann für Logtabellen nicht verwendet werden" ER_BAD_LOG_STATEMENT eng "You cannot '%s' a log table if logging is enabled" ger "Sie können eine Logtabelle nicht '%s', wenn Loggen angeschaltet ist" -ER_NON_INSERTABLE_TABLE - eng "The target table %-.100s of the %s is not insertable-into" - ger "Die Zieltabelle %-.100s von %s ist nicht einfügbar" ER_CANT_RENAME_LOG_TABLE eng "Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'" ger "Kann '%s' nicht umbenennen. Wenn Loggen angeschaltet ist, müssen beim Umbenennen zu/von einer Logtabelle zwei Tabellen angegeben werden: die Logtabelle zu einer Archivtabelle und eine weitere Tabelle zurück zu '%s'" @@ -6023,6 +6031,8 @@ ER_WRONG_PARAMETERS_TO_STORED_FCT 42000 ER_NATIVE_FCT_NAME_COLLISION eng "This function '%-.192s' has the same name as a native function" ger "Die Funktion '%-.192s' hat denselben Namen wie eine native Funktion" +# When using this error message, use the ER_DUP_ENTRY error code. See, for +# example, code in handler.cc. ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009 cze "Zvojen-Bý klíè '%-.64s' (èíslo klíèe '%-.192s')" dan "Ens værdier '%-.64s' for indeks '%-.192s'" @@ -6059,8 +6069,6 @@ ER_SLAVE_INCIDENT eng "The incident %s occured on the master. Message: %-.64s" ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT eng "Table has no partition for some existing values" -ER_ADMIN_WRONG_MRG_TABLE - eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist" ER_BINLOG_UNSAFE_STATEMENT eng "Statement is not safe to log in statement format." swe "Detta är inte säkert att logga i statement-format." From 865ac1a2b3c8cc3353f8a21914fa71a877e85936 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jun 2007 14:18:53 +0200 Subject: [PATCH 024/227] Bug #29133 mysqld does not exit during shutdown - Fix faulty merge by adding back the 'pthread_kill' call that wakes up the select thread sql/mysqld.cc: Wake up the select thread from 'close_connections', caused by faulty merge --- sql/mysqld.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 12cab1c6de6..cdb6ee616db 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -762,6 +762,7 @@ static void close_connections(void) DBUG_PRINT("info",("Waiting for select thread")); #ifndef DONT_USE_THR_ALARM + if (pthread_kill(select_thread, thr_client_alarm)) break; // allready dead #endif set_timespec(abstime, 2); From f39d636a9224a1ffe06eb694996bf7d7adaeb3a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jun 2007 11:26:01 -0400 Subject: [PATCH 025/227] Bug#24732 Executables do not include Vista manifests - Corrected manifest attributes. CMakeLists.txt: Bug#24732 Executables do not include Vista manifests - Use correct value for 64 built binaries. win/create_manifest.js: Bug#24732 Executables do not include Vista manifests - Remove type attribute as the only valid value is win32. win/mysql_manifest.cmake: Bug#24732 Executables do not include Vista manifests - Remove type attribute. --- CMakeLists.txt | 2 +- win/create_manifest.js | 10 +++------- win/mysql_manifest.cmake | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 54df0befad9..d2a828c1843 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,7 +161,7 @@ IF(EMBED_MANIFESTS) ENDIF(NOT tmp_manifest) # Set the processor architecture. IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") - SET(PROCESSOR_ARCH "X64") + SET(PROCESSOR_ARCH "amd64") ELSE(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") SET(PROCESSOR_ARCH "X86") ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") diff --git a/win/create_manifest.js b/win/create_manifest.js index 520ecec21b8..8569bd508ff 100755 --- a/win/create_manifest.js +++ b/win/create_manifest.js @@ -1,11 +1,10 @@ /* manifest.js - Writes a custom XML manifest for each executable/library - 6 command line options must be supplied: + 5 command line options must be supplied: name - Name of the executable/library into which the mainfest will be embedded. version - Version of the executable arch - Architecture intended. - type - Application type. exe_level - Application execution level. [asInvoker|highestAvailable|requireAdministrator] outfile - Final destination where mainfest will be written. @@ -37,9 +36,6 @@ try case "arch": var app_arch= parts[1]; break; - case "type": - var app_type= parts[1]; - break; case "exe_level": var app_exe_level= parts[1]; break; @@ -50,7 +46,7 @@ try WScript.echo("Invalid argument supplied."); } } - if (i != 6) + if (i != 5) throw new Error(1, "Incorrect number of arguments."); var manifest_xml= "\r\n"; @@ -61,7 +57,7 @@ try manifest_xml+= " version=\'" + app_version + "\'"; manifest_xml+= " processorArchitecture=\'" + app_arch + "\'"; // TOADD - Add publicKeyToken attribute once we have Authenticode key. - manifest_xml+= " type=\'" + app_type + "\' />\r\n"; + manifest_xml+= " type=\'win32\' />\r\n"; // Identify the application security requirements. manifest_xml+= "\t\r\n"; manifest_xml+= "\t\t\r\n\t\t\t\r\n\t\t\t\t"; diff --git a/win/mysql_manifest.cmake b/win/mysql_manifest.cmake index b5bb6fda8fb..4c88be1d800 100755 --- a/win/mysql_manifest.cmake +++ b/win/mysql_manifest.cmake @@ -9,7 +9,7 @@ MACRO(MYSQL_EMBED_MANIFEST _target_name _required_privs) TARGET ${_target_name} PRE_LINK COMMAND cscript.exe - ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName) version=${VERSION} arch=${PROCESSOR_ARCH} type=$(PlatformName) exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest + ARGS "${PROJECT_SOURCE_DIR}/win/create_manifest.js" name=$(ProjectName) version=${VERSION} arch=${PROCESSOR_ARCH} exe_level=${_required_privs} outfile=$(IntDir)\\$(TargetFileName).intermediate.manifest COMMENT "Generates the contents of the manifest contents.") ADD_CUSTOM_COMMAND( TARGET ${_target_name} From fe0e8ef0e85d1ffe24fc084694915488735e5885 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jun 2007 14:24:01 -0400 Subject: [PATCH 026/227] Bug#24732 Executables do not include Vista manifests - Post Merge Fixup --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 538c5cb122e..1bdb1e01612 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,7 +174,7 @@ IF(EMBED_MANIFESTS) ENDIF(NOT tmp_manifest) # Set the processor architecture. IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") - SET(PROCESSOR_ARCH "X64") + SET(PROCESSOR_ARCH "amd64") ELSE(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") SET(PROCESSOR_ARCH "X86") ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") From 5d1d9f11d72f0f0f2f29b21e0f9af8caf9326818 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jun 2007 20:33:53 -0400 Subject: [PATCH 027/227] Bug #29307 status.test fails with different Table_locks_immediate Added more sleep time befoe reap to allow query to be executed. mysql-test/t/status.test: Added more sleep time befoe reap to allow query to be executed. --- mysql-test/t/status.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 3f7671b18d4..6fcb82e160d 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -25,7 +25,7 @@ connection con1; --send update t1 set n = 3; connection con2; -sleep 0.5; +sleep 1; unlock tables; connection con1; reap; From 094c3d17d9125529c6b19d524da3567406a26db0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Jun 2007 21:10:51 -0400 Subject: [PATCH 028/227] Bug #29307 status.test fails with different Table_locks_immediate Instead of sleeping for a fixed period of time, we wait until the other query is executing. --- mysql-test/t/status.test | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test index 746d3a352a4..1208393aa09 100644 --- a/mysql-test/t/status.test +++ b/mysql-test/t/status.test @@ -22,11 +22,14 @@ connection con2; lock tables t1 read; unlock tables; lock tables t1 read; +let $ID= `select connection_id()`; connection con1; --send update t1 set n = 3; connection con2; -sleep 0.5; +# wait for the other query to start executing +let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST where ID = $ID and STATE = 0; +--source include/wait_condition.inc unlock tables; connection con1; reap; From 3a42a50fd8333478a7bfce8aab5425a614701882 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 08:18:24 +0200 Subject: [PATCH 029/227] Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint into mysql.com:/home/ram/work/b29079/b29079.5.0 --- Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB fix binlog-writing so that end_log_pos is given correctly even within transactions for both SHOW BINLOG and SHOW MASTER STATUS, that is as absolute values (from log start) rather than relative values (from transaction's start). --- Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint into sin.intern.azundris.com:/home/tnurnberg/22540/50-22540 --- Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB end_log_pos data within a transaction are relative to the start of the transaction rather than absolute. we fix those groups in situ before writing the log out. additional comments and handling for groups with very large single events, as suggested by Guilhem. --- Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint into amd64.(none):/src/bug24732/my50-bug24732 --- Merge maint1.mysql.com:/data/localhome/tsmith/bk/50 into maint1.mysql.com:/data/localhome/tsmith/bk/maint/50 --- Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB end_log_pos data within a transaction are relative to the start of the transaction rather than absolute. we fix those groups in situ before writing the log out. additional comments and handling for groups with very large single events, as suggested by Guilhem. --- Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint into sin.intern.azundris.com:/home/tnurnberg/22540/50-22540 --- Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-maint into sin.intern.azundris.com:/home/tnurnberg/22540/51-22540 --- Merge sin.intern.azundris.com:/home/tnurnberg/22540/50-22540 into sin.intern.azundris.com:/home/tnurnberg/22540/51-22540 mysql-test/r/rpl_truncate_7ndb.result: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB fix output for SHOW BINLOG EVENTS so that end_log_pos is given correctly even within transactions. do this by rewriting the commit-buffer in place. --- Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB end_log_pos data within a transaction are relative to the start of the transaction rather than absolute. we fix those groups in situ before writing the log out. additional comments and handling for groups with very large single events, as suggested by Guilhem. --- Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB end_log_pos data within a transaction are relative to the start of the transaction rather than absolute. we fix those groups in situ before writing the log out. additional comments and handling for groups with very large single events, as suggested by Guilhem. --- manual merge sql/log.cc: Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that output for SHOW BINLOG EVENTS is no correct even within transactions. --- mysql-test/r/rpl_truncate_7ndb.result | 40 ++++++------ sql/log.cc | 92 ++++++++++++++++++++------- 2 files changed, 89 insertions(+), 43 deletions(-) diff --git a/mysql-test/r/rpl_truncate_7ndb.result b/mysql-test/r/rpl_truncate_7ndb.result index 62ace911e45..602c4d55ac5 100644 --- a/mysql-test/r/rpl_truncate_7ndb.result +++ b/mysql-test/r/rpl_truncate_7ndb.result @@ -32,11 +32,11 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 223 Query 1 287 BEGIN -master-bin.000001 287 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status) -master-bin.000001 385 Write_rows 1 157 table_id: # -master-bin.000001 444 Write_rows 1 195 table_id: # -master-bin.000001 482 Write_rows 1 233 table_id: # flags: STMT_END_F +master-bin.000001 287 Table_map 1 327 table_id: # (test.t1) +master-bin.000001 327 Table_map 1 385 table_id: # (mysql.ndb_apply_status) +master-bin.000001 385 Write_rows 1 444 table_id: # +master-bin.000001 444 Write_rows 1 482 table_id: # +master-bin.000001 482 Write_rows 1 520 table_id: # flags: STMT_END_F master-bin.000001 520 Query 1 585 COMMIT master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1 master-bin.000001 665 Query 1 741 use `test`; DROP TABLE t1 @@ -69,27 +69,27 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 4 Format_desc 1 106 Server ver: SERVER_VERSION, Binlog ver: 4 master-bin.000001 106 Query 1 223 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 223 Query 1 287 BEGIN -master-bin.000001 287 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 327 Table_map 1 98 table_id: # (mysql.ndb_apply_status) -master-bin.000001 385 Write_rows 1 157 table_id: # -master-bin.000001 444 Write_rows 1 195 table_id: # -master-bin.000001 482 Write_rows 1 233 table_id: # flags: STMT_END_F +master-bin.000001 287 Table_map 1 327 table_id: # (test.t1) +master-bin.000001 327 Table_map 1 385 table_id: # (mysql.ndb_apply_status) +master-bin.000001 385 Write_rows 1 444 table_id: # +master-bin.000001 444 Write_rows 1 482 table_id: # +master-bin.000001 482 Write_rows 1 520 table_id: # flags: STMT_END_F master-bin.000001 520 Query 1 585 COMMIT master-bin.000001 585 Query 1 665 use `test`; TRUNCATE TABLE t1 master-bin.000001 665 Query 1 741 use `test`; DROP TABLE t1 master-bin.000001 741 Query 1 858 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB master-bin.000001 858 Query 1 922 BEGIN -master-bin.000001 922 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 962 Table_map 1 98 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1020 Write_rows 1 157 table_id: # -master-bin.000001 1079 Write_rows 1 195 table_id: # -master-bin.000001 1117 Write_rows 1 233 table_id: # flags: STMT_END_F +master-bin.000001 922 Table_map 1 962 table_id: # (test.t1) +master-bin.000001 962 Table_map 1 1020 table_id: # (mysql.ndb_apply_status) +master-bin.000001 1020 Write_rows 1 1079 table_id: # +master-bin.000001 1079 Write_rows 1 1117 table_id: # +master-bin.000001 1117 Write_rows 1 1155 table_id: # flags: STMT_END_F master-bin.000001 1155 Query 1 1220 COMMIT master-bin.000001 1220 Query 1 1284 BEGIN -master-bin.000001 1284 Table_map 1 40 table_id: # (test.t1) -master-bin.000001 1324 Table_map 1 98 table_id: # (mysql.ndb_apply_status) -master-bin.000001 1382 Write_rows 1 157 table_id: # -master-bin.000001 1441 Delete_rows 1 191 table_id: # -master-bin.000001 1475 Delete_rows 1 225 table_id: # flags: STMT_END_F +master-bin.000001 1284 Table_map 1 1324 table_id: # (test.t1) +master-bin.000001 1324 Table_map 1 1382 table_id: # (mysql.ndb_apply_status) +master-bin.000001 1382 Write_rows 1 1441 table_id: # +master-bin.000001 1441 Delete_rows 1 1475 table_id: # +master-bin.000001 1475 Delete_rows 1 1509 table_id: # flags: STMT_END_F master-bin.000001 1509 Query 1 1574 COMMIT master-bin.000001 1574 Query 1 1650 use `test`; DROP TABLE t1 diff --git a/sql/log.cc b/sql/log.cc index de5d94a2e93..831066ab401 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3949,65 +3949,111 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log) long val; uchar header[LOG_EVENT_HEADER_LEN]; + /* + The events in the buffer have incorrect end_log_pos data + (relative to beginning of group rather than absolute), + so we'll recalculate them in situ so the binlog is always + correct, even in the middle of a group. This is possible + because we now know the start position of the group (the + offset of this cache in the log, if you will); all we need + to do is to find all event-headers, and add the position of + the group to the end_log_pos of each event. This is pretty + straight forward, except that we read the cache in segments, + so an event-header might end up on the cache-border and get + split. + */ + group= my_b_tell(&log_file); hdr_offs= carry= 0; do { - if (likely(carry > 0)) + + /* + if we only got a partial header in the last iteration, + get the other half now and process a full header. + */ + if (unlikely(carry > 0)) { DBUG_ASSERT(carry < LOG_EVENT_HEADER_LEN); + /* assemble both halves */ memcpy(&header[carry], (char *)cache->read_pos, LOG_EVENT_HEADER_LEN - carry); + /* fix end_log_pos */ val= uint4korr(&header[LOG_POS_OFFSET]) + group; int4store(&header[LOG_POS_OFFSET], val); + /* write the first half of the split header */ if (my_b_write(&log_file, header, carry)) return ER_ERROR_ON_WRITE; + /* + copy fixed second half of header to cache so the correct + version will be written later. + */ memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry); + /* next event header at ... */ hdr_offs = LOG_EVENT_HEADER_LEN - carry + uint4korr(&header[EVENT_LEN_OFFSET]); carry= 0; } + /* if there is anything to write, process it. */ + if(likely(bytes > 0)) { - do { - DBUG_ASSERT((hdr_offs + max(EVENT_LEN_OFFSET, LOG_POS_OFFSET) + 4) <= bytes); + /* + next header beyond current read-buffer? we'll get it later + (though not necessarily in the very next iteration). + */ - val= uint4korr((char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET) + group; - int4store((char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET, val); - hdr_offs += uint4korr((char *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET); + if (hdr_offs >= bytes) + hdr_offs -= bytes; + else + { - /* header beyond current read-buffer? */ - if (hdr_offs >= bytes) - { - hdr_offs -= bytes; - break; - } + /* process all event-headers in this (partial) cache. */ - /* split header? */ - if (hdr_offs + LOG_EVENT_HEADER_LEN > bytes) - { - carry= bytes - hdr_offs; + do { - memcpy(header, (char *)cache->read_pos + hdr_offs, carry); - bytes -= carry; - } + /* + partial header only? save what we can get, process once + we get the rest. + */ - } while (hdr_offs < bytes); + if (hdr_offs + LOG_EVENT_HEADER_LEN > bytes) + { + carry= bytes - hdr_offs; + memcpy(header, (char *)cache->read_pos + hdr_offs, carry); + bytes= hdr_offs; + } + else + { + /* we've got a full event-header, and it came in one piece */ + + uchar *log_pos= cache->read_pos + hdr_offs + LOG_POS_OFFSET; + + /* fix end_log_pos */ + val= uint4korr(log_pos) + group; + int4store(log_pos, val); + + /* next event header at ... */ + log_pos= (uchar *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET; + hdr_offs += uint4korr(log_pos); + + } + } while (hdr_offs < bytes); + } } /* Write data to the binary log file */ - if (my_b_write(&log_file, cache->read_pos, bytes)) return ER_ERROR_ON_WRITE; - cache->read_pos= cache->read_end; - } while ((bytes= my_b_fill(cache))); + cache->read_pos=cache->read_end; // Mark buffer used up + } while ((bytes=my_b_fill(cache))); if (sync_log) flush_and_sync(); From 4fa62524a4661159eb8e154adc8922e37fe78dff Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 09:30:29 +0200 Subject: [PATCH 030/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB windows fixies --- sql/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index a5c5f42a393..f682b9b206e 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1886,7 +1886,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) split. */ - group= my_b_tell(&log_file); + group= (uint)my_b_tell(&log_file); hdr_offs= carry= 0; do From 56b463a95ca0e583612b5e1706e9b3ea1287b15c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 09:31:47 +0200 Subject: [PATCH 031/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB windows fixies --- sql/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 831066ab401..6e635ba581c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3963,7 +3963,7 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log) split. */ - group= my_b_tell(&log_file); + group= (uint)my_b_tell(&log_file); hdr_offs= carry= 0; do From a38b1ae7c9e7b237acb4daf63edc4d2406478e57 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 13:19:34 +0500 Subject: [PATCH 032/227] BUG#29207 - archive table reported as corrupt by check table (P1) CHECK TABLE against ARCHIVE table may falsely report table corruption, or cause server crash. Fixed by using proper buffer for CHECK TABLE. Affects both 5.0 and 5.1. mysql-test/r/archive.result: A test case for BUG#28916. mysql-test/t/archive.test: A test case for BUG#28916. sql/ha_archive.cc: We call Field::get_length() from get_row(). Field::get_length() assumes that the row was read into table->record[0] buffer, which is not the case when we check a table. As a result we get wrongly initialized blob length. Use table->record[0] as record buffer for check table instead. --- mysql-test/r/archive.result | 7 +++++++ mysql-test/t/archive.test | 9 +++++++++ sql/ha_archive.cc | 19 +++---------------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index d89cecedcdd..b6a313ddf1a 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12364,3 +12364,10 @@ select * from t1; i 1 drop table t1; +create table t1(a longblob) engine=archive; +insert into t1 set a=''; +insert into t1 set a='a'; +check table t1 extended; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index 0ffbfab3d4f..61033fca3f7 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1374,3 +1374,12 @@ insert into t1 values (1); repair table t1 use_frm; select * from t1; drop table t1; + +# +# BUG#29207 - archive table reported as corrupt by check table +# +create table t1(a longblob) engine=archive; +insert into t1 set a=''; +insert into t1 set a='a'; +check table t1 extended; +drop table t1; diff --git a/sql/ha_archive.cc b/sql/ha_archive.cc index 6e18f2e1e01..0c558bf2515 100644 --- a/sql/ha_archive.cc +++ b/sql/ha_archive.cc @@ -1205,7 +1205,6 @@ bool ha_archive::is_crashed() const int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt) { int rc= 0; - byte *buf; const char *old_proc_info=thd->proc_info; ha_rows count= share->rows_recorded; DBUG_ENTER("ha_archive::check"); @@ -1214,25 +1213,13 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt) /* Flush any waiting data */ gzflush(share->archive_write, Z_SYNC_FLUSH); - /* - First we create a buffer that we can use for reading rows, and can pass - to get_row(). - */ - if (!(buf= (byte*) my_malloc(table->s->reclength, MYF(MY_WME)))) - rc= HA_ERR_OUT_OF_MEM; - /* Now we will rewind the archive file so that we are positioned at the start of the file. */ - if (!rc) - read_data_header(archive); - - if (!rc) - while (!(rc= get_row(archive, buf))) - count--; - - my_free((char*)buf, MYF(0)); + read_data_header(archive); + while (!(rc= get_row(archive, table->record[0]))) + count--; thd->proc_info= old_proc_info; From 5d7082e1b227c801f1398d2920db527f54dfe7f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 13:19:28 +0200 Subject: [PATCH 033/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB Windows fixies --- sql/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index f682b9b206e..af8168c6a46 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1957,7 +1957,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) { /* we've got a full event-header, and it came in one piece */ - char *log_pos= cache->read_pos + hdr_offs + LOG_POS_OFFSET; + char *log_pos= (char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET; /* fix end_log_pos */ val= uint4korr(log_pos) + group; From 2a76abce96bed0b60274e443a0922534ee610b59 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 16:20:00 +0500 Subject: [PATCH 034/227] Fix for bug #29353: inserting a negative value to a csv table leads to the table corruption Problem: we believe a number cannot start with '-' ['+'] sign reading rows. Fix: let field->store() check given values. mysql-test/r/csv.result: Fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - test result. mysql-test/t/csv.test: Fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - test case. storage/csv/ha_tina.cc: Fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - code optimization: removed unnecessary file_buff->get_value() calls. - let field->store() check given value correctness. --- mysql-test/r/csv.result | 31 ++++++++++++++++++ mysql-test/t/csv.test | 25 +++++++++++++++ storage/csv/ha_tina.cc | 70 +++++++++++++++++++++-------------------- 3 files changed, 92 insertions(+), 34 deletions(-) diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index 34dc1cb5b2e..e7cdd612a25 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -5261,3 +5261,34 @@ CREATE TABLE `bug21328` ( insert into bug21328 values (1,NULL,NULL); alter table bug21328 engine=myisam; drop table bug21328; +create table t1(a int) engine=csv; +insert into t1 values(-1), (-123.34), (2), (-23); +select * from t1; +a +-1 +-123 +2 +-23 +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1(a int, b int) engine=csv; +repair table t1; +Table Op Msg_type Msg_text +test.t1 repair Warning Data truncated for column 'a' at row 1 +test.t1 repair status OK +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +a b +1 0 +-200 1 +-1 -1 +-1 -100 +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +End of 5.1 tests diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index c7c7f3e13ab..6d24b38ee10 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1674,3 +1674,28 @@ CREATE TABLE `bug21328` ( insert into bug21328 values (1,NULL,NULL); alter table bug21328 engine=myisam; drop table bug21328; + +# +# Bug #29353: negative values +# +create table t1(a int) engine=csv; +insert into t1 values(-1), (-123.34), (2), (-23); +select * from t1; +check table t1; +drop table t1; + +create table t1(a int, b int) engine=csv; +--write_file $MYSQLTEST_VARDIR/master-data/test/t1.CSV +1, 1E-2 +-2E2, .9 +-10E-1, -.9 +-1, -100.1 +1a, -2b +EOF +repair table t1; +check table t1; +select * from t1; +check table t1; +drop table t1; + +--echo End of 5.1 tests diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 6de153c82d7..239d47890ed 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -45,11 +45,12 @@ TODO: #pragma implementation // gcc: Class implementation #endif -#include "mysql_priv.h" +#define MYSQL_SERVER 1 +#include "mysql_priv.h" +#include #include "ha_tina.h" -#include /* uchar + uchar + ulonglong + ulonglong + ulonglong + ulonglong + uchar @@ -609,37 +610,41 @@ int ha_tina::find_current_row(uchar *buf) for (Field **field=table->field ; *field ; field++) { + char curr_char; + buffer.length(0); - if (curr_offset < end_offset && - file_buff->get_value(curr_offset) == '"') + if (curr_offset >= end_offset) + goto err; + curr_char= file_buff->get_value(curr_offset); + if (curr_char == '"') { curr_offset++; // Incrementpast the first quote - for(;curr_offset < end_offset; curr_offset++) + for(; curr_offset < end_offset; curr_offset++) { + curr_char= file_buff->get_value(curr_offset); // Need to convert line feeds! - if (file_buff->get_value(curr_offset) == '"' && - ((file_buff->get_value(curr_offset + 1) == ',') || - (curr_offset == end_offset -1 ))) + if (curr_char == '"' && + (curr_offset == end_offset - 1 || + file_buff->get_value(curr_offset + 1) == ',')) { curr_offset+= 2; // Move past the , and the " break; } - if (file_buff->get_value(curr_offset) == '\\' && - curr_offset != (end_offset - 1)) + if (curr_char == '\\' && curr_offset != (end_offset - 1)) { curr_offset++; - if (file_buff->get_value(curr_offset) == 'r') + curr_char= file_buff->get_value(curr_offset); + if (curr_char == 'r') buffer.append('\r'); - else if (file_buff->get_value(curr_offset) == 'n' ) + else if (curr_char == 'n' ) buffer.append('\n'); - else if ((file_buff->get_value(curr_offset) == '\\') || - (file_buff->get_value(curr_offset) == '"')) - buffer.append(file_buff->get_value(curr_offset)); + else if (curr_char == '\\' || curr_char == '"') + buffer.append(curr_char); else /* This could only happed with an externally created file */ { buffer.append('\\'); - buffer.append(file_buff->get_value(curr_offset)); + buffer.append(curr_char); } } else // ordinary symbol @@ -650,36 +655,29 @@ int ha_tina::find_current_row(uchar *buf) */ if (curr_offset == end_offset - 1) goto err; - buffer.append(file_buff->get_value(curr_offset)); + buffer.append(curr_char); } } } - else if (my_isdigit(system_charset_info, - file_buff->get_value(curr_offset))) + else { - for(;curr_offset < end_offset; curr_offset++) + for(; curr_offset < end_offset; curr_offset++) { - if (file_buff->get_value(curr_offset) == ',') + curr_char= file_buff->get_value(curr_offset); + if (curr_char == ',') { - curr_offset+= 1; // Move past the , + curr_offset++; // Skip the , break; } - - if (my_isdigit(system_charset_info, file_buff->get_value(curr_offset))) - buffer.append(file_buff->get_value(curr_offset)); - else if (file_buff->get_value(curr_offset) == '.') - buffer.append(file_buff->get_value(curr_offset)); - else - goto err; + buffer.append(curr_char); } } - else - { - goto err; - } if (bitmap_is_set(table->read_set, (*field)->field_index)) - (*field)->store(buffer.ptr(), buffer.length(), buffer.charset()); + { + if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset())) + goto err; + } } next_position= end_offset + eoln_len; error= 0; @@ -1004,6 +1002,7 @@ int ha_tina::delete_row(const uchar * buf) int ha_tina::rnd_init(bool scan) { + THD *thd= table ? table->in_use : current_thd; DBUG_ENTER("ha_tina::rnd_init"); /* set buffer to the beginning of the file */ @@ -1015,6 +1014,7 @@ int ha_tina::rnd_init(bool scan) stats.records= 0; records_is_known= 0; chain_ptr= chain; + thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong values DBUG_RETURN(0); } @@ -1298,6 +1298,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt) current_position= next_position= 0; /* Read the file row-by-row. If everything is ok, repair is not needed. */ + thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong values while (!(rc= find_current_row(buf))) { rows_repaired++; @@ -1463,6 +1464,7 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt) /* set current position to the beginning of the file */ current_position= next_position= 0; /* Read the file row-by-row. If everything is ok, repair is not needed. */ + thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong values while (!(rc= find_current_row(buf))) { count--; From 6e3bed6a65d7008ef9d72cfd4bad4b7d8e5b3ae6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 13:23:58 +0200 Subject: [PATCH 035/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB windows fixies --- sql/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 6e635ba581c..5f3ff9b10f7 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -4034,7 +4034,7 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log) { /* we've got a full event-header, and it came in one piece */ - uchar *log_pos= cache->read_pos + hdr_offs + LOG_POS_OFFSET; + uchar *log_pos= (uchar *)cache->read_pos + hdr_offs + LOG_POS_OFFSET; /* fix end_log_pos */ val= uint4korr(log_pos) + group; From f0ccaddf8b786d3bc3f0702d9a48161e47a80537 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 14:04:29 +0200 Subject: [PATCH 036/227] Bug#24924: shared-memory-base-name that is too long causes buffer overflow show that shm communication still works on windows, and that we can't overflow the base-name. mysql-test/t/windows_shm-master.opt: Bug#24924: shared-memory-base-name that is too long causes buffer overflow start a server with shm communication if we're on windows. mysql-test/t/windows_shm.test: Bug#24924: shared-memory-base-name that is too long causes buffer overflow .opt has started a server with shm communication if we're on windows. now start a client with shm and connect to that server. --- mysql-test/r/windows_shm.result | 2 ++ mysql-test/t/windows_shm-master.opt | 1 + mysql-test/t/windows_shm.test | 9 +++++++++ 3 files changed, 12 insertions(+) create mode 100644 mysql-test/r/windows_shm.result create mode 100644 mysql-test/t/windows_shm-master.opt create mode 100644 mysql-test/t/windows_shm.test diff --git a/mysql-test/r/windows_shm.result b/mysql-test/r/windows_shm.result new file mode 100644 index 00000000000..c60049bece8 --- /dev/null +++ b/mysql-test/r/windows_shm.result @@ -0,0 +1,2 @@ +mysqld is alive +End of 5.0 tests. diff --git a/mysql-test/t/windows_shm-master.opt b/mysql-test/t/windows_shm-master.opt new file mode 100644 index 00000000000..4476ea16360 --- /dev/null +++ b/mysql-test/t/windows_shm-master.opt @@ -0,0 +1 @@ +--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1 diff --git a/mysql-test/t/windows_shm.test b/mysql-test/t/windows_shm.test new file mode 100644 index 00000000000..203471aac56 --- /dev/null +++ b/mysql-test/t/windows_shm.test @@ -0,0 +1,9 @@ +# Windows-specific tests +--source include/windows.inc + +# +# Bug #24924: shared-memory-base-name that is too long causes buffer overflow +# +--exec $MYSQLADMIN --no-defaults --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping + +--echo End of 5.0 tests. From a40e44efed0794ed91e7d454743fdaa7d6099f45 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 14:28:02 +0200 Subject: [PATCH 037/227] WL#3933 Split main test suite to rpl, rpl_ndb and ndb - Update mysql-test-run.pl to collect tests from several suites - Group test into suites - Add suite.opt file mysql-test/suite/ndb/r/ndb_multi.result: Rename: mysql-test/r/ndb_multi.result -> mysql-test/suite/ndb/r/ndb_multi.result mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test: Rename: mysql-test/t/rpl_replicate_ignore_db.test -> mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test mysql-test/suite/rpl/t/rpl_row_trig001.test: Rename: mysql-test/t/rpl_row_trig001.test -> mysql-test/suite/rpl/t/rpl_row_trig001.test mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result: Rename: mysql-test/r/rpl_ndb_sp003.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result mysql-test/suite/binlog/r/binlog_stm_insert_select.result: Rename: mysql-test/r/binlog_stm_insert_select.result -> mysql-test/suite/binlog/r/binlog_stm_insert_select.result mysql-test/suite/ndb/t/ndb_condition_pushdown.test: Rename: mysql-test/t/ndb_condition_pushdown.test -> mysql-test/suite/ndb/t/ndb_condition_pushdown.test mysql-test/suite/ndb/t/ndb_dd_dump.test: Rename: mysql-test/t/ndb_dd_dump.test -> mysql-test/suite/ndb/t/ndb_dd_dump.test mysql-test/suite/ndb/t/ndb_partition_range.test: Rename: mysql-test/t/ndb_partition_range.test -> mysql-test/suite/ndb/t/ndb_partition_range.test mysql-test/suite/ndb/t/strict_autoinc_5ndb.test: Rename: mysql-test/t/strict_autoinc_5ndb.test -> mysql-test/suite/ndb/t/strict_autoinc_5ndb.test mysql-test/suite/rpl/r/rpl_commit_after_flush.result: Rename: mysql-test/r/rpl_commit_after_flush.result -> mysql-test/suite/rpl/r/rpl_commit_after_flush.result mysql-test/suite/rpl/r/rpl_view.result: Rename: mysql-test/r/rpl_view.result -> mysql-test/suite/rpl/r/rpl_view.result mysql-test/suite/rpl/t/rpl_insert_select.test: Rename: mysql-test/t/rpl_insert_select.test -> mysql-test/suite/rpl/t/rpl_insert_select.test mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt: Rename: mysql-test/t/rpl_load_from_master-slave.opt -> mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt mysql-test/suite/rpl/t/rpl_many_optimize.test: Rename: mysql-test/t/rpl_many_optimize.test -> mysql-test/suite/rpl/t/rpl_many_optimize.test mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test: Rename: mysql-test/t/rpl_mixed_ddl_dml.test -> mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test mysql-test/suite/rpl/t/rpl_multi_delete.test: Rename: mysql-test/t/rpl_multi_delete.test -> mysql-test/suite/rpl/t/rpl_multi_delete.test mysql-test/suite/rpl/t/rpl_row_log_innodb.test: Rename: mysql-test/t/rpl_row_log_innodb.test -> mysql-test/suite/rpl/t/rpl_row_log_innodb.test mysql-test/suite/rpl/t/rpl_row_reset_slave.test: Rename: mysql-test/t/rpl_row_reset_slave.test -> mysql-test/suite/rpl/t/rpl_row_reset_slave.test mysql-test/suite/rpl/t/rpl_row_stop_middle.test: Rename: mysql-test/t/rpl_row_stop_middle.test -> mysql-test/suite/rpl/t/rpl_row_stop_middle.test mysql-test/suite/rpl/t/rpl_stm_log-master.opt: Rename: mysql-test/t/rpl_stm_log-master.opt -> mysql-test/suite/rpl/t/rpl_stm_log-master.opt mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result: Rename: mysql-test/r/rpl_ndb_delete_nowhere.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test: Rename: mysql-test/t/rpl_ndb_sync.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result: Rename: mysql-test/r/binlog_row_mix_innodb_myisam.result -> mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result mysql-test/suite/ndb/r/ndb_dd_alter.result: Rename: mysql-test/r/ndb_dd_alter.result -> mysql-test/suite/ndb/r/ndb_dd_alter.result mysql-test/suite/ndb/r/ndb_index_unique.result: Rename: mysql-test/r/ndb_index_unique.result -> mysql-test/suite/ndb/r/ndb_index_unique.result mysql-test/suite/ndb/r/ndb_rename.result: Rename: mysql-test/r/ndb_rename.result -> mysql-test/suite/ndb/r/ndb_rename.result mysql-test/suite/ndb/r/ndb_update.result: Rename: mysql-test/r/ndb_update.result -> mysql-test/suite/ndb/r/ndb_update.result mysql-test/suite/ndb/r/ndb_view.result: Rename: mysql-test/r/ndb_view.result -> mysql-test/suite/ndb/r/ndb_view.result mysql-test/suite/ndb/t/ndb_alter_table2.test: Rename: mysql-test/t/ndb_alter_table2.test -> mysql-test/suite/ndb/t/ndb_alter_table2.test mysql-test/suite/ndb/t/ndb_autodiscover.test: Rename: mysql-test/t/ndb_autodiscover.test -> mysql-test/suite/ndb/t/ndb_autodiscover.test mysql-test/suite/ndb/t/ndb_binlog_discover.test: Rename: mysql-test/t/ndb_binlog_discover.test -> mysql-test/suite/ndb/t/ndb_binlog_discover.test mysql-test/suite/ndb/t/ndb_binlog_multi.test: Rename: mysql-test/t/ndb_binlog_multi.test -> mysql-test/suite/ndb/t/ndb_binlog_multi.test mysql-test/suite/ndb/t/ndb_cache_multi.test: Rename: mysql-test/t/ndb_cache_multi.test -> mysql-test/suite/ndb/t/ndb_cache_multi.test mysql-test/suite/ndb/t/ndb_partition_error2-master.opt: Rename: mysql-test/t/ndb_partition_error2-master.opt -> mysql-test/suite/ndb/t/ndb_partition_error2-master.opt mysql-test/suite/rpl/r/rpl000001.a.result: Rename: mysql-test/r/rpl000001.a.result -> mysql-test/suite/rpl/r/rpl000001.a.result mysql-test/suite/rpl/r/rpl_alter.result: Rename: mysql-test/r/rpl_alter.result -> mysql-test/suite/rpl/r/rpl_alter.result mysql-test/suite/rpl/r/rpl_insert_ignore.result: Rename: mysql-test/r/rpl_insert_ignore.result -> mysql-test/suite/rpl/r/rpl_insert_ignore.result mysql-test/suite/rpl/r/rpl_relayspace.result: Rename: mysql-test/r/rpl_relayspace.result -> mysql-test/suite/rpl/r/rpl_relayspace.result mysql-test/suite/rpl/r/rpl_row_func001.result: Rename: mysql-test/r/rpl_row_func001.result -> mysql-test/suite/rpl/r/rpl_row_func001.result mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result: Rename: mysql-test/r/rpl_row_inexist_tbl.result -> mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result: Rename: mysql-test/r/rpl_stm_insert_delayed.result -> mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result mysql-test/suite/rpl/t/rpl_create_database.test: Rename: mysql-test/t/rpl_create_database.test -> mysql-test/suite/rpl/t/rpl_create_database.test mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt: Rename: mysql-test/t/rpl_dual_pos_advance-master.opt -> mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh: Rename: mysql-test/t/rpl_flushlog_loop-slave.sh -> mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh mysql-test/suite/rpl/t/rpl_ignore_grant.test: Rename: mysql-test/t/rpl_ignore_grant.test -> mysql-test/suite/rpl/t/rpl_ignore_grant.test mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt: Rename: mysql-test/t/rpl_multi_update2-slave.opt -> mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt mysql-test/suite/rpl/t/rpl_multi_update4.test: Rename: mysql-test/t/rpl_multi_update4.test -> mysql-test/suite/rpl/t/rpl_multi_update4.test mysql-test/suite/rpl/t/rpl_rewrt_db.test: Rename: mysql-test/t/rpl_rewrt_db.test -> mysql-test/suite/rpl/t/rpl_rewrt_db.test mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt: Rename: mysql-test/t/rpl_rotate_logs-master.opt -> mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt mysql-test/suite/rpl/t/rpl_row_4_bytes.test: Rename: mysql-test/t/rpl_row_4_bytes.test -> mysql-test/suite/rpl/t/rpl_row_4_bytes.test mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt: Rename: mysql-test/t/rpl_row_create_table-slave.opt -> mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test: Rename: mysql-test/t/rpl_row_flsh_tbls.test -> mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test mysql-test/suite/rpl/t/rpl_row_func003.test: Rename: mysql-test/t/rpl_row_func003.test -> mysql-test/suite/rpl/t/rpl_row_func003.test mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test: Rename: mysql-test/t/rpl_row_sp007_innodb.test -> mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt: Rename: mysql-test/t/rpl_row_stop_middle_update-slave.opt -> mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test: Rename: mysql-test/t/rpl_row_tabledefs_3innodb.test -> mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test mysql-test/suite/rpl/t/rpl_ssl1.test: Rename: mysql-test/t/rpl_ssl1.test -> mysql-test/suite/rpl/t/rpl_ssl1.test mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test: Rename: mysql-test/t/rpl_stm_max_relay_size.test -> mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test mysql-test/suite/rpl/t/rpl_stm_mystery22.test: Rename: mysql-test/t/rpl_stm_mystery22.test -> mysql-test/suite/rpl/t/rpl_stm_mystery22.test mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test: Rename: mysql-test/t/rpl_truncate_7ndb_2.test -> mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test mysql-test/suite/rpl/t/rpl_variables.test: Rename: mysql-test/t/rpl_variables.test -> mysql-test/suite/rpl/t/rpl_variables.test mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result: Rename: mysql-test/r/rpl_ndb_auto_inc.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result: Rename: mysql-test/r/rpl_ndb_do_db.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result: Rename: mysql-test/r/rpl_truncate_7ndb.result -> mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test: Rename: mysql-test/t/rpl_ndb_do_table.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test: Rename: mysql-test/t/rpl_ndb_multi.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test mysql-test/suite/binlog/r/binlog_row_blackhole.result: Rename: mysql-test/r/binlog_row_blackhole.result -> mysql-test/suite/binlog/r/binlog_row_blackhole.result mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result: Rename: mysql-test/r/binlog_row_ctype_cp932.result -> mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result mysql-test/suite/binlog/r/binlog_row_insert_select.result: Rename: mysql-test/r/binlog_row_insert_select.result -> mysql-test/suite/binlog/r/binlog_row_insert_select.result mysql-test/suite/binlog/r/binlog_stm_ps.result: Rename: mysql-test/r/binlog_stm_ps.result -> mysql-test/suite/binlog/r/binlog_stm_ps.result mysql-test/suite/binlog/t/binlog_row_binlog-master.opt: Rename: mysql-test/t/binlog_row_binlog-master.opt -> mysql-test/suite/binlog/t/binlog_row_binlog-master.opt mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt: Rename: mysql-test/t/binlog_row_innodb_stat-master.opt -> mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt mysql-test/suite/binlog/t/binlog_row_innodb_stat.test: Rename: mysql-test/t/binlog_row_innodb_stat.test -> mysql-test/suite/binlog/t/binlog_row_innodb_stat.test mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test: Rename: mysql-test/t/binlog_stm_ctype_ucs.test -> mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result: Rename: mysql-test/r/ndb_binlog_ddl_multi.result -> mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result mysql-test/suite/ndb/r/ndb_dd_backuprestore.result: Rename: mysql-test/r/ndb_dd_backuprestore.result -> mysql-test/suite/ndb/r/ndb_dd_backuprestore.result mysql-test/suite/ndb/r/ndb_index_ordered.result: Rename: mysql-test/r/ndb_index_ordered.result -> mysql-test/suite/ndb/r/ndb_index_ordered.result mysql-test/suite/ndb/r/ndb_lock.result: Rename: mysql-test/r/ndb_lock.result -> mysql-test/suite/ndb/r/ndb_lock.result mysql-test/suite/ndb/r/ndb_partition_range.result: Rename: mysql-test/r/ndb_partition_range.result -> mysql-test/suite/ndb/r/ndb_partition_range.result mysql-test/suite/ndb/r/ndb_replace.result: Rename: mysql-test/r/ndb_replace.result -> mysql-test/suite/ndb/r/ndb_replace.result mysql-test/suite/ndb/t/ndb_alter_table3.test: Rename: mysql-test/t/ndb_alter_table3.test -> mysql-test/suite/ndb/t/ndb_alter_table3.test mysql-test/suite/ndb/t/ndb_binlog_basic.test: Rename: mysql-test/t/ndb_binlog_basic.test -> mysql-test/suite/ndb/t/ndb_binlog_basic.test mysql-test/suite/ndb/t/ndb_bitfield.test: Rename: mysql-test/t/ndb_bitfield.test -> mysql-test/suite/ndb/t/ndb_bitfield.test mysql-test/suite/ndb/t/ndb_blob_partition.test: Rename: mysql-test/t/ndb_blob_partition.test -> mysql-test/suite/ndb/t/ndb_blob_partition.test mysql-test/suite/ndb/t/ndb_cache.test: Rename: mysql-test/t/ndb_cache.test -> mysql-test/suite/ndb/t/ndb_cache.test mysql-test/suite/ndb/t/ndb_cache2.test: Rename: mysql-test/t/ndb_cache2.test -> mysql-test/suite/ndb/t/ndb_cache2.test mysql-test/suite/ndb/t/ndb_dd_alter.test: Rename: mysql-test/t/ndb_dd_alter.test -> mysql-test/suite/ndb/t/ndb_dd_alter.test mysql-test/suite/ndb/t/ndb_dd_backuprestore.test: Rename: mysql-test/t/ndb_dd_backuprestore.test -> mysql-test/suite/ndb/t/ndb_dd_backuprestore.test mysql-test/suite/ndb/t/ndb_limit.test: Rename: mysql-test/t/ndb_limit.test -> mysql-test/suite/ndb/t/ndb_limit.test mysql-test/suite/ndb/t/ndb_minmax.test: Rename: mysql-test/t/ndb_minmax.test -> mysql-test/suite/ndb/t/ndb_minmax.test mysql-test/suite/ndb/t/ndb_partition_list.test: Rename: mysql-test/t/ndb_partition_list.test -> mysql-test/suite/ndb/t/ndb_partition_list.test mysql-test/suite/ndb/t/ndb_restore_partition.test: Rename: mysql-test/t/ndb_restore_partition.test -> mysql-test/suite/ndb/t/ndb_restore_partition.test mysql-test/suite/ndb/t/ndb_restore_print.test: Rename: mysql-test/t/ndb_restore_print.test -> mysql-test/suite/ndb/t/ndb_restore_print.test mysql-test/suite/rpl/r/rpl000001.b.result: Rename: mysql-test/r/rpl000001.b.result -> mysql-test/suite/rpl/r/rpl000001.b.result mysql-test/suite/rpl/r/rpl000017.result: Rename: mysql-test/r/rpl000017.result -> mysql-test/suite/rpl/r/rpl000017.result mysql-test/suite/rpl/r/rpl_bit.result: Rename: mysql-test/r/rpl_bit.result -> mysql-test/suite/rpl/r/rpl_bit.result mysql-test/suite/rpl/r/rpl_dual_pos_advance.result: Rename: mysql-test/r/rpl_dual_pos_advance.result -> mysql-test/suite/rpl/r/rpl_dual_pos_advance.result mysql-test/suite/rpl/r/rpl_failed_optimize.result: Rename: mysql-test/r/rpl_failed_optimize.result -> mysql-test/suite/rpl/r/rpl_failed_optimize.result mysql-test/suite/rpl/r/rpl_ignore_table_update.result: Rename: mysql-test/r/rpl_ignore_table_update.result -> mysql-test/suite/rpl/r/rpl_ignore_table_update.result mysql-test/suite/rpl/r/rpl_insert_id_pk.result: Rename: mysql-test/r/rpl_insert_id_pk.result -> mysql-test/suite/rpl/r/rpl_insert_id_pk.result mysql-test/suite/rpl/r/rpl_known_bugs_detection.result: Rename: mysql-test/r/rpl_known_bugs_detection.result -> mysql-test/suite/rpl/r/rpl_known_bugs_detection.result mysql-test/suite/rpl/r/rpl_loaddata.result: Rename: mysql-test/r/rpl_loaddata.result -> mysql-test/suite/rpl/r/rpl_loaddata.result mysql-test/suite/rpl/r/rpl_redirect.result: Rename: mysql-test/r/rpl_redirect.result -> mysql-test/suite/rpl/r/rpl_redirect.result mysql-test/suite/rpl/r/rpl_row_NOW.result: Rename: mysql-test/r/rpl_row_NOW.result -> mysql-test/suite/rpl/r/rpl_row_NOW.result mysql-test/suite/rpl/r/rpl_row_func002.result: Rename: mysql-test/r/rpl_row_func002.result -> mysql-test/suite/rpl/r/rpl_row_func002.result mysql-test/suite/rpl/r/rpl_row_loaddata_m.result: Rename: mysql-test/r/rpl_row_loaddata_m.result -> mysql-test/suite/rpl/r/rpl_row_loaddata_m.result mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result: Rename: mysql-test/r/rpl_row_stop_middle_update.result -> mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result mysql-test/suite/rpl/r/rpl_row_trig001.result: Rename: mysql-test/r/rpl_row_trig001.result -> mysql-test/suite/rpl/r/rpl_row_trig001.result mysql-test/suite/rpl/r/rpl_stm_no_op.result: Rename: mysql-test/r/rpl_stm_no_op.result -> mysql-test/suite/rpl/r/rpl_stm_no_op.result mysql-test/suite/rpl/r/rpl_truncate_3innodb.result: Rename: mysql-test/r/rpl_truncate_3innodb.result -> mysql-test/suite/rpl/r/rpl_truncate_3innodb.result mysql-test/suite/rpl/t/rpl000011.test: Rename: mysql-test/t/rpl000011.test -> mysql-test/suite/rpl/t/rpl000011.test mysql-test/suite/rpl/t/rpl_alter_db.test: Rename: mysql-test/t/rpl_alter_db.test -> mysql-test/suite/rpl/t/rpl_alter_db.test mysql-test/suite/rpl/t/rpl_delete_no_where.test: Rename: mysql-test/t/rpl_delete_no_where.test -> mysql-test/suite/rpl/t/rpl_delete_no_where.test mysql-test/suite/rpl/t/rpl_dual_pos_advance.test: Rename: mysql-test/t/rpl_dual_pos_advance.test -> mysql-test/suite/rpl/t/rpl_dual_pos_advance.test mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt: Rename: mysql-test/t/rpl_flushlog_loop-master.opt -> mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh: Rename: mysql-test/t/rpl_flushlog_loop-master.sh -> mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh mysql-test/suite/rpl/t/rpl_get_lock.test: Rename: mysql-test/t/rpl_get_lock.test -> mysql-test/suite/rpl/t/rpl_get_lock.test mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt: Rename: mysql-test/t/rpl_ignore_grant-slave.opt -> mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt mysql-test/suite/rpl/t/rpl_incident.test: Rename: mysql-test/t/rpl_incident.test -> mysql-test/suite/rpl/t/rpl_incident.test mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt: Rename: mysql-test/t/rpl_insert_ignore-slave.opt -> mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt: Rename: mysql-test/t/rpl_known_bugs_detection-master.opt -> mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt mysql-test/suite/rpl/t/rpl_loaddata_m.test: Rename: mysql-test/t/rpl_loaddata_m.test -> mysql-test/suite/rpl/t/rpl_loaddata_m.test mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt: Rename: mysql-test/t/rpl_loaddata_s-slave.opt -> mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt mysql-test/suite/rpl/t/rpl_loadfile.test: Rename: mysql-test/t/rpl_loadfile.test -> mysql-test/suite/rpl/t/rpl_loadfile.test mysql-test/suite/rpl/t/rpl_read_only.test: Rename: mysql-test/t/rpl_read_only.test -> mysql-test/suite/rpl/t/rpl_read_only.test mysql-test/suite/rpl/t/rpl_redirect.test: Rename: mysql-test/t/rpl_redirect.test -> mysql-test/suite/rpl/t/rpl_redirect.test mysql-test/suite/rpl/t/rpl_relay_space_innodb.test: Rename: mysql-test/t/rpl_relay_space_innodb.test -> mysql-test/suite/rpl/t/rpl_relay_space_innodb.test mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt: Rename: mysql-test/t/rpl_row_basic_11bugs-master.opt -> mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt: Rename: mysql-test/t/rpl_row_err_daisychain-slave.opt -> mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt mysql-test/suite/rpl/t/rpl_row_log-slave.opt: Rename: mysql-test/t/rpl_row_log-slave.opt -> mysql-test/suite/rpl/t/rpl_row_log-slave.opt mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt: Rename: mysql-test/t/rpl_row_mysqlbinlog-master.opt -> mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test: Rename: mysql-test/t/rpl_row_sp006_InnoDB.test -> mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt: Rename: mysql-test/t/rpl_row_sp007_innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt: Rename: mysql-test/t/rpl_row_stop_middle_update-master.opt -> mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt: Rename: mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt: Rename: mysql-test/t/rpl_sp_effects-slave.opt -> mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt mysql-test/suite/rpl/t/rpl_sp_effects.test: Rename: mysql-test/t/rpl_sp_effects.test -> mysql-test/suite/rpl/t/rpl_sp_effects.test mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt: Rename: mysql-test/t/rpl_sporadic_master-master.opt -> mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test: Rename: mysql-test/t/rpl_switch_stm_row_mixed.test -> mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test mysql-test/suite/rpl/t/rpl_temporary.test: Rename: mysql-test/t/rpl_temporary.test -> mysql-test/suite/rpl/t/rpl_temporary.test mysql-test/suite/rpl/t/rpl_timezone-master.opt: Rename: mysql-test/t/rpl_timezone-master.opt -> mysql-test/suite/rpl/t/rpl_timezone-master.opt mysql-test/suite/rpl/t/rpl_trigger.test: Rename: mysql-test/t/rpl_trigger.test -> mysql-test/suite/rpl/t/rpl_trigger.test mysql-test/suite/rpl/t/rpl_trunc_temp.test: Rename: mysql-test/t/rpl_trunc_temp.test -> mysql-test/suite/rpl/t/rpl_trunc_temp.test mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result: Rename: mysql-test/r/rpl_ndb_bank.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result: Rename: mysql-test/r/rpl_ndb_blob.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result: Rename: mysql-test/r/rpl_ndb_blob2.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result: Rename: mysql-test/r/rpl_ndb_relayrotate.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test: Rename: mysql-test/t/rpl_ndb_2innodb.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test: Rename: mysql-test/t/rpl_ndb_charset.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test: Rename: mysql-test/t/rpl_ndb_dd_basic.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test: Rename: mysql-test/t/rpl_ndb_ddl.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test: Rename: mysql-test/t/rpl_ndb_delete_nowhere.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt: Rename: mysql-test/t/rpl_ndb_do_db-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt: Rename: mysql-test/t/rpl_ndb_innodb2ndb-master.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt: Rename: mysql-test/t/rpl_ndb_log-master.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt: Rename: mysql-test/t/rpl_ndb_relayrotate-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test: Rename: mysql-test/t/rpl_ndb_sp006.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test: Rename: mysql-test/t/rpl_ndb_trig004.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result: Rename: mysql-test/r/binlog_stm_ctype_cp932.result -> mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result mysql-test/suite/ndb/r/ndb_basic.result: Rename: mysql-test/r/ndb_basic.result -> mysql-test/suite/ndb/r/ndb_basic.result mysql-test/suite/ndb/r/ndb_binlog_log_bin.result: Rename: mysql-test/r/ndb_binlog_log_bin.result -> mysql-test/suite/ndb/r/ndb_binlog_log_bin.result mysql-test/suite/ndb/r/ndb_cursor.result: Rename: mysql-test/r/ndb_cursor.result -> mysql-test/suite/ndb/r/ndb_cursor.result mysql-test/suite/ndb/r/ndb_dd_basic.result: Rename: mysql-test/r/ndb_dd_basic.result -> mysql-test/suite/ndb/r/ndb_dd_basic.result mysql-test/suite/ndb/r/ndb_dd_sql_features.result: Rename: mysql-test/r/ndb_dd_sql_features.result -> mysql-test/suite/ndb/r/ndb_dd_sql_features.result mysql-test/suite/ndb/r/ndb_gis.result: Rename: mysql-test/r/ndb_gis.result -> mysql-test/suite/ndb/r/ndb_gis.result mysql-test/suite/ndb/r/ndb_load.result: Rename: mysql-test/r/ndb_load.result -> mysql-test/suite/ndb/r/ndb_load.result mysql-test/suite/ndb/r/ndb_multi_row.result: Rename: mysql-test/r/ndb_multi_row.result -> mysql-test/suite/ndb/r/ndb_multi_row.result mysql-test/suite/ndb/r/ndb_trigger.result: Rename: mysql-test/r/ndb_trigger.result -> mysql-test/suite/ndb/r/ndb_trigger.result mysql-test/suite/ndb/r/ndb_types.result: Rename: mysql-test/r/ndb_types.result -> mysql-test/suite/ndb/r/ndb_types.result mysql-test/suite/ndb/t/ndb_alter_table.test: Rename: mysql-test/t/ndb_alter_table.test -> mysql-test/suite/ndb/t/ndb_alter_table.test mysql-test/suite/ndb/t/ndb_basic.test: Rename: mysql-test/t/ndb_basic.test -> mysql-test/suite/ndb/t/ndb_basic.test mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt: Rename: mysql-test/t/ndb_binlog_ignore_db-master.opt -> mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt mysql-test/suite/ndb/t/ndb_blob.test: Rename: mysql-test/t/ndb_blob.test -> mysql-test/suite/ndb/t/ndb_blob.test mysql-test/suite/ndb/t/ndb_dd_ddl.test: Rename: mysql-test/t/ndb_dd_ddl.test -> mysql-test/suite/ndb/t/ndb_dd_ddl.test mysql-test/suite/ndb/t/ndb_dd_disk2memory.test: Rename: mysql-test/t/ndb_dd_disk2memory.test -> mysql-test/suite/ndb/t/ndb_dd_disk2memory.test mysql-test/suite/ndb/t/ndb_index_unique.test: Rename: mysql-test/t/ndb_index_unique.test -> mysql-test/suite/ndb/t/ndb_index_unique.test mysql-test/suite/ndb/t/ndb_read_multi_range.test: Rename: mysql-test/t/ndb_read_multi_range.test -> mysql-test/suite/ndb/t/ndb_read_multi_range.test mysql-test/suite/ndb/t/ndb_row_format.test: Rename: mysql-test/t/ndb_row_format.test -> mysql-test/suite/ndb/t/ndb_row_format.test mysql-test/suite/rpl/r/rpl_alter_db.result: Rename: mysql-test/r/rpl_alter_db.result -> mysql-test/suite/rpl/r/rpl_alter_db.result mysql-test/suite/rpl/r/rpl_drop_db.result: Rename: mysql-test/r/rpl_drop_db.result -> mysql-test/suite/rpl/r/rpl_drop_db.result mysql-test/suite/rpl/r/rpl_log_pos.result: Rename: mysql-test/r/rpl_log_pos.result -> mysql-test/suite/rpl/r/rpl_log_pos.result mysql-test/suite/rpl/r/rpl_multi_update3.result: Rename: mysql-test/r/rpl_multi_update3.result -> mysql-test/suite/rpl/r/rpl_multi_update3.result mysql-test/suite/rpl/r/rpl_rewrt_db.result: Rename: mysql-test/r/rpl_rewrt_db.result -> mysql-test/suite/rpl/r/rpl_rewrt_db.result mysql-test/suite/rpl/r/rpl_row_create_table.result: Rename: mysql-test/r/rpl_row_create_table.result -> mysql-test/suite/rpl/r/rpl_row_create_table.result mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result: Rename: mysql-test/r/rpl_row_flsh_tbls.result -> mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result mysql-test/suite/rpl/r/rpl_row_func003.result: Rename: mysql-test/r/rpl_row_func003.result -> mysql-test/suite/rpl/r/rpl_row_func003.result mysql-test/suite/rpl/r/rpl_row_sp008.result: Rename: mysql-test/r/rpl_row_sp008.result -> mysql-test/suite/rpl/r/rpl_row_sp008.result mysql-test/suite/rpl/r/rpl_row_trig002.result: Rename: mysql-test/r/rpl_row_trig002.result -> mysql-test/suite/rpl/r/rpl_row_trig002.result mysql-test/suite/rpl/r/rpl_sp004.result: Rename: mysql-test/r/rpl_sp004.result -> mysql-test/suite/rpl/r/rpl_sp004.result mysql-test/suite/rpl/r/rpl_ssl.result: Rename: mysql-test/r/rpl_ssl.result -> mysql-test/suite/rpl/r/rpl_ssl.result mysql-test/suite/rpl/r/rpl_stm_EE_err2.result: Rename: mysql-test/r/rpl_stm_EE_err2.result -> mysql-test/suite/rpl/r/rpl_stm_EE_err2.result mysql-test/suite/rpl/r/rpl_stm_multi_query.result: Rename: mysql-test/r/rpl_stm_multi_query.result -> mysql-test/suite/rpl/r/rpl_stm_multi_query.result mysql-test/suite/rpl/t/rpl000013.test: Rename: mysql-test/t/rpl000013.test -> mysql-test/suite/rpl/t/rpl000013.test mysql-test/suite/rpl/t/rpl000017-slave.opt: Rename: mysql-test/t/rpl000017-slave.opt -> mysql-test/suite/rpl/t/rpl000017-slave.opt mysql-test/suite/rpl/t/rpl_drop_db.test: Rename: mysql-test/t/rpl_drop_db.test -> mysql-test/suite/rpl/t/rpl_drop_db.test mysql-test/suite/rpl/t/rpl_flushlog_loop.test: Rename: mysql-test/t/rpl_flushlog_loop.test -> mysql-test/suite/rpl/t/rpl_flushlog_loop.test mysql-test/suite/rpl/t/rpl_load_from_master.test: Rename: mysql-test/t/rpl_load_from_master.test -> mysql-test/suite/rpl/t/rpl_load_from_master.test mysql-test/suite/rpl/t/rpl_locale.test: Rename: mysql-test/t/rpl_locale.test -> mysql-test/suite/rpl/t/rpl_locale.test mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt: Rename: mysql-test/t/rpl_multi_delete-slave.opt -> mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt mysql-test/suite/rpl/t/rpl_rotate_logs.test: Rename: mysql-test/t/rpl_rotate_logs.test -> mysql-test/suite/rpl/t/rpl_rotate_logs.test mysql-test/suite/rpl/t/rpl_row_NOW.test: Rename: mysql-test/t/rpl_row_NOW.test -> mysql-test/suite/rpl/t/rpl_row_NOW.test mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt: Rename: mysql-test/t/rpl_row_err_daisychain-master.opt -> mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test: Rename: mysql-test/t/rpl_row_inexist_tbl.test -> mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test mysql-test/suite/rpl/t/rpl_row_mystery22.test: Rename: mysql-test/t/rpl_row_mystery22.test -> mysql-test/suite/rpl/t/rpl_row_mystery22.test mysql-test/suite/rpl/t/rpl_row_sp003.test: Rename: mysql-test/t/rpl_row_sp003.test -> mysql-test/suite/rpl/t/rpl_row_sp003.test mysql-test/suite/rpl/t/rpl_row_sp011.test: Rename: mysql-test/t/rpl_row_sp011.test -> mysql-test/suite/rpl/t/rpl_row_sp011.test mysql-test/suite/rpl/t/rpl_server_id1.test: Rename: mysql-test/t/rpl_server_id1.test -> mysql-test/suite/rpl/t/rpl_server_id1.test mysql-test/suite/rpl/t/rpl_session_var.test: Rename: mysql-test/t/rpl_session_var.test -> mysql-test/suite/rpl/t/rpl_session_var.test mysql-test/suite/rpl/t/rpl_skip_error.test: Rename: mysql-test/t/rpl_skip_error.test -> mysql-test/suite/rpl/t/rpl_skip_error.test mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result: Rename: mysql-test/r/rpl_ndb_commit_afterflush.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test: Rename: mysql-test/t/rpl_ndb_do_db.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt: Rename: mysql-test/t/rpl_ndb_innodb2ndb-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt: Rename: mysql-test/t/rpl_ndb_multi_update2-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test: Rename: mysql-test/t/rpl_ndb_multi_update2.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result: Rename: mysql-test/r/binlog_statement_insert_delayed.result -> mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result mysql-test/suite/binlog/t/binlog_row_blackhole.test: Rename: mysql-test/t/binlog_row_blackhole.test -> mysql-test/suite/binlog/t/binlog_row_blackhole.test mysql-test/suite/ndb/r/ndb_limit.result: Rename: mysql-test/r/ndb_limit.result -> mysql-test/suite/ndb/r/ndb_limit.result mysql-test/suite/ndb/t/ndb_dd_basic.test: Rename: mysql-test/t/ndb_dd_basic.test -> mysql-test/suite/ndb/t/ndb_dd_basic.test mysql-test/suite/ndb/t/ndb_types.test: Rename: mysql-test/t/ndb_types.test -> mysql-test/suite/ndb/t/ndb_types.test mysql-test/suite/ndb/t/ndb_update.test: Rename: mysql-test/t/ndb_update.test -> mysql-test/suite/ndb/t/ndb_update.test mysql-test/suite/rpl/r/rpl_extraCol_innodb.result: Rename: mysql-test/r/rpl_extraCol_innodb.result -> mysql-test/suite/rpl/r/rpl_extraCol_innodb.result mysql-test/suite/rpl/r/rpl_loaddata_charset.result: Rename: mysql-test/r/rpl_loaddata_charset.result -> mysql-test/suite/rpl/r/rpl_loaddata_charset.result mysql-test/suite/rpl/r/rpl_loaddata_m.result: Rename: mysql-test/r/rpl_loaddata_m.result -> mysql-test/suite/rpl/r/rpl_loaddata_m.result mysql-test/suite/rpl/r/rpl_multi_delete.result: Rename: mysql-test/r/rpl_multi_delete.result -> mysql-test/suite/rpl/r/rpl_multi_delete.result mysql-test/suite/rpl/r/rpl_multi_delete2.result: Rename: mysql-test/r/rpl_multi_delete2.result -> mysql-test/suite/rpl/r/rpl_multi_delete2.result mysql-test/suite/rpl/r/rpl_row_sp009.result: Rename: mysql-test/r/rpl_row_sp009.result -> mysql-test/suite/rpl/r/rpl_row_sp009.result mysql-test/suite/rpl/r/rpl_row_sp010.result: Rename: mysql-test/r/rpl_row_sp010.result -> mysql-test/suite/rpl/r/rpl_row_sp010.result mysql-test/suite/rpl/r/rpl_set_charset.result: Rename: mysql-test/r/rpl_set_charset.result -> mysql-test/suite/rpl/r/rpl_set_charset.result mysql-test/suite/rpl/r/rpl_skip_error.result: Rename: mysql-test/r/rpl_skip_error.result -> mysql-test/suite/rpl/r/rpl_skip_error.result mysql-test/suite/rpl/r/rpl_stm_charset.result: Rename: mysql-test/r/rpl_stm_charset.result -> mysql-test/suite/rpl/r/rpl_stm_charset.result mysql-test/suite/rpl/r/rpl_trigger.result: Rename: mysql-test/r/rpl_trigger.result -> mysql-test/suite/rpl/r/rpl_trigger.result mysql-test/suite/rpl/t/rpl_auto_increment-master.opt: Rename: mysql-test/t/rpl_auto_increment-master.opt -> mysql-test/suite/rpl/t/rpl_auto_increment-master.opt mysql-test/suite/rpl/t/rpl_bit_npk.test: Rename: mysql-test/t/rpl_bit_npk.test -> mysql-test/suite/rpl/t/rpl_bit_npk.test mysql-test/suite/rpl/t/rpl_extraCol_innodb.test: Rename: mysql-test/t/rpl_extraCol_innodb.test -> mysql-test/suite/rpl/t/rpl_extraCol_innodb.test mysql-test/suite/rpl/t/rpl_free_items-slave.opt: Rename: mysql-test/t/rpl_free_items-slave.opt -> mysql-test/suite/rpl/t/rpl_free_items-slave.opt mysql-test/suite/rpl/t/rpl_init_slave.test: Rename: mysql-test/t/rpl_init_slave.test -> mysql-test/suite/rpl/t/rpl_init_slave.test mysql-test/suite/rpl/t/rpl_packet-slave.opt: Rename: mysql-test/t/rpl_packet-slave.opt -> mysql-test/suite/rpl/t/rpl_packet-slave.opt mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt: Rename: mysql-test/t/rpl_relay_space_innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi: Rename: mysql-test/t/rpl_rotate_logs.slave-mi -> mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi mysql-test/suite/rpl/t/rpl_row_USER.test: Rename: mysql-test/t/rpl_row_USER.test -> mysql-test/suite/rpl/t/rpl_row_USER.test mysql-test/suite/rpl/t/rpl_row_delayed_ins.test: Rename: mysql-test/t/rpl_row_delayed_ins.test -> mysql-test/suite/rpl/t/rpl_row_delayed_ins.test mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt: Rename: mysql-test/t/rpl_row_sp002_innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt mysql-test/suite/rpl/t/rpl_row_trig002.test: Rename: mysql-test/t/rpl_row_trig002.test -> mysql-test/suite/rpl/t/rpl_row_trig002.test mysql-test/suite/rpl/t/rpl_sf.test: Rename: mysql-test/t/rpl_sf.test -> mysql-test/suite/rpl/t/rpl_sf.test mysql-test/suite/rpl/t/rpl_stm_no_op.test: Rename: mysql-test/t/rpl_stm_no_op.test -> mysql-test/suite/rpl/t/rpl_stm_no_op.test mysql-test/suite/rpl/t/rpl_udf-slave.opt: Rename: mysql-test/t/rpl_udf-slave.opt -> mysql-test/suite/rpl/t/rpl_udf-slave.opt mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result: Rename: mysql-test/r/rpl_ndb_dd_partitions.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result: Rename: mysql-test/r/rpl_ndb_multi.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result: Rename: mysql-test/r/rpl_ndb_rep_ignore.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result: Rename: mysql-test/r/rpl_ndb_sp006.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt: Rename: mysql-test/t/rpl_ndb_2myisam-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test: Rename: mysql-test/t/rpl_ndb_idempotent.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test: Rename: mysql-test/t/rpl_ndb_sp003.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test mysql-test/suite/binlog/r/binlog_row_binlog.result: Rename: mysql-test/r/binlog_row_binlog.result -> mysql-test/suite/binlog/r/binlog_row_binlog.result mysql-test/suite/binlog/r/binlog_stm_blackhole.result: Rename: mysql-test/r/binlog_stm_blackhole.result -> mysql-test/suite/binlog/r/binlog_stm_blackhole.result mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result: Rename: mysql-test/r/binlog_stm_mix_innodb_myisam.result -> mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test: Rename: mysql-test/t/binlog_row_drop_tmp_tbl.test -> mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt: Rename: mysql-test/t/binlog_row_mix_innodb_myisam-master.opt -> mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test: Rename: mysql-test/t/binlog_statement_insert_delayed.test -> mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt: Rename: mysql-test/t/binlog_stm_binlog-master.opt -> mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt mysql-test/suite/ndb/r/ndb_alter_table2.result: Rename: mysql-test/r/ndb_alter_table2.result -> mysql-test/suite/ndb/r/ndb_alter_table2.result mysql-test/suite/ndb/r/ndb_blob.result: Rename: mysql-test/r/ndb_blob.result -> mysql-test/suite/ndb/r/ndb_blob.result mysql-test/suite/ndb/r/ndb_cache_multi2.result: Rename: mysql-test/r/ndb_cache_multi2.result -> mysql-test/suite/ndb/r/ndb_cache_multi2.result mysql-test/suite/ndb/r/ndb_config2.result: Rename: mysql-test/r/ndb_config2.result -> mysql-test/suite/ndb/r/ndb_config2.result mysql-test/suite/ndb/t/ndb_truncate.test: Rename: mysql-test/t/ndb_truncate.test -> mysql-test/suite/ndb/t/ndb_truncate.test mysql-test/suite/ndb/t/ndbapi.test: Rename: mysql-test/t/ndbapi.test -> mysql-test/suite/ndb/t/ndbapi.test mysql-test/suite/rpl/r/rpl_charset_sjis.result: Rename: mysql-test/r/rpl_charset_sjis.result -> mysql-test/suite/rpl/r/rpl_charset_sjis.result mysql-test/suite/rpl/r/rpl_extraCol_myisam.result: Rename: mysql-test/r/rpl_extraCol_myisam.result -> mysql-test/suite/rpl/r/rpl_extraCol_myisam.result mysql-test/suite/rpl/r/rpl_locale.result: Rename: mysql-test/r/rpl_locale.result -> mysql-test/suite/rpl/r/rpl_locale.result mysql-test/suite/rpl/r/rpl_multi_update2.result: Rename: mysql-test/r/rpl_multi_update2.result -> mysql-test/suite/rpl/r/rpl_multi_update2.result mysql-test/suite/rpl/r/rpl_relay_space_innodb.result: Rename: mysql-test/r/rpl_relay_space_innodb.result -> mysql-test/suite/rpl/r/rpl_relay_space_innodb.result mysql-test/suite/rpl/r/rpl_row_insert_delayed.result: Rename: mysql-test/r/rpl_row_insert_delayed.result -> mysql-test/suite/rpl/r/rpl_row_insert_delayed.result mysql-test/suite/rpl/r/rpl_row_log_innodb.result: Rename: mysql-test/r/rpl_row_log_innodb.result -> mysql-test/suite/rpl/r/rpl_row_log_innodb.result mysql-test/suite/rpl/r/rpl_row_multi_query.result: Rename: mysql-test/r/rpl_row_multi_query.result -> mysql-test/suite/rpl/r/rpl_row_multi_query.result mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result: Rename: mysql-test/r/rpl_row_tabledefs_3innodb.result -> mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result mysql-test/suite/rpl/r/rpl_row_trig003.result: Rename: mysql-test/r/rpl_row_trig003.result -> mysql-test/suite/rpl/r/rpl_row_trig003.result mysql-test/suite/rpl/r/rpl_row_until.result: Rename: mysql-test/r/rpl_row_until.result -> mysql-test/suite/rpl/r/rpl_row_until.result mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt: Rename: mysql-test/t/rpl_empty_master_crash-master.opt -> mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt mysql-test/suite/rpl/t/rpl_free_items.test: Rename: mysql-test/t/rpl_free_items.test -> mysql-test/suite/rpl/t/rpl_free_items.test mysql-test/suite/rpl/t/rpl_ps.test: Rename: mysql-test/t/rpl_ps.test -> mysql-test/suite/rpl/t/rpl_ps.test mysql-test/suite/rpl/t/rpl_relay_space_myisam.test: Rename: mysql-test/t/rpl_relay_space_myisam.test -> mysql-test/suite/rpl/t/rpl_relay_space_myisam.test mysql-test/suite/rpl/t/rpl_relayrotate.test: Rename: mysql-test/t/rpl_relayrotate.test -> mysql-test/suite/rpl/t/rpl_relayrotate.test mysql-test/suite/rpl/t/rpl_relayspace.test: Rename: mysql-test/t/rpl_relayspace.test -> mysql-test/suite/rpl/t/rpl_relayspace.test mysql-test/suite/rpl/t/rpl_row_sp003-master.opt: Rename: mysql-test/t/rpl_row_sp003-master.opt -> mysql-test/suite/rpl/t/rpl_row_sp003-master.opt mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result: Rename: mysql-test/r/rpl_ndb_sync.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result: Rename: mysql-test/r/rpl_ndbapi_multi.result -> mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test: Rename: mysql-test/t/rpl_ndb_2myisam.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test: Rename: mysql-test/t/rpl_ndb_func003.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test: Rename: mysql-test/t/rpl_ndb_innodb_trans.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test: Rename: mysql-test/t/rpl_ndb_load.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test: Rename: mysql-test/t/rpl_truncate_7ndb.test -> mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test: Rename: mysql-test/t/binlog_row_mix_innodb_myisam.test -> mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test mysql-test/suite/binlog/t/binlog_stm_binlog.test: Rename: mysql-test/t/binlog_stm_binlog.test -> mysql-test/suite/binlog/t/binlog_stm_binlog.test mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test: Rename: mysql-test/t/binlog_stm_ctype_cp932.test -> mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt: Rename: mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt -> mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test: Rename: mysql-test/t/binlog_stm_mix_innodb_myisam.test -> mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test mysql-test/suite/ndb/r/ndb_alter_table3.result: Rename: mysql-test/r/ndb_alter_table3.result -> mysql-test/suite/ndb/r/ndb_alter_table3.result mysql-test/suite/ndb/r/ndb_autodiscover2.result: Rename: mysql-test/r/ndb_autodiscover2.result -> mysql-test/suite/ndb/r/ndb_autodiscover2.result mysql-test/suite/ndb/r/ndb_backup_print.result: Rename: mysql-test/r/ndb_backup_print.result -> mysql-test/suite/ndb/r/ndb_backup_print.result mysql-test/suite/ndb/r/ndb_binlog_basic.result: Rename: mysql-test/r/ndb_binlog_basic.result -> mysql-test/suite/ndb/r/ndb_binlog_basic.result mysql-test/suite/ndb/r/ndb_condition_pushdown.result: Rename: mysql-test/r/ndb_condition_pushdown.result -> mysql-test/suite/ndb/r/ndb_condition_pushdown.result mysql-test/suite/ndb/r/ndb_dd_ddl.result: Rename: mysql-test/r/ndb_dd_ddl.result -> mysql-test/suite/ndb/r/ndb_dd_ddl.result mysql-test/suite/ndb/r/ndb_dd_dump.result: Rename: mysql-test/r/ndb_dd_dump.result -> mysql-test/suite/ndb/r/ndb_dd_dump.result mysql-test/suite/ndb/r/ndb_loaddatalocal.result: Rename: mysql-test/r/ndb_loaddatalocal.result -> mysql-test/suite/ndb/r/ndb_loaddatalocal.result mysql-test/suite/ndb/r/ndb_restore_compat.result: Rename: mysql-test/r/ndb_restore_compat.result -> mysql-test/suite/ndb/r/ndb_restore_compat.result mysql-test/suite/ndb/r/ndb_row_format.result: Rename: mysql-test/r/ndb_row_format.result -> mysql-test/suite/ndb/r/ndb_row_format.result mysql-test/suite/ndb/r/ndb_sp.result: Rename: mysql-test/r/ndb_sp.result -> mysql-test/suite/ndb/r/ndb_sp.result mysql-test/suite/ndb/r/ndb_temporary.result: Rename: mysql-test/r/ndb_temporary.result -> mysql-test/suite/ndb/r/ndb_temporary.result mysql-test/suite/ndb/r/ps_7ndb.result: Rename: mysql-test/r/ps_7ndb.result -> mysql-test/suite/ndb/r/ps_7ndb.result mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test: Rename: mysql-test/t/ndb_binlog_ddl_multi.test -> mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test mysql-test/suite/ndb/t/ndb_cache_multi2.test: Rename: mysql-test/t/ndb_cache_multi2.test -> mysql-test/suite/ndb/t/ndb_cache_multi2.test mysql-test/suite/ndb/t/ndb_charset.test: Rename: mysql-test/t/ndb_charset.test -> mysql-test/suite/ndb/t/ndb_charset.test mysql-test/suite/ndb/t/ndb_dd_sql_features.test: Rename: mysql-test/t/ndb_dd_sql_features.test -> mysql-test/suite/ndb/t/ndb_dd_sql_features.test mysql-test/suite/ndb/t/ndb_loaddatalocal.test: Rename: mysql-test/t/ndb_loaddatalocal.test -> mysql-test/suite/ndb/t/ndb_loaddatalocal.test mysql-test/suite/ndb/t/ndb_multi_row.test: Rename: mysql-test/t/ndb_multi_row.test -> mysql-test/suite/ndb/t/ndb_multi_row.test mysql-test/suite/ndb/t/ndb_restore.test: Rename: mysql-test/t/ndb_restore.test -> mysql-test/suite/ndb/t/ndb_restore.test mysql-test/suite/ndb/t/partition_03ndb.test: Rename: mysql-test/t/partition_03ndb.test -> mysql-test/suite/ndb/t/partition_03ndb.test mysql-test/suite/ndb/t/ps_7ndb.test: Rename: mysql-test/t/ps_7ndb.test -> mysql-test/suite/ndb/t/ps_7ndb.test mysql-test/suite/rpl/r/rpl000013.result: Rename: mysql-test/r/rpl000013.result -> mysql-test/suite/rpl/r/rpl000013.result mysql-test/suite/rpl/r/rpl_auto_increment_11932.result: Rename: mysql-test/r/rpl_auto_increment_11932.result -> mysql-test/suite/rpl/r/rpl_auto_increment_11932.result mysql-test/suite/rpl/r/rpl_change_master.result: Rename: mysql-test/r/rpl_change_master.result -> mysql-test/suite/rpl/r/rpl_change_master.result mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result: Rename: mysql-test/r/rpl_foreign_key_innodb.result -> mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result mysql-test/suite/rpl/r/rpl_insert_select.result: Rename: mysql-test/r/rpl_insert_select.result -> mysql-test/suite/rpl/r/rpl_insert_select.result mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result: Rename: mysql-test/r/rpl_mixed_ddl_dml.result -> mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result mysql-test/suite/rpl/r/rpl_replicate_do.result: Rename: mysql-test/r/rpl_replicate_do.result -> mysql-test/suite/rpl/r/rpl_replicate_do.result mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result: Rename: mysql-test/r/rpl_row_basic_2myisam.result -> mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result mysql-test/suite/rpl/r/rpl_row_sp011.result: Rename: mysql-test/r/rpl_row_sp011.result -> mysql-test/suite/rpl/r/rpl_row_sp011.result mysql-test/suite/rpl/r/rpl_row_trig004.result: Rename: mysql-test/r/rpl_row_trig004.result -> mysql-test/suite/rpl/r/rpl_row_trig004.result mysql-test/suite/rpl/r/rpl_slave_status.result: Rename: mysql-test/r/rpl_slave_status.result -> mysql-test/suite/rpl/r/rpl_slave_status.result mysql-test/suite/rpl/r/rpl_stm_log.result: Rename: mysql-test/r/rpl_stm_log.result -> mysql-test/suite/rpl/r/rpl_stm_log.result mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result: Rename: mysql-test/r/rpl_stm_max_relay_size.result -> mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result: Rename: mysql-test/r/rpl_switch_stm_row_mixed.result -> mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result mysql-test/suite/rpl/r/rpl_temp_table.result: Rename: mysql-test/r/rpl_temp_table.result -> mysql-test/suite/rpl/r/rpl_temp_table.result mysql-test/suite/rpl/r/rpl_timezone.result: Rename: mysql-test/r/rpl_timezone.result -> mysql-test/suite/rpl/r/rpl_timezone.result mysql-test/suite/rpl/t/rpl000017-slave.sh: Rename: mysql-test/t/rpl000017-slave.sh -> mysql-test/suite/rpl/t/rpl000017-slave.sh mysql-test/suite/rpl/t/rpl000018-slave.opt: Rename: mysql-test/t/rpl000018-slave.opt -> mysql-test/suite/rpl/t/rpl000018-slave.opt mysql-test/suite/rpl/t/rpl_auto_increment_11932.test: Rename: mysql-test/t/rpl_auto_increment_11932.test -> mysql-test/suite/rpl/t/rpl_auto_increment_11932.test mysql-test/suite/rpl/t/rpl_commit_after_flush.test: Rename: mysql-test/t/rpl_commit_after_flush.test -> mysql-test/suite/rpl/t/rpl_commit_after_flush.test mysql-test/suite/rpl/t/rpl_create_database-master.opt: Rename: mysql-test/t/rpl_create_database-master.opt -> mysql-test/suite/rpl/t/rpl_create_database-master.opt mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt: Rename: mysql-test/t/rpl_deadlock_innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt mysql-test/suite/rpl/t/rpl_drop.test: Rename: mysql-test/t/rpl_drop.test -> mysql-test/suite/rpl/t/rpl_drop.test mysql-test/suite/rpl/t/rpl_empty_master_crash.test: Rename: mysql-test/t/rpl_empty_master_crash.test -> mysql-test/suite/rpl/t/rpl_empty_master_crash.test mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt: Rename: mysql-test/t/rpl_flushlog_loop-slave.opt -> mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt mysql-test/suite/rpl/t/rpl_ignore_table_update.test: Rename: mysql-test/t/rpl_ignore_table_update.test -> mysql-test/suite/rpl/t/rpl_ignore_table_update.test mysql-test/suite/rpl/t/rpl_innodb.test: Rename: mysql-test/t/rpl_innodb.test -> mysql-test/suite/rpl/t/rpl_innodb.test mysql-test/suite/rpl/t/rpl_known_bugs_detection.test: Rename: mysql-test/t/rpl_known_bugs_detection.test -> mysql-test/suite/rpl/t/rpl_known_bugs_detection.test mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt: Rename: mysql-test/t/rpl_multi_update4-slave.opt -> mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt mysql-test/suite/rpl/t/rpl_packet-master.opt: Rename: mysql-test/t/rpl_packet-master.opt -> mysql-test/suite/rpl/t/rpl_packet-master.opt mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt: Rename: mysql-test/t/rpl_row_4_bytes-master.opt -> mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test: Rename: mysql-test/t/rpl_row_basic_3innodb.test -> mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test mysql-test/suite/rpl/t/rpl_row_func001.test: Rename: mysql-test/t/rpl_row_func001.test -> mysql-test/suite/rpl/t/rpl_row_func001.test mysql-test/suite/rpl/t/rpl_row_func003-slave.opt: Rename: mysql-test/t/rpl_row_func003-slave.opt -> mysql-test/suite/rpl/t/rpl_row_func003-slave.opt mysql-test/suite/rpl/t/rpl_row_until.test: Rename: mysql-test/t/rpl_row_until.test -> mysql-test/suite/rpl/t/rpl_row_until.test mysql-test/suite/rpl/t/rpl_set_charset.test: Rename: mysql-test/t/rpl_set_charset.test -> mysql-test/suite/rpl/t/rpl_set_charset.test mysql-test/suite/rpl/t/rpl_skip_error-slave.opt: Rename: mysql-test/t/rpl_skip_error-slave.opt -> mysql-test/suite/rpl/t/rpl_skip_error-slave.opt mysql-test/suite/rpl/t/rpl_slave_status.test: Rename: mysql-test/t/rpl_slave_status.test -> mysql-test/suite/rpl/t/rpl_slave_status.test mysql-test/suite/rpl/t/rpl_sp-master.opt: Rename: mysql-test/t/rpl_sp-master.opt -> mysql-test/suite/rpl/t/rpl_sp-master.opt mysql-test/suite/rpl/t/rpl_sp004.test: Rename: mysql-test/t/rpl_sp004.test -> mysql-test/suite/rpl/t/rpl_sp004.test mysql-test/suite/rpl/t/rpl_start_stop_slave.test: Rename: mysql-test/t/rpl_start_stop_slave.test -> mysql-test/suite/rpl/t/rpl_start_stop_slave.test mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test: Rename: mysql-test/t/rpl_stm_flsh_tbls.test -> mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test mysql-test/suite/rpl/t/rpl_stm_log.test: Rename: mysql-test/t/rpl_stm_log.test -> mysql-test/suite/rpl/t/rpl_stm_log.test mysql-test/suite/rpl/t/rpl_truncate_2myisam.test: Rename: mysql-test/t/rpl_truncate_2myisam.test -> mysql-test/suite/rpl/t/rpl_truncate_2myisam.test mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result: Rename: mysql-test/r/rpl_ndb_UUID.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result: Rename: mysql-test/r/rpl_ndb_insert_ignore.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test: Rename: mysql-test/t/rpl_ndb_circular.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test: Rename: mysql-test/t/rpl_ndb_commit_afterflush.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test: Rename: mysql-test/t/rpl_ndb_relayrotate.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt: Rename: mysql-test/t/rpl_ndb_rep_ignore-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result: Rename: mysql-test/r/binlog_stm_ctype_ucs.result -> mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test: Rename: mysql-test/t/binlog_stm_drop_tmp_tbl.test -> mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt: Rename: mysql-test/t/binlog_stm_innodb_stat-master.opt -> mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt mysql-test/suite/ndb/r/loaddata_autocom_ndb.result: Rename: mysql-test/r/loaddata_autocom_ndb.result -> mysql-test/suite/ndb/r/loaddata_autocom_ndb.result mysql-test/suite/ndb/r/ndb_autodiscover3.result: Rename: mysql-test/r/ndb_autodiscover3.result -> mysql-test/suite/ndb/r/ndb_autodiscover3.result mysql-test/suite/ndb/r/ndb_binlog_basic2.result: Rename: mysql-test/r/ndb_binlog_basic2.result -> mysql-test/suite/ndb/r/ndb_binlog_basic2.result mysql-test/suite/ndb/r/ndb_blob_partition.result: Rename: mysql-test/r/ndb_blob_partition.result -> mysql-test/suite/ndb/r/ndb_blob_partition.result mysql-test/suite/ndb/r/ndb_insert.result: Rename: mysql-test/r/ndb_insert.result -> mysql-test/suite/ndb/r/ndb_insert.result mysql-test/suite/ndb/r/ndb_partition_error2.result: Rename: mysql-test/r/ndb_partition_error2.result -> mysql-test/suite/ndb/r/ndb_partition_error2.result mysql-test/suite/ndb/r/ndb_partition_list.result: Rename: mysql-test/r/ndb_partition_list.result -> mysql-test/suite/ndb/r/ndb_partition_list.result mysql-test/suite/ndb/r/ndb_restore_print.result: Rename: mysql-test/r/ndb_restore_print.result -> mysql-test/suite/ndb/r/ndb_restore_print.result mysql-test/suite/ndb/r/ndb_transaction.result: Rename: mysql-test/r/ndb_transaction.result -> mysql-test/suite/ndb/r/ndb_transaction.result mysql-test/suite/ndb/r/partition_03ndb.result: Rename: mysql-test/r/partition_03ndb.result -> mysql-test/suite/ndb/r/partition_03ndb.result mysql-test/suite/ndb/t/loaddata_autocom_ndb.test: Rename: mysql-test/t/loaddata_autocom_ndb.test -> mysql-test/suite/ndb/t/loaddata_autocom_ndb.test mysql-test/suite/ndb/t/ndb_autodiscover3.test: Rename: mysql-test/t/ndb_autodiscover3.test -> mysql-test/suite/ndb/t/ndb_autodiscover3.test mysql-test/suite/ndb/t/ndb_config2.test: Rename: mysql-test/t/ndb_config2.test -> mysql-test/suite/ndb/t/ndb_config2.test mysql-test/suite/ndb/t/ndb_cursor.test: Rename: mysql-test/t/ndb_cursor.test -> mysql-test/suite/ndb/t/ndb_cursor.test mysql-test/suite/ndb/t/ndb_database.test: Rename: mysql-test/t/ndb_database.test -> mysql-test/suite/ndb/t/ndb_database.test mysql-test/suite/ndb/t/ndb_index_ordered.test: Rename: mysql-test/t/ndb_index_ordered.test -> mysql-test/suite/ndb/t/ndb_index_ordered.test mysql-test/suite/ndb/t/ndb_restore_partition-master.opt: Rename: mysql-test/t/ndb_restore_partition-master.opt -> mysql-test/suite/ndb/t/ndb_restore_partition-master.opt mysql-test/suite/rpl/r/rpl_000015.result: Rename: mysql-test/r/rpl_000015.result -> mysql-test/suite/rpl/r/rpl_000015.result mysql-test/suite/rpl/r/rpl_bit_npk.result: Rename: mysql-test/r/rpl_bit_npk.result -> mysql-test/suite/rpl/r/rpl_bit_npk.result mysql-test/suite/rpl/r/rpl_critical_errors.result: Rename: mysql-test/r/rpl_critical_errors.result -> mysql-test/suite/rpl/r/rpl_critical_errors.result mysql-test/suite/rpl/r/rpl_delete_no_where.result: Rename: mysql-test/r/rpl_delete_no_where.result -> mysql-test/suite/rpl/r/rpl_delete_no_where.result mysql-test/suite/rpl/r/rpl_do_grant.result: Rename: mysql-test/r/rpl_do_grant.result -> mysql-test/suite/rpl/r/rpl_do_grant.result mysql-test/suite/rpl/r/rpl_events.result: Rename: mysql-test/r/rpl_events.result -> mysql-test/suite/rpl/r/rpl_events.result mysql-test/suite/rpl/r/rpl_get_lock.result: Rename: mysql-test/r/rpl_get_lock.result -> mysql-test/suite/rpl/r/rpl_get_lock.result mysql-test/suite/rpl/r/rpl_incident.result: Rename: mysql-test/r/rpl_incident.result -> mysql-test/suite/rpl/r/rpl_incident.result mysql-test/suite/rpl/r/rpl_init_slave.result: Rename: mysql-test/r/rpl_init_slave.result -> mysql-test/suite/rpl/r/rpl_init_slave.result mysql-test/suite/rpl/r/rpl_insert.result: Rename: mysql-test/r/rpl_insert.result -> mysql-test/suite/rpl/r/rpl_insert.result mysql-test/suite/rpl/r/rpl_insert_id.result: Rename: mysql-test/r/rpl_insert_id.result -> mysql-test/suite/rpl/r/rpl_insert_id.result mysql-test/suite/rpl/r/rpl_loaddata_s.result: Rename: mysql-test/r/rpl_loaddata_s.result -> mysql-test/suite/rpl/r/rpl_loaddata_s.result mysql-test/suite/rpl/r/rpl_multi_update4.result: Rename: mysql-test/r/rpl_multi_update4.result -> mysql-test/suite/rpl/r/rpl_multi_update4.result mysql-test/suite/rpl/r/rpl_optimize.result: Rename: mysql-test/r/rpl_optimize.result -> mysql-test/suite/rpl/r/rpl_optimize.result mysql-test/suite/rpl/r/rpl_row_blob_innodb.result: Rename: mysql-test/r/rpl_row_blob_innodb.result -> mysql-test/suite/rpl/r/rpl_row_blob_innodb.result mysql-test/suite/rpl/r/rpl_row_charset.result: Rename: mysql-test/r/rpl_row_charset.result -> mysql-test/suite/rpl/r/rpl_row_charset.result mysql-test/suite/rpl/r/rpl_row_drop.result: Rename: mysql-test/r/rpl_row_drop.result -> mysql-test/suite/rpl/r/rpl_row_drop.result mysql-test/suite/rpl/r/rpl_row_sp001.result: Rename: mysql-test/r/rpl_row_sp001.result -> mysql-test/suite/rpl/r/rpl_row_sp001.result mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result: Rename: mysql-test/r/rpl_row_sp006_InnoDB.result -> mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result mysql-test/suite/rpl/r/rpl_row_sp012.result: Rename: mysql-test/r/rpl_row_sp012.result -> mysql-test/suite/rpl/r/rpl_row_sp012.result mysql-test/suite/rpl/r/rpl_row_stop_middle.result: Rename: mysql-test/r/rpl_row_stop_middle.result -> mysql-test/suite/rpl/r/rpl_row_stop_middle.result mysql-test/suite/rpl/r/rpl_sp_effects.result: Rename: mysql-test/r/rpl_sp_effects.result -> mysql-test/suite/rpl/r/rpl_sp_effects.result mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result: Rename: mysql-test/r/rpl_stm_flsh_tbls.result -> mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result mysql-test/suite/rpl/r/rpl_stm_mystery22.result: Rename: mysql-test/r/rpl_stm_mystery22.result -> mysql-test/suite/rpl/r/rpl_stm_mystery22.result mysql-test/suite/rpl/t/rpl000010.test: Rename: mysql-test/t/rpl000010.test -> mysql-test/suite/rpl/t/rpl000010.test mysql-test/suite/rpl/t/rpl000017.test: Rename: mysql-test/t/rpl000017.test -> mysql-test/suite/rpl/t/rpl000017.test mysql-test/suite/rpl/t/rpl_000015.slave-mi: Rename: mysql-test/t/rpl_000015.slave-mi -> mysql-test/suite/rpl/t/rpl_000015.slave-mi mysql-test/suite/rpl/t/rpl_EE_err.test: Rename: mysql-test/t/rpl_EE_err.test -> mysql-test/suite/rpl/t/rpl_EE_err.test mysql-test/suite/rpl/t/rpl_LD_INFILE.test: Rename: mysql-test/t/rpl_LD_INFILE.test -> mysql-test/suite/rpl/t/rpl_LD_INFILE.test mysql-test/suite/rpl/t/rpl_charset_sjis.test: Rename: mysql-test/t/rpl_charset_sjis.test -> mysql-test/suite/rpl/t/rpl_charset_sjis.test mysql-test/suite/rpl/t/rpl_create_database-slave.opt: Rename: mysql-test/t/rpl_create_database-slave.opt -> mysql-test/suite/rpl/t/rpl_create_database-slave.opt mysql-test/suite/rpl/t/rpl_err_ignoredtable.test: Rename: mysql-test/t/rpl_err_ignoredtable.test -> mysql-test/suite/rpl/t/rpl_err_ignoredtable.test mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt: Rename: mysql-test/t/rpl_extraCol_innodb-master.opt -> mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt mysql-test/suite/rpl/t/rpl_extraCol_myisam.test: Rename: mysql-test/t/rpl_extraCol_myisam.test -> mysql-test/suite/rpl/t/rpl_extraCol_myisam.test mysql-test/suite/rpl/t/rpl_failed_optimize.test: Rename: mysql-test/t/rpl_failed_optimize.test -> mysql-test/suite/rpl/t/rpl_failed_optimize.test mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt: Rename: mysql-test/t/rpl_foreign_key_innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt mysql-test/suite/rpl/t/rpl_insert_id-slave.opt: Rename: mysql-test/t/rpl_insert_id-slave.opt -> mysql-test/suite/rpl/t/rpl_insert_id-slave.opt mysql-test/suite/rpl/t/rpl_load_table_from_master.test: Rename: mysql-test/t/rpl_load_table_from_master.test -> mysql-test/suite/rpl/t/rpl_load_table_from_master.test mysql-test/suite/rpl/t/rpl_loaddata.test: Rename: mysql-test/t/rpl_loaddata.test -> mysql-test/suite/rpl/t/rpl_loaddata.test mysql-test/suite/rpl/t/rpl_loaddata_s.test: Rename: mysql-test/t/rpl_loaddata_s.test -> mysql-test/suite/rpl/t/rpl_loaddata_s.test mysql-test/suite/rpl/t/rpl_master_pos_wait.test: Rename: mysql-test/t/rpl_master_pos_wait.test -> mysql-test/suite/rpl/t/rpl_master_pos_wait.test mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh: Rename: mysql-test/t/rpl_misc_functions-slave.sh -> mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh mysql-test/suite/rpl/t/rpl_multi_update2.test: Rename: mysql-test/t/rpl_multi_update2.test -> mysql-test/suite/rpl/t/rpl_multi_update2.test mysql-test/suite/rpl/t/rpl_packet.test: Rename: mysql-test/t/rpl_packet.test -> mysql-test/suite/rpl/t/rpl_packet.test mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt: Rename: mysql-test/t/rpl_relay_space_innodb-master.opt -> mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt: Rename: mysql-test/t/rpl_row_basic_11bugs-slave.opt -> mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt: Rename: mysql-test/t/rpl_row_inexist_tbl-slave.opt -> mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt mysql-test/suite/rpl/t/rpl_row_insert_delayed.test: Rename: mysql-test/t/rpl_row_insert_delayed.test -> mysql-test/suite/rpl/t/rpl_row_insert_delayed.test mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt: Rename: mysql-test/t/rpl_row_log_innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt mysql-test/suite/rpl/t/rpl_row_max_relay_size.test: Rename: mysql-test/t/rpl_row_max_relay_size.test -> mysql-test/suite/rpl/t/rpl_row_max_relay_size.test mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test: Rename: mysql-test/t/rpl_row_sp002_innodb.test -> mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt: Rename: mysql-test/t/rpl_row_sp003-slave.opt -> mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt: Rename: mysql-test/t/rpl_row_sp006_InnoDB-slave.opt -> mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt mysql-test/suite/rpl/t/rpl_row_sp012.test: Rename: mysql-test/t/rpl_row_sp012.test -> mysql-test/suite/rpl/t/rpl_row_sp012.test mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test: Rename: mysql-test/t/rpl_row_stop_middle_update.test -> mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test: Rename: mysql-test/t/rpl_row_tabledefs_2myisam.test -> mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test mysql-test/suite/rpl/t/rpl_row_trig003.test: Rename: mysql-test/t/rpl_row_trig003.test -> mysql-test/suite/rpl/t/rpl_row_trig003.test mysql-test/suite/rpl/t/rpl_server_id2.test: Rename: mysql-test/t/rpl_server_id2.test -> mysql-test/suite/rpl/t/rpl_server_id2.test mysql-test/suite/rpl/t/rpl_sporadic_master.test: Rename: mysql-test/t/rpl_sporadic_master.test -> mysql-test/suite/rpl/t/rpl_sporadic_master.test mysql-test/suite/rpl/t/rpl_stm_000001.test: Rename: mysql-test/t/rpl_stm_000001.test -> mysql-test/suite/rpl/t/rpl_stm_000001.test mysql-test/suite/rpl/t/rpl_stm_reset_slave.test: Rename: mysql-test/t/rpl_stm_reset_slave.test -> mysql-test/suite/rpl/t/rpl_stm_reset_slave.test mysql-test/suite/rpl/t/rpl_temp_table.test: Rename: mysql-test/t/rpl_temp_table.test -> mysql-test/suite/rpl/t/rpl_temp_table.test mysql-test/suite/rpl/t/rpl_timezone-slave.opt: Rename: mysql-test/t/rpl_timezone-slave.opt -> mysql-test/suite/rpl/t/rpl_timezone-slave.opt mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result: Rename: mysql-test/r/rpl_ndb_2innodb.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result: Rename: mysql-test/r/rpl_ndb_circular.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result: Rename: mysql-test/r/rpl_ndb_innodb_trans.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test: Rename: mysql-test/t/rpl_ndb_blob2.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt: Rename: mysql-test/t/rpl_ndb_do_table-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test: Rename: mysql-test/t/rpl_ndb_innodb2ndb.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test: Rename: mysql-test/t/rpl_ndb_insert_ignore.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test: Rename: mysql-test/t/rpl_ndb_multi_update3.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test: Rename: mysql-test/t/rpl_ndb_myisam2ndb.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result: Rename: mysql-test/r/binlog_stm_drop_tmp_tbl.result -> mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result: Rename: mysql-test/r/binlog_stm_innodb_stat.result -> mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result mysql-test/suite/binlog/t/binlog_stm_blackhole.test: Rename: mysql-test/t/binlog_stm_blackhole.test -> mysql-test/suite/binlog/t/binlog_stm_blackhole.test mysql-test/suite/binlog/t/binlog_stm_insert_select.test: Rename: mysql-test/t/binlog_stm_insert_select.test -> mysql-test/suite/binlog/t/binlog_stm_insert_select.test mysql-test/suite/ndb/r/ndb_binlog_discover.result: Rename: mysql-test/r/ndb_binlog_discover.result -> mysql-test/suite/ndb/r/ndb_binlog_discover.result mysql-test/suite/ndb/r/ndb_bitfield.result: Rename: mysql-test/r/ndb_bitfield.result -> mysql-test/suite/ndb/r/ndb_bitfield.result mysql-test/suite/ndb/r/ndb_minmax.result: Rename: mysql-test/r/ndb_minmax.result -> mysql-test/suite/ndb/r/ndb_minmax.result mysql-test/suite/ndb/r/ndb_single_user.result: Rename: mysql-test/r/ndb_single_user.result -> mysql-test/suite/ndb/r/ndb_single_user.result mysql-test/suite/ndb/r/ndb_subquery.result: Rename: mysql-test/r/ndb_subquery.result -> mysql-test/suite/ndb/r/ndb_subquery.result mysql-test/suite/ndb/t/ndb_binlog_log_bin.test: Rename: mysql-test/t/ndb_binlog_log_bin.test -> mysql-test/suite/ndb/t/ndb_binlog_log_bin.test mysql-test/suite/ndb/t/ndb_config.test: Rename: mysql-test/t/ndb_config.test -> mysql-test/suite/ndb/t/ndb_config.test mysql-test/suite/ndb/t/ndb_replace.test: Rename: mysql-test/t/ndb_replace.test -> mysql-test/suite/ndb/t/ndb_replace.test mysql-test/suite/ndb/t/ndb_transaction.test: Rename: mysql-test/t/ndb_transaction.test -> mysql-test/suite/ndb/t/ndb_transaction.test mysql-test/suite/ndb/t/ndb_trigger.test: Rename: mysql-test/t/ndb_trigger.test -> mysql-test/suite/ndb/t/ndb_trigger.test mysql-test/suite/ndb/t/ndb_view.test: Rename: mysql-test/t/ndb_view.test -> mysql-test/suite/ndb/t/ndb_view.test mysql-test/suite/rpl/r/rpl000011.result: Rename: mysql-test/r/rpl000011.result -> mysql-test/suite/rpl/r/rpl000011.result mysql-test/suite/rpl/r/rpl_free_items.result: Rename: mysql-test/r/rpl_free_items.result -> mysql-test/suite/rpl/r/rpl_free_items.result mysql-test/suite/rpl/r/rpl_ignore_revoke.result: Rename: mysql-test/r/rpl_ignore_revoke.result -> mysql-test/suite/rpl/r/rpl_ignore_revoke.result mysql-test/suite/rpl/r/rpl_innodb.result: Rename: mysql-test/r/rpl_innodb.result -> mysql-test/suite/rpl/r/rpl_innodb.result mysql-test/suite/rpl/r/rpl_loadfile.result: Rename: mysql-test/r/rpl_loadfile.result -> mysql-test/suite/rpl/r/rpl_loadfile.result mysql-test/suite/rpl/r/rpl_multi_update.result: Rename: mysql-test/r/rpl_multi_update.result -> mysql-test/suite/rpl/r/rpl_multi_update.result mysql-test/suite/rpl/r/rpl_ps.result: Rename: mysql-test/r/rpl_ps.result -> mysql-test/suite/rpl/r/rpl_ps.result mysql-test/suite/rpl/r/rpl_read_only.result: Rename: mysql-test/r/rpl_read_only.result -> mysql-test/suite/rpl/r/rpl_read_only.result mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result: Rename: mysql-test/r/rpl_replicate_ignore_db.result -> mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result mysql-test/suite/rpl/r/rpl_row_4_bytes.result: Rename: mysql-test/r/rpl_row_4_bytes.result -> mysql-test/suite/rpl/r/rpl_row_4_bytes.result mysql-test/suite/rpl/r/rpl_row_USER.result: Rename: mysql-test/r/rpl_row_USER.result -> mysql-test/suite/rpl/r/rpl_row_USER.result mysql-test/suite/rpl/r/rpl_row_UUID.result: Rename: mysql-test/r/rpl_row_UUID.result -> mysql-test/suite/rpl/r/rpl_row_UUID.result mysql-test/suite/rpl/r/rpl_row_blob_myisam.result: Rename: mysql-test/r/rpl_row_blob_myisam.result -> mysql-test/suite/rpl/r/rpl_row_blob_myisam.result mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result: Rename: mysql-test/r/rpl_row_err_ignoredtable.result -> mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result: Rename: mysql-test/r/rpl_row_sp002_innodb.result -> mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result: Rename: mysql-test/r/rpl_row_sp007_innodb.result -> mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result mysql-test/suite/rpl/r/rpl_ssl1.result: Rename: mysql-test/r/rpl_ssl1.result -> mysql-test/suite/rpl/r/rpl_ssl1.result mysql-test/suite/rpl/r/rpl_stm_000001.result: Rename: mysql-test/r/rpl_stm_000001.result -> mysql-test/suite/rpl/r/rpl_stm_000001.result mysql-test/suite/rpl/r/rpl_truncate_2myisam.result: Rename: mysql-test/r/rpl_truncate_2myisam.result -> mysql-test/suite/rpl/r/rpl_truncate_2myisam.result mysql-test/suite/rpl/t/rpl000018-master.opt: Rename: mysql-test/t/rpl000018-master.opt -> mysql-test/suite/rpl/t/rpl000018-master.opt mysql-test/suite/rpl/t/rpl_000015.test: Rename: mysql-test/t/rpl_000015.test -> mysql-test/suite/rpl/t/rpl_000015.test mysql-test/suite/rpl/t/rpl_drop_temp.test: Rename: mysql-test/t/rpl_drop_temp.test -> mysql-test/suite/rpl/t/rpl_drop_temp.test mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt: Rename: mysql-test/t/rpl_err_ignoredtable-slave.opt -> mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt: Rename: mysql-test/t/rpl_failed_optimize-master.opt -> mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test: Rename: mysql-test/t/rpl_foreign_key_innodb.test -> mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test mysql-test/suite/rpl/t/rpl_ignore_table.test: Rename: mysql-test/t/rpl_ignore_table.test -> mysql-test/suite/rpl/t/rpl_ignore_table.test mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt: Rename: mysql-test/t/rpl_ignore_table_update-slave.opt -> mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt mysql-test/suite/rpl/t/rpl_incident-master.opt: Rename: mysql-test/t/rpl_incident-master.opt -> mysql-test/suite/rpl/t/rpl_incident-master.opt mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt: Rename: mysql-test/t/rpl_insert_id_pk-slave.opt -> mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt: Rename: mysql-test/t/rpl_loaddata_m-master.opt -> mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt mysql-test/suite/rpl/t/rpl_loaddatalocal.test: Rename: mysql-test/t/rpl_loaddatalocal.test -> mysql-test/suite/rpl/t/rpl_loaddatalocal.test mysql-test/suite/rpl/t/rpl_misc_functions.test: Rename: mysql-test/t/rpl_misc_functions.test -> mysql-test/suite/rpl/t/rpl_misc_functions.test mysql-test/suite/rpl/t/rpl_multi_update.test: Rename: mysql-test/t/rpl_multi_update.test -> mysql-test/suite/rpl/t/rpl_multi_update.test mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test: Rename: mysql-test/t/rpl_row_basic_11bugs.test -> mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt: Rename: mysql-test/t/rpl_row_blob_innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt mysql-test/suite/rpl/t/rpl_row_log-master.opt: Rename: mysql-test/t/rpl_row_log-master.opt -> mysql-test/suite/rpl/t/rpl_row_log-master.opt mysql-test/suite/rpl/t/rpl_row_sp001.test: Rename: mysql-test/t/rpl_row_sp001.test -> mysql-test/suite/rpl/t/rpl_row_sp001.test mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt: Rename: mysql-test/t/rpl_row_sp002_innodb-master.opt -> mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt mysql-test/suite/rpl/t/rpl_row_sp008.test: Rename: mysql-test/t/rpl_row_sp008.test -> mysql-test/suite/rpl/t/rpl_row_sp008.test mysql-test/suite/rpl/t/rpl_sp-slave.opt: Rename: mysql-test/t/rpl_sp-slave.opt -> mysql-test/suite/rpl/t/rpl_sp-slave.opt mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt: Rename: mysql-test/t/rpl_stm_000001-slave.opt -> mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt mysql-test/suite/rpl/t/rpl_timezone.test: Rename: mysql-test/t/rpl_timezone.test -> mysql-test/suite/rpl/t/rpl_timezone.test mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result: Rename: mysql-test/r/rpl_ndb_2myisam.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result: Rename: mysql-test/r/rpl_ndb_basic.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result: Rename: mysql-test/r/rpl_ndb_extraCol.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result: Rename: mysql-test/r/rpl_ndb_idempotent.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result: Rename: mysql-test/r/rpl_ndb_log.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result: Rename: mysql-test/r/rpl_ndb_row_001.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result: Rename: mysql-test/r/rpl_ndb_stm_innodb.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt: Rename: mysql-test/t/rpl_ndb_2innodb-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test: Rename: mysql-test/t/rpl_ndb_blob.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test: Rename: mysql-test/t/rpl_ndb_dd_advance.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt: Rename: mysql-test/t/rpl_ndb_innodb_trans-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt: Rename: mysql-test/t/rpl_ndb_myisam2ndb-slave.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test: Rename: mysql-test/t/rpl_ndb_rep_ignore.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test: Rename: mysql-test/t/rpl_ndb_stm_innodb.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test: Rename: mysql-test/t/rpl_ndbapi_multi.test -> mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test mysql-test/suite/binlog/r/binlog_killed.result: Rename: mysql-test/r/binlog_killed.result -> mysql-test/suite/binlog/r/binlog_killed.result mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result: Rename: mysql-test/r/binlog_row_ctype_ucs.result -> mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result mysql-test/suite/binlog/r/binlog_stm_binlog.result: Rename: mysql-test/r/binlog_stm_binlog.result -> mysql-test/suite/binlog/r/binlog_stm_binlog.result mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test: Rename: mysql-test/t/binlog_row_ctype_ucs.test -> mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test: Rename: mysql-test/t/binlog_stm_innodb_stat.test -> mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test mysql-test/suite/binlog/t/binlog_stm_ps.test: Rename: mysql-test/t/binlog_stm_ps.test -> mysql-test/suite/binlog/t/binlog_stm_ps.test mysql-test/suite/ndb/r/ndb_cache.result: Rename: mysql-test/r/ndb_cache.result -> mysql-test/suite/ndb/r/ndb_cache.result mysql-test/suite/ndb/r/ndb_charset.result: Rename: mysql-test/r/ndb_charset.result -> mysql-test/suite/ndb/r/ndb_charset.result mysql-test/suite/ndb/r/ndb_config.result: Rename: mysql-test/r/ndb_config.result -> mysql-test/suite/ndb/r/ndb_config.result mysql-test/suite/ndb/r/ndb_dd_disk2memory.result: Rename: mysql-test/r/ndb_dd_disk2memory.result -> mysql-test/suite/ndb/r/ndb_dd_disk2memory.result mysql-test/suite/ndb/r/ndb_index.result: Rename: mysql-test/r/ndb_index.result -> mysql-test/suite/ndb/r/ndb_index.result mysql-test/suite/ndb/r/ndb_partition_key.result: Rename: mysql-test/r/ndb_partition_key.result -> mysql-test/suite/ndb/r/ndb_partition_key.result mysql-test/suite/ndb/r/strict_autoinc_5ndb.result: Rename: mysql-test/r/strict_autoinc_5ndb.result -> mysql-test/suite/ndb/r/strict_autoinc_5ndb.result mysql-test/suite/ndb/t/ndb_backup_print.test: Rename: mysql-test/t/ndb_backup_print.test -> mysql-test/suite/ndb/t/ndb_backup_print.test mysql-test/suite/ndb/t/ndb_binlog_basic2.test: Rename: mysql-test/t/ndb_binlog_basic2.test -> mysql-test/suite/ndb/t/ndb_binlog_basic2.test mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test: Rename: mysql-test/t/ndb_binlog_ignore_db.test -> mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test mysql-test/suite/ndb/t/ndb_insert.test: Rename: mysql-test/t/ndb_insert.test -> mysql-test/suite/ndb/t/ndb_insert.test mysql-test/suite/ndb/t/ndb_load.test: Rename: mysql-test/t/ndb_load.test -> mysql-test/suite/ndb/t/ndb_load.test mysql-test/suite/ndb/t/ndb_multi.test: Rename: mysql-test/t/ndb_multi.test -> mysql-test/suite/ndb/t/ndb_multi.test mysql-test/suite/ndb/t/ndb_partition_error.test: Rename: mysql-test/t/ndb_partition_error.test -> mysql-test/suite/ndb/t/ndb_partition_error.test mysql-test/suite/ndb/t/ndb_partition_error2.test: Rename: mysql-test/t/ndb_partition_error2.test -> mysql-test/suite/ndb/t/ndb_partition_error2.test mysql-test/suite/ndb/t/ndb_partition_key.test: Rename: mysql-test/t/ndb_partition_key.test -> mysql-test/suite/ndb/t/ndb_partition_key.test mysql-test/suite/ndb/t/ndb_rename.test: Rename: mysql-test/t/ndb_rename.test -> mysql-test/suite/ndb/t/ndb_rename.test mysql-test/suite/ndb/t/ndb_single_user.test: Rename: mysql-test/t/ndb_single_user.test -> mysql-test/suite/ndb/t/ndb_single_user.test mysql-test/suite/rpl/r/rpl000010.result: Rename: mysql-test/r/rpl000010.result -> mysql-test/suite/rpl/r/rpl000010.result mysql-test/suite/rpl/r/rpl_EE_err.result: Rename: mysql-test/r/rpl_EE_err.result -> mysql-test/suite/rpl/r/rpl_EE_err.result mysql-test/suite/rpl/r/rpl_ddl.result: Rename: mysql-test/r/rpl_ddl.result -> mysql-test/suite/rpl/r/rpl_ddl.result mysql-test/suite/rpl/r/rpl_deadlock_innodb.result: Rename: mysql-test/r/rpl_deadlock_innodb.result -> mysql-test/suite/rpl/r/rpl_deadlock_innodb.result mysql-test/suite/rpl/r/rpl_drop.result: Rename: mysql-test/r/rpl_drop.result -> mysql-test/suite/rpl/r/rpl_drop.result mysql-test/suite/rpl/r/rpl_drop_temp.result: Rename: mysql-test/r/rpl_drop_temp.result -> mysql-test/suite/rpl/r/rpl_drop_temp.result mysql-test/suite/rpl/r/rpl_many_optimize.result: Rename: mysql-test/r/rpl_many_optimize.result -> mysql-test/suite/rpl/r/rpl_many_optimize.result mysql-test/suite/rpl/r/rpl_multi_engine.result: Rename: mysql-test/r/rpl_multi_engine.result -> mysql-test/suite/rpl/r/rpl_multi_engine.result mysql-test/suite/rpl/r/rpl_packet.result: Rename: mysql-test/r/rpl_packet.result -> mysql-test/suite/rpl/r/rpl_packet.result mysql-test/suite/rpl/r/rpl_relayrotate.result: Rename: mysql-test/r/rpl_relayrotate.result -> mysql-test/suite/rpl/r/rpl_relayrotate.result mysql-test/suite/rpl/r/rpl_row_basic_8partition.result: Rename: mysql-test/r/rpl_row_basic_8partition.result -> mysql-test/suite/rpl/r/rpl_row_basic_8partition.result mysql-test/suite/rpl/r/rpl_row_log.result: Rename: mysql-test/r/rpl_row_log.result -> mysql-test/suite/rpl/r/rpl_row_log.result mysql-test/suite/rpl/r/rpl_row_sp003.result: Rename: mysql-test/r/rpl_row_sp003.result -> mysql-test/suite/rpl/r/rpl_row_sp003.result mysql-test/suite/rpl/r/rpl_row_view01.result: Rename: mysql-test/r/rpl_row_view01.result -> mysql-test/suite/rpl/r/rpl_row_view01.result mysql-test/suite/rpl/r/rpl_session_var.result: Rename: mysql-test/r/rpl_session_var.result -> mysql-test/suite/rpl/r/rpl_session_var.result mysql-test/suite/rpl/r/rpl_sporadic_master.result: Rename: mysql-test/r/rpl_sporadic_master.result -> mysql-test/suite/rpl/r/rpl_sporadic_master.result mysql-test/suite/rpl/r/rpl_udf.result: Rename: mysql-test/r/rpl_udf.result -> mysql-test/suite/rpl/r/rpl_udf.result mysql-test/suite/rpl/r/rpl_variables.result: Rename: mysql-test/r/rpl_variables.result -> mysql-test/suite/rpl/r/rpl_variables.result mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt: Rename: mysql-test/t/rpl_auto_increment-slave.opt -> mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt mysql-test/suite/rpl/t/rpl_auto_increment.test: Rename: mysql-test/t/rpl_auto_increment.test -> mysql-test/suite/rpl/t/rpl_auto_increment.test mysql-test/suite/rpl/t/rpl_bit.test: Rename: mysql-test/t/rpl_bit.test -> mysql-test/suite/rpl/t/rpl_bit.test mysql-test/suite/rpl/t/rpl_critical_errors.test: Rename: mysql-test/t/rpl_critical_errors.test -> mysql-test/suite/rpl/t/rpl_critical_errors.test mysql-test/suite/rpl/t/rpl_ddl.test: Rename: mysql-test/t/rpl_ddl.test -> mysql-test/suite/rpl/t/rpl_ddl.test mysql-test/suite/rpl/t/rpl_do_grant.test: Rename: mysql-test/t/rpl_do_grant.test -> mysql-test/suite/rpl/t/rpl_do_grant.test mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt: Rename: mysql-test/t/rpl_extraCol_innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt mysql-test/suite/rpl/t/rpl_ignore_revoke.test: Rename: mysql-test/t/rpl_ignore_revoke.test -> mysql-test/suite/rpl/t/rpl_ignore_revoke.test mysql-test/suite/rpl/t/rpl_init_slave-slave.opt: Rename: mysql-test/t/rpl_init_slave-slave.opt -> mysql-test/suite/rpl/t/rpl_init_slave-slave.opt mysql-test/suite/rpl/t/rpl_log_pos.test: Rename: mysql-test/t/rpl_log_pos.test -> mysql-test/suite/rpl/t/rpl_log_pos.test mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt: Rename: mysql-test/t/rpl_multi_delete2-slave.opt -> mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt mysql-test/suite/rpl/t/rpl_multi_update3.test: Rename: mysql-test/t/rpl_multi_update3.test -> mysql-test/suite/rpl/t/rpl_multi_update3.test mysql-test/suite/rpl/t/rpl_optimize.test: Rename: mysql-test/t/rpl_optimize.test -> mysql-test/suite/rpl/t/rpl_optimize.test mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test: Rename: mysql-test/t/rpl_rbr_to_sbr.test -> mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt: Rename: mysql-test/t/rpl_replicate_do-slave.opt -> mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt: Rename: mysql-test/t/rpl_rewrt_db-slave.opt -> mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh: Rename: mysql-test/t/rpl_rotate_logs-slave.sh -> mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh mysql-test/suite/rpl/t/rpl_row_UUID.test: Rename: mysql-test/t/rpl_row_UUID.test -> mysql-test/suite/rpl/t/rpl_row_UUID.test mysql-test/suite/rpl/t/rpl_row_blob_innodb.test: Rename: mysql-test/t/rpl_row_blob_innodb.test -> mysql-test/suite/rpl/t/rpl_row_blob_innodb.test mysql-test/suite/rpl/t/rpl_row_create_table.test: Rename: mysql-test/t/rpl_row_create_table.test -> mysql-test/suite/rpl/t/rpl_row_create_table.test mysql-test/suite/rpl/t/rpl_row_func002.test: Rename: mysql-test/t/rpl_row_func002.test -> mysql-test/suite/rpl/t/rpl_row_func002.test mysql-test/suite/rpl/t/rpl_row_log.test: Rename: mysql-test/t/rpl_row_log.test -> mysql-test/suite/rpl/t/rpl_row_log.test mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt: Rename: mysql-test/t/rpl_row_log_innodb-master.opt -> mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test: Rename: mysql-test/t/rpl_row_mysqlbinlog.test -> mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test mysql-test/suite/rpl/t/rpl_row_sp005.test: Rename: mysql-test/t/rpl_row_sp005.test -> mysql-test/suite/rpl/t/rpl_row_sp005.test mysql-test/suite/rpl/t/rpl_server_id2-slave.opt: Rename: mysql-test/t/rpl_server_id2-slave.opt -> mysql-test/suite/rpl/t/rpl_server_id2-slave.opt mysql-test/suite/rpl/t/rpl_sp.test: Rename: mysql-test/t/rpl_sp.test -> mysql-test/suite/rpl/t/rpl_sp.test mysql-test/suite/rpl/t/rpl_ssl.test: Rename: mysql-test/t/rpl_ssl.test -> mysql-test/suite/rpl/t/rpl_ssl.test mysql-test/suite/rpl/t/rpl_stm_EE_err2.test: Rename: mysql-test/t/rpl_stm_EE_err2.test -> mysql-test/suite/rpl/t/rpl_stm_EE_err2.test mysql-test/suite/rpl/t/rpl_stm_multi_query.test: Rename: mysql-test/t/rpl_stm_multi_query.test -> mysql-test/suite/rpl/t/rpl_stm_multi_query.test mysql-test/suite/rpl/t/rpl_udf-master.opt: Rename: mysql-test/t/rpl_udf-master.opt -> mysql-test/suite/rpl/t/rpl_udf-master.opt mysql-test/suite/rpl/t/rpl_udf.test: Rename: mysql-test/t/rpl_udf.test -> mysql-test/suite/rpl/t/rpl_udf.test mysql-test/suite/rpl/t/rpl_user_variables.test: Rename: mysql-test/t/rpl_user_variables.test -> mysql-test/suite/rpl/t/rpl_user_variables.test mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result: Rename: mysql-test/r/rpl_ndb_dd_basic.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result: Rename: mysql-test/r/rpl_ndb_ddl.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result: Rename: mysql-test/r/rpl_ndb_do_table.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result: Rename: mysql-test/r/rpl_ndb_func003.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result: Rename: mysql-test/r/rpl_ndb_load.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result: Rename: mysql-test/r/rpl_ndb_multi_update2.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result: Rename: mysql-test/r/rpl_ndb_multi_update3.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result: Rename: mysql-test/r/rpl_row_basic_7ndb.result -> mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt: Rename: mysql-test/t/rpl_ndb_2myisam-master.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test: Rename: mysql-test/t/rpl_ndb_auto_inc.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test: Rename: mysql-test/t/rpl_ndb_basic.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test: Rename: mysql-test/t/rpl_ndb_dd_partitions.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test: Rename: mysql-test/t/rpl_ndb_log.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt: Rename: mysql-test/t/rpl_ndb_myisam2ndb-master.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test: Rename: mysql-test/t/rpl_row_basic_7ndb.test -> mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result: Rename: mysql-test/r/binlog_row_drop_tmp_tbl.result -> mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result mysql-test/suite/binlog/r/binlog_row_innodb_stat.result: Rename: mysql-test/r/binlog_row_innodb_stat.result -> mysql-test/suite/binlog/r/binlog_row_innodb_stat.result mysql-test/suite/binlog/t/binlog_killed.test: Rename: mysql-test/t/binlog_killed.test -> mysql-test/suite/binlog/t/binlog_killed.test mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test: Rename: mysql-test/t/binlog_row_ctype_cp932.test -> mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test mysql-test/suite/binlog/t/binlog_row_insert_select.test: Rename: mysql-test/t/binlog_row_insert_select.test -> mysql-test/suite/binlog/t/binlog_row_insert_select.test mysql-test/suite/ndb/r/ndb_alter_table.result: Rename: mysql-test/r/ndb_alter_table.result -> mysql-test/suite/ndb/r/ndb_alter_table.result mysql-test/suite/ndb/r/ndb_binlog_multi.result: Rename: mysql-test/r/ndb_binlog_multi.result -> mysql-test/suite/ndb/r/ndb_binlog_multi.result mysql-test/suite/ndb/r/ndb_cache2.result: Rename: mysql-test/r/ndb_cache2.result -> mysql-test/suite/ndb/r/ndb_cache2.result mysql-test/suite/ndb/r/ndb_database.result: Rename: mysql-test/r/ndb_database.result -> mysql-test/suite/ndb/r/ndb_database.result mysql-test/suite/ndb/r/ndb_grant.result: Rename: mysql-test/r/ndb_grant.result -> mysql-test/suite/ndb/r/ndb_grant.result mysql-test/suite/ndb/r/ndb_restore.result: Rename: mysql-test/r/ndb_restore.result -> mysql-test/suite/ndb/r/ndb_restore.result mysql-test/suite/ndb/r/ndb_restore_partition.result: Rename: mysql-test/r/ndb_restore_partition.result -> mysql-test/suite/ndb/r/ndb_restore_partition.result mysql-test/suite/ndb/r/ndbapi.result: Rename: mysql-test/r/ndbapi.result -> mysql-test/suite/ndb/r/ndbapi.result mysql-test/suite/ndb/t/ndb_autodiscover2-master.opt: Rename: mysql-test/t/ndb_autodiscover2-master.opt -> mysql-test/suite/ndb/t/ndb_autodiscover2-master.opt mysql-test/suite/ndb/t/ndb_autodiscover2.test: Rename: mysql-test/t/ndb_autodiscover2.test -> mysql-test/suite/ndb/t/ndb_autodiscover2.test mysql-test/suite/ndb/t/ndb_index.test: Rename: mysql-test/t/ndb_index.test -> mysql-test/suite/ndb/t/ndb_index.test mysql-test/suite/ndb/t/ndb_lock.test: Rename: mysql-test/t/ndb_lock.test -> mysql-test/suite/ndb/t/ndb_lock.test mysql-test/suite/ndb/t/ndb_restore_compat.test: Rename: mysql-test/t/ndb_restore_compat.test -> mysql-test/suite/ndb/t/ndb_restore_compat.test mysql-test/suite/ndb/t/ndb_sp.test: Rename: mysql-test/t/ndb_sp.test -> mysql-test/suite/ndb/t/ndb_sp.test mysql-test/suite/ndb/t/ndb_subquery.test: Rename: mysql-test/t/ndb_subquery.test -> mysql-test/suite/ndb/t/ndb_subquery.test mysql-test/suite/ndb/t/ndb_temporary.test: Rename: mysql-test/t/ndb_temporary.test -> mysql-test/suite/ndb/t/ndb_temporary.test mysql-test/suite/rpl/r/rpl_LD_INFILE.result: Rename: mysql-test/r/rpl_LD_INFILE.result -> mysql-test/suite/rpl/r/rpl_LD_INFILE.result mysql-test/suite/rpl/r/rpl_auto_increment.result: Rename: mysql-test/r/rpl_auto_increment.result -> mysql-test/suite/rpl/r/rpl_auto_increment.result mysql-test/suite/rpl/r/rpl_create_database.result: Rename: mysql-test/r/rpl_create_database.result -> mysql-test/suite/rpl/r/rpl_create_database.result mysql-test/suite/rpl/r/rpl_critical_errors.result.txt: Rename: mysql-test/r/rpl_critical_errors.result.txt -> mysql-test/suite/rpl/r/rpl_critical_errors.result.txt mysql-test/suite/rpl/r/rpl_empty_master_crash.result: Rename: mysql-test/r/rpl_empty_master_crash.result -> mysql-test/suite/rpl/r/rpl_empty_master_crash.result mysql-test/suite/rpl/r/rpl_flushlog_loop.result: Rename: mysql-test/r/rpl_flushlog_loop.result -> mysql-test/suite/rpl/r/rpl_flushlog_loop.result mysql-test/suite/rpl/r/rpl_ignore_table.result: Rename: mysql-test/r/rpl_ignore_table.result -> mysql-test/suite/rpl/r/rpl_ignore_table.result mysql-test/suite/rpl/r/rpl_load_table_from_master.result: Rename: mysql-test/r/rpl_load_table_from_master.result -> mysql-test/suite/rpl/r/rpl_load_table_from_master.result mysql-test/suite/rpl/r/rpl_loaddata_simple.result: Rename: mysql-test/r/rpl_loaddata_simple.result -> mysql-test/suite/rpl/r/rpl_loaddata_simple.result mysql-test/suite/rpl/r/rpl_loaddatalocal.result: Rename: mysql-test/r/rpl_loaddatalocal.result -> mysql-test/suite/rpl/r/rpl_loaddatalocal.result mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result: Rename: mysql-test/r/rpl_rbr_to_sbr.result -> mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result mysql-test/suite/rpl/r/rpl_relay_space_myisam.result: Rename: mysql-test/r/rpl_relay_space_myisam.result -> mysql-test/suite/rpl/r/rpl_relay_space_myisam.result mysql-test/suite/rpl/r/rpl_rotate_logs.result: Rename: mysql-test/r/rpl_rotate_logs.result -> mysql-test/suite/rpl/r/rpl_rotate_logs.result mysql-test/suite/rpl/r/rpl_row_001.result: Rename: mysql-test/r/rpl_row_001.result -> mysql-test/suite/rpl/r/rpl_row_001.result mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt: Rename: mysql-test/r/rpl_row_basic_11bugs-master.opt -> mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt: Rename: mysql-test/r/rpl_row_basic_11bugs-slave.opt -> mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result: Rename: mysql-test/r/rpl_row_basic_3innodb.result -> mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result mysql-test/suite/rpl/r/rpl_row_delayed_ins.result: Rename: mysql-test/r/rpl_row_delayed_ins.result -> mysql-test/suite/rpl/r/rpl_row_delayed_ins.result mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result: Rename: mysql-test/r/rpl_row_mysqlbinlog.result -> mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result mysql-test/suite/rpl/r/rpl_row_mystery22.result: Rename: mysql-test/r/rpl_row_mystery22.result -> mysql-test/suite/rpl/r/rpl_row_mystery22.result mysql-test/suite/rpl/r/rpl_row_reset_slave.result: Rename: mysql-test/r/rpl_row_reset_slave.result -> mysql-test/suite/rpl/r/rpl_row_reset_slave.result mysql-test/suite/rpl/r/rpl_row_sp005.result: Rename: mysql-test/r/rpl_row_sp005.result -> mysql-test/suite/rpl/r/rpl_row_sp005.result mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result: Rename: mysql-test/r/rpl_row_tabledefs_7ndb.result -> mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result mysql-test/suite/rpl/r/rpl_server_id2.result: Rename: mysql-test/r/rpl_server_id2.result -> mysql-test/suite/rpl/r/rpl_server_id2.result mysql-test/suite/rpl/r/rpl_sp.result: Rename: mysql-test/r/rpl_sp.result -> mysql-test/suite/rpl/r/rpl_sp.result mysql-test/suite/rpl/r/rpl_temporary.result: Rename: mysql-test/r/rpl_temporary.result -> mysql-test/suite/rpl/r/rpl_temporary.result mysql-test/suite/rpl/r/rpl_trunc_temp.result: Rename: mysql-test/r/rpl_trunc_temp.result -> mysql-test/suite/rpl/r/rpl_trunc_temp.result mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result: Rename: mysql-test/r/rpl_truncate_7ndb_2.result -> mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result mysql-test/suite/rpl/r/rpl_user_variables.result: Rename: mysql-test/r/rpl_user_variables.result -> mysql-test/suite/rpl/r/rpl_user_variables.result mysql-test/suite/rpl/t/rpl000010-slave.opt: Rename: mysql-test/t/rpl000010-slave.opt -> mysql-test/suite/rpl/t/rpl000010-slave.opt mysql-test/suite/rpl/t/rpl_alter.test: Rename: mysql-test/t/rpl_alter.test -> mysql-test/suite/rpl/t/rpl_alter.test mysql-test/suite/rpl/t/rpl_deadlock_innodb.test: Rename: mysql-test/t/rpl_deadlock_innodb.test -> mysql-test/suite/rpl/t/rpl_deadlock_innodb.test mysql-test/suite/rpl/t/rpl_events.test: Rename: mysql-test/t/rpl_events.test -> mysql-test/suite/rpl/t/rpl_events.test mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt: Rename: mysql-test/t/rpl_ignore_revoke-slave.opt -> mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt: Rename: mysql-test/t/rpl_ignore_table-slave.opt -> mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt mysql-test/suite/rpl/t/rpl_insert.test: Rename: mysql-test/t/rpl_insert.test -> mysql-test/suite/rpl/t/rpl_insert.test mysql-test/suite/rpl/t/rpl_insert_id.test: Rename: mysql-test/t/rpl_insert_id.test -> mysql-test/suite/rpl/t/rpl_insert_id.test mysql-test/suite/rpl/t/rpl_insert_id_pk.test: Rename: mysql-test/t/rpl_insert_id_pk.test -> mysql-test/suite/rpl/t/rpl_insert_id_pk.test mysql-test/suite/rpl/t/rpl_insert_ignore.test: Rename: mysql-test/t/rpl_insert_ignore.test -> mysql-test/suite/rpl/t/rpl_insert_ignore.test mysql-test/suite/rpl/t/rpl_loaddata_charset.test: Rename: mysql-test/t/rpl_loaddata_charset.test -> mysql-test/suite/rpl/t/rpl_loaddata_charset.test mysql-test/suite/rpl/t/rpl_loaddata_simple.test: Rename: mysql-test/t/rpl_loaddata_simple.test -> mysql-test/suite/rpl/t/rpl_loaddata_simple.test mysql-test/suite/rpl/t/rpl_multi_delete2.test: Rename: mysql-test/t/rpl_multi_delete2.test -> mysql-test/suite/rpl/t/rpl_multi_delete2.test mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt: Rename: mysql-test/t/rpl_multi_engine-slave.opt -> mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt mysql-test/suite/rpl/t/rpl_read_only-slave.opt: Rename: mysql-test/t/rpl_read_only-slave.opt -> mysql-test/suite/rpl/t/rpl_read_only-slave.opt mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt: Rename: mysql-test/t/rpl_relayrotate-slave.opt -> mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt mysql-test/suite/rpl/t/rpl_replicate_do.test: Rename: mysql-test/t/rpl_replicate_do.test -> mysql-test/suite/rpl/t/rpl_replicate_do.test mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt: Rename: mysql-test/t/rpl_replicate_ignore_db-slave.opt -> mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt mysql-test/suite/rpl/t/rpl_row_001.test: Rename: mysql-test/t/rpl_row_001.test -> mysql-test/suite/rpl/t/rpl_row_001.test mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test: Rename: mysql-test/t/rpl_row_basic_2myisam.test -> mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt: Rename: mysql-test/t/rpl_row_basic_3innodb-slave.opt -> mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt mysql-test/suite/rpl/t/rpl_row_basic_8partition.test: Rename: mysql-test/t/rpl_row_basic_8partition.test -> mysql-test/suite/rpl/t/rpl_row_basic_8partition.test mysql-test/suite/rpl/t/rpl_row_charset.test: Rename: mysql-test/t/rpl_row_charset.test -> mysql-test/suite/rpl/t/rpl_row_charset.test mysql-test/suite/rpl/t/rpl_row_drop.test: Rename: mysql-test/t/rpl_row_drop.test -> mysql-test/suite/rpl/t/rpl_row_drop.test mysql-test/suite/rpl/t/rpl_row_trig004.test: Rename: mysql-test/t/rpl_row_trig004.test -> mysql-test/suite/rpl/t/rpl_row_trig004.test mysql-test/suite/rpl/t/rpl_row_view01.test: Rename: mysql-test/t/rpl_row_view01.test -> mysql-test/suite/rpl/t/rpl_row_view01.test mysql-test/suite/rpl/t/rpl_sp_effects-master.opt: Rename: mysql-test/t/rpl_sp_effects-master.opt -> mysql-test/suite/rpl/t/rpl_sp_effects-master.opt mysql-test/suite/rpl/t/rpl_stm_charset.test: Rename: mysql-test/t/rpl_stm_charset.test -> mysql-test/suite/rpl/t/rpl_stm_charset.test mysql-test/suite/rpl/t/rpl_stm_log-slave.opt: Rename: mysql-test/t/rpl_stm_log-slave.opt -> mysql-test/suite/rpl/t/rpl_stm_log-slave.opt mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt: Rename: mysql-test/t/rpl_truncate_7ndb_2-master.opt -> mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt mysql-test/suite/rpl/t/rpl_variables-master.opt: Rename: mysql-test/t/rpl_variables-master.opt -> mysql-test/suite/rpl/t/rpl_variables-master.opt mysql-test/suite/rpl/t/rpl_view-slave.opt: Rename: mysql-test/t/rpl_view-slave.opt -> mysql-test/suite/rpl/t/rpl_view-slave.opt mysql-test/suite/rpl/t/rpl_view.test: Rename: mysql-test/t/rpl_view.test -> mysql-test/suite/rpl/t/rpl_view.test mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result: Rename: mysql-test/r/rpl_ndb_charset.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result: Rename: mysql-test/r/rpl_ndb_circular_simplex.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result: Rename: mysql-test/r/rpl_ndb_dd_advance.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result: Rename: mysql-test/r/rpl_ndb_trig004.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt: Rename: mysql-test/t/rpl_ndb_2innodb-master.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test: Rename: mysql-test/t/rpl_ndb_UUID.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test: Rename: mysql-test/t/rpl_ndb_circular_simplex.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test: Rename: mysql-test/t/rpl_ndb_extraCol.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt: Rename: mysql-test/t/rpl_ndb_stm_innodb-master.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt mysql-test/suite/binlog/t/binlog_row_binlog.test: Rename: mysql-test/t/binlog_row_binlog.test -> mysql-test/suite/binlog/t/binlog_row_binlog.test mysql-test/suite/ndb/r/ndb_autodiscover.result: Rename: mysql-test/r/ndb_autodiscover.result -> mysql-test/suite/ndb/r/ndb_autodiscover.result mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result: Rename: mysql-test/r/ndb_binlog_ignore_db.result -> mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result mysql-test/suite/ndb/r/ndb_cache_multi.result: Rename: mysql-test/r/ndb_cache_multi.result -> mysql-test/suite/ndb/r/ndb_cache_multi.result mysql-test/suite/ndb/r/ndb_partition_error.result: Rename: mysql-test/r/ndb_partition_error.result -> mysql-test/suite/ndb/r/ndb_partition_error.result mysql-test/suite/ndb/r/ndb_read_multi_range.result: Rename: mysql-test/r/ndb_read_multi_range.result -> mysql-test/suite/ndb/r/ndb_read_multi_range.result mysql-test/suite/ndb/r/ndb_truncate.result: Rename: mysql-test/r/ndb_truncate.result -> mysql-test/suite/ndb/r/ndb_truncate.result mysql-test/suite/ndb/t/ndb_gis.test: Rename: mysql-test/t/ndb_gis.test -> mysql-test/suite/ndb/t/ndb_gis.test mysql-test/suite/ndb/t/ndb_grant.later: Rename: mysql-test/t/ndb_grant.later -> mysql-test/suite/ndb/t/ndb_grant.later mysql-test/suite/rpl/r/rpl_err_ignoredtable.result: Rename: mysql-test/r/rpl_err_ignoredtable.result -> mysql-test/suite/rpl/r/rpl_err_ignoredtable.result mysql-test/suite/rpl/r/rpl_ignore_grant.result: Rename: mysql-test/r/rpl_ignore_grant.result -> mysql-test/suite/rpl/r/rpl_ignore_grant.result mysql-test/suite/rpl/r/rpl_load_from_master.result: Rename: mysql-test/r/rpl_load_from_master.result -> mysql-test/suite/rpl/r/rpl_load_from_master.result mysql-test/suite/rpl/r/rpl_master_pos_wait.result: Rename: mysql-test/r/rpl_master_pos_wait.result -> mysql-test/suite/rpl/r/rpl_master_pos_wait.result mysql-test/suite/rpl/r/rpl_misc_functions.result: Rename: mysql-test/r/rpl_misc_functions.result -> mysql-test/suite/rpl/r/rpl_misc_functions.result mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result: Rename: mysql-test/r/rpl_row_basic_11bugs.result -> mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result mysql-test/suite/rpl/r/rpl_row_max_relay_size.result: Rename: mysql-test/r/rpl_row_max_relay_size.result -> mysql-test/suite/rpl/r/rpl_row_max_relay_size.result mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result: Rename: mysql-test/r/rpl_row_tabledefs_2myisam.result -> mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result mysql-test/suite/rpl/r/rpl_server_id1.result: Rename: mysql-test/r/rpl_server_id1.result -> mysql-test/suite/rpl/r/rpl_server_id1.result mysql-test/suite/rpl/r/rpl_sf.result: Rename: mysql-test/r/rpl_sf.result -> mysql-test/suite/rpl/r/rpl_sf.result mysql-test/suite/rpl/r/rpl_start_stop_slave.result: Rename: mysql-test/r/rpl_start_stop_slave.result -> mysql-test/suite/rpl/r/rpl_start_stop_slave.result mysql-test/suite/rpl/r/rpl_stm_reset_slave.result: Rename: mysql-test/r/rpl_stm_reset_slave.result -> mysql-test/suite/rpl/r/rpl_stm_reset_slave.result mysql-test/suite/rpl/r/rpl_stm_until.result: Rename: mysql-test/r/rpl_stm_until.result -> mysql-test/suite/rpl/r/rpl_stm_until.result mysql-test/suite/rpl/t/rpl_000015-slave.sh: Rename: mysql-test/t/rpl_000015-slave.sh -> mysql-test/suite/rpl/t/rpl_000015-slave.sh mysql-test/suite/rpl/t/rpl_change_master.test: Rename: mysql-test/t/rpl_change_master.test -> mysql-test/suite/rpl/t/rpl_change_master.test mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt: Rename: mysql-test/t/rpl_drop_temp-slave.opt -> mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt mysql-test/suite/rpl/t/rpl_multi_engine.test: Rename: mysql-test/t/rpl_multi_engine.test -> mysql-test/suite/rpl/t/rpl_multi_engine.test mysql-test/suite/rpl/t/rpl_relayspace-slave.opt: Rename: mysql-test/t/rpl_relayspace-slave.opt -> mysql-test/suite/rpl/t/rpl_relayspace-slave.opt mysql-test/suite/rpl/t/rpl_row_blob_myisam.test: Rename: mysql-test/t/rpl_row_blob_myisam.test -> mysql-test/suite/rpl/t/rpl_row_blob_myisam.test mysql-test/suite/rpl/t/rpl_row_sp009.test: Rename: mysql-test/t/rpl_row_sp009.test -> mysql-test/suite/rpl/t/rpl_row_sp009.test mysql-test/suite/rpl/t/rpl_row_sp010.test: Rename: mysql-test/t/rpl_row_sp010.test -> mysql-test/suite/rpl/t/rpl_row_sp010.test mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test: Rename: mysql-test/t/rpl_stm_insert_delayed.test -> mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test mysql-test/suite/rpl/t/rpl_stm_until.test: Rename: mysql-test/t/rpl_stm_until.test -> mysql-test/suite/rpl/t/rpl_stm_until.test mysql-test/suite/rpl/t/rpl_truncate_3innodb.test: Rename: mysql-test/t/rpl_truncate_3innodb.test -> mysql-test/suite/rpl/t/rpl_truncate_3innodb.test mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test: Rename: mysql-test/t/rpl_ndb_bank.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test: Rename: mysql-test/t/rpl_ndb_row_001.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test mysql-test/lib/mtr_cases.pl: Reorganize collect function to collect from more than one suite Add new function collect_one_suite Set name of test to . mysql-test/lib/mtr_report.pl: Determine name of files from "result_file" name mysql-test/mysql-test-run.pl: Collect tests from suites main, binlog, rpl, rpl_ndb and ndb as default. Add --suites as a synonym of --suite and allow a semicolon separated list of suite names to be passed to it. Determine name of files to cleanup from "result_file" name Update usage Add possibility to add a suite.opt file mysql-test/t/disabled.def: Move disabled testcases to their respective suite mysql-test/suite/funcs_1/t/suite.opt: New BitKeeper file ``mysql-test/suite/funcs_1/t/suite.opt'' mysql-test/suite/funcs_2/t/suite.opt: New BitKeeper file ``mysql-test/suite/funcs_2/t/suite.opt'' mysql-test/suite/ndb/t/disabled.def: New BitKeeper file ``mysql-test/suite/ndb/t/disabled.def'' mysql-test/suite/rpl/t/disabled.def: New BitKeeper file ``mysql-test/suite/rpl/t/disabled.def'' mysql-test/suite/rpl_ndb/t/disabled.def: New BitKeeper file ``mysql-test/suite/rpl_ndb/t/disabled.def'' --- mysql-test/lib/mtr_cases.pl | 311 +++++++++++------- mysql-test/lib/mtr_report.pl | 27 +- mysql-test/mysql-test-run.pl | 50 +-- .../{ => suite/binlog}/r/binlog_killed.result | 0 .../binlog}/r/binlog_row_binlog.result | 0 .../binlog}/r/binlog_row_blackhole.result | 0 .../binlog}/r/binlog_row_ctype_cp932.result | 0 .../binlog}/r/binlog_row_ctype_ucs.result | 0 .../binlog}/r/binlog_row_drop_tmp_tbl.result | 0 .../binlog}/r/binlog_row_innodb_stat.result | 0 .../binlog}/r/binlog_row_insert_select.result | 0 .../r/binlog_row_mix_innodb_myisam.result | 0 .../r/binlog_statement_insert_delayed.result | 0 .../binlog}/r/binlog_stm_binlog.result | 0 .../binlog}/r/binlog_stm_blackhole.result | 0 .../binlog}/r/binlog_stm_ctype_cp932.result | 0 .../binlog}/r/binlog_stm_ctype_ucs.result | 0 .../binlog}/r/binlog_stm_drop_tmp_tbl.result | 0 .../binlog}/r/binlog_stm_innodb_stat.result | 0 .../binlog}/r/binlog_stm_insert_select.result | 0 .../r/binlog_stm_mix_innodb_myisam.result | 0 .../{ => suite/binlog}/r/binlog_stm_ps.result | 0 .../{ => suite/binlog}/t/binlog_killed.test | 0 .../binlog}/t/binlog_row_binlog-master.opt | 0 .../binlog}/t/binlog_row_binlog.test | 0 .../binlog}/t/binlog_row_blackhole.test | 0 .../binlog}/t/binlog_row_ctype_cp932.test | 0 .../binlog}/t/binlog_row_ctype_ucs.test | 0 .../binlog}/t/binlog_row_drop_tmp_tbl.test | 0 .../t/binlog_row_innodb_stat-master.opt | 0 .../binlog}/t/binlog_row_innodb_stat.test | 0 .../binlog}/t/binlog_row_insert_select.test | 0 .../t/binlog_row_mix_innodb_myisam-master.opt | 0 .../t/binlog_row_mix_innodb_myisam.test | 0 .../t/binlog_statement_insert_delayed.test | 0 .../binlog}/t/binlog_stm_binlog-master.opt | 0 .../binlog}/t/binlog_stm_binlog.test | 0 .../binlog}/t/binlog_stm_blackhole.test | 0 .../binlog}/t/binlog_stm_ctype_cp932.test | 0 .../binlog}/t/binlog_stm_ctype_ucs.test | 0 .../binlog}/t/binlog_stm_drop_tmp_tbl.test | 0 .../t/binlog_stm_innodb_stat-master.opt | 0 .../binlog}/t/binlog_stm_innodb_stat.test | 0 .../binlog}/t/binlog_stm_insert_select.test | 0 .../t/binlog_stm_mix_innodb_myisam-master.opt | 0 .../t/binlog_stm_mix_innodb_myisam.test | 0 .../{ => suite/binlog}/t/binlog_stm_ps.test | 0 mysql-test/suite/funcs_1/t/suite.opt | 2 + mysql-test/suite/funcs_2/t/suite.opt | 2 + .../ndb}/r/loaddata_autocom_ndb.result | 0 .../{ => suite/ndb}/r/ndb_alter_table.result | 0 .../{ => suite/ndb}/r/ndb_alter_table2.result | 0 .../{ => suite/ndb}/r/ndb_alter_table3.result | 0 .../{ => suite/ndb}/r/ndb_autodiscover.result | 0 .../ndb}/r/ndb_autodiscover2.result | 0 .../ndb}/r/ndb_autodiscover3.result | 0 .../{ => suite/ndb}/r/ndb_backup_print.result | 0 mysql-test/{ => suite/ndb}/r/ndb_basic.result | 0 .../{ => suite/ndb}/r/ndb_binlog_basic.result | 0 .../ndb}/r/ndb_binlog_basic2.result | 0 .../ndb}/r/ndb_binlog_ddl_multi.result | 0 .../ndb}/r/ndb_binlog_discover.result | 0 .../ndb}/r/ndb_binlog_ignore_db.result | 0 .../ndb}/r/ndb_binlog_log_bin.result | 0 .../{ => suite/ndb}/r/ndb_binlog_multi.result | 0 .../{ => suite/ndb}/r/ndb_bitfield.result | 0 mysql-test/{ => suite/ndb}/r/ndb_blob.result | 0 .../ndb}/r/ndb_blob_partition.result | 0 mysql-test/{ => suite/ndb}/r/ndb_cache.result | 0 .../{ => suite/ndb}/r/ndb_cache2.result | 0 .../{ => suite/ndb}/r/ndb_cache_multi.result | 0 .../{ => suite/ndb}/r/ndb_cache_multi2.result | 0 .../{ => suite/ndb}/r/ndb_charset.result | 0 .../ndb}/r/ndb_condition_pushdown.result | 0 .../{ => suite/ndb}/r/ndb_config.result | 0 .../{ => suite/ndb}/r/ndb_config2.result | 0 .../{ => suite/ndb}/r/ndb_cursor.result | 0 .../{ => suite/ndb}/r/ndb_database.result | 0 .../{ => suite/ndb}/r/ndb_dd_alter.result | 0 .../ndb}/r/ndb_dd_backuprestore.result | 0 .../{ => suite/ndb}/r/ndb_dd_basic.result | 0 .../{ => suite/ndb}/r/ndb_dd_ddl.result | 0 .../ndb}/r/ndb_dd_disk2memory.result | 0 .../{ => suite/ndb}/r/ndb_dd_dump.result | 0 .../ndb}/r/ndb_dd_sql_features.result | 0 mysql-test/{ => suite/ndb}/r/ndb_gis.result | 0 mysql-test/{ => suite/ndb}/r/ndb_grant.result | 0 mysql-test/{ => suite/ndb}/r/ndb_index.result | 0 .../ndb}/r/ndb_index_ordered.result | 0 .../{ => suite/ndb}/r/ndb_index_unique.result | 0 .../{ => suite/ndb}/r/ndb_insert.result | 0 mysql-test/{ => suite/ndb}/r/ndb_limit.result | 0 mysql-test/{ => suite/ndb}/r/ndb_load.result | 0 .../ndb}/r/ndb_loaddatalocal.result | 0 mysql-test/{ => suite/ndb}/r/ndb_lock.result | 0 .../{ => suite/ndb}/r/ndb_minmax.result | 0 mysql-test/{ => suite/ndb}/r/ndb_multi.result | 0 .../{ => suite/ndb}/r/ndb_multi_row.result | 0 .../ndb}/r/ndb_partition_error.result | 0 .../ndb}/r/ndb_partition_error2.result | 0 .../ndb}/r/ndb_partition_key.result | 0 .../ndb}/r/ndb_partition_list.result | 0 .../ndb}/r/ndb_partition_range.result | 0 .../ndb}/r/ndb_read_multi_range.result | 0 .../{ => suite/ndb}/r/ndb_rename.result | 0 .../{ => suite/ndb}/r/ndb_replace.result | 0 .../{ => suite/ndb}/r/ndb_restore.result | 0 .../ndb}/r/ndb_restore_compat.result | 0 .../ndb}/r/ndb_restore_partition.result | 0 .../ndb}/r/ndb_restore_print.result | 0 .../{ => suite/ndb}/r/ndb_row_format.result | 0 .../{ => suite/ndb}/r/ndb_single_user.result | 0 mysql-test/{ => suite/ndb}/r/ndb_sp.result | 0 .../{ => suite/ndb}/r/ndb_subquery.result | 0 .../{ => suite/ndb}/r/ndb_temporary.result | 0 .../{ => suite/ndb}/r/ndb_transaction.result | 0 .../{ => suite/ndb}/r/ndb_trigger.result | 0 .../{ => suite/ndb}/r/ndb_truncate.result | 0 mysql-test/{ => suite/ndb}/r/ndb_types.result | 0 .../{ => suite/ndb}/r/ndb_update.result | 0 mysql-test/{ => suite/ndb}/r/ndb_view.result | 0 mysql-test/{ => suite/ndb}/r/ndbapi.result | 0 .../{ => suite/ndb}/r/partition_03ndb.result | 0 mysql-test/{ => suite/ndb}/r/ps_7ndb.result | 0 .../ndb}/r/strict_autoinc_5ndb.result | 0 mysql-test/suite/ndb/t/disabled.def | 23 ++ .../ndb}/t/loaddata_autocom_ndb.test | 0 .../{ => suite/ndb}/t/ndb_alter_table.test | 0 .../{ => suite/ndb}/t/ndb_alter_table2.test | 0 .../{ => suite/ndb}/t/ndb_alter_table3.test | 0 .../{ => suite/ndb}/t/ndb_autodiscover.test | 0 .../ndb}/t/ndb_autodiscover2-master.opt | 0 .../{ => suite/ndb}/t/ndb_autodiscover2.test | 0 .../{ => suite/ndb}/t/ndb_autodiscover3.test | 0 .../{ => suite/ndb}/t/ndb_backup_print.test | 0 mysql-test/{ => suite/ndb}/t/ndb_basic.test | 0 .../{ => suite/ndb}/t/ndb_binlog_basic.test | 0 .../{ => suite/ndb}/t/ndb_binlog_basic2.test | 0 .../ndb}/t/ndb_binlog_ddl_multi.test | 0 .../ndb}/t/ndb_binlog_discover.test | 0 .../ndb}/t/ndb_binlog_ignore_db-master.opt | 0 .../ndb}/t/ndb_binlog_ignore_db.test | 0 .../{ => suite/ndb}/t/ndb_binlog_log_bin.test | 0 .../{ => suite/ndb}/t/ndb_binlog_multi.test | 0 .../{ => suite/ndb}/t/ndb_bitfield.test | 0 mysql-test/{ => suite/ndb}/t/ndb_blob.test | 0 .../{ => suite/ndb}/t/ndb_blob_partition.test | 0 mysql-test/{ => suite/ndb}/t/ndb_cache.test | 0 mysql-test/{ => suite/ndb}/t/ndb_cache2.test | 0 .../{ => suite/ndb}/t/ndb_cache_multi.test | 0 .../{ => suite/ndb}/t/ndb_cache_multi2.test | 0 mysql-test/{ => suite/ndb}/t/ndb_charset.test | 0 .../ndb}/t/ndb_condition_pushdown.test | 0 mysql-test/{ => suite/ndb}/t/ndb_config.test | 0 mysql-test/{ => suite/ndb}/t/ndb_config2.test | 0 mysql-test/{ => suite/ndb}/t/ndb_cursor.test | 0 .../{ => suite/ndb}/t/ndb_database.test | 0 .../{ => suite/ndb}/t/ndb_dd_alter.test | 0 .../ndb}/t/ndb_dd_backuprestore.test | 0 .../{ => suite/ndb}/t/ndb_dd_basic.test | 0 mysql-test/{ => suite/ndb}/t/ndb_dd_ddl.test | 0 .../{ => suite/ndb}/t/ndb_dd_disk2memory.test | 0 mysql-test/{ => suite/ndb}/t/ndb_dd_dump.test | 0 .../ndb}/t/ndb_dd_sql_features.test | 0 mysql-test/{ => suite/ndb}/t/ndb_gis.test | 0 mysql-test/{ => suite/ndb}/t/ndb_grant.later | 0 mysql-test/{ => suite/ndb}/t/ndb_index.test | 0 .../{ => suite/ndb}/t/ndb_index_ordered.test | 0 .../{ => suite/ndb}/t/ndb_index_unique.test | 0 mysql-test/{ => suite/ndb}/t/ndb_insert.test | 0 mysql-test/{ => suite/ndb}/t/ndb_limit.test | 0 mysql-test/{ => suite/ndb}/t/ndb_load.test | 0 .../{ => suite/ndb}/t/ndb_loaddatalocal.test | 0 mysql-test/{ => suite/ndb}/t/ndb_lock.test | 0 mysql-test/{ => suite/ndb}/t/ndb_minmax.test | 0 mysql-test/{ => suite/ndb}/t/ndb_multi.test | 0 .../{ => suite/ndb}/t/ndb_multi_row.test | 0 .../ndb}/t/ndb_partition_error.test | 0 .../ndb}/t/ndb_partition_error2-master.opt | 0 .../ndb}/t/ndb_partition_error2.test | 0 .../{ => suite/ndb}/t/ndb_partition_key.test | 0 .../{ => suite/ndb}/t/ndb_partition_list.test | 0 .../ndb}/t/ndb_partition_range.test | 0 .../ndb}/t/ndb_read_multi_range.test | 0 mysql-test/{ => suite/ndb}/t/ndb_rename.test | 0 mysql-test/{ => suite/ndb}/t/ndb_replace.test | 0 mysql-test/{ => suite/ndb}/t/ndb_restore.test | 0 .../{ => suite/ndb}/t/ndb_restore_compat.test | 0 .../ndb}/t/ndb_restore_partition-master.opt | 0 .../ndb}/t/ndb_restore_partition.test | 0 .../{ => suite/ndb}/t/ndb_restore_print.test | 0 .../{ => suite/ndb}/t/ndb_row_format.test | 0 .../{ => suite/ndb}/t/ndb_single_user.test | 0 mysql-test/{ => suite/ndb}/t/ndb_sp.test | 0 .../{ => suite/ndb}/t/ndb_subquery.test | 0 .../{ => suite/ndb}/t/ndb_temporary.test | 0 .../{ => suite/ndb}/t/ndb_transaction.test | 0 mysql-test/{ => suite/ndb}/t/ndb_trigger.test | 0 .../{ => suite/ndb}/t/ndb_truncate.test | 0 mysql-test/{ => suite/ndb}/t/ndb_types.test | 0 mysql-test/{ => suite/ndb}/t/ndb_update.test | 0 mysql-test/{ => suite/ndb}/t/ndb_view.test | 0 mysql-test/{ => suite/ndb}/t/ndbapi.test | 0 .../{ => suite/ndb}/t/partition_03ndb.test | 0 mysql-test/{ => suite/ndb}/t/ps_7ndb.test | 0 .../ndb}/t/strict_autoinc_5ndb.test | 0 .../{ => suite/rpl}/r/rpl000001.a.result | 0 .../{ => suite/rpl}/r/rpl000001.b.result | 0 mysql-test/{ => suite/rpl}/r/rpl000010.result | 0 mysql-test/{ => suite/rpl}/r/rpl000011.result | 0 mysql-test/{ => suite/rpl}/r/rpl000013.result | 0 mysql-test/{ => suite/rpl}/r/rpl000017.result | 0 .../{ => suite/rpl}/r/rpl_000015.result | 0 .../{ => suite/rpl}/r/rpl_EE_err.result | 0 .../{ => suite/rpl}/r/rpl_LD_INFILE.result | 0 mysql-test/{ => suite/rpl}/r/rpl_alter.result | 0 .../{ => suite/rpl}/r/rpl_alter_db.result | 0 .../rpl}/r/rpl_auto_increment.result | 0 .../rpl}/r/rpl_auto_increment_11932.result | 0 mysql-test/{ => suite/rpl}/r/rpl_bit.result | 0 .../{ => suite/rpl}/r/rpl_bit_npk.result | 0 .../rpl}/r/rpl_change_master.result | 0 .../{ => suite/rpl}/r/rpl_charset_sjis.result | 0 .../rpl}/r/rpl_commit_after_flush.result | 0 .../rpl}/r/rpl_create_database.result | 0 .../rpl}/r/rpl_critical_errors.result | 0 .../rpl}/r/rpl_critical_errors.result.txt | 0 mysql-test/{ => suite/rpl}/r/rpl_ddl.result | 0 .../rpl}/r/rpl_deadlock_innodb.result | 0 .../rpl}/r/rpl_delete_no_where.result | 0 .../{ => suite/rpl}/r/rpl_do_grant.result | 0 mysql-test/{ => suite/rpl}/r/rpl_drop.result | 0 .../{ => suite/rpl}/r/rpl_drop_db.result | 0 .../{ => suite/rpl}/r/rpl_drop_temp.result | 0 .../rpl}/r/rpl_dual_pos_advance.result | 0 .../rpl}/r/rpl_empty_master_crash.result | 0 .../rpl}/r/rpl_err_ignoredtable.result | 0 .../{ => suite/rpl}/r/rpl_events.result | 0 .../rpl}/r/rpl_extraCol_innodb.result | 0 .../rpl}/r/rpl_extraCol_myisam.result | 0 .../rpl}/r/rpl_failed_optimize.result | 0 .../rpl}/r/rpl_flushlog_loop.result | 0 .../rpl}/r/rpl_foreign_key_innodb.result | 0 .../{ => suite/rpl}/r/rpl_free_items.result | 0 .../{ => suite/rpl}/r/rpl_get_lock.result | 0 .../{ => suite/rpl}/r/rpl_ignore_grant.result | 0 .../rpl}/r/rpl_ignore_revoke.result | 0 .../{ => suite/rpl}/r/rpl_ignore_table.result | 0 .../rpl}/r/rpl_ignore_table_update.result | 0 .../{ => suite/rpl}/r/rpl_incident.result | 0 .../{ => suite/rpl}/r/rpl_init_slave.result | 0 .../{ => suite/rpl}/r/rpl_innodb.result | 0 .../{ => suite/rpl}/r/rpl_insert.result | 0 .../{ => suite/rpl}/r/rpl_insert_id.result | 0 .../{ => suite/rpl}/r/rpl_insert_id_pk.result | 0 .../rpl}/r/rpl_insert_ignore.result | 0 .../rpl}/r/rpl_insert_select.result | 0 .../rpl}/r/rpl_known_bugs_detection.result | 0 .../rpl}/r/rpl_load_from_master.result | 0 .../rpl}/r/rpl_load_table_from_master.result | 0 .../{ => suite/rpl}/r/rpl_loaddata.result | 0 .../rpl}/r/rpl_loaddata_charset.result | 0 .../{ => suite/rpl}/r/rpl_loaddata_m.result | 0 .../{ => suite/rpl}/r/rpl_loaddata_s.result | 0 .../rpl}/r/rpl_loaddata_simple.result | 0 .../rpl}/r/rpl_loaddatalocal.result | 0 .../{ => suite/rpl}/r/rpl_loadfile.result | 0 .../{ => suite/rpl}/r/rpl_locale.result | 0 .../{ => suite/rpl}/r/rpl_log_pos.result | 0 .../rpl}/r/rpl_many_optimize.result | 0 .../rpl}/r/rpl_master_pos_wait.result | 0 .../rpl}/r/rpl_misc_functions.result | 0 .../rpl}/r/rpl_mixed_ddl_dml.result | 0 .../{ => suite/rpl}/r/rpl_multi_delete.result | 0 .../rpl}/r/rpl_multi_delete2.result | 0 .../{ => suite/rpl}/r/rpl_multi_engine.result | 0 .../{ => suite/rpl}/r/rpl_multi_update.result | 0 .../rpl}/r/rpl_multi_update2.result | 0 .../rpl}/r/rpl_multi_update3.result | 0 .../rpl}/r/rpl_multi_update4.result | 0 .../{ => suite/rpl}/r/rpl_optimize.result | 0 .../{ => suite/rpl}/r/rpl_packet.result | 0 mysql-test/{ => suite/rpl}/r/rpl_ps.result | 0 .../{ => suite/rpl}/r/rpl_rbr_to_sbr.result | 0 .../{ => suite/rpl}/r/rpl_read_only.result | 0 .../{ => suite/rpl}/r/rpl_redirect.result | 0 .../rpl}/r/rpl_relay_space_innodb.result | 0 .../rpl}/r/rpl_relay_space_myisam.result | 0 .../{ => suite/rpl}/r/rpl_relayrotate.result | 0 .../{ => suite/rpl}/r/rpl_relayspace.result | 0 .../{ => suite/rpl}/r/rpl_replicate_do.result | 0 .../rpl}/r/rpl_replicate_ignore_db.result | 0 .../{ => suite/rpl}/r/rpl_rewrt_db.result | 0 .../{ => suite/rpl}/r/rpl_rotate_logs.result | 0 .../{ => suite/rpl}/r/rpl_row_001.result | 0 .../{ => suite/rpl}/r/rpl_row_4_bytes.result | 0 .../{ => suite/rpl}/r/rpl_row_NOW.result | 0 .../{ => suite/rpl}/r/rpl_row_USER.result | 0 .../{ => suite/rpl}/r/rpl_row_UUID.result | 0 .../rpl}/r/rpl_row_basic_11bugs-master.opt | 0 .../rpl}/r/rpl_row_basic_11bugs-slave.opt | 0 .../rpl}/r/rpl_row_basic_11bugs.result | 0 .../rpl}/r/rpl_row_basic_2myisam.result | 0 .../rpl}/r/rpl_row_basic_3innodb.result | 0 .../rpl}/r/rpl_row_basic_8partition.result | 0 .../rpl}/r/rpl_row_blob_innodb.result | 0 .../rpl}/r/rpl_row_blob_myisam.result | 0 .../{ => suite/rpl}/r/rpl_row_charset.result | 0 .../rpl}/r/rpl_row_create_table.result | 0 .../rpl}/r/rpl_row_delayed_ins.result | 0 .../{ => suite/rpl}/r/rpl_row_drop.result | 0 .../rpl}/r/rpl_row_err_ignoredtable.result | 0 .../rpl}/r/rpl_row_flsh_tbls.result | 0 .../{ => suite/rpl}/r/rpl_row_func001.result | 0 .../{ => suite/rpl}/r/rpl_row_func002.result | 0 .../{ => suite/rpl}/r/rpl_row_func003.result | 0 .../rpl}/r/rpl_row_inexist_tbl.result | 0 .../rpl}/r/rpl_row_insert_delayed.result | 0 .../rpl}/r/rpl_row_loaddata_m.result | 0 .../{ => suite/rpl}/r/rpl_row_log.result | 0 .../rpl}/r/rpl_row_log_innodb.result | 0 .../rpl}/r/rpl_row_max_relay_size.result | 0 .../rpl}/r/rpl_row_multi_query.result | 0 .../rpl}/r/rpl_row_mysqlbinlog.result | 0 .../rpl}/r/rpl_row_mystery22.result | 0 .../rpl}/r/rpl_row_reset_slave.result | 0 .../{ => suite/rpl}/r/rpl_row_sp001.result | 0 .../rpl}/r/rpl_row_sp002_innodb.result | 0 .../{ => suite/rpl}/r/rpl_row_sp003.result | 0 .../{ => suite/rpl}/r/rpl_row_sp005.result | 0 .../rpl}/r/rpl_row_sp006_InnoDB.result | 0 .../rpl}/r/rpl_row_sp007_innodb.result | 0 .../{ => suite/rpl}/r/rpl_row_sp008.result | 0 .../{ => suite/rpl}/r/rpl_row_sp009.result | 0 .../{ => suite/rpl}/r/rpl_row_sp010.result | 0 .../{ => suite/rpl}/r/rpl_row_sp011.result | 0 .../{ => suite/rpl}/r/rpl_row_sp012.result | 0 .../rpl}/r/rpl_row_stop_middle.result | 0 .../rpl}/r/rpl_row_stop_middle_update.result | 0 .../rpl}/r/rpl_row_tabledefs_2myisam.result | 0 .../rpl}/r/rpl_row_tabledefs_3innodb.result | 0 .../rpl}/r/rpl_row_tabledefs_7ndb.result | 0 .../{ => suite/rpl}/r/rpl_row_trig001.result | 0 .../{ => suite/rpl}/r/rpl_row_trig002.result | 0 .../{ => suite/rpl}/r/rpl_row_trig003.result | 0 .../{ => suite/rpl}/r/rpl_row_trig004.result | 0 .../{ => suite/rpl}/r/rpl_row_until.result | 0 .../{ => suite/rpl}/r/rpl_row_view01.result | 0 .../{ => suite/rpl}/r/rpl_server_id1.result | 0 .../{ => suite/rpl}/r/rpl_server_id2.result | 0 .../{ => suite/rpl}/r/rpl_session_var.result | 0 .../{ => suite/rpl}/r/rpl_set_charset.result | 0 mysql-test/{ => suite/rpl}/r/rpl_sf.result | 0 .../{ => suite/rpl}/r/rpl_skip_error.result | 0 .../{ => suite/rpl}/r/rpl_slave_status.result | 0 mysql-test/{ => suite/rpl}/r/rpl_sp.result | 0 mysql-test/{ => suite/rpl}/r/rpl_sp004.result | 0 .../{ => suite/rpl}/r/rpl_sp_effects.result | 0 .../rpl}/r/rpl_sporadic_master.result | 0 mysql-test/{ => suite/rpl}/r/rpl_ssl.result | 0 mysql-test/{ => suite/rpl}/r/rpl_ssl1.result | 0 .../rpl}/r/rpl_start_stop_slave.result | 0 .../{ => suite/rpl}/r/rpl_stm_000001.result | 0 .../{ => suite/rpl}/r/rpl_stm_EE_err2.result | 0 .../{ => suite/rpl}/r/rpl_stm_charset.result | 0 .../rpl}/r/rpl_stm_flsh_tbls.result | 0 .../rpl}/r/rpl_stm_insert_delayed.result | 0 .../{ => suite/rpl}/r/rpl_stm_log.result | 0 .../rpl}/r/rpl_stm_max_relay_size.result | 0 .../rpl}/r/rpl_stm_multi_query.result | 0 .../rpl}/r/rpl_stm_mystery22.result | 0 .../{ => suite/rpl}/r/rpl_stm_no_op.result | 0 .../rpl}/r/rpl_stm_reset_slave.result | 0 .../{ => suite/rpl}/r/rpl_stm_until.result | 0 .../rpl}/r/rpl_switch_stm_row_mixed.result | 0 .../{ => suite/rpl}/r/rpl_temp_table.result | 0 .../{ => suite/rpl}/r/rpl_temporary.result | 0 .../{ => suite/rpl}/r/rpl_timezone.result | 0 .../{ => suite/rpl}/r/rpl_trigger.result | 0 .../{ => suite/rpl}/r/rpl_trunc_temp.result | 0 .../rpl}/r/rpl_truncate_2myisam.result | 0 .../rpl}/r/rpl_truncate_3innodb.result | 0 .../rpl}/r/rpl_truncate_7ndb_2.result | 0 mysql-test/{ => suite/rpl}/r/rpl_udf.result | 0 .../rpl}/r/rpl_user_variables.result | 0 .../{ => suite/rpl}/r/rpl_variables.result | 0 mysql-test/{ => suite/rpl}/r/rpl_view.result | 0 mysql-test/suite/rpl/t/disabled.def | 15 + .../{ => suite/rpl}/t/rpl000010-slave.opt | 0 mysql-test/{ => suite/rpl}/t/rpl000010.test | 0 mysql-test/{ => suite/rpl}/t/rpl000011.test | 0 mysql-test/{ => suite/rpl}/t/rpl000013.test | 0 .../{ => suite/rpl}/t/rpl000017-slave.opt | 0 .../{ => suite/rpl}/t/rpl000017-slave.sh | 0 mysql-test/{ => suite/rpl}/t/rpl000017.test | 0 .../{ => suite/rpl}/t/rpl000018-master.opt | 0 .../{ => suite/rpl}/t/rpl000018-slave.opt | 0 .../{ => suite/rpl}/t/rpl_000015-slave.sh | 0 .../{ => suite/rpl}/t/rpl_000015.slave-mi | 0 mysql-test/{ => suite/rpl}/t/rpl_000015.test | 0 mysql-test/{ => suite/rpl}/t/rpl_EE_err.test | 0 .../{ => suite/rpl}/t/rpl_LD_INFILE.test | 0 mysql-test/{ => suite/rpl}/t/rpl_alter.test | 0 .../{ => suite/rpl}/t/rpl_alter_db.test | 0 .../rpl}/t/rpl_auto_increment-master.opt | 0 .../rpl}/t/rpl_auto_increment-slave.opt | 0 .../{ => suite/rpl}/t/rpl_auto_increment.test | 0 .../rpl}/t/rpl_auto_increment_11932.test | 0 mysql-test/{ => suite/rpl}/t/rpl_bit.test | 0 mysql-test/{ => suite/rpl}/t/rpl_bit_npk.test | 0 .../{ => suite/rpl}/t/rpl_change_master.test | 0 .../{ => suite/rpl}/t/rpl_charset_sjis.test | 0 .../rpl}/t/rpl_commit_after_flush.test | 0 .../rpl}/t/rpl_create_database-master.opt | 0 .../rpl}/t/rpl_create_database-slave.opt | 0 .../rpl}/t/rpl_create_database.test | 0 .../rpl}/t/rpl_critical_errors.test | 0 mysql-test/{ => suite/rpl}/t/rpl_ddl.test | 0 .../rpl}/t/rpl_deadlock_innodb-slave.opt | 0 .../rpl}/t/rpl_deadlock_innodb.test | 0 .../rpl}/t/rpl_delete_no_where.test | 0 .../{ => suite/rpl}/t/rpl_do_grant.test | 0 mysql-test/{ => suite/rpl}/t/rpl_drop.test | 0 mysql-test/{ => suite/rpl}/t/rpl_drop_db.test | 0 .../{ => suite/rpl}/t/rpl_drop_temp-slave.opt | 0 .../{ => suite/rpl}/t/rpl_drop_temp.test | 0 .../rpl}/t/rpl_dual_pos_advance-master.opt | 0 .../rpl}/t/rpl_dual_pos_advance.test | 0 .../rpl}/t/rpl_empty_master_crash-master.opt | 0 .../rpl}/t/rpl_empty_master_crash.test | 0 .../rpl}/t/rpl_err_ignoredtable-slave.opt | 0 .../rpl}/t/rpl_err_ignoredtable.test | 0 mysql-test/{ => suite/rpl}/t/rpl_events.test | 0 .../rpl}/t/rpl_extraCol_innodb-master.opt | 0 .../rpl}/t/rpl_extraCol_innodb-slave.opt | 0 .../rpl}/t/rpl_extraCol_innodb.test | 0 .../rpl}/t/rpl_extraCol_myisam.test | 0 .../rpl}/t/rpl_failed_optimize-master.opt | 0 .../rpl}/t/rpl_failed_optimize.test | 0 .../rpl}/t/rpl_flushlog_loop-master.opt | 0 .../rpl}/t/rpl_flushlog_loop-master.sh | 0 .../rpl}/t/rpl_flushlog_loop-slave.opt | 0 .../rpl}/t/rpl_flushlog_loop-slave.sh | 0 .../{ => suite/rpl}/t/rpl_flushlog_loop.test | 0 .../rpl}/t/rpl_foreign_key_innodb-slave.opt | 0 .../rpl}/t/rpl_foreign_key_innodb.test | 0 .../rpl}/t/rpl_free_items-slave.opt | 0 .../{ => suite/rpl}/t/rpl_free_items.test | 0 .../{ => suite/rpl}/t/rpl_get_lock.test | 0 .../rpl}/t/rpl_ignore_grant-slave.opt | 0 .../{ => suite/rpl}/t/rpl_ignore_grant.test | 0 .../rpl}/t/rpl_ignore_revoke-slave.opt | 0 .../{ => suite/rpl}/t/rpl_ignore_revoke.test | 0 .../rpl}/t/rpl_ignore_table-slave.opt | 0 .../{ => suite/rpl}/t/rpl_ignore_table.test | 0 .../rpl}/t/rpl_ignore_table_update-slave.opt | 0 .../rpl}/t/rpl_ignore_table_update.test | 0 .../{ => suite/rpl}/t/rpl_incident-master.opt | 0 .../{ => suite/rpl}/t/rpl_incident.test | 0 .../rpl}/t/rpl_init_slave-slave.opt | 0 .../{ => suite/rpl}/t/rpl_init_slave.test | 0 mysql-test/{ => suite/rpl}/t/rpl_innodb.test | 0 mysql-test/{ => suite/rpl}/t/rpl_insert.test | 0 .../{ => suite/rpl}/t/rpl_insert_id-slave.opt | 0 .../{ => suite/rpl}/t/rpl_insert_id.test | 0 .../rpl}/t/rpl_insert_id_pk-slave.opt | 0 .../{ => suite/rpl}/t/rpl_insert_id_pk.test | 0 .../rpl}/t/rpl_insert_ignore-slave.opt | 0 .../{ => suite/rpl}/t/rpl_insert_ignore.test | 0 .../{ => suite/rpl}/t/rpl_insert_select.test | 0 .../t/rpl_known_bugs_detection-master.opt | 0 .../rpl}/t/rpl_known_bugs_detection.test | 0 .../rpl}/t/rpl_load_from_master-slave.opt | 0 .../rpl}/t/rpl_load_from_master.test | 0 .../rpl}/t/rpl_load_table_from_master.test | 0 .../{ => suite/rpl}/t/rpl_loaddata.test | 0 .../rpl}/t/rpl_loaddata_charset.test | 0 .../rpl}/t/rpl_loaddata_m-master.opt | 0 .../{ => suite/rpl}/t/rpl_loaddata_m.test | 0 .../rpl}/t/rpl_loaddata_s-slave.opt | 0 .../{ => suite/rpl}/t/rpl_loaddata_s.test | 0 .../rpl}/t/rpl_loaddata_simple.test | 0 .../{ => suite/rpl}/t/rpl_loaddatalocal.test | 0 .../{ => suite/rpl}/t/rpl_loadfile.test | 0 mysql-test/{ => suite/rpl}/t/rpl_locale.test | 0 mysql-test/{ => suite/rpl}/t/rpl_log_pos.test | 0 .../{ => suite/rpl}/t/rpl_many_optimize.test | 0 .../rpl}/t/rpl_master_pos_wait.test | 0 .../rpl}/t/rpl_misc_functions-slave.sh | 0 .../{ => suite/rpl}/t/rpl_misc_functions.test | 0 .../{ => suite/rpl}/t/rpl_mixed_ddl_dml.test | 0 .../rpl}/t/rpl_multi_delete-slave.opt | 0 .../{ => suite/rpl}/t/rpl_multi_delete.test | 0 .../rpl}/t/rpl_multi_delete2-slave.opt | 0 .../{ => suite/rpl}/t/rpl_multi_delete2.test | 0 .../rpl}/t/rpl_multi_engine-slave.opt | 0 .../{ => suite/rpl}/t/rpl_multi_engine.test | 0 .../{ => suite/rpl}/t/rpl_multi_update.test | 0 .../rpl}/t/rpl_multi_update2-slave.opt | 0 .../{ => suite/rpl}/t/rpl_multi_update2.test | 0 .../{ => suite/rpl}/t/rpl_multi_update3.test | 0 .../rpl}/t/rpl_multi_update4-slave.opt | 0 .../{ => suite/rpl}/t/rpl_multi_update4.test | 0 .../{ => suite/rpl}/t/rpl_optimize.test | 0 .../{ => suite/rpl}/t/rpl_packet-master.opt | 0 .../{ => suite/rpl}/t/rpl_packet-slave.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_packet.test | 0 mysql-test/{ => suite/rpl}/t/rpl_ps.test | 0 .../{ => suite/rpl}/t/rpl_rbr_to_sbr.test | 0 .../{ => suite/rpl}/t/rpl_read_only-slave.opt | 0 .../{ => suite/rpl}/t/rpl_read_only.test | 0 .../{ => suite/rpl}/t/rpl_redirect.test | 0 .../rpl}/t/rpl_relay_space_innodb-master.opt | 0 .../rpl}/t/rpl_relay_space_innodb-slave.opt | 0 .../rpl}/t/rpl_relay_space_innodb.test | 0 .../rpl}/t/rpl_relay_space_myisam.test | 0 .../rpl}/t/rpl_relayrotate-slave.opt | 0 .../{ => suite/rpl}/t/rpl_relayrotate.test | 0 .../rpl}/t/rpl_relayspace-slave.opt | 0 .../{ => suite/rpl}/t/rpl_relayspace.test | 0 .../rpl}/t/rpl_replicate_do-slave.opt | 0 .../{ => suite/rpl}/t/rpl_replicate_do.test | 0 .../rpl}/t/rpl_replicate_ignore_db-slave.opt | 0 .../rpl}/t/rpl_replicate_ignore_db.test | 0 .../{ => suite/rpl}/t/rpl_rewrt_db-slave.opt | 0 .../{ => suite/rpl}/t/rpl_rewrt_db.test | 0 .../rpl}/t/rpl_rotate_logs-master.opt | 0 .../rpl}/t/rpl_rotate_logs-slave.sh | 0 .../rpl}/t/rpl_rotate_logs.slave-mi | 0 .../{ => suite/rpl}/t/rpl_rotate_logs.test | 0 mysql-test/{ => suite/rpl}/t/rpl_row_001.test | 0 .../rpl}/t/rpl_row_4_bytes-master.opt | 0 .../{ => suite/rpl}/t/rpl_row_4_bytes.test | 0 mysql-test/{ => suite/rpl}/t/rpl_row_NOW.test | 0 .../{ => suite/rpl}/t/rpl_row_USER.test | 0 .../{ => suite/rpl}/t/rpl_row_UUID.test | 0 .../rpl}/t/rpl_row_basic_11bugs-master.opt | 0 .../rpl}/t/rpl_row_basic_11bugs-slave.opt | 0 .../rpl}/t/rpl_row_basic_11bugs.test | 0 .../rpl}/t/rpl_row_basic_2myisam.test | 0 .../rpl}/t/rpl_row_basic_3innodb-slave.opt | 0 .../rpl}/t/rpl_row_basic_3innodb.test | 0 .../rpl}/t/rpl_row_basic_8partition.test | 0 .../rpl}/t/rpl_row_blob_innodb-slave.opt | 0 .../rpl}/t/rpl_row_blob_innodb.test | 0 .../rpl}/t/rpl_row_blob_myisam.test | 0 .../{ => suite/rpl}/t/rpl_row_charset.test | 0 .../rpl}/t/rpl_row_create_table-slave.opt | 0 .../rpl}/t/rpl_row_create_table.test | 0 .../rpl}/t/rpl_row_delayed_ins.test | 0 .../{ => suite/rpl}/t/rpl_row_drop.test | 0 .../rpl}/t/rpl_row_err_daisychain-master.opt | 0 .../rpl}/t/rpl_row_err_daisychain-slave.opt | 0 .../{ => suite/rpl}/t/rpl_row_flsh_tbls.test | 0 .../{ => suite/rpl}/t/rpl_row_func001.test | 0 .../{ => suite/rpl}/t/rpl_row_func002.test | 0 .../rpl}/t/rpl_row_func003-slave.opt | 0 .../{ => suite/rpl}/t/rpl_row_func003.test | 0 .../rpl}/t/rpl_row_inexist_tbl-slave.opt | 0 .../rpl}/t/rpl_row_inexist_tbl.test | 0 .../rpl}/t/rpl_row_insert_delayed.test | 0 .../{ => suite/rpl}/t/rpl_row_log-master.opt | 0 .../{ => suite/rpl}/t/rpl_row_log-slave.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_row_log.test | 0 .../rpl}/t/rpl_row_log_innodb-master.opt | 0 .../rpl}/t/rpl_row_log_innodb-slave.opt | 0 .../{ => suite/rpl}/t/rpl_row_log_innodb.test | 0 .../rpl}/t/rpl_row_max_relay_size.test | 0 .../rpl}/t/rpl_row_mysqlbinlog-master.opt | 0 .../rpl}/t/rpl_row_mysqlbinlog.test | 0 .../{ => suite/rpl}/t/rpl_row_mystery22.test | 0 .../rpl}/t/rpl_row_reset_slave.test | 0 .../{ => suite/rpl}/t/rpl_row_sp001.test | 0 .../rpl}/t/rpl_row_sp002_innodb-master.opt | 0 .../rpl}/t/rpl_row_sp002_innodb-slave.opt | 0 .../rpl}/t/rpl_row_sp002_innodb.test | 0 .../rpl}/t/rpl_row_sp003-master.opt | 0 .../{ => suite/rpl}/t/rpl_row_sp003-slave.opt | 0 .../{ => suite/rpl}/t/rpl_row_sp003.test | 0 .../{ => suite/rpl}/t/rpl_row_sp005.test | 0 .../rpl}/t/rpl_row_sp006_InnoDB-slave.opt | 0 .../rpl}/t/rpl_row_sp006_InnoDB.test | 0 .../rpl}/t/rpl_row_sp007_innodb-slave.opt | 0 .../rpl}/t/rpl_row_sp007_innodb.test | 0 .../{ => suite/rpl}/t/rpl_row_sp008.test | 0 .../{ => suite/rpl}/t/rpl_row_sp009.test | 0 .../{ => suite/rpl}/t/rpl_row_sp010.test | 0 .../{ => suite/rpl}/t/rpl_row_sp011.test | 0 .../{ => suite/rpl}/t/rpl_row_sp012.test | 0 .../rpl}/t/rpl_row_stop_middle.test | 0 .../t/rpl_row_stop_middle_update-master.opt | 0 .../t/rpl_row_stop_middle_update-slave.opt | 0 .../rpl}/t/rpl_row_stop_middle_update.test | 0 .../rpl}/t/rpl_row_tabledefs_2myisam.test | 0 .../t/rpl_row_tabledefs_3innodb-slave.opt | 0 .../rpl}/t/rpl_row_tabledefs_3innodb.test | 0 .../{ => suite/rpl}/t/rpl_row_trig001.test | 0 .../{ => suite/rpl}/t/rpl_row_trig002.test | 0 .../{ => suite/rpl}/t/rpl_row_trig003.test | 0 .../{ => suite/rpl}/t/rpl_row_trig004.test | 0 .../{ => suite/rpl}/t/rpl_row_until.test | 0 .../{ => suite/rpl}/t/rpl_row_view01.test | 0 .../{ => suite/rpl}/t/rpl_server_id1.test | 0 .../rpl}/t/rpl_server_id2-slave.opt | 0 .../{ => suite/rpl}/t/rpl_server_id2.test | 0 .../{ => suite/rpl}/t/rpl_session_var.test | 0 .../{ => suite/rpl}/t/rpl_set_charset.test | 0 mysql-test/{ => suite/rpl}/t/rpl_sf.test | 0 .../rpl}/t/rpl_skip_error-slave.opt | 0 .../{ => suite/rpl}/t/rpl_skip_error.test | 0 .../{ => suite/rpl}/t/rpl_slave_status.test | 0 .../{ => suite/rpl}/t/rpl_sp-master.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_sp-slave.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_sp.test | 0 mysql-test/{ => suite/rpl}/t/rpl_sp004.test | 0 .../rpl}/t/rpl_sp_effects-master.opt | 0 .../rpl}/t/rpl_sp_effects-slave.opt | 0 .../{ => suite/rpl}/t/rpl_sp_effects.test | 0 .../rpl}/t/rpl_sporadic_master-master.opt | 0 .../rpl}/t/rpl_sporadic_master.test | 0 mysql-test/{ => suite/rpl}/t/rpl_ssl.test | 0 mysql-test/{ => suite/rpl}/t/rpl_ssl1.test | 0 .../rpl}/t/rpl_start_stop_slave.test | 0 .../rpl}/t/rpl_stm_000001-slave.opt | 0 .../{ => suite/rpl}/t/rpl_stm_000001.test | 0 .../{ => suite/rpl}/t/rpl_stm_EE_err2.test | 0 .../{ => suite/rpl}/t/rpl_stm_charset.test | 0 .../{ => suite/rpl}/t/rpl_stm_flsh_tbls.test | 0 .../rpl}/t/rpl_stm_insert_delayed.test | 0 .../{ => suite/rpl}/t/rpl_stm_log-master.opt | 0 .../{ => suite/rpl}/t/rpl_stm_log-slave.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_stm_log.test | 0 .../rpl}/t/rpl_stm_max_relay_size.test | 0 .../rpl}/t/rpl_stm_multi_query.test | 0 .../{ => suite/rpl}/t/rpl_stm_mystery22.test | 0 .../{ => suite/rpl}/t/rpl_stm_no_op.test | 0 .../rpl}/t/rpl_stm_reset_slave.test | 0 .../{ => suite/rpl}/t/rpl_stm_until.test | 0 .../rpl}/t/rpl_switch_stm_row_mixed.test | 0 .../{ => suite/rpl}/t/rpl_temp_table.test | 0 .../{ => suite/rpl}/t/rpl_temporary.test | 0 .../{ => suite/rpl}/t/rpl_timezone-master.opt | 0 .../{ => suite/rpl}/t/rpl_timezone-slave.opt | 0 .../{ => suite/rpl}/t/rpl_timezone.test | 0 mysql-test/{ => suite/rpl}/t/rpl_trigger.test | 0 .../{ => suite/rpl}/t/rpl_trunc_temp.test | 0 .../rpl}/t/rpl_truncate_2myisam.test | 0 .../rpl}/t/rpl_truncate_3innodb.test | 0 .../rpl}/t/rpl_truncate_7ndb_2-master.opt | 0 .../rpl}/t/rpl_truncate_7ndb_2.test | 0 .../{ => suite/rpl}/t/rpl_udf-master.opt | 0 .../{ => suite/rpl}/t/rpl_udf-slave.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_udf.test | 0 .../{ => suite/rpl}/t/rpl_user_variables.test | 0 .../rpl}/t/rpl_variables-master.opt | 0 .../{ => suite/rpl}/t/rpl_variables.test | 0 .../{ => suite/rpl}/t/rpl_view-slave.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_view.test | 0 .../rpl_ndb}/r/rpl_ndb_2innodb.result | 0 .../rpl_ndb}/r/rpl_ndb_2myisam.result | 0 .../{ => suite/rpl_ndb}/r/rpl_ndb_UUID.result | 0 .../rpl_ndb}/r/rpl_ndb_auto_inc.result | 0 .../{ => suite/rpl_ndb}/r/rpl_ndb_bank.result | 0 .../rpl_ndb}/r/rpl_ndb_basic.result | 0 .../{ => suite/rpl_ndb}/r/rpl_ndb_blob.result | 0 .../rpl_ndb}/r/rpl_ndb_blob2.result | 0 .../rpl_ndb}/r/rpl_ndb_charset.result | 0 .../rpl_ndb}/r/rpl_ndb_circular.result | 0 .../r/rpl_ndb_circular_simplex.result | 0 .../r/rpl_ndb_commit_afterflush.result | 0 .../rpl_ndb}/r/rpl_ndb_dd_advance.result | 0 .../rpl_ndb}/r/rpl_ndb_dd_basic.result | 0 .../rpl_ndb}/r/rpl_ndb_dd_partitions.result | 0 .../{ => suite/rpl_ndb}/r/rpl_ndb_ddl.result | 0 .../rpl_ndb}/r/rpl_ndb_delete_nowhere.result | 0 .../rpl_ndb}/r/rpl_ndb_do_db.result | 0 .../rpl_ndb}/r/rpl_ndb_do_table.result | 0 .../rpl_ndb}/r/rpl_ndb_extraCol.result | 0 .../rpl_ndb}/r/rpl_ndb_func003.result | 0 .../rpl_ndb}/r/rpl_ndb_idempotent.result | 0 .../rpl_ndb}/r/rpl_ndb_innodb_trans.result | 0 .../rpl_ndb}/r/rpl_ndb_insert_ignore.result | 0 .../{ => suite/rpl_ndb}/r/rpl_ndb_load.result | 0 .../{ => suite/rpl_ndb}/r/rpl_ndb_log.result | 0 .../rpl_ndb}/r/rpl_ndb_multi.result | 0 .../rpl_ndb}/r/rpl_ndb_multi_update2.result | 0 .../rpl_ndb}/r/rpl_ndb_multi_update3.result | 0 .../rpl_ndb}/r/rpl_ndb_relayrotate.result | 0 .../rpl_ndb}/r/rpl_ndb_rep_ignore.result | 0 .../rpl_ndb}/r/rpl_ndb_row_001.result | 0 .../rpl_ndb}/r/rpl_ndb_sp003.result | 0 .../rpl_ndb}/r/rpl_ndb_sp006.result | 0 .../rpl_ndb}/r/rpl_ndb_stm_innodb.result | 0 .../{ => suite/rpl_ndb}/r/rpl_ndb_sync.result | 0 .../rpl_ndb}/r/rpl_ndb_trig004.result | 0 .../rpl_ndb}/r/rpl_ndbapi_multi.result | 0 .../rpl_ndb}/r/rpl_row_basic_7ndb.result | 0 .../rpl_ndb}/r/rpl_truncate_7ndb.result | 0 mysql-test/suite/rpl_ndb/t/disabled.def | 27 ++ .../rpl_ndb}/t/rpl_ndb_2innodb-master.opt | 0 .../rpl_ndb}/t/rpl_ndb_2innodb-slave.opt | 0 .../rpl_ndb}/t/rpl_ndb_2innodb.test | 0 .../rpl_ndb}/t/rpl_ndb_2myisam-master.opt | 0 .../rpl_ndb}/t/rpl_ndb_2myisam-slave.opt | 0 .../rpl_ndb}/t/rpl_ndb_2myisam.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_UUID.test | 0 .../rpl_ndb}/t/rpl_ndb_auto_inc.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_bank.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_basic.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_blob.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_blob2.test | 0 .../rpl_ndb}/t/rpl_ndb_charset.test | 0 .../rpl_ndb}/t/rpl_ndb_circular.test | 0 .../rpl_ndb}/t/rpl_ndb_circular_simplex.test | 0 .../rpl_ndb}/t/rpl_ndb_commit_afterflush.test | 0 .../rpl_ndb}/t/rpl_ndb_dd_advance.test | 0 .../rpl_ndb}/t/rpl_ndb_dd_basic.test | 0 .../rpl_ndb}/t/rpl_ndb_dd_partitions.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_ddl.test | 0 .../rpl_ndb}/t/rpl_ndb_delete_nowhere.test | 0 .../rpl_ndb}/t/rpl_ndb_do_db-slave.opt | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_do_db.test | 0 .../rpl_ndb}/t/rpl_ndb_do_table-slave.opt | 0 .../rpl_ndb}/t/rpl_ndb_do_table.test | 0 .../rpl_ndb}/t/rpl_ndb_extraCol.test | 0 .../rpl_ndb}/t/rpl_ndb_func003.test | 0 .../rpl_ndb}/t/rpl_ndb_idempotent.test | 0 .../rpl_ndb}/t/rpl_ndb_innodb2ndb-master.opt | 0 .../rpl_ndb}/t/rpl_ndb_innodb2ndb-slave.opt | 0 .../rpl_ndb}/t/rpl_ndb_innodb2ndb.test | 0 .../rpl_ndb}/t/rpl_ndb_innodb_trans-slave.opt | 0 .../rpl_ndb}/t/rpl_ndb_innodb_trans.test | 0 .../rpl_ndb}/t/rpl_ndb_insert_ignore.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_load.test | 0 .../rpl_ndb}/t/rpl_ndb_log-master.opt | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_log.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_multi.test | 0 .../t/rpl_ndb_multi_update2-slave.opt | 0 .../rpl_ndb}/t/rpl_ndb_multi_update2.test | 0 .../rpl_ndb}/t/rpl_ndb_multi_update3.test | 0 .../rpl_ndb}/t/rpl_ndb_myisam2ndb-master.opt | 0 .../rpl_ndb}/t/rpl_ndb_myisam2ndb-slave.opt | 0 .../rpl_ndb}/t/rpl_ndb_myisam2ndb.test | 0 .../rpl_ndb}/t/rpl_ndb_relayrotate-slave.opt | 0 .../rpl_ndb}/t/rpl_ndb_relayrotate.test | 0 .../rpl_ndb}/t/rpl_ndb_rep_ignore-slave.opt | 0 .../rpl_ndb}/t/rpl_ndb_rep_ignore.test | 0 .../rpl_ndb}/t/rpl_ndb_row_001.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_sp003.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_sp006.test | 0 .../rpl_ndb}/t/rpl_ndb_stm_innodb-master.opt | 0 .../rpl_ndb}/t/rpl_ndb_stm_innodb.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_sync.test | 0 .../rpl_ndb}/t/rpl_ndb_trig004.test | 0 .../rpl_ndb}/t/rpl_ndbapi_multi.test | 0 .../rpl_ndb}/t/rpl_row_basic_7ndb.test | 0 .../rpl_ndb}/t/rpl_truncate_7ndb.test | 0 mysql-test/t/disabled.def | 23 -- 758 files changed, 278 insertions(+), 202 deletions(-) rename mysql-test/{ => suite/binlog}/r/binlog_killed.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_row_binlog.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_row_blackhole.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_row_ctype_cp932.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_row_ctype_ucs.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_row_drop_tmp_tbl.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_row_innodb_stat.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_row_insert_select.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_row_mix_innodb_myisam.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_statement_insert_delayed.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_stm_binlog.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_stm_blackhole.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_stm_ctype_cp932.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_stm_ctype_ucs.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_stm_drop_tmp_tbl.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_stm_innodb_stat.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_stm_insert_select.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_stm_mix_innodb_myisam.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_stm_ps.result (100%) rename mysql-test/{ => suite/binlog}/t/binlog_killed.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_binlog-master.opt (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_binlog.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_blackhole.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_ctype_cp932.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_ctype_ucs.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_drop_tmp_tbl.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_innodb_stat-master.opt (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_innodb_stat.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_insert_select.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_mix_innodb_myisam-master.opt (100%) rename mysql-test/{ => suite/binlog}/t/binlog_row_mix_innodb_myisam.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_statement_insert_delayed.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_binlog-master.opt (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_binlog.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_blackhole.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_ctype_cp932.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_ctype_ucs.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_drop_tmp_tbl.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_innodb_stat-master.opt (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_innodb_stat.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_insert_select.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_mix_innodb_myisam-master.opt (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_mix_innodb_myisam.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_stm_ps.test (100%) create mode 100644 mysql-test/suite/funcs_1/t/suite.opt create mode 100644 mysql-test/suite/funcs_2/t/suite.opt rename mysql-test/{ => suite/ndb}/r/loaddata_autocom_ndb.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_alter_table.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_alter_table2.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_alter_table3.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_autodiscover.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_autodiscover2.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_autodiscover3.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_backup_print.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_basic.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_binlog_basic.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_binlog_basic2.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_binlog_ddl_multi.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_binlog_discover.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_binlog_ignore_db.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_binlog_log_bin.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_binlog_multi.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_bitfield.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_blob.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_blob_partition.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_cache.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_cache2.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_cache_multi.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_cache_multi2.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_charset.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_condition_pushdown.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_config.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_config2.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_cursor.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_database.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_dd_alter.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_dd_backuprestore.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_dd_basic.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_dd_ddl.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_dd_disk2memory.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_dd_dump.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_dd_sql_features.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_gis.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_grant.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_index.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_index_ordered.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_index_unique.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_insert.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_limit.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_load.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_loaddatalocal.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_lock.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_minmax.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_multi.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_multi_row.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_partition_error.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_partition_error2.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_partition_key.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_partition_list.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_partition_range.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_read_multi_range.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_rename.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_replace.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_restore.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_restore_compat.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_restore_partition.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_restore_print.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_row_format.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_single_user.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_sp.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_subquery.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_temporary.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_transaction.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_trigger.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_truncate.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_types.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_update.result (100%) rename mysql-test/{ => suite/ndb}/r/ndb_view.result (100%) rename mysql-test/{ => suite/ndb}/r/ndbapi.result (100%) rename mysql-test/{ => suite/ndb}/r/partition_03ndb.result (100%) rename mysql-test/{ => suite/ndb}/r/ps_7ndb.result (100%) rename mysql-test/{ => suite/ndb}/r/strict_autoinc_5ndb.result (100%) create mode 100644 mysql-test/suite/ndb/t/disabled.def rename mysql-test/{ => suite/ndb}/t/loaddata_autocom_ndb.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_alter_table.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_alter_table2.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_alter_table3.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_autodiscover.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_autodiscover2-master.opt (100%) rename mysql-test/{ => suite/ndb}/t/ndb_autodiscover2.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_autodiscover3.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_backup_print.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_basic.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_binlog_basic.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_binlog_basic2.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_binlog_ddl_multi.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_binlog_discover.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_binlog_ignore_db-master.opt (100%) rename mysql-test/{ => suite/ndb}/t/ndb_binlog_ignore_db.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_binlog_log_bin.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_binlog_multi.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_bitfield.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_blob.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_blob_partition.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_cache.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_cache2.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_cache_multi.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_cache_multi2.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_charset.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_condition_pushdown.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_config.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_config2.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_cursor.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_database.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_dd_alter.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_dd_backuprestore.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_dd_basic.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_dd_ddl.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_dd_disk2memory.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_dd_dump.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_dd_sql_features.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_gis.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_grant.later (100%) rename mysql-test/{ => suite/ndb}/t/ndb_index.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_index_ordered.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_index_unique.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_insert.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_limit.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_load.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_loaddatalocal.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_lock.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_minmax.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_multi.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_multi_row.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_partition_error.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_partition_error2-master.opt (100%) rename mysql-test/{ => suite/ndb}/t/ndb_partition_error2.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_partition_key.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_partition_list.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_partition_range.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_read_multi_range.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_rename.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_replace.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_restore.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_restore_compat.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_restore_partition-master.opt (100%) rename mysql-test/{ => suite/ndb}/t/ndb_restore_partition.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_restore_print.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_row_format.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_single_user.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_sp.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_subquery.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_temporary.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_transaction.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_trigger.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_truncate.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_types.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_update.test (100%) rename mysql-test/{ => suite/ndb}/t/ndb_view.test (100%) rename mysql-test/{ => suite/ndb}/t/ndbapi.test (100%) rename mysql-test/{ => suite/ndb}/t/partition_03ndb.test (100%) rename mysql-test/{ => suite/ndb}/t/ps_7ndb.test (100%) rename mysql-test/{ => suite/ndb}/t/strict_autoinc_5ndb.test (100%) rename mysql-test/{ => suite/rpl}/r/rpl000001.a.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl000001.b.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl000010.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl000011.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl000013.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl000017.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_000015.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_EE_err.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_LD_INFILE.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_alter.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_alter_db.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_auto_increment.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_auto_increment_11932.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_bit.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_bit_npk.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_change_master.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_charset_sjis.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_commit_after_flush.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_create_database.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_critical_errors.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_critical_errors.result.txt (100%) rename mysql-test/{ => suite/rpl}/r/rpl_ddl.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_deadlock_innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_delete_no_where.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_do_grant.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_drop.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_drop_db.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_drop_temp.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_dual_pos_advance.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_empty_master_crash.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_err_ignoredtable.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_events.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_extraCol_innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_extraCol_myisam.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_failed_optimize.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_flushlog_loop.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_foreign_key_innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_free_items.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_get_lock.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_ignore_grant.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_ignore_revoke.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_ignore_table.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_ignore_table_update.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_incident.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_init_slave.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_insert.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_insert_id.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_insert_id_pk.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_insert_ignore.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_insert_select.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_known_bugs_detection.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_load_from_master.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_load_table_from_master.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_loaddata.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_loaddata_charset.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_loaddata_m.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_loaddata_s.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_loaddata_simple.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_loaddatalocal.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_loadfile.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_locale.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_log_pos.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_many_optimize.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_master_pos_wait.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_misc_functions.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_mixed_ddl_dml.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_multi_delete.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_multi_delete2.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_multi_engine.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_multi_update.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_multi_update2.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_multi_update3.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_multi_update4.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_optimize.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_packet.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_ps.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_rbr_to_sbr.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_read_only.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_redirect.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_relay_space_innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_relay_space_myisam.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_relayrotate.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_relayspace.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_replicate_do.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_replicate_ignore_db.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_rewrt_db.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_rotate_logs.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_001.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_4_bytes.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_NOW.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_USER.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_UUID.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_basic_11bugs-master.opt (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_basic_11bugs-slave.opt (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_basic_11bugs.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_basic_2myisam.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_basic_3innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_basic_8partition.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_blob_innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_blob_myisam.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_charset.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_create_table.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_delayed_ins.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_drop.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_err_ignoredtable.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_flsh_tbls.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_func001.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_func002.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_func003.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_inexist_tbl.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_insert_delayed.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_loaddata_m.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_log.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_log_innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_max_relay_size.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_multi_query.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_mysqlbinlog.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_mystery22.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_reset_slave.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp001.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp002_innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp003.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp005.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp006_InnoDB.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp007_innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp008.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp009.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp010.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp011.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_sp012.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_stop_middle.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_stop_middle_update.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_tabledefs_2myisam.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_tabledefs_3innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_tabledefs_7ndb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_trig001.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_trig002.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_trig003.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_trig004.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_until.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_row_view01.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_server_id1.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_server_id2.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_session_var.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_set_charset.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_sf.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_skip_error.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_slave_status.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_sp.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_sp004.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_sp_effects.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_sporadic_master.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_ssl.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_ssl1.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_start_stop_slave.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_000001.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_EE_err2.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_charset.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_flsh_tbls.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_insert_delayed.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_log.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_max_relay_size.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_multi_query.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_mystery22.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_no_op.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_reset_slave.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_stm_until.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_switch_stm_row_mixed.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_temp_table.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_temporary.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_timezone.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_trigger.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_trunc_temp.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_truncate_2myisam.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_truncate_3innodb.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_truncate_7ndb_2.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_udf.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_user_variables.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_variables.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_view.result (100%) create mode 100644 mysql-test/suite/rpl/t/disabled.def rename mysql-test/{ => suite/rpl}/t/rpl000010-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl000010.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl000011.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl000013.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl000017-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl000017-slave.sh (100%) rename mysql-test/{ => suite/rpl}/t/rpl000017.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl000018-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl000018-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_000015-slave.sh (100%) rename mysql-test/{ => suite/rpl}/t/rpl_000015.slave-mi (100%) rename mysql-test/{ => suite/rpl}/t/rpl_000015.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_EE_err.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_LD_INFILE.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_alter.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_alter_db.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_auto_increment-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_auto_increment-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_auto_increment.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_auto_increment_11932.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_bit.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_bit_npk.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_change_master.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_charset_sjis.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_commit_after_flush.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_create_database-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_create_database-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_create_database.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_critical_errors.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ddl.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_deadlock_innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_deadlock_innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_delete_no_where.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_do_grant.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_drop.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_drop_db.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_drop_temp-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_drop_temp.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_dual_pos_advance-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_dual_pos_advance.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_empty_master_crash-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_empty_master_crash.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_err_ignoredtable-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_err_ignoredtable.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_events.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_extraCol_innodb-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_extraCol_innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_extraCol_innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_extraCol_myisam.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_failed_optimize-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_failed_optimize.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_flushlog_loop-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_flushlog_loop-master.sh (100%) rename mysql-test/{ => suite/rpl}/t/rpl_flushlog_loop-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_flushlog_loop-slave.sh (100%) rename mysql-test/{ => suite/rpl}/t/rpl_flushlog_loop.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_foreign_key_innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_foreign_key_innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_free_items-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_free_items.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_get_lock.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ignore_grant-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ignore_grant.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ignore_revoke-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ignore_revoke.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ignore_table-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ignore_table.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ignore_table_update-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ignore_table_update.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_incident-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_incident.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_init_slave-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_init_slave.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_insert.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_insert_id-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_insert_id.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_insert_id_pk-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_insert_id_pk.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_insert_ignore-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_insert_ignore.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_insert_select.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_known_bugs_detection-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_known_bugs_detection.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_load_from_master-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_load_from_master.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_load_table_from_master.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddata.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddata_charset.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddata_m-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddata_m.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddata_s-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddata_s.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddata_simple.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddatalocal.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loadfile.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_locale.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_log_pos.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_many_optimize.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_master_pos_wait.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_misc_functions-slave.sh (100%) rename mysql-test/{ => suite/rpl}/t/rpl_misc_functions.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_mixed_ddl_dml.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_delete-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_delete.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_delete2-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_delete2.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_engine-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_engine.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_update.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_update2-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_update2.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_update3.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_update4-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_multi_update4.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_optimize.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_packet-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_packet-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_packet.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ps.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_rbr_to_sbr.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_read_only-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_read_only.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_redirect.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_relay_space_innodb-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_relay_space_innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_relay_space_innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_relay_space_myisam.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_relayrotate-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_relayrotate.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_relayspace-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_relayspace.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_replicate_do-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_replicate_do.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_replicate_ignore_db-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_replicate_ignore_db.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_rewrt_db-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_rewrt_db.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_rotate_logs-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_rotate_logs-slave.sh (100%) rename mysql-test/{ => suite/rpl}/t/rpl_rotate_logs.slave-mi (100%) rename mysql-test/{ => suite/rpl}/t/rpl_rotate_logs.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_001.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_4_bytes-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_4_bytes.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_NOW.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_USER.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_UUID.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_basic_11bugs-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_basic_11bugs-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_basic_11bugs.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_basic_2myisam.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_basic_3innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_basic_3innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_basic_8partition.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_blob_innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_blob_innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_blob_myisam.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_charset.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_create_table-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_create_table.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_delayed_ins.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_drop.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_err_daisychain-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_err_daisychain-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_flsh_tbls.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_func001.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_func002.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_func003-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_func003.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_inexist_tbl-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_inexist_tbl.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_insert_delayed.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_log-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_log-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_log.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_log_innodb-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_log_innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_log_innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_max_relay_size.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_mysqlbinlog-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_mysqlbinlog.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_mystery22.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_reset_slave.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp001.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp002_innodb-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp002_innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp002_innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp003-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp003-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp003.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp005.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp006_InnoDB-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp006_InnoDB.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp007_innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp007_innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp008.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp009.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp010.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp011.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_sp012.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_stop_middle.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_stop_middle_update-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_stop_middle_update-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_stop_middle_update.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_tabledefs_2myisam.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_tabledefs_3innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_tabledefs_3innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_trig001.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_trig002.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_trig003.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_trig004.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_until.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_row_view01.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_server_id1.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_server_id2-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_server_id2.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_session_var.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_set_charset.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sf.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_skip_error-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_skip_error.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_slave_status.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sp-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sp-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sp.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sp004.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sp_effects-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sp_effects-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sp_effects.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sporadic_master-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_sporadic_master.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ssl.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_ssl1.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_start_stop_slave.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_000001-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_000001.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_EE_err2.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_charset.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_flsh_tbls.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_insert_delayed.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_log-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_log-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_log.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_max_relay_size.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_multi_query.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_mystery22.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_no_op.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_reset_slave.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_stm_until.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_switch_stm_row_mixed.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_temp_table.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_temporary.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_timezone-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_timezone-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_timezone.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_trigger.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_trunc_temp.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_truncate_2myisam.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_truncate_3innodb.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_truncate_7ndb_2-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_truncate_7ndb_2.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_udf-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_udf-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_udf.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_user_variables.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_variables-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_variables.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_view-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_view.test (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_2innodb.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_2myisam.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_UUID.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_auto_inc.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_bank.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_basic.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_blob.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_blob2.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_charset.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_circular.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_circular_simplex.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_commit_afterflush.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_dd_advance.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_dd_basic.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_dd_partitions.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_ddl.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_delete_nowhere.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_do_db.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_do_table.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_extraCol.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_func003.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_idempotent.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_innodb_trans.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_insert_ignore.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_load.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_log.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_multi.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_multi_update2.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_multi_update3.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_relayrotate.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_rep_ignore.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_row_001.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_sp003.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_sp006.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_stm_innodb.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_sync.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_trig004.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndbapi_multi.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_row_basic_7ndb.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_truncate_7ndb.result (100%) create mode 100644 mysql-test/suite/rpl_ndb/t/disabled.def rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_2innodb-master.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_2innodb-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_2innodb.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_2myisam-master.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_2myisam-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_2myisam.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_UUID.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_auto_inc.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_bank.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_basic.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_blob.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_blob2.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_charset.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_circular.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_circular_simplex.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_commit_afterflush.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_dd_advance.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_dd_basic.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_dd_partitions.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_ddl.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_delete_nowhere.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_do_db-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_do_db.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_do_table-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_do_table.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_extraCol.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_func003.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_idempotent.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_innodb2ndb-master.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_innodb2ndb-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_innodb2ndb.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_innodb_trans-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_innodb_trans.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_insert_ignore.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_load.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_log-master.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_log.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_multi.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_multi_update2-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_multi_update2.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_multi_update3.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_myisam2ndb-master.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_myisam2ndb-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_myisam2ndb.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_relayrotate-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_relayrotate.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_rep_ignore-slave.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_rep_ignore.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_row_001.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_sp003.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_sp006.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_stm_innodb-master.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_stm_innodb.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_sync.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_trig004.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndbapi_multi.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_row_basic_7ndb.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_truncate_7ndb.test (100%) diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 11ff85818a7..13708a5a3af 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -23,7 +23,8 @@ use IO::File(); use strict; sub collect_test_cases ($); -sub collect_one_test_case ($$$$$$$); +sub collect_one_suite ($$); +sub collect_one_test_case ($$$$$$$$$); sub mtr_options_from_test_file($$); @@ -34,147 +35,39 @@ sub mtr_options_from_test_file($$); ############################################################################## sub collect_test_cases ($) { - my $suite= shift; # Test suite name + my $suites= shift; # Semicolon separated list of test suites + my $cases = []; # Array of hash - my $testdir; - my $resdir; - - if ( $suite eq "main" ) + foreach my $suite (split(",", $suites)) { - $testdir= "$::glob_mysql_test_dir/t"; - $resdir= "$::glob_mysql_test_dir/r"; - } - else - { - $testdir= "$::glob_mysql_test_dir/suite/$suite/t"; - $resdir= "$::glob_mysql_test_dir/suite/$suite/r"; + collect_one_suite($suite, $cases); } - my $cases = []; # Array of hash, will be array of C struct - - opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!"); - - # ---------------------------------------------------------------------- - # Disable some tests listed in disabled.def - # ---------------------------------------------------------------------- - my %disabled; - if ( open(DISABLED, "$testdir/disabled.def" ) ) - { - while ( ) - { - chomp; - if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ ) - { - $disabled{$1}= $2; - } - } - close DISABLED; - } if ( @::opt_cases ) { + # Check that the tests specified was found + # in at least one suite foreach my $tname ( @::opt_cases ) { - # Run in specified order, no sort - my $elem= undef; - my $component_id= undef; - - # Get rid of directory part (path). Leave the extension since it is used - # to understand type of the test. - - $tname = basename($tname); - - # Check if the extenstion has been specified. - - if ( mtr_match_extension($tname, "test") ) + my $found= 0; + foreach my $test ( @$cases ) { - $elem= $tname; - $tname=~ s/\.test$//; - $component_id= 'mysqld'; + if ( mtr_match_extension($test->{'name'}, $tname) ) + { + $found= 1; + } } - elsif ( mtr_match_extension($tname, "imtest") ) + if ( not $found ) { - $elem= $tname; - $tname =~ s/\.imtest$//; - $component_id= 'im'; + mtr_error("Could not find $tname in any suite"); } - - # If target component is known, check that the specified test case - # exists. - # - # Otherwise, try to guess the target component. - - if ( $component_id ) - { - if ( ! -f "$testdir/$elem") - { - mtr_error("Test case $tname ($testdir/$elem) is not found"); - } - } - else - { - my $mysqld_test_exists = -f "$testdir/$tname.test"; - my $im_test_exists = -f "$testdir/$tname.imtest"; - - if ( $mysqld_test_exists and $im_test_exists ) - { - mtr_error("Ambiguous test case name ($tname)"); - } - elsif ( ! $mysqld_test_exists and ! $im_test_exists ) - { - mtr_error("Test case $tname is not found"); - } - elsif ( $mysqld_test_exists ) - { - $elem= "$tname.test"; - $component_id= 'mysqld'; - } - elsif ( $im_test_exists ) - { - $elem= "$tname.imtest"; - $component_id= 'im'; - } - } - - collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled, - $component_id); } - closedir TESTDIR; - } - else - { - foreach my $elem ( sort readdir(TESTDIR) ) - { - my $component_id= undef; - my $tname= undef; - - if ($tname= mtr_match_extension($elem, 'test')) - { - $component_id = 'mysqld'; - } - elsif ($tname= mtr_match_extension($elem, 'imtest')) - { - $component_id = 'im'; - } - else - { - next; - } - - # Skip tests that does not match the --do-test= filter - next if $::opt_do_test and - ! defined mtr_match_prefix($elem,$::opt_do_test); - - collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled, - $component_id); - } - closedir TESTDIR; } - # Reorder the test cases in an order that will make them faster to run if ( $::opt_reorder ) { - + # Reorder the test cases in an order that will make them faster to run my %sort_criteria; # Make a mapping of test name to a string that represents how that test @@ -246,6 +139,160 @@ sub collect_test_cases ($) { } } + return $cases; + +} + +sub collect_one_suite($$) +{ + my $suite= shift; # Test suite name + my $cases= shift; # List of test cases + + mtr_verbose("Collecting: $suite"); + + my $testdir; + my $resdir; + + if ( $suite eq "main" ) + { + $testdir= "$::glob_mysql_test_dir/t"; + $resdir= "$::glob_mysql_test_dir/r"; + } + else + { + $testdir= "$::glob_mysql_test_dir/suite/$suite/t"; + $resdir= "$::glob_mysql_test_dir/suite/$suite/r"; + } + + # ---------------------------------------------------------------------- + # Build a hash of disabled testcases for this suite + # ---------------------------------------------------------------------- + my %disabled; + if ( open(DISABLED, "$testdir/disabled.def" ) ) + { + while ( ) + { + chomp; + if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ ) + { + $disabled{$1}= $2; + } + } + close DISABLED; + } + + # Read suite.opt file + my $suite_opt_file= "$testdir/suite.opt"; + my $suite_opts= []; + if ( -f $suite_opt_file ) + { + $suite_opts= mtr_get_opts_from_file($suite_opt_file); + } + + if ( @::opt_cases ) + { + # Collect in specified order, no sort + foreach my $tname ( @::opt_cases ) + { + my $elem= undef; + my $component_id= undef; + + # Get rid of directory part (path). Leave the extension since it is used + # to understand type of the test. + + $tname = basename($tname); + + # Check if the extenstion has been specified. + + if ( mtr_match_extension($tname, "test") ) + { + $elem= $tname; + $tname=~ s/\.test$//; + $component_id= 'mysqld'; + } + elsif ( mtr_match_extension($tname, "imtest") ) + { + $elem= $tname; + $tname =~ s/\.imtest$//; + $component_id= 'im'; + } + + # If target component is known, check that the specified test case + # exists. + # + # Otherwise, try to guess the target component. + + if ( $component_id ) + { + if ( ! -f "$testdir/$elem") + { + mtr_error("Test case $tname ($testdir/$elem) is not found"); + } + } + else + { + my $mysqld_test_exists = -f "$testdir/$tname.test"; + my $im_test_exists = -f "$testdir/$tname.imtest"; + + if ( $mysqld_test_exists and $im_test_exists ) + { + mtr_error("Ambiguous test case name ($tname)"); + } + elsif ( ! $mysqld_test_exists and ! $im_test_exists ) + { + # Silently skip, could exist in another suite + next; + } + elsif ( $mysqld_test_exists ) + { + $elem= "$tname.test"; + $component_id= 'mysqld'; + } + elsif ( $im_test_exists ) + { + $elem= "$tname.imtest"; + $component_id= 'im'; + } + } + + collect_one_test_case($testdir,$resdir,$suite,$tname, + $elem,$cases,\%disabled,$component_id, + $suite_opts); + } + } + else + { + opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!"); + + foreach my $elem ( sort readdir(TESTDIR) ) + { + my $component_id= undef; + my $tname= undef; + + if ($tname= mtr_match_extension($elem, 'test')) + { + $component_id = 'mysqld'; + } + elsif ($tname= mtr_match_extension($elem, 'imtest')) + { + $component_id = 'im'; + } + else + { + next; + } + + # Skip tests that does not match the --do-test= filter + next if $::opt_do_test and + ! defined mtr_match_prefix($elem,$::opt_do_test); + + collect_one_test_case($testdir,$resdir,$suite,$tname, + $elem,$cases,\%disabled,$component_id, + $suite_opts); + } + closedir TESTDIR; + } + return $cases; } @@ -257,14 +304,16 @@ sub collect_test_cases ($) { ############################################################################## -sub collect_one_test_case($$$$$$$) { +sub collect_one_test_case($$$$$$$$$) { my $testdir= shift; my $resdir= shift; + my $suite= shift; my $tname= shift; my $elem= shift; my $cases= shift; my $disabled=shift; my $component_id= shift; + my $suite_opts= shift; my $path= "$testdir/$elem"; @@ -279,7 +328,7 @@ sub collect_one_test_case($$$$$$$) { my $tinfo= {}; - $tinfo->{'name'}= $tname; + $tinfo->{'name'}= "$suite.$tname"; $tinfo->{'result_file'}= "$resdir/$tname.result"; $tinfo->{'component_id'} = $component_id; push(@$cases, $tinfo); @@ -334,6 +383,15 @@ sub collect_one_test_case($$$$$$$) { $tinfo->{'slave_opt'}= []; $tinfo->{'slave_mi'}= []; + # Add suite opts + foreach my $opt ( @$suite_opts ) + { + mtr_verbose($opt); + push(@{$tinfo->{'master_opt'}}, $opt); + push(@{$tinfo->{'slave_opt'}}, $opt); + } + + # Add master opts if ( -f $master_opt_file ) { @@ -394,6 +452,7 @@ sub collect_one_test_case($$$$$$$) { } } + # Add slave opts if ( -f $slave_opt_file ) { my $slave_opt= mtr_get_opts_from_file($slave_opt_file); diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 096840eb559..d60f8967256 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -48,30 +48,15 @@ sub mtr_verbose (@); # We can't use diff -u or diff -a as these are not portable sub mtr_show_failed_diff ($) { - my $result_file_name= shift; + my $tinfo= shift; # The reject and log files have been dumped to # to filenames based on the result_file's name - my $tname= basename($result_file_name); - $tname=~ s/\..*$//; - - my $reject_file= "r/$tname.reject"; - my $result_file= "r/$tname.result"; - my $log_file= "$::opt_vardir/log/$tname.log"; - my $eval_file= "r/$tname.eval"; - - if ( $::opt_suite ne "main" ) - { - $reject_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$reject_file"; - $result_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$result_file"; - $eval_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$eval_file"; - $log_file= "$::glob_mysql_test_dir/suite/$::opt_suite/$log_file"; - } - - if ( -f $eval_file ) - { - $result_file= $eval_file; - } + my $base_file= mtr_match_extension($tinfo->{'result_file'}, + "result"); # Trim extension + my $reject_file= "$base_file.reject"; + my $result_file= "$base_file.result"; + my $log_file= "$base_file.log"; my $diffopts= $::opt_udiff ? "-u" : "-c"; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 970790f4141..085feb524c4 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -132,7 +132,7 @@ our $opt_vs_config = $ENV{'MTR_VS_CONFIG'}; our $default_vardir; our $opt_usage; -our $opt_suite; +our $opt_suites= "main,binlog,rpl,rpl_ndb,ndb"; # Default suites to run our $opt_script_debug= 0; # Script debugging, enable with --script-debug our $opt_verbose= 0; # Verbose output, enable with --verbose @@ -404,7 +404,7 @@ sub main () { else { # Figure out which tests we are going to run - my $tests= collect_test_cases($opt_suite); + my $tests= collect_test_cases($opt_suites); # Turn off NDB and other similar options if no tests use it my ($need_ndbcluster,$need_im); @@ -458,7 +458,7 @@ sub main () { run_report_features(); } - run_suite($opt_suite, $tests); + run_tests($tests); } mtr_exit(0); @@ -474,7 +474,6 @@ sub command_line_setup () { # These are defaults for things that are set on the command line - $opt_suite= "main"; # Special default suite my $opt_comment; $opt_master_myport= 9306; @@ -534,7 +533,7 @@ sub command_line_setup () { 'skip-slave-binlog' => \$opt_skip_slave_binlog, 'do-test=s' => \$opt_do_test, 'start-from=s' => \$opt_start_from, - 'suite=s' => \$opt_suite, + 'suite|suites=s' => \$opt_suites, 'skip-rpl' => \$opt_skip_rpl, 'skip-im' => \$opt_skip_im, 'skip-test=s' => \$opt_skip_test, @@ -2797,19 +2796,17 @@ sub run_benchmarks ($) { ############################################################################## # -# Run the test suite +# Run the tests # ############################################################################## -sub run_suite () { - my ($suite, $tests)= @_; +sub run_tests () { + my ($tests)= @_; mtr_print_thick_line(); mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout); - mtr_report("Starting Tests in the '$suite' suite"); - mtr_report_tests_not_skipped_though_disabled($tests); mtr_print_header(); @@ -3272,18 +3269,14 @@ sub run_testcase_check_skip_test($) sub do_before_run_mysqltest($) { my $tinfo= shift; - my $tname= $tinfo->{'name'}; # Remove old files produced by mysqltest - my $result_dir= "r"; - if ( $opt_suite ne "main" ) - { - $result_dir= "suite/$opt_suite/r"; - } - unlink("$result_dir/$tname.reject"); - unlink("$result_dir/$tname.progress"); - unlink("$result_dir/$tname.log"); - unlink("$result_dir/$tname.warnings"); + my $base_file= mtr_match_extension($tinfo->{'result_file'}, + "result"); # Trim extension + unlink("$base_file.reject"); + unlink("$base_file.progress"); + unlink("$base_file.log"); + unlink("$base_file.warnings"); if (!$opt_extern) { @@ -3302,7 +3295,6 @@ sub do_before_run_mysqltest($) sub do_after_run_mysqltest($) { my $tinfo= shift; - my $tname= $tinfo->{'name'}; # Save info from this testcase run to mysqltest.log mtr_appendfile_to_file($path_current_test_log, $path_mysqltest_log) @@ -3626,7 +3618,7 @@ sub report_failure_and_restart ($) { my $tinfo= shift; mtr_report_test_failed($tinfo); - mtr_show_failed_diff($tinfo->{'result_file'}); + mtr_show_failed_diff($tinfo); print "\n"; if ( $opt_force ) { @@ -3766,15 +3758,7 @@ sub mysqld_arguments ($$$$) { if ( $mysql_version_id >= 50036) { # By default, prevent the started mysqld to access files outside of vardir - my $secure_file_dir= $opt_vardir; - if ( $opt_suite ne "main" ) - { - # When running a suite other than default allow the mysqld - # access to subdirs of mysql-test/ in order to make it possible - # to "load data" from the suites data/ directory. - $secure_file_dir= $glob_mysql_test_dir; - } - mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $secure_file_dir); + mtr_add_arg($args, "%s--secure-file-priv=%s", $prefix, $opt_vardir); } if ( $mysql_version_id >= 50000 ) @@ -5147,7 +5131,9 @@ Options to control what test suites or cases to run ndb-extra Run extra tests from ndb directory do-test=PREFIX Run test cases which name are prefixed with PREFIX start-from=PREFIX Run test cases starting from test prefixed with PREFIX - suite=NAME Run the test suite named NAME. The default is "main" + suite[s]=NAME1,..,NAMEN Collect tests in suites from the comma separated + list of suite names. + The default is: "$opt_suites" skip-rpl Skip the replication test cases. skip-im Don't start IM, and skip the IM test cases skip-test=PREFIX Skip test cases which name are prefixed with PREFIX diff --git a/mysql-test/r/binlog_killed.result b/mysql-test/suite/binlog/r/binlog_killed.result similarity index 100% rename from mysql-test/r/binlog_killed.result rename to mysql-test/suite/binlog/r/binlog_killed.result diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result similarity index 100% rename from mysql-test/r/binlog_row_binlog.result rename to mysql-test/suite/binlog/r/binlog_row_binlog.result diff --git a/mysql-test/r/binlog_row_blackhole.result b/mysql-test/suite/binlog/r/binlog_row_blackhole.result similarity index 100% rename from mysql-test/r/binlog_row_blackhole.result rename to mysql-test/suite/binlog/r/binlog_row_blackhole.result diff --git a/mysql-test/r/binlog_row_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result similarity index 100% rename from mysql-test/r/binlog_row_ctype_cp932.result rename to mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result diff --git a/mysql-test/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result similarity index 100% rename from mysql-test/r/binlog_row_ctype_ucs.result rename to mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result diff --git a/mysql-test/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result similarity index 100% rename from mysql-test/r/binlog_row_drop_tmp_tbl.result rename to mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result diff --git a/mysql-test/r/binlog_row_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result similarity index 100% rename from mysql-test/r/binlog_row_innodb_stat.result rename to mysql-test/suite/binlog/r/binlog_row_innodb_stat.result diff --git a/mysql-test/r/binlog_row_insert_select.result b/mysql-test/suite/binlog/r/binlog_row_insert_select.result similarity index 100% rename from mysql-test/r/binlog_row_insert_select.result rename to mysql-test/suite/binlog/r/binlog_row_insert_select.result diff --git a/mysql-test/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result similarity index 100% rename from mysql-test/r/binlog_row_mix_innodb_myisam.result rename to mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result diff --git a/mysql-test/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result similarity index 100% rename from mysql-test/r/binlog_statement_insert_delayed.result rename to mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result similarity index 100% rename from mysql-test/r/binlog_stm_binlog.result rename to mysql-test/suite/binlog/r/binlog_stm_binlog.result diff --git a/mysql-test/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result similarity index 100% rename from mysql-test/r/binlog_stm_blackhole.result rename to mysql-test/suite/binlog/r/binlog_stm_blackhole.result diff --git a/mysql-test/r/binlog_stm_ctype_cp932.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result similarity index 100% rename from mysql-test/r/binlog_stm_ctype_cp932.result rename to mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result diff --git a/mysql-test/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result similarity index 100% rename from mysql-test/r/binlog_stm_ctype_ucs.result rename to mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result diff --git a/mysql-test/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result similarity index 100% rename from mysql-test/r/binlog_stm_drop_tmp_tbl.result rename to mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result diff --git a/mysql-test/r/binlog_stm_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result similarity index 100% rename from mysql-test/r/binlog_stm_innodb_stat.result rename to mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result diff --git a/mysql-test/r/binlog_stm_insert_select.result b/mysql-test/suite/binlog/r/binlog_stm_insert_select.result similarity index 100% rename from mysql-test/r/binlog_stm_insert_select.result rename to mysql-test/suite/binlog/r/binlog_stm_insert_select.result diff --git a/mysql-test/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result similarity index 100% rename from mysql-test/r/binlog_stm_mix_innodb_myisam.result rename to mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result diff --git a/mysql-test/r/binlog_stm_ps.result b/mysql-test/suite/binlog/r/binlog_stm_ps.result similarity index 100% rename from mysql-test/r/binlog_stm_ps.result rename to mysql-test/suite/binlog/r/binlog_stm_ps.result diff --git a/mysql-test/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test similarity index 100% rename from mysql-test/t/binlog_killed.test rename to mysql-test/suite/binlog/t/binlog_killed.test diff --git a/mysql-test/t/binlog_row_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_row_binlog-master.opt similarity index 100% rename from mysql-test/t/binlog_row_binlog-master.opt rename to mysql-test/suite/binlog/t/binlog_row_binlog-master.opt diff --git a/mysql-test/t/binlog_row_binlog.test b/mysql-test/suite/binlog/t/binlog_row_binlog.test similarity index 100% rename from mysql-test/t/binlog_row_binlog.test rename to mysql-test/suite/binlog/t/binlog_row_binlog.test diff --git a/mysql-test/t/binlog_row_blackhole.test b/mysql-test/suite/binlog/t/binlog_row_blackhole.test similarity index 100% rename from mysql-test/t/binlog_row_blackhole.test rename to mysql-test/suite/binlog/t/binlog_row_blackhole.test diff --git a/mysql-test/t/binlog_row_ctype_cp932.test b/mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test similarity index 100% rename from mysql-test/t/binlog_row_ctype_cp932.test rename to mysql-test/suite/binlog/t/binlog_row_ctype_cp932.test diff --git a/mysql-test/t/binlog_row_ctype_ucs.test b/mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test similarity index 100% rename from mysql-test/t/binlog_row_ctype_ucs.test rename to mysql-test/suite/binlog/t/binlog_row_ctype_ucs.test diff --git a/mysql-test/t/binlog_row_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test similarity index 100% rename from mysql-test/t/binlog_row_drop_tmp_tbl.test rename to mysql-test/suite/binlog/t/binlog_row_drop_tmp_tbl.test diff --git a/mysql-test/t/binlog_row_innodb_stat-master.opt b/mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt similarity index 100% rename from mysql-test/t/binlog_row_innodb_stat-master.opt rename to mysql-test/suite/binlog/t/binlog_row_innodb_stat-master.opt diff --git a/mysql-test/t/binlog_row_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_row_innodb_stat.test similarity index 100% rename from mysql-test/t/binlog_row_innodb_stat.test rename to mysql-test/suite/binlog/t/binlog_row_innodb_stat.test diff --git a/mysql-test/t/binlog_row_insert_select.test b/mysql-test/suite/binlog/t/binlog_row_insert_select.test similarity index 100% rename from mysql-test/t/binlog_row_insert_select.test rename to mysql-test/suite/binlog/t/binlog_row_insert_select.test diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt similarity index 100% rename from mysql-test/t/binlog_row_mix_innodb_myisam-master.opt rename to mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam-master.opt diff --git a/mysql-test/t/binlog_row_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test similarity index 100% rename from mysql-test/t/binlog_row_mix_innodb_myisam.test rename to mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test diff --git a/mysql-test/t/binlog_statement_insert_delayed.test b/mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test similarity index 100% rename from mysql-test/t/binlog_statement_insert_delayed.test rename to mysql-test/suite/binlog/t/binlog_statement_insert_delayed.test diff --git a/mysql-test/t/binlog_stm_binlog-master.opt b/mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt similarity index 100% rename from mysql-test/t/binlog_stm_binlog-master.opt rename to mysql-test/suite/binlog/t/binlog_stm_binlog-master.opt diff --git a/mysql-test/t/binlog_stm_binlog.test b/mysql-test/suite/binlog/t/binlog_stm_binlog.test similarity index 100% rename from mysql-test/t/binlog_stm_binlog.test rename to mysql-test/suite/binlog/t/binlog_stm_binlog.test diff --git a/mysql-test/t/binlog_stm_blackhole.test b/mysql-test/suite/binlog/t/binlog_stm_blackhole.test similarity index 100% rename from mysql-test/t/binlog_stm_blackhole.test rename to mysql-test/suite/binlog/t/binlog_stm_blackhole.test diff --git a/mysql-test/t/binlog_stm_ctype_cp932.test b/mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test similarity index 100% rename from mysql-test/t/binlog_stm_ctype_cp932.test rename to mysql-test/suite/binlog/t/binlog_stm_ctype_cp932.test diff --git a/mysql-test/t/binlog_stm_ctype_ucs.test b/mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test similarity index 100% rename from mysql-test/t/binlog_stm_ctype_ucs.test rename to mysql-test/suite/binlog/t/binlog_stm_ctype_ucs.test diff --git a/mysql-test/t/binlog_stm_drop_tmp_tbl.test b/mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test similarity index 100% rename from mysql-test/t/binlog_stm_drop_tmp_tbl.test rename to mysql-test/suite/binlog/t/binlog_stm_drop_tmp_tbl.test diff --git a/mysql-test/t/binlog_stm_innodb_stat-master.opt b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt similarity index 100% rename from mysql-test/t/binlog_stm_innodb_stat-master.opt rename to mysql-test/suite/binlog/t/binlog_stm_innodb_stat-master.opt diff --git a/mysql-test/t/binlog_stm_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test similarity index 100% rename from mysql-test/t/binlog_stm_innodb_stat.test rename to mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test diff --git a/mysql-test/t/binlog_stm_insert_select.test b/mysql-test/suite/binlog/t/binlog_stm_insert_select.test similarity index 100% rename from mysql-test/t/binlog_stm_insert_select.test rename to mysql-test/suite/binlog/t/binlog_stm_insert_select.test diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt similarity index 100% rename from mysql-test/t/binlog_stm_mix_innodb_myisam-master.opt rename to mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam-master.opt diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test similarity index 100% rename from mysql-test/t/binlog_stm_mix_innodb_myisam.test rename to mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test diff --git a/mysql-test/t/binlog_stm_ps.test b/mysql-test/suite/binlog/t/binlog_stm_ps.test similarity index 100% rename from mysql-test/t/binlog_stm_ps.test rename to mysql-test/suite/binlog/t/binlog_stm_ps.test diff --git a/mysql-test/suite/funcs_1/t/suite.opt b/mysql-test/suite/funcs_1/t/suite.opt new file mode 100644 index 00000000000..9b22c677b83 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/suite.opt @@ -0,0 +1,2 @@ +--secure-file-priv=$MYSQL_TEST_DIR + diff --git a/mysql-test/suite/funcs_2/t/suite.opt b/mysql-test/suite/funcs_2/t/suite.opt new file mode 100644 index 00000000000..9b22c677b83 --- /dev/null +++ b/mysql-test/suite/funcs_2/t/suite.opt @@ -0,0 +1,2 @@ +--secure-file-priv=$MYSQL_TEST_DIR + diff --git a/mysql-test/r/loaddata_autocom_ndb.result b/mysql-test/suite/ndb/r/loaddata_autocom_ndb.result similarity index 100% rename from mysql-test/r/loaddata_autocom_ndb.result rename to mysql-test/suite/ndb/r/loaddata_autocom_ndb.result diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/suite/ndb/r/ndb_alter_table.result similarity index 100% rename from mysql-test/r/ndb_alter_table.result rename to mysql-test/suite/ndb/r/ndb_alter_table.result diff --git a/mysql-test/r/ndb_alter_table2.result b/mysql-test/suite/ndb/r/ndb_alter_table2.result similarity index 100% rename from mysql-test/r/ndb_alter_table2.result rename to mysql-test/suite/ndb/r/ndb_alter_table2.result diff --git a/mysql-test/r/ndb_alter_table3.result b/mysql-test/suite/ndb/r/ndb_alter_table3.result similarity index 100% rename from mysql-test/r/ndb_alter_table3.result rename to mysql-test/suite/ndb/r/ndb_alter_table3.result diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/suite/ndb/r/ndb_autodiscover.result similarity index 100% rename from mysql-test/r/ndb_autodiscover.result rename to mysql-test/suite/ndb/r/ndb_autodiscover.result diff --git a/mysql-test/r/ndb_autodiscover2.result b/mysql-test/suite/ndb/r/ndb_autodiscover2.result similarity index 100% rename from mysql-test/r/ndb_autodiscover2.result rename to mysql-test/suite/ndb/r/ndb_autodiscover2.result diff --git a/mysql-test/r/ndb_autodiscover3.result b/mysql-test/suite/ndb/r/ndb_autodiscover3.result similarity index 100% rename from mysql-test/r/ndb_autodiscover3.result rename to mysql-test/suite/ndb/r/ndb_autodiscover3.result diff --git a/mysql-test/r/ndb_backup_print.result b/mysql-test/suite/ndb/r/ndb_backup_print.result similarity index 100% rename from mysql-test/r/ndb_backup_print.result rename to mysql-test/suite/ndb/r/ndb_backup_print.result diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/suite/ndb/r/ndb_basic.result similarity index 100% rename from mysql-test/r/ndb_basic.result rename to mysql-test/suite/ndb/r/ndb_basic.result diff --git a/mysql-test/r/ndb_binlog_basic.result b/mysql-test/suite/ndb/r/ndb_binlog_basic.result similarity index 100% rename from mysql-test/r/ndb_binlog_basic.result rename to mysql-test/suite/ndb/r/ndb_binlog_basic.result diff --git a/mysql-test/r/ndb_binlog_basic2.result b/mysql-test/suite/ndb/r/ndb_binlog_basic2.result similarity index 100% rename from mysql-test/r/ndb_binlog_basic2.result rename to mysql-test/suite/ndb/r/ndb_binlog_basic2.result diff --git a/mysql-test/r/ndb_binlog_ddl_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result similarity index 100% rename from mysql-test/r/ndb_binlog_ddl_multi.result rename to mysql-test/suite/ndb/r/ndb_binlog_ddl_multi.result diff --git a/mysql-test/r/ndb_binlog_discover.result b/mysql-test/suite/ndb/r/ndb_binlog_discover.result similarity index 100% rename from mysql-test/r/ndb_binlog_discover.result rename to mysql-test/suite/ndb/r/ndb_binlog_discover.result diff --git a/mysql-test/r/ndb_binlog_ignore_db.result b/mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result similarity index 100% rename from mysql-test/r/ndb_binlog_ignore_db.result rename to mysql-test/suite/ndb/r/ndb_binlog_ignore_db.result diff --git a/mysql-test/r/ndb_binlog_log_bin.result b/mysql-test/suite/ndb/r/ndb_binlog_log_bin.result similarity index 100% rename from mysql-test/r/ndb_binlog_log_bin.result rename to mysql-test/suite/ndb/r/ndb_binlog_log_bin.result diff --git a/mysql-test/r/ndb_binlog_multi.result b/mysql-test/suite/ndb/r/ndb_binlog_multi.result similarity index 100% rename from mysql-test/r/ndb_binlog_multi.result rename to mysql-test/suite/ndb/r/ndb_binlog_multi.result diff --git a/mysql-test/r/ndb_bitfield.result b/mysql-test/suite/ndb/r/ndb_bitfield.result similarity index 100% rename from mysql-test/r/ndb_bitfield.result rename to mysql-test/suite/ndb/r/ndb_bitfield.result diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/suite/ndb/r/ndb_blob.result similarity index 100% rename from mysql-test/r/ndb_blob.result rename to mysql-test/suite/ndb/r/ndb_blob.result diff --git a/mysql-test/r/ndb_blob_partition.result b/mysql-test/suite/ndb/r/ndb_blob_partition.result similarity index 100% rename from mysql-test/r/ndb_blob_partition.result rename to mysql-test/suite/ndb/r/ndb_blob_partition.result diff --git a/mysql-test/r/ndb_cache.result b/mysql-test/suite/ndb/r/ndb_cache.result similarity index 100% rename from mysql-test/r/ndb_cache.result rename to mysql-test/suite/ndb/r/ndb_cache.result diff --git a/mysql-test/r/ndb_cache2.result b/mysql-test/suite/ndb/r/ndb_cache2.result similarity index 100% rename from mysql-test/r/ndb_cache2.result rename to mysql-test/suite/ndb/r/ndb_cache2.result diff --git a/mysql-test/r/ndb_cache_multi.result b/mysql-test/suite/ndb/r/ndb_cache_multi.result similarity index 100% rename from mysql-test/r/ndb_cache_multi.result rename to mysql-test/suite/ndb/r/ndb_cache_multi.result diff --git a/mysql-test/r/ndb_cache_multi2.result b/mysql-test/suite/ndb/r/ndb_cache_multi2.result similarity index 100% rename from mysql-test/r/ndb_cache_multi2.result rename to mysql-test/suite/ndb/r/ndb_cache_multi2.result diff --git a/mysql-test/r/ndb_charset.result b/mysql-test/suite/ndb/r/ndb_charset.result similarity index 100% rename from mysql-test/r/ndb_charset.result rename to mysql-test/suite/ndb/r/ndb_charset.result diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result similarity index 100% rename from mysql-test/r/ndb_condition_pushdown.result rename to mysql-test/suite/ndb/r/ndb_condition_pushdown.result diff --git a/mysql-test/r/ndb_config.result b/mysql-test/suite/ndb/r/ndb_config.result similarity index 100% rename from mysql-test/r/ndb_config.result rename to mysql-test/suite/ndb/r/ndb_config.result diff --git a/mysql-test/r/ndb_config2.result b/mysql-test/suite/ndb/r/ndb_config2.result similarity index 100% rename from mysql-test/r/ndb_config2.result rename to mysql-test/suite/ndb/r/ndb_config2.result diff --git a/mysql-test/r/ndb_cursor.result b/mysql-test/suite/ndb/r/ndb_cursor.result similarity index 100% rename from mysql-test/r/ndb_cursor.result rename to mysql-test/suite/ndb/r/ndb_cursor.result diff --git a/mysql-test/r/ndb_database.result b/mysql-test/suite/ndb/r/ndb_database.result similarity index 100% rename from mysql-test/r/ndb_database.result rename to mysql-test/suite/ndb/r/ndb_database.result diff --git a/mysql-test/r/ndb_dd_alter.result b/mysql-test/suite/ndb/r/ndb_dd_alter.result similarity index 100% rename from mysql-test/r/ndb_dd_alter.result rename to mysql-test/suite/ndb/r/ndb_dd_alter.result diff --git a/mysql-test/r/ndb_dd_backuprestore.result b/mysql-test/suite/ndb/r/ndb_dd_backuprestore.result similarity index 100% rename from mysql-test/r/ndb_dd_backuprestore.result rename to mysql-test/suite/ndb/r/ndb_dd_backuprestore.result diff --git a/mysql-test/r/ndb_dd_basic.result b/mysql-test/suite/ndb/r/ndb_dd_basic.result similarity index 100% rename from mysql-test/r/ndb_dd_basic.result rename to mysql-test/suite/ndb/r/ndb_dd_basic.result diff --git a/mysql-test/r/ndb_dd_ddl.result b/mysql-test/suite/ndb/r/ndb_dd_ddl.result similarity index 100% rename from mysql-test/r/ndb_dd_ddl.result rename to mysql-test/suite/ndb/r/ndb_dd_ddl.result diff --git a/mysql-test/r/ndb_dd_disk2memory.result b/mysql-test/suite/ndb/r/ndb_dd_disk2memory.result similarity index 100% rename from mysql-test/r/ndb_dd_disk2memory.result rename to mysql-test/suite/ndb/r/ndb_dd_disk2memory.result diff --git a/mysql-test/r/ndb_dd_dump.result b/mysql-test/suite/ndb/r/ndb_dd_dump.result similarity index 100% rename from mysql-test/r/ndb_dd_dump.result rename to mysql-test/suite/ndb/r/ndb_dd_dump.result diff --git a/mysql-test/r/ndb_dd_sql_features.result b/mysql-test/suite/ndb/r/ndb_dd_sql_features.result similarity index 100% rename from mysql-test/r/ndb_dd_sql_features.result rename to mysql-test/suite/ndb/r/ndb_dd_sql_features.result diff --git a/mysql-test/r/ndb_gis.result b/mysql-test/suite/ndb/r/ndb_gis.result similarity index 100% rename from mysql-test/r/ndb_gis.result rename to mysql-test/suite/ndb/r/ndb_gis.result diff --git a/mysql-test/r/ndb_grant.result b/mysql-test/suite/ndb/r/ndb_grant.result similarity index 100% rename from mysql-test/r/ndb_grant.result rename to mysql-test/suite/ndb/r/ndb_grant.result diff --git a/mysql-test/r/ndb_index.result b/mysql-test/suite/ndb/r/ndb_index.result similarity index 100% rename from mysql-test/r/ndb_index.result rename to mysql-test/suite/ndb/r/ndb_index.result diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/suite/ndb/r/ndb_index_ordered.result similarity index 100% rename from mysql-test/r/ndb_index_ordered.result rename to mysql-test/suite/ndb/r/ndb_index_ordered.result diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/suite/ndb/r/ndb_index_unique.result similarity index 100% rename from mysql-test/r/ndb_index_unique.result rename to mysql-test/suite/ndb/r/ndb_index_unique.result diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/suite/ndb/r/ndb_insert.result similarity index 100% rename from mysql-test/r/ndb_insert.result rename to mysql-test/suite/ndb/r/ndb_insert.result diff --git a/mysql-test/r/ndb_limit.result b/mysql-test/suite/ndb/r/ndb_limit.result similarity index 100% rename from mysql-test/r/ndb_limit.result rename to mysql-test/suite/ndb/r/ndb_limit.result diff --git a/mysql-test/r/ndb_load.result b/mysql-test/suite/ndb/r/ndb_load.result similarity index 100% rename from mysql-test/r/ndb_load.result rename to mysql-test/suite/ndb/r/ndb_load.result diff --git a/mysql-test/r/ndb_loaddatalocal.result b/mysql-test/suite/ndb/r/ndb_loaddatalocal.result similarity index 100% rename from mysql-test/r/ndb_loaddatalocal.result rename to mysql-test/suite/ndb/r/ndb_loaddatalocal.result diff --git a/mysql-test/r/ndb_lock.result b/mysql-test/suite/ndb/r/ndb_lock.result similarity index 100% rename from mysql-test/r/ndb_lock.result rename to mysql-test/suite/ndb/r/ndb_lock.result diff --git a/mysql-test/r/ndb_minmax.result b/mysql-test/suite/ndb/r/ndb_minmax.result similarity index 100% rename from mysql-test/r/ndb_minmax.result rename to mysql-test/suite/ndb/r/ndb_minmax.result diff --git a/mysql-test/r/ndb_multi.result b/mysql-test/suite/ndb/r/ndb_multi.result similarity index 100% rename from mysql-test/r/ndb_multi.result rename to mysql-test/suite/ndb/r/ndb_multi.result diff --git a/mysql-test/r/ndb_multi_row.result b/mysql-test/suite/ndb/r/ndb_multi_row.result similarity index 100% rename from mysql-test/r/ndb_multi_row.result rename to mysql-test/suite/ndb/r/ndb_multi_row.result diff --git a/mysql-test/r/ndb_partition_error.result b/mysql-test/suite/ndb/r/ndb_partition_error.result similarity index 100% rename from mysql-test/r/ndb_partition_error.result rename to mysql-test/suite/ndb/r/ndb_partition_error.result diff --git a/mysql-test/r/ndb_partition_error2.result b/mysql-test/suite/ndb/r/ndb_partition_error2.result similarity index 100% rename from mysql-test/r/ndb_partition_error2.result rename to mysql-test/suite/ndb/r/ndb_partition_error2.result diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/suite/ndb/r/ndb_partition_key.result similarity index 100% rename from mysql-test/r/ndb_partition_key.result rename to mysql-test/suite/ndb/r/ndb_partition_key.result diff --git a/mysql-test/r/ndb_partition_list.result b/mysql-test/suite/ndb/r/ndb_partition_list.result similarity index 100% rename from mysql-test/r/ndb_partition_list.result rename to mysql-test/suite/ndb/r/ndb_partition_list.result diff --git a/mysql-test/r/ndb_partition_range.result b/mysql-test/suite/ndb/r/ndb_partition_range.result similarity index 100% rename from mysql-test/r/ndb_partition_range.result rename to mysql-test/suite/ndb/r/ndb_partition_range.result diff --git a/mysql-test/r/ndb_read_multi_range.result b/mysql-test/suite/ndb/r/ndb_read_multi_range.result similarity index 100% rename from mysql-test/r/ndb_read_multi_range.result rename to mysql-test/suite/ndb/r/ndb_read_multi_range.result diff --git a/mysql-test/r/ndb_rename.result b/mysql-test/suite/ndb/r/ndb_rename.result similarity index 100% rename from mysql-test/r/ndb_rename.result rename to mysql-test/suite/ndb/r/ndb_rename.result diff --git a/mysql-test/r/ndb_replace.result b/mysql-test/suite/ndb/r/ndb_replace.result similarity index 100% rename from mysql-test/r/ndb_replace.result rename to mysql-test/suite/ndb/r/ndb_replace.result diff --git a/mysql-test/r/ndb_restore.result b/mysql-test/suite/ndb/r/ndb_restore.result similarity index 100% rename from mysql-test/r/ndb_restore.result rename to mysql-test/suite/ndb/r/ndb_restore.result diff --git a/mysql-test/r/ndb_restore_compat.result b/mysql-test/suite/ndb/r/ndb_restore_compat.result similarity index 100% rename from mysql-test/r/ndb_restore_compat.result rename to mysql-test/suite/ndb/r/ndb_restore_compat.result diff --git a/mysql-test/r/ndb_restore_partition.result b/mysql-test/suite/ndb/r/ndb_restore_partition.result similarity index 100% rename from mysql-test/r/ndb_restore_partition.result rename to mysql-test/suite/ndb/r/ndb_restore_partition.result diff --git a/mysql-test/r/ndb_restore_print.result b/mysql-test/suite/ndb/r/ndb_restore_print.result similarity index 100% rename from mysql-test/r/ndb_restore_print.result rename to mysql-test/suite/ndb/r/ndb_restore_print.result diff --git a/mysql-test/r/ndb_row_format.result b/mysql-test/suite/ndb/r/ndb_row_format.result similarity index 100% rename from mysql-test/r/ndb_row_format.result rename to mysql-test/suite/ndb/r/ndb_row_format.result diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/suite/ndb/r/ndb_single_user.result similarity index 100% rename from mysql-test/r/ndb_single_user.result rename to mysql-test/suite/ndb/r/ndb_single_user.result diff --git a/mysql-test/r/ndb_sp.result b/mysql-test/suite/ndb/r/ndb_sp.result similarity index 100% rename from mysql-test/r/ndb_sp.result rename to mysql-test/suite/ndb/r/ndb_sp.result diff --git a/mysql-test/r/ndb_subquery.result b/mysql-test/suite/ndb/r/ndb_subquery.result similarity index 100% rename from mysql-test/r/ndb_subquery.result rename to mysql-test/suite/ndb/r/ndb_subquery.result diff --git a/mysql-test/r/ndb_temporary.result b/mysql-test/suite/ndb/r/ndb_temporary.result similarity index 100% rename from mysql-test/r/ndb_temporary.result rename to mysql-test/suite/ndb/r/ndb_temporary.result diff --git a/mysql-test/r/ndb_transaction.result b/mysql-test/suite/ndb/r/ndb_transaction.result similarity index 100% rename from mysql-test/r/ndb_transaction.result rename to mysql-test/suite/ndb/r/ndb_transaction.result diff --git a/mysql-test/r/ndb_trigger.result b/mysql-test/suite/ndb/r/ndb_trigger.result similarity index 100% rename from mysql-test/r/ndb_trigger.result rename to mysql-test/suite/ndb/r/ndb_trigger.result diff --git a/mysql-test/r/ndb_truncate.result b/mysql-test/suite/ndb/r/ndb_truncate.result similarity index 100% rename from mysql-test/r/ndb_truncate.result rename to mysql-test/suite/ndb/r/ndb_truncate.result diff --git a/mysql-test/r/ndb_types.result b/mysql-test/suite/ndb/r/ndb_types.result similarity index 100% rename from mysql-test/r/ndb_types.result rename to mysql-test/suite/ndb/r/ndb_types.result diff --git a/mysql-test/r/ndb_update.result b/mysql-test/suite/ndb/r/ndb_update.result similarity index 100% rename from mysql-test/r/ndb_update.result rename to mysql-test/suite/ndb/r/ndb_update.result diff --git a/mysql-test/r/ndb_view.result b/mysql-test/suite/ndb/r/ndb_view.result similarity index 100% rename from mysql-test/r/ndb_view.result rename to mysql-test/suite/ndb/r/ndb_view.result diff --git a/mysql-test/r/ndbapi.result b/mysql-test/suite/ndb/r/ndbapi.result similarity index 100% rename from mysql-test/r/ndbapi.result rename to mysql-test/suite/ndb/r/ndbapi.result diff --git a/mysql-test/r/partition_03ndb.result b/mysql-test/suite/ndb/r/partition_03ndb.result similarity index 100% rename from mysql-test/r/partition_03ndb.result rename to mysql-test/suite/ndb/r/partition_03ndb.result diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/suite/ndb/r/ps_7ndb.result similarity index 100% rename from mysql-test/r/ps_7ndb.result rename to mysql-test/suite/ndb/r/ps_7ndb.result diff --git a/mysql-test/r/strict_autoinc_5ndb.result b/mysql-test/suite/ndb/r/strict_autoinc_5ndb.result similarity index 100% rename from mysql-test/r/strict_autoinc_5ndb.result rename to mysql-test/suite/ndb/r/strict_autoinc_5ndb.result diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def new file mode 100644 index 00000000000..ec1dc26039f --- /dev/null +++ b/mysql-test/suite/ndb/t/disabled.def @@ -0,0 +1,23 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# : BUG# +# +# Do not use any TAB characters for whitespace. +# +############################################################################## +ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog +ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog +ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed + +partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table + +ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms + +# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open +#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events +#ndb_binlog_discover : bug#21806 2006-08-24 +#ndb_autodiscover3 : bug#21806 diff --git a/mysql-test/t/loaddata_autocom_ndb.test b/mysql-test/suite/ndb/t/loaddata_autocom_ndb.test similarity index 100% rename from mysql-test/t/loaddata_autocom_ndb.test rename to mysql-test/suite/ndb/t/loaddata_autocom_ndb.test diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/suite/ndb/t/ndb_alter_table.test similarity index 100% rename from mysql-test/t/ndb_alter_table.test rename to mysql-test/suite/ndb/t/ndb_alter_table.test diff --git a/mysql-test/t/ndb_alter_table2.test b/mysql-test/suite/ndb/t/ndb_alter_table2.test similarity index 100% rename from mysql-test/t/ndb_alter_table2.test rename to mysql-test/suite/ndb/t/ndb_alter_table2.test diff --git a/mysql-test/t/ndb_alter_table3.test b/mysql-test/suite/ndb/t/ndb_alter_table3.test similarity index 100% rename from mysql-test/t/ndb_alter_table3.test rename to mysql-test/suite/ndb/t/ndb_alter_table3.test diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/suite/ndb/t/ndb_autodiscover.test similarity index 100% rename from mysql-test/t/ndb_autodiscover.test rename to mysql-test/suite/ndb/t/ndb_autodiscover.test diff --git a/mysql-test/t/ndb_autodiscover2-master.opt b/mysql-test/suite/ndb/t/ndb_autodiscover2-master.opt similarity index 100% rename from mysql-test/t/ndb_autodiscover2-master.opt rename to mysql-test/suite/ndb/t/ndb_autodiscover2-master.opt diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/suite/ndb/t/ndb_autodiscover2.test similarity index 100% rename from mysql-test/t/ndb_autodiscover2.test rename to mysql-test/suite/ndb/t/ndb_autodiscover2.test diff --git a/mysql-test/t/ndb_autodiscover3.test b/mysql-test/suite/ndb/t/ndb_autodiscover3.test similarity index 100% rename from mysql-test/t/ndb_autodiscover3.test rename to mysql-test/suite/ndb/t/ndb_autodiscover3.test diff --git a/mysql-test/t/ndb_backup_print.test b/mysql-test/suite/ndb/t/ndb_backup_print.test similarity index 100% rename from mysql-test/t/ndb_backup_print.test rename to mysql-test/suite/ndb/t/ndb_backup_print.test diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/suite/ndb/t/ndb_basic.test similarity index 100% rename from mysql-test/t/ndb_basic.test rename to mysql-test/suite/ndb/t/ndb_basic.test diff --git a/mysql-test/t/ndb_binlog_basic.test b/mysql-test/suite/ndb/t/ndb_binlog_basic.test similarity index 100% rename from mysql-test/t/ndb_binlog_basic.test rename to mysql-test/suite/ndb/t/ndb_binlog_basic.test diff --git a/mysql-test/t/ndb_binlog_basic2.test b/mysql-test/suite/ndb/t/ndb_binlog_basic2.test similarity index 100% rename from mysql-test/t/ndb_binlog_basic2.test rename to mysql-test/suite/ndb/t/ndb_binlog_basic2.test diff --git a/mysql-test/t/ndb_binlog_ddl_multi.test b/mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test similarity index 100% rename from mysql-test/t/ndb_binlog_ddl_multi.test rename to mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test diff --git a/mysql-test/t/ndb_binlog_discover.test b/mysql-test/suite/ndb/t/ndb_binlog_discover.test similarity index 100% rename from mysql-test/t/ndb_binlog_discover.test rename to mysql-test/suite/ndb/t/ndb_binlog_discover.test diff --git a/mysql-test/t/ndb_binlog_ignore_db-master.opt b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt similarity index 100% rename from mysql-test/t/ndb_binlog_ignore_db-master.opt rename to mysql-test/suite/ndb/t/ndb_binlog_ignore_db-master.opt diff --git a/mysql-test/t/ndb_binlog_ignore_db.test b/mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test similarity index 100% rename from mysql-test/t/ndb_binlog_ignore_db.test rename to mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test diff --git a/mysql-test/t/ndb_binlog_log_bin.test b/mysql-test/suite/ndb/t/ndb_binlog_log_bin.test similarity index 100% rename from mysql-test/t/ndb_binlog_log_bin.test rename to mysql-test/suite/ndb/t/ndb_binlog_log_bin.test diff --git a/mysql-test/t/ndb_binlog_multi.test b/mysql-test/suite/ndb/t/ndb_binlog_multi.test similarity index 100% rename from mysql-test/t/ndb_binlog_multi.test rename to mysql-test/suite/ndb/t/ndb_binlog_multi.test diff --git a/mysql-test/t/ndb_bitfield.test b/mysql-test/suite/ndb/t/ndb_bitfield.test similarity index 100% rename from mysql-test/t/ndb_bitfield.test rename to mysql-test/suite/ndb/t/ndb_bitfield.test diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/suite/ndb/t/ndb_blob.test similarity index 100% rename from mysql-test/t/ndb_blob.test rename to mysql-test/suite/ndb/t/ndb_blob.test diff --git a/mysql-test/t/ndb_blob_partition.test b/mysql-test/suite/ndb/t/ndb_blob_partition.test similarity index 100% rename from mysql-test/t/ndb_blob_partition.test rename to mysql-test/suite/ndb/t/ndb_blob_partition.test diff --git a/mysql-test/t/ndb_cache.test b/mysql-test/suite/ndb/t/ndb_cache.test similarity index 100% rename from mysql-test/t/ndb_cache.test rename to mysql-test/suite/ndb/t/ndb_cache.test diff --git a/mysql-test/t/ndb_cache2.test b/mysql-test/suite/ndb/t/ndb_cache2.test similarity index 100% rename from mysql-test/t/ndb_cache2.test rename to mysql-test/suite/ndb/t/ndb_cache2.test diff --git a/mysql-test/t/ndb_cache_multi.test b/mysql-test/suite/ndb/t/ndb_cache_multi.test similarity index 100% rename from mysql-test/t/ndb_cache_multi.test rename to mysql-test/suite/ndb/t/ndb_cache_multi.test diff --git a/mysql-test/t/ndb_cache_multi2.test b/mysql-test/suite/ndb/t/ndb_cache_multi2.test similarity index 100% rename from mysql-test/t/ndb_cache_multi2.test rename to mysql-test/suite/ndb/t/ndb_cache_multi2.test diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/suite/ndb/t/ndb_charset.test similarity index 100% rename from mysql-test/t/ndb_charset.test rename to mysql-test/suite/ndb/t/ndb_charset.test diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test similarity index 100% rename from mysql-test/t/ndb_condition_pushdown.test rename to mysql-test/suite/ndb/t/ndb_condition_pushdown.test diff --git a/mysql-test/t/ndb_config.test b/mysql-test/suite/ndb/t/ndb_config.test similarity index 100% rename from mysql-test/t/ndb_config.test rename to mysql-test/suite/ndb/t/ndb_config.test diff --git a/mysql-test/t/ndb_config2.test b/mysql-test/suite/ndb/t/ndb_config2.test similarity index 100% rename from mysql-test/t/ndb_config2.test rename to mysql-test/suite/ndb/t/ndb_config2.test diff --git a/mysql-test/t/ndb_cursor.test b/mysql-test/suite/ndb/t/ndb_cursor.test similarity index 100% rename from mysql-test/t/ndb_cursor.test rename to mysql-test/suite/ndb/t/ndb_cursor.test diff --git a/mysql-test/t/ndb_database.test b/mysql-test/suite/ndb/t/ndb_database.test similarity index 100% rename from mysql-test/t/ndb_database.test rename to mysql-test/suite/ndb/t/ndb_database.test diff --git a/mysql-test/t/ndb_dd_alter.test b/mysql-test/suite/ndb/t/ndb_dd_alter.test similarity index 100% rename from mysql-test/t/ndb_dd_alter.test rename to mysql-test/suite/ndb/t/ndb_dd_alter.test diff --git a/mysql-test/t/ndb_dd_backuprestore.test b/mysql-test/suite/ndb/t/ndb_dd_backuprestore.test similarity index 100% rename from mysql-test/t/ndb_dd_backuprestore.test rename to mysql-test/suite/ndb/t/ndb_dd_backuprestore.test diff --git a/mysql-test/t/ndb_dd_basic.test b/mysql-test/suite/ndb/t/ndb_dd_basic.test similarity index 100% rename from mysql-test/t/ndb_dd_basic.test rename to mysql-test/suite/ndb/t/ndb_dd_basic.test diff --git a/mysql-test/t/ndb_dd_ddl.test b/mysql-test/suite/ndb/t/ndb_dd_ddl.test similarity index 100% rename from mysql-test/t/ndb_dd_ddl.test rename to mysql-test/suite/ndb/t/ndb_dd_ddl.test diff --git a/mysql-test/t/ndb_dd_disk2memory.test b/mysql-test/suite/ndb/t/ndb_dd_disk2memory.test similarity index 100% rename from mysql-test/t/ndb_dd_disk2memory.test rename to mysql-test/suite/ndb/t/ndb_dd_disk2memory.test diff --git a/mysql-test/t/ndb_dd_dump.test b/mysql-test/suite/ndb/t/ndb_dd_dump.test similarity index 100% rename from mysql-test/t/ndb_dd_dump.test rename to mysql-test/suite/ndb/t/ndb_dd_dump.test diff --git a/mysql-test/t/ndb_dd_sql_features.test b/mysql-test/suite/ndb/t/ndb_dd_sql_features.test similarity index 100% rename from mysql-test/t/ndb_dd_sql_features.test rename to mysql-test/suite/ndb/t/ndb_dd_sql_features.test diff --git a/mysql-test/t/ndb_gis.test b/mysql-test/suite/ndb/t/ndb_gis.test similarity index 100% rename from mysql-test/t/ndb_gis.test rename to mysql-test/suite/ndb/t/ndb_gis.test diff --git a/mysql-test/t/ndb_grant.later b/mysql-test/suite/ndb/t/ndb_grant.later similarity index 100% rename from mysql-test/t/ndb_grant.later rename to mysql-test/suite/ndb/t/ndb_grant.later diff --git a/mysql-test/t/ndb_index.test b/mysql-test/suite/ndb/t/ndb_index.test similarity index 100% rename from mysql-test/t/ndb_index.test rename to mysql-test/suite/ndb/t/ndb_index.test diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/suite/ndb/t/ndb_index_ordered.test similarity index 100% rename from mysql-test/t/ndb_index_ordered.test rename to mysql-test/suite/ndb/t/ndb_index_ordered.test diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/suite/ndb/t/ndb_index_unique.test similarity index 100% rename from mysql-test/t/ndb_index_unique.test rename to mysql-test/suite/ndb/t/ndb_index_unique.test diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/suite/ndb/t/ndb_insert.test similarity index 100% rename from mysql-test/t/ndb_insert.test rename to mysql-test/suite/ndb/t/ndb_insert.test diff --git a/mysql-test/t/ndb_limit.test b/mysql-test/suite/ndb/t/ndb_limit.test similarity index 100% rename from mysql-test/t/ndb_limit.test rename to mysql-test/suite/ndb/t/ndb_limit.test diff --git a/mysql-test/t/ndb_load.test b/mysql-test/suite/ndb/t/ndb_load.test similarity index 100% rename from mysql-test/t/ndb_load.test rename to mysql-test/suite/ndb/t/ndb_load.test diff --git a/mysql-test/t/ndb_loaddatalocal.test b/mysql-test/suite/ndb/t/ndb_loaddatalocal.test similarity index 100% rename from mysql-test/t/ndb_loaddatalocal.test rename to mysql-test/suite/ndb/t/ndb_loaddatalocal.test diff --git a/mysql-test/t/ndb_lock.test b/mysql-test/suite/ndb/t/ndb_lock.test similarity index 100% rename from mysql-test/t/ndb_lock.test rename to mysql-test/suite/ndb/t/ndb_lock.test diff --git a/mysql-test/t/ndb_minmax.test b/mysql-test/suite/ndb/t/ndb_minmax.test similarity index 100% rename from mysql-test/t/ndb_minmax.test rename to mysql-test/suite/ndb/t/ndb_minmax.test diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/suite/ndb/t/ndb_multi.test similarity index 100% rename from mysql-test/t/ndb_multi.test rename to mysql-test/suite/ndb/t/ndb_multi.test diff --git a/mysql-test/t/ndb_multi_row.test b/mysql-test/suite/ndb/t/ndb_multi_row.test similarity index 100% rename from mysql-test/t/ndb_multi_row.test rename to mysql-test/suite/ndb/t/ndb_multi_row.test diff --git a/mysql-test/t/ndb_partition_error.test b/mysql-test/suite/ndb/t/ndb_partition_error.test similarity index 100% rename from mysql-test/t/ndb_partition_error.test rename to mysql-test/suite/ndb/t/ndb_partition_error.test diff --git a/mysql-test/t/ndb_partition_error2-master.opt b/mysql-test/suite/ndb/t/ndb_partition_error2-master.opt similarity index 100% rename from mysql-test/t/ndb_partition_error2-master.opt rename to mysql-test/suite/ndb/t/ndb_partition_error2-master.opt diff --git a/mysql-test/t/ndb_partition_error2.test b/mysql-test/suite/ndb/t/ndb_partition_error2.test similarity index 100% rename from mysql-test/t/ndb_partition_error2.test rename to mysql-test/suite/ndb/t/ndb_partition_error2.test diff --git a/mysql-test/t/ndb_partition_key.test b/mysql-test/suite/ndb/t/ndb_partition_key.test similarity index 100% rename from mysql-test/t/ndb_partition_key.test rename to mysql-test/suite/ndb/t/ndb_partition_key.test diff --git a/mysql-test/t/ndb_partition_list.test b/mysql-test/suite/ndb/t/ndb_partition_list.test similarity index 100% rename from mysql-test/t/ndb_partition_list.test rename to mysql-test/suite/ndb/t/ndb_partition_list.test diff --git a/mysql-test/t/ndb_partition_range.test b/mysql-test/suite/ndb/t/ndb_partition_range.test similarity index 100% rename from mysql-test/t/ndb_partition_range.test rename to mysql-test/suite/ndb/t/ndb_partition_range.test diff --git a/mysql-test/t/ndb_read_multi_range.test b/mysql-test/suite/ndb/t/ndb_read_multi_range.test similarity index 100% rename from mysql-test/t/ndb_read_multi_range.test rename to mysql-test/suite/ndb/t/ndb_read_multi_range.test diff --git a/mysql-test/t/ndb_rename.test b/mysql-test/suite/ndb/t/ndb_rename.test similarity index 100% rename from mysql-test/t/ndb_rename.test rename to mysql-test/suite/ndb/t/ndb_rename.test diff --git a/mysql-test/t/ndb_replace.test b/mysql-test/suite/ndb/t/ndb_replace.test similarity index 100% rename from mysql-test/t/ndb_replace.test rename to mysql-test/suite/ndb/t/ndb_replace.test diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/suite/ndb/t/ndb_restore.test similarity index 100% rename from mysql-test/t/ndb_restore.test rename to mysql-test/suite/ndb/t/ndb_restore.test diff --git a/mysql-test/t/ndb_restore_compat.test b/mysql-test/suite/ndb/t/ndb_restore_compat.test similarity index 100% rename from mysql-test/t/ndb_restore_compat.test rename to mysql-test/suite/ndb/t/ndb_restore_compat.test diff --git a/mysql-test/t/ndb_restore_partition-master.opt b/mysql-test/suite/ndb/t/ndb_restore_partition-master.opt similarity index 100% rename from mysql-test/t/ndb_restore_partition-master.opt rename to mysql-test/suite/ndb/t/ndb_restore_partition-master.opt diff --git a/mysql-test/t/ndb_restore_partition.test b/mysql-test/suite/ndb/t/ndb_restore_partition.test similarity index 100% rename from mysql-test/t/ndb_restore_partition.test rename to mysql-test/suite/ndb/t/ndb_restore_partition.test diff --git a/mysql-test/t/ndb_restore_print.test b/mysql-test/suite/ndb/t/ndb_restore_print.test similarity index 100% rename from mysql-test/t/ndb_restore_print.test rename to mysql-test/suite/ndb/t/ndb_restore_print.test diff --git a/mysql-test/t/ndb_row_format.test b/mysql-test/suite/ndb/t/ndb_row_format.test similarity index 100% rename from mysql-test/t/ndb_row_format.test rename to mysql-test/suite/ndb/t/ndb_row_format.test diff --git a/mysql-test/t/ndb_single_user.test b/mysql-test/suite/ndb/t/ndb_single_user.test similarity index 100% rename from mysql-test/t/ndb_single_user.test rename to mysql-test/suite/ndb/t/ndb_single_user.test diff --git a/mysql-test/t/ndb_sp.test b/mysql-test/suite/ndb/t/ndb_sp.test similarity index 100% rename from mysql-test/t/ndb_sp.test rename to mysql-test/suite/ndb/t/ndb_sp.test diff --git a/mysql-test/t/ndb_subquery.test b/mysql-test/suite/ndb/t/ndb_subquery.test similarity index 100% rename from mysql-test/t/ndb_subquery.test rename to mysql-test/suite/ndb/t/ndb_subquery.test diff --git a/mysql-test/t/ndb_temporary.test b/mysql-test/suite/ndb/t/ndb_temporary.test similarity index 100% rename from mysql-test/t/ndb_temporary.test rename to mysql-test/suite/ndb/t/ndb_temporary.test diff --git a/mysql-test/t/ndb_transaction.test b/mysql-test/suite/ndb/t/ndb_transaction.test similarity index 100% rename from mysql-test/t/ndb_transaction.test rename to mysql-test/suite/ndb/t/ndb_transaction.test diff --git a/mysql-test/t/ndb_trigger.test b/mysql-test/suite/ndb/t/ndb_trigger.test similarity index 100% rename from mysql-test/t/ndb_trigger.test rename to mysql-test/suite/ndb/t/ndb_trigger.test diff --git a/mysql-test/t/ndb_truncate.test b/mysql-test/suite/ndb/t/ndb_truncate.test similarity index 100% rename from mysql-test/t/ndb_truncate.test rename to mysql-test/suite/ndb/t/ndb_truncate.test diff --git a/mysql-test/t/ndb_types.test b/mysql-test/suite/ndb/t/ndb_types.test similarity index 100% rename from mysql-test/t/ndb_types.test rename to mysql-test/suite/ndb/t/ndb_types.test diff --git a/mysql-test/t/ndb_update.test b/mysql-test/suite/ndb/t/ndb_update.test similarity index 100% rename from mysql-test/t/ndb_update.test rename to mysql-test/suite/ndb/t/ndb_update.test diff --git a/mysql-test/t/ndb_view.test b/mysql-test/suite/ndb/t/ndb_view.test similarity index 100% rename from mysql-test/t/ndb_view.test rename to mysql-test/suite/ndb/t/ndb_view.test diff --git a/mysql-test/t/ndbapi.test b/mysql-test/suite/ndb/t/ndbapi.test similarity index 100% rename from mysql-test/t/ndbapi.test rename to mysql-test/suite/ndb/t/ndbapi.test diff --git a/mysql-test/t/partition_03ndb.test b/mysql-test/suite/ndb/t/partition_03ndb.test similarity index 100% rename from mysql-test/t/partition_03ndb.test rename to mysql-test/suite/ndb/t/partition_03ndb.test diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/suite/ndb/t/ps_7ndb.test similarity index 100% rename from mysql-test/t/ps_7ndb.test rename to mysql-test/suite/ndb/t/ps_7ndb.test diff --git a/mysql-test/t/strict_autoinc_5ndb.test b/mysql-test/suite/ndb/t/strict_autoinc_5ndb.test similarity index 100% rename from mysql-test/t/strict_autoinc_5ndb.test rename to mysql-test/suite/ndb/t/strict_autoinc_5ndb.test diff --git a/mysql-test/r/rpl000001.a.result b/mysql-test/suite/rpl/r/rpl000001.a.result similarity index 100% rename from mysql-test/r/rpl000001.a.result rename to mysql-test/suite/rpl/r/rpl000001.a.result diff --git a/mysql-test/r/rpl000001.b.result b/mysql-test/suite/rpl/r/rpl000001.b.result similarity index 100% rename from mysql-test/r/rpl000001.b.result rename to mysql-test/suite/rpl/r/rpl000001.b.result diff --git a/mysql-test/r/rpl000010.result b/mysql-test/suite/rpl/r/rpl000010.result similarity index 100% rename from mysql-test/r/rpl000010.result rename to mysql-test/suite/rpl/r/rpl000010.result diff --git a/mysql-test/r/rpl000011.result b/mysql-test/suite/rpl/r/rpl000011.result similarity index 100% rename from mysql-test/r/rpl000011.result rename to mysql-test/suite/rpl/r/rpl000011.result diff --git a/mysql-test/r/rpl000013.result b/mysql-test/suite/rpl/r/rpl000013.result similarity index 100% rename from mysql-test/r/rpl000013.result rename to mysql-test/suite/rpl/r/rpl000013.result diff --git a/mysql-test/r/rpl000017.result b/mysql-test/suite/rpl/r/rpl000017.result similarity index 100% rename from mysql-test/r/rpl000017.result rename to mysql-test/suite/rpl/r/rpl000017.result diff --git a/mysql-test/r/rpl_000015.result b/mysql-test/suite/rpl/r/rpl_000015.result similarity index 100% rename from mysql-test/r/rpl_000015.result rename to mysql-test/suite/rpl/r/rpl_000015.result diff --git a/mysql-test/r/rpl_EE_err.result b/mysql-test/suite/rpl/r/rpl_EE_err.result similarity index 100% rename from mysql-test/r/rpl_EE_err.result rename to mysql-test/suite/rpl/r/rpl_EE_err.result diff --git a/mysql-test/r/rpl_LD_INFILE.result b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result similarity index 100% rename from mysql-test/r/rpl_LD_INFILE.result rename to mysql-test/suite/rpl/r/rpl_LD_INFILE.result diff --git a/mysql-test/r/rpl_alter.result b/mysql-test/suite/rpl/r/rpl_alter.result similarity index 100% rename from mysql-test/r/rpl_alter.result rename to mysql-test/suite/rpl/r/rpl_alter.result diff --git a/mysql-test/r/rpl_alter_db.result b/mysql-test/suite/rpl/r/rpl_alter_db.result similarity index 100% rename from mysql-test/r/rpl_alter_db.result rename to mysql-test/suite/rpl/r/rpl_alter_db.result diff --git a/mysql-test/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result similarity index 100% rename from mysql-test/r/rpl_auto_increment.result rename to mysql-test/suite/rpl/r/rpl_auto_increment.result diff --git a/mysql-test/r/rpl_auto_increment_11932.result b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result similarity index 100% rename from mysql-test/r/rpl_auto_increment_11932.result rename to mysql-test/suite/rpl/r/rpl_auto_increment_11932.result diff --git a/mysql-test/r/rpl_bit.result b/mysql-test/suite/rpl/r/rpl_bit.result similarity index 100% rename from mysql-test/r/rpl_bit.result rename to mysql-test/suite/rpl/r/rpl_bit.result diff --git a/mysql-test/r/rpl_bit_npk.result b/mysql-test/suite/rpl/r/rpl_bit_npk.result similarity index 100% rename from mysql-test/r/rpl_bit_npk.result rename to mysql-test/suite/rpl/r/rpl_bit_npk.result diff --git a/mysql-test/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result similarity index 100% rename from mysql-test/r/rpl_change_master.result rename to mysql-test/suite/rpl/r/rpl_change_master.result diff --git a/mysql-test/r/rpl_charset_sjis.result b/mysql-test/suite/rpl/r/rpl_charset_sjis.result similarity index 100% rename from mysql-test/r/rpl_charset_sjis.result rename to mysql-test/suite/rpl/r/rpl_charset_sjis.result diff --git a/mysql-test/r/rpl_commit_after_flush.result b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result similarity index 100% rename from mysql-test/r/rpl_commit_after_flush.result rename to mysql-test/suite/rpl/r/rpl_commit_after_flush.result diff --git a/mysql-test/r/rpl_create_database.result b/mysql-test/suite/rpl/r/rpl_create_database.result similarity index 100% rename from mysql-test/r/rpl_create_database.result rename to mysql-test/suite/rpl/r/rpl_create_database.result diff --git a/mysql-test/r/rpl_critical_errors.result b/mysql-test/suite/rpl/r/rpl_critical_errors.result similarity index 100% rename from mysql-test/r/rpl_critical_errors.result rename to mysql-test/suite/rpl/r/rpl_critical_errors.result diff --git a/mysql-test/r/rpl_critical_errors.result.txt b/mysql-test/suite/rpl/r/rpl_critical_errors.result.txt similarity index 100% rename from mysql-test/r/rpl_critical_errors.result.txt rename to mysql-test/suite/rpl/r/rpl_critical_errors.result.txt diff --git a/mysql-test/r/rpl_ddl.result b/mysql-test/suite/rpl/r/rpl_ddl.result similarity index 100% rename from mysql-test/r/rpl_ddl.result rename to mysql-test/suite/rpl/r/rpl_ddl.result diff --git a/mysql-test/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result similarity index 100% rename from mysql-test/r/rpl_deadlock_innodb.result rename to mysql-test/suite/rpl/r/rpl_deadlock_innodb.result diff --git a/mysql-test/r/rpl_delete_no_where.result b/mysql-test/suite/rpl/r/rpl_delete_no_where.result similarity index 100% rename from mysql-test/r/rpl_delete_no_where.result rename to mysql-test/suite/rpl/r/rpl_delete_no_where.result diff --git a/mysql-test/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result similarity index 100% rename from mysql-test/r/rpl_do_grant.result rename to mysql-test/suite/rpl/r/rpl_do_grant.result diff --git a/mysql-test/r/rpl_drop.result b/mysql-test/suite/rpl/r/rpl_drop.result similarity index 100% rename from mysql-test/r/rpl_drop.result rename to mysql-test/suite/rpl/r/rpl_drop.result diff --git a/mysql-test/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result similarity index 100% rename from mysql-test/r/rpl_drop_db.result rename to mysql-test/suite/rpl/r/rpl_drop_db.result diff --git a/mysql-test/r/rpl_drop_temp.result b/mysql-test/suite/rpl/r/rpl_drop_temp.result similarity index 100% rename from mysql-test/r/rpl_drop_temp.result rename to mysql-test/suite/rpl/r/rpl_drop_temp.result diff --git a/mysql-test/r/rpl_dual_pos_advance.result b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result similarity index 100% rename from mysql-test/r/rpl_dual_pos_advance.result rename to mysql-test/suite/rpl/r/rpl_dual_pos_advance.result diff --git a/mysql-test/r/rpl_empty_master_crash.result b/mysql-test/suite/rpl/r/rpl_empty_master_crash.result similarity index 100% rename from mysql-test/r/rpl_empty_master_crash.result rename to mysql-test/suite/rpl/r/rpl_empty_master_crash.result diff --git a/mysql-test/r/rpl_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result similarity index 100% rename from mysql-test/r/rpl_err_ignoredtable.result rename to mysql-test/suite/rpl/r/rpl_err_ignoredtable.result diff --git a/mysql-test/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result similarity index 100% rename from mysql-test/r/rpl_events.result rename to mysql-test/suite/rpl/r/rpl_events.result diff --git a/mysql-test/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result similarity index 100% rename from mysql-test/r/rpl_extraCol_innodb.result rename to mysql-test/suite/rpl/r/rpl_extraCol_innodb.result diff --git a/mysql-test/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result similarity index 100% rename from mysql-test/r/rpl_extraCol_myisam.result rename to mysql-test/suite/rpl/r/rpl_extraCol_myisam.result diff --git a/mysql-test/r/rpl_failed_optimize.result b/mysql-test/suite/rpl/r/rpl_failed_optimize.result similarity index 100% rename from mysql-test/r/rpl_failed_optimize.result rename to mysql-test/suite/rpl/r/rpl_failed_optimize.result diff --git a/mysql-test/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result similarity index 100% rename from mysql-test/r/rpl_flushlog_loop.result rename to mysql-test/suite/rpl/r/rpl_flushlog_loop.result diff --git a/mysql-test/r/rpl_foreign_key_innodb.result b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result similarity index 100% rename from mysql-test/r/rpl_foreign_key_innodb.result rename to mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result diff --git a/mysql-test/r/rpl_free_items.result b/mysql-test/suite/rpl/r/rpl_free_items.result similarity index 100% rename from mysql-test/r/rpl_free_items.result rename to mysql-test/suite/rpl/r/rpl_free_items.result diff --git a/mysql-test/r/rpl_get_lock.result b/mysql-test/suite/rpl/r/rpl_get_lock.result similarity index 100% rename from mysql-test/r/rpl_get_lock.result rename to mysql-test/suite/rpl/r/rpl_get_lock.result diff --git a/mysql-test/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result similarity index 100% rename from mysql-test/r/rpl_ignore_grant.result rename to mysql-test/suite/rpl/r/rpl_ignore_grant.result diff --git a/mysql-test/r/rpl_ignore_revoke.result b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result similarity index 100% rename from mysql-test/r/rpl_ignore_revoke.result rename to mysql-test/suite/rpl/r/rpl_ignore_revoke.result diff --git a/mysql-test/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result similarity index 100% rename from mysql-test/r/rpl_ignore_table.result rename to mysql-test/suite/rpl/r/rpl_ignore_table.result diff --git a/mysql-test/r/rpl_ignore_table_update.result b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result similarity index 100% rename from mysql-test/r/rpl_ignore_table_update.result rename to mysql-test/suite/rpl/r/rpl_ignore_table_update.result diff --git a/mysql-test/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result similarity index 100% rename from mysql-test/r/rpl_incident.result rename to mysql-test/suite/rpl/r/rpl_incident.result diff --git a/mysql-test/r/rpl_init_slave.result b/mysql-test/suite/rpl/r/rpl_init_slave.result similarity index 100% rename from mysql-test/r/rpl_init_slave.result rename to mysql-test/suite/rpl/r/rpl_init_slave.result diff --git a/mysql-test/r/rpl_innodb.result b/mysql-test/suite/rpl/r/rpl_innodb.result similarity index 100% rename from mysql-test/r/rpl_innodb.result rename to mysql-test/suite/rpl/r/rpl_innodb.result diff --git a/mysql-test/r/rpl_insert.result b/mysql-test/suite/rpl/r/rpl_insert.result similarity index 100% rename from mysql-test/r/rpl_insert.result rename to mysql-test/suite/rpl/r/rpl_insert.result diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/suite/rpl/r/rpl_insert_id.result similarity index 100% rename from mysql-test/r/rpl_insert_id.result rename to mysql-test/suite/rpl/r/rpl_insert_id.result diff --git a/mysql-test/r/rpl_insert_id_pk.result b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result similarity index 100% rename from mysql-test/r/rpl_insert_id_pk.result rename to mysql-test/suite/rpl/r/rpl_insert_id_pk.result diff --git a/mysql-test/r/rpl_insert_ignore.result b/mysql-test/suite/rpl/r/rpl_insert_ignore.result similarity index 100% rename from mysql-test/r/rpl_insert_ignore.result rename to mysql-test/suite/rpl/r/rpl_insert_ignore.result diff --git a/mysql-test/r/rpl_insert_select.result b/mysql-test/suite/rpl/r/rpl_insert_select.result similarity index 100% rename from mysql-test/r/rpl_insert_select.result rename to mysql-test/suite/rpl/r/rpl_insert_select.result diff --git a/mysql-test/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result similarity index 100% rename from mysql-test/r/rpl_known_bugs_detection.result rename to mysql-test/suite/rpl/r/rpl_known_bugs_detection.result diff --git a/mysql-test/r/rpl_load_from_master.result b/mysql-test/suite/rpl/r/rpl_load_from_master.result similarity index 100% rename from mysql-test/r/rpl_load_from_master.result rename to mysql-test/suite/rpl/r/rpl_load_from_master.result diff --git a/mysql-test/r/rpl_load_table_from_master.result b/mysql-test/suite/rpl/r/rpl_load_table_from_master.result similarity index 100% rename from mysql-test/r/rpl_load_table_from_master.result rename to mysql-test/suite/rpl/r/rpl_load_table_from_master.result diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result similarity index 100% rename from mysql-test/r/rpl_loaddata.result rename to mysql-test/suite/rpl/r/rpl_loaddata.result diff --git a/mysql-test/r/rpl_loaddata_charset.result b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result similarity index 100% rename from mysql-test/r/rpl_loaddata_charset.result rename to mysql-test/suite/rpl/r/rpl_loaddata_charset.result diff --git a/mysql-test/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result similarity index 100% rename from mysql-test/r/rpl_loaddata_m.result rename to mysql-test/suite/rpl/r/rpl_loaddata_m.result diff --git a/mysql-test/r/rpl_loaddata_s.result b/mysql-test/suite/rpl/r/rpl_loaddata_s.result similarity index 100% rename from mysql-test/r/rpl_loaddata_s.result rename to mysql-test/suite/rpl/r/rpl_loaddata_s.result diff --git a/mysql-test/r/rpl_loaddata_simple.result b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result similarity index 100% rename from mysql-test/r/rpl_loaddata_simple.result rename to mysql-test/suite/rpl/r/rpl_loaddata_simple.result diff --git a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result similarity index 100% rename from mysql-test/r/rpl_loaddatalocal.result rename to mysql-test/suite/rpl/r/rpl_loaddatalocal.result diff --git a/mysql-test/r/rpl_loadfile.result b/mysql-test/suite/rpl/r/rpl_loadfile.result similarity index 100% rename from mysql-test/r/rpl_loadfile.result rename to mysql-test/suite/rpl/r/rpl_loadfile.result diff --git a/mysql-test/r/rpl_locale.result b/mysql-test/suite/rpl/r/rpl_locale.result similarity index 100% rename from mysql-test/r/rpl_locale.result rename to mysql-test/suite/rpl/r/rpl_locale.result diff --git a/mysql-test/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result similarity index 100% rename from mysql-test/r/rpl_log_pos.result rename to mysql-test/suite/rpl/r/rpl_log_pos.result diff --git a/mysql-test/r/rpl_many_optimize.result b/mysql-test/suite/rpl/r/rpl_many_optimize.result similarity index 100% rename from mysql-test/r/rpl_many_optimize.result rename to mysql-test/suite/rpl/r/rpl_many_optimize.result diff --git a/mysql-test/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result similarity index 100% rename from mysql-test/r/rpl_master_pos_wait.result rename to mysql-test/suite/rpl/r/rpl_master_pos_wait.result diff --git a/mysql-test/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result similarity index 100% rename from mysql-test/r/rpl_misc_functions.result rename to mysql-test/suite/rpl/r/rpl_misc_functions.result diff --git a/mysql-test/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result similarity index 100% rename from mysql-test/r/rpl_mixed_ddl_dml.result rename to mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result diff --git a/mysql-test/r/rpl_multi_delete.result b/mysql-test/suite/rpl/r/rpl_multi_delete.result similarity index 100% rename from mysql-test/r/rpl_multi_delete.result rename to mysql-test/suite/rpl/r/rpl_multi_delete.result diff --git a/mysql-test/r/rpl_multi_delete2.result b/mysql-test/suite/rpl/r/rpl_multi_delete2.result similarity index 100% rename from mysql-test/r/rpl_multi_delete2.result rename to mysql-test/suite/rpl/r/rpl_multi_delete2.result diff --git a/mysql-test/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result similarity index 100% rename from mysql-test/r/rpl_multi_engine.result rename to mysql-test/suite/rpl/r/rpl_multi_engine.result diff --git a/mysql-test/r/rpl_multi_update.result b/mysql-test/suite/rpl/r/rpl_multi_update.result similarity index 100% rename from mysql-test/r/rpl_multi_update.result rename to mysql-test/suite/rpl/r/rpl_multi_update.result diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/suite/rpl/r/rpl_multi_update2.result similarity index 100% rename from mysql-test/r/rpl_multi_update2.result rename to mysql-test/suite/rpl/r/rpl_multi_update2.result diff --git a/mysql-test/r/rpl_multi_update3.result b/mysql-test/suite/rpl/r/rpl_multi_update3.result similarity index 100% rename from mysql-test/r/rpl_multi_update3.result rename to mysql-test/suite/rpl/r/rpl_multi_update3.result diff --git a/mysql-test/r/rpl_multi_update4.result b/mysql-test/suite/rpl/r/rpl_multi_update4.result similarity index 100% rename from mysql-test/r/rpl_multi_update4.result rename to mysql-test/suite/rpl/r/rpl_multi_update4.result diff --git a/mysql-test/r/rpl_optimize.result b/mysql-test/suite/rpl/r/rpl_optimize.result similarity index 100% rename from mysql-test/r/rpl_optimize.result rename to mysql-test/suite/rpl/r/rpl_optimize.result diff --git a/mysql-test/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result similarity index 100% rename from mysql-test/r/rpl_packet.result rename to mysql-test/suite/rpl/r/rpl_packet.result diff --git a/mysql-test/r/rpl_ps.result b/mysql-test/suite/rpl/r/rpl_ps.result similarity index 100% rename from mysql-test/r/rpl_ps.result rename to mysql-test/suite/rpl/r/rpl_ps.result diff --git a/mysql-test/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result similarity index 100% rename from mysql-test/r/rpl_rbr_to_sbr.result rename to mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result diff --git a/mysql-test/r/rpl_read_only.result b/mysql-test/suite/rpl/r/rpl_read_only.result similarity index 100% rename from mysql-test/r/rpl_read_only.result rename to mysql-test/suite/rpl/r/rpl_read_only.result diff --git a/mysql-test/r/rpl_redirect.result b/mysql-test/suite/rpl/r/rpl_redirect.result similarity index 100% rename from mysql-test/r/rpl_redirect.result rename to mysql-test/suite/rpl/r/rpl_redirect.result diff --git a/mysql-test/r/rpl_relay_space_innodb.result b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result similarity index 100% rename from mysql-test/r/rpl_relay_space_innodb.result rename to mysql-test/suite/rpl/r/rpl_relay_space_innodb.result diff --git a/mysql-test/r/rpl_relay_space_myisam.result b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result similarity index 100% rename from mysql-test/r/rpl_relay_space_myisam.result rename to mysql-test/suite/rpl/r/rpl_relay_space_myisam.result diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/suite/rpl/r/rpl_relayrotate.result similarity index 100% rename from mysql-test/r/rpl_relayrotate.result rename to mysql-test/suite/rpl/r/rpl_relayrotate.result diff --git a/mysql-test/r/rpl_relayspace.result b/mysql-test/suite/rpl/r/rpl_relayspace.result similarity index 100% rename from mysql-test/r/rpl_relayspace.result rename to mysql-test/suite/rpl/r/rpl_relayspace.result diff --git a/mysql-test/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result similarity index 100% rename from mysql-test/r/rpl_replicate_do.result rename to mysql-test/suite/rpl/r/rpl_replicate_do.result diff --git a/mysql-test/r/rpl_replicate_ignore_db.result b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result similarity index 100% rename from mysql-test/r/rpl_replicate_ignore_db.result rename to mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result diff --git a/mysql-test/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result similarity index 100% rename from mysql-test/r/rpl_rewrt_db.result rename to mysql-test/suite/rpl/r/rpl_rewrt_db.result diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result similarity index 100% rename from mysql-test/r/rpl_rotate_logs.result rename to mysql-test/suite/rpl/r/rpl_rotate_logs.result diff --git a/mysql-test/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result similarity index 100% rename from mysql-test/r/rpl_row_001.result rename to mysql-test/suite/rpl/r/rpl_row_001.result diff --git a/mysql-test/r/rpl_row_4_bytes.result b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result similarity index 100% rename from mysql-test/r/rpl_row_4_bytes.result rename to mysql-test/suite/rpl/r/rpl_row_4_bytes.result diff --git a/mysql-test/r/rpl_row_NOW.result b/mysql-test/suite/rpl/r/rpl_row_NOW.result similarity index 100% rename from mysql-test/r/rpl_row_NOW.result rename to mysql-test/suite/rpl/r/rpl_row_NOW.result diff --git a/mysql-test/r/rpl_row_USER.result b/mysql-test/suite/rpl/r/rpl_row_USER.result similarity index 100% rename from mysql-test/r/rpl_row_USER.result rename to mysql-test/suite/rpl/r/rpl_row_USER.result diff --git a/mysql-test/r/rpl_row_UUID.result b/mysql-test/suite/rpl/r/rpl_row_UUID.result similarity index 100% rename from mysql-test/r/rpl_row_UUID.result rename to mysql-test/suite/rpl/r/rpl_row_UUID.result diff --git a/mysql-test/r/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt similarity index 100% rename from mysql-test/r/rpl_row_basic_11bugs-master.opt rename to mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt diff --git a/mysql-test/r/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt similarity index 100% rename from mysql-test/r/rpl_row_basic_11bugs-slave.opt rename to mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt diff --git a/mysql-test/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result similarity index 100% rename from mysql-test/r/rpl_row_basic_11bugs.result rename to mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result diff --git a/mysql-test/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result similarity index 100% rename from mysql-test/r/rpl_row_basic_2myisam.result rename to mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result diff --git a/mysql-test/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result similarity index 100% rename from mysql-test/r/rpl_row_basic_3innodb.result rename to mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result diff --git a/mysql-test/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result similarity index 100% rename from mysql-test/r/rpl_row_basic_8partition.result rename to mysql-test/suite/rpl/r/rpl_row_basic_8partition.result diff --git a/mysql-test/r/rpl_row_blob_innodb.result b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result similarity index 100% rename from mysql-test/r/rpl_row_blob_innodb.result rename to mysql-test/suite/rpl/r/rpl_row_blob_innodb.result diff --git a/mysql-test/r/rpl_row_blob_myisam.result b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result similarity index 100% rename from mysql-test/r/rpl_row_blob_myisam.result rename to mysql-test/suite/rpl/r/rpl_row_blob_myisam.result diff --git a/mysql-test/r/rpl_row_charset.result b/mysql-test/suite/rpl/r/rpl_row_charset.result similarity index 100% rename from mysql-test/r/rpl_row_charset.result rename to mysql-test/suite/rpl/r/rpl_row_charset.result diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result similarity index 100% rename from mysql-test/r/rpl_row_create_table.result rename to mysql-test/suite/rpl/r/rpl_row_create_table.result diff --git a/mysql-test/r/rpl_row_delayed_ins.result b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result similarity index 100% rename from mysql-test/r/rpl_row_delayed_ins.result rename to mysql-test/suite/rpl/r/rpl_row_delayed_ins.result diff --git a/mysql-test/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result similarity index 100% rename from mysql-test/r/rpl_row_drop.result rename to mysql-test/suite/rpl/r/rpl_row_drop.result diff --git a/mysql-test/r/rpl_row_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result similarity index 100% rename from mysql-test/r/rpl_row_err_ignoredtable.result rename to mysql-test/suite/rpl/r/rpl_row_err_ignoredtable.result diff --git a/mysql-test/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result similarity index 100% rename from mysql-test/r/rpl_row_flsh_tbls.result rename to mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result diff --git a/mysql-test/r/rpl_row_func001.result b/mysql-test/suite/rpl/r/rpl_row_func001.result similarity index 100% rename from mysql-test/r/rpl_row_func001.result rename to mysql-test/suite/rpl/r/rpl_row_func001.result diff --git a/mysql-test/r/rpl_row_func002.result b/mysql-test/suite/rpl/r/rpl_row_func002.result similarity index 100% rename from mysql-test/r/rpl_row_func002.result rename to mysql-test/suite/rpl/r/rpl_row_func002.result diff --git a/mysql-test/r/rpl_row_func003.result b/mysql-test/suite/rpl/r/rpl_row_func003.result similarity index 100% rename from mysql-test/r/rpl_row_func003.result rename to mysql-test/suite/rpl/r/rpl_row_func003.result diff --git a/mysql-test/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result similarity index 100% rename from mysql-test/r/rpl_row_inexist_tbl.result rename to mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result diff --git a/mysql-test/r/rpl_row_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result similarity index 100% rename from mysql-test/r/rpl_row_insert_delayed.result rename to mysql-test/suite/rpl/r/rpl_row_insert_delayed.result diff --git a/mysql-test/r/rpl_row_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_m.result similarity index 100% rename from mysql-test/r/rpl_row_loaddata_m.result rename to mysql-test/suite/rpl/r/rpl_row_loaddata_m.result diff --git a/mysql-test/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result similarity index 100% rename from mysql-test/r/rpl_row_log.result rename to mysql-test/suite/rpl/r/rpl_row_log.result diff --git a/mysql-test/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result similarity index 100% rename from mysql-test/r/rpl_row_log_innodb.result rename to mysql-test/suite/rpl/r/rpl_row_log_innodb.result diff --git a/mysql-test/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result similarity index 100% rename from mysql-test/r/rpl_row_max_relay_size.result rename to mysql-test/suite/rpl/r/rpl_row_max_relay_size.result diff --git a/mysql-test/r/rpl_row_multi_query.result b/mysql-test/suite/rpl/r/rpl_row_multi_query.result similarity index 100% rename from mysql-test/r/rpl_row_multi_query.result rename to mysql-test/suite/rpl/r/rpl_row_multi_query.result diff --git a/mysql-test/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result similarity index 100% rename from mysql-test/r/rpl_row_mysqlbinlog.result rename to mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result diff --git a/mysql-test/r/rpl_row_mystery22.result b/mysql-test/suite/rpl/r/rpl_row_mystery22.result similarity index 100% rename from mysql-test/r/rpl_row_mystery22.result rename to mysql-test/suite/rpl/r/rpl_row_mystery22.result diff --git a/mysql-test/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result similarity index 100% rename from mysql-test/r/rpl_row_reset_slave.result rename to mysql-test/suite/rpl/r/rpl_row_reset_slave.result diff --git a/mysql-test/r/rpl_row_sp001.result b/mysql-test/suite/rpl/r/rpl_row_sp001.result similarity index 100% rename from mysql-test/r/rpl_row_sp001.result rename to mysql-test/suite/rpl/r/rpl_row_sp001.result diff --git a/mysql-test/r/rpl_row_sp002_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result similarity index 100% rename from mysql-test/r/rpl_row_sp002_innodb.result rename to mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result diff --git a/mysql-test/r/rpl_row_sp003.result b/mysql-test/suite/rpl/r/rpl_row_sp003.result similarity index 100% rename from mysql-test/r/rpl_row_sp003.result rename to mysql-test/suite/rpl/r/rpl_row_sp003.result diff --git a/mysql-test/r/rpl_row_sp005.result b/mysql-test/suite/rpl/r/rpl_row_sp005.result similarity index 100% rename from mysql-test/r/rpl_row_sp005.result rename to mysql-test/suite/rpl/r/rpl_row_sp005.result diff --git a/mysql-test/r/rpl_row_sp006_InnoDB.result b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result similarity index 100% rename from mysql-test/r/rpl_row_sp006_InnoDB.result rename to mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result diff --git a/mysql-test/r/rpl_row_sp007_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result similarity index 100% rename from mysql-test/r/rpl_row_sp007_innodb.result rename to mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result diff --git a/mysql-test/r/rpl_row_sp008.result b/mysql-test/suite/rpl/r/rpl_row_sp008.result similarity index 100% rename from mysql-test/r/rpl_row_sp008.result rename to mysql-test/suite/rpl/r/rpl_row_sp008.result diff --git a/mysql-test/r/rpl_row_sp009.result b/mysql-test/suite/rpl/r/rpl_row_sp009.result similarity index 100% rename from mysql-test/r/rpl_row_sp009.result rename to mysql-test/suite/rpl/r/rpl_row_sp009.result diff --git a/mysql-test/r/rpl_row_sp010.result b/mysql-test/suite/rpl/r/rpl_row_sp010.result similarity index 100% rename from mysql-test/r/rpl_row_sp010.result rename to mysql-test/suite/rpl/r/rpl_row_sp010.result diff --git a/mysql-test/r/rpl_row_sp011.result b/mysql-test/suite/rpl/r/rpl_row_sp011.result similarity index 100% rename from mysql-test/r/rpl_row_sp011.result rename to mysql-test/suite/rpl/r/rpl_row_sp011.result diff --git a/mysql-test/r/rpl_row_sp012.result b/mysql-test/suite/rpl/r/rpl_row_sp012.result similarity index 100% rename from mysql-test/r/rpl_row_sp012.result rename to mysql-test/suite/rpl/r/rpl_row_sp012.result diff --git a/mysql-test/r/rpl_row_stop_middle.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle.result similarity index 100% rename from mysql-test/r/rpl_row_stop_middle.result rename to mysql-test/suite/rpl/r/rpl_row_stop_middle.result diff --git a/mysql-test/r/rpl_row_stop_middle_update.result b/mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result similarity index 100% rename from mysql-test/r/rpl_row_stop_middle_update.result rename to mysql-test/suite/rpl/r/rpl_row_stop_middle_update.result diff --git a/mysql-test/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result similarity index 100% rename from mysql-test/r/rpl_row_tabledefs_2myisam.result rename to mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result diff --git a/mysql-test/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result similarity index 100% rename from mysql-test/r/rpl_row_tabledefs_3innodb.result rename to mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result diff --git a/mysql-test/r/rpl_row_tabledefs_7ndb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result similarity index 100% rename from mysql-test/r/rpl_row_tabledefs_7ndb.result rename to mysql-test/suite/rpl/r/rpl_row_tabledefs_7ndb.result diff --git a/mysql-test/r/rpl_row_trig001.result b/mysql-test/suite/rpl/r/rpl_row_trig001.result similarity index 100% rename from mysql-test/r/rpl_row_trig001.result rename to mysql-test/suite/rpl/r/rpl_row_trig001.result diff --git a/mysql-test/r/rpl_row_trig002.result b/mysql-test/suite/rpl/r/rpl_row_trig002.result similarity index 100% rename from mysql-test/r/rpl_row_trig002.result rename to mysql-test/suite/rpl/r/rpl_row_trig002.result diff --git a/mysql-test/r/rpl_row_trig003.result b/mysql-test/suite/rpl/r/rpl_row_trig003.result similarity index 100% rename from mysql-test/r/rpl_row_trig003.result rename to mysql-test/suite/rpl/r/rpl_row_trig003.result diff --git a/mysql-test/r/rpl_row_trig004.result b/mysql-test/suite/rpl/r/rpl_row_trig004.result similarity index 100% rename from mysql-test/r/rpl_row_trig004.result rename to mysql-test/suite/rpl/r/rpl_row_trig004.result diff --git a/mysql-test/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result similarity index 100% rename from mysql-test/r/rpl_row_until.result rename to mysql-test/suite/rpl/r/rpl_row_until.result diff --git a/mysql-test/r/rpl_row_view01.result b/mysql-test/suite/rpl/r/rpl_row_view01.result similarity index 100% rename from mysql-test/r/rpl_row_view01.result rename to mysql-test/suite/rpl/r/rpl_row_view01.result diff --git a/mysql-test/r/rpl_server_id1.result b/mysql-test/suite/rpl/r/rpl_server_id1.result similarity index 100% rename from mysql-test/r/rpl_server_id1.result rename to mysql-test/suite/rpl/r/rpl_server_id1.result diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result similarity index 100% rename from mysql-test/r/rpl_server_id2.result rename to mysql-test/suite/rpl/r/rpl_server_id2.result diff --git a/mysql-test/r/rpl_session_var.result b/mysql-test/suite/rpl/r/rpl_session_var.result similarity index 100% rename from mysql-test/r/rpl_session_var.result rename to mysql-test/suite/rpl/r/rpl_session_var.result diff --git a/mysql-test/r/rpl_set_charset.result b/mysql-test/suite/rpl/r/rpl_set_charset.result similarity index 100% rename from mysql-test/r/rpl_set_charset.result rename to mysql-test/suite/rpl/r/rpl_set_charset.result diff --git a/mysql-test/r/rpl_sf.result b/mysql-test/suite/rpl/r/rpl_sf.result similarity index 100% rename from mysql-test/r/rpl_sf.result rename to mysql-test/suite/rpl/r/rpl_sf.result diff --git a/mysql-test/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result similarity index 100% rename from mysql-test/r/rpl_skip_error.result rename to mysql-test/suite/rpl/r/rpl_skip_error.result diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/suite/rpl/r/rpl_slave_status.result similarity index 100% rename from mysql-test/r/rpl_slave_status.result rename to mysql-test/suite/rpl/r/rpl_slave_status.result diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result similarity index 100% rename from mysql-test/r/rpl_sp.result rename to mysql-test/suite/rpl/r/rpl_sp.result diff --git a/mysql-test/r/rpl_sp004.result b/mysql-test/suite/rpl/r/rpl_sp004.result similarity index 100% rename from mysql-test/r/rpl_sp004.result rename to mysql-test/suite/rpl/r/rpl_sp004.result diff --git a/mysql-test/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result similarity index 100% rename from mysql-test/r/rpl_sp_effects.result rename to mysql-test/suite/rpl/r/rpl_sp_effects.result diff --git a/mysql-test/r/rpl_sporadic_master.result b/mysql-test/suite/rpl/r/rpl_sporadic_master.result similarity index 100% rename from mysql-test/r/rpl_sporadic_master.result rename to mysql-test/suite/rpl/r/rpl_sporadic_master.result diff --git a/mysql-test/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result similarity index 100% rename from mysql-test/r/rpl_ssl.result rename to mysql-test/suite/rpl/r/rpl_ssl.result diff --git a/mysql-test/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result similarity index 100% rename from mysql-test/r/rpl_ssl1.result rename to mysql-test/suite/rpl/r/rpl_ssl1.result diff --git a/mysql-test/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result similarity index 100% rename from mysql-test/r/rpl_start_stop_slave.result rename to mysql-test/suite/rpl/r/rpl_start_stop_slave.result diff --git a/mysql-test/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result similarity index 100% rename from mysql-test/r/rpl_stm_000001.result rename to mysql-test/suite/rpl/r/rpl_stm_000001.result diff --git a/mysql-test/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result similarity index 100% rename from mysql-test/r/rpl_stm_EE_err2.result rename to mysql-test/suite/rpl/r/rpl_stm_EE_err2.result diff --git a/mysql-test/r/rpl_stm_charset.result b/mysql-test/suite/rpl/r/rpl_stm_charset.result similarity index 100% rename from mysql-test/r/rpl_stm_charset.result rename to mysql-test/suite/rpl/r/rpl_stm_charset.result diff --git a/mysql-test/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result similarity index 100% rename from mysql-test/r/rpl_stm_flsh_tbls.result rename to mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result diff --git a/mysql-test/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result similarity index 100% rename from mysql-test/r/rpl_stm_insert_delayed.result rename to mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result diff --git a/mysql-test/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result similarity index 100% rename from mysql-test/r/rpl_stm_log.result rename to mysql-test/suite/rpl/r/rpl_stm_log.result diff --git a/mysql-test/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result similarity index 100% rename from mysql-test/r/rpl_stm_max_relay_size.result rename to mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result diff --git a/mysql-test/r/rpl_stm_multi_query.result b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result similarity index 100% rename from mysql-test/r/rpl_stm_multi_query.result rename to mysql-test/suite/rpl/r/rpl_stm_multi_query.result diff --git a/mysql-test/r/rpl_stm_mystery22.result b/mysql-test/suite/rpl/r/rpl_stm_mystery22.result similarity index 100% rename from mysql-test/r/rpl_stm_mystery22.result rename to mysql-test/suite/rpl/r/rpl_stm_mystery22.result diff --git a/mysql-test/r/rpl_stm_no_op.result b/mysql-test/suite/rpl/r/rpl_stm_no_op.result similarity index 100% rename from mysql-test/r/rpl_stm_no_op.result rename to mysql-test/suite/rpl/r/rpl_stm_no_op.result diff --git a/mysql-test/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result similarity index 100% rename from mysql-test/r/rpl_stm_reset_slave.result rename to mysql-test/suite/rpl/r/rpl_stm_reset_slave.result diff --git a/mysql-test/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result similarity index 100% rename from mysql-test/r/rpl_stm_until.result rename to mysql-test/suite/rpl/r/rpl_stm_until.result diff --git a/mysql-test/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result similarity index 100% rename from mysql-test/r/rpl_switch_stm_row_mixed.result rename to mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result diff --git a/mysql-test/r/rpl_temp_table.result b/mysql-test/suite/rpl/r/rpl_temp_table.result similarity index 100% rename from mysql-test/r/rpl_temp_table.result rename to mysql-test/suite/rpl/r/rpl_temp_table.result diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result similarity index 100% rename from mysql-test/r/rpl_temporary.result rename to mysql-test/suite/rpl/r/rpl_temporary.result diff --git a/mysql-test/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result similarity index 100% rename from mysql-test/r/rpl_timezone.result rename to mysql-test/suite/rpl/r/rpl_timezone.result diff --git a/mysql-test/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result similarity index 100% rename from mysql-test/r/rpl_trigger.result rename to mysql-test/suite/rpl/r/rpl_trigger.result diff --git a/mysql-test/r/rpl_trunc_temp.result b/mysql-test/suite/rpl/r/rpl_trunc_temp.result similarity index 100% rename from mysql-test/r/rpl_trunc_temp.result rename to mysql-test/suite/rpl/r/rpl_trunc_temp.result diff --git a/mysql-test/r/rpl_truncate_2myisam.result b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result similarity index 100% rename from mysql-test/r/rpl_truncate_2myisam.result rename to mysql-test/suite/rpl/r/rpl_truncate_2myisam.result diff --git a/mysql-test/r/rpl_truncate_3innodb.result b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result similarity index 100% rename from mysql-test/r/rpl_truncate_3innodb.result rename to mysql-test/suite/rpl/r/rpl_truncate_3innodb.result diff --git a/mysql-test/r/rpl_truncate_7ndb_2.result b/mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result similarity index 100% rename from mysql-test/r/rpl_truncate_7ndb_2.result rename to mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result diff --git a/mysql-test/r/rpl_udf.result b/mysql-test/suite/rpl/r/rpl_udf.result similarity index 100% rename from mysql-test/r/rpl_udf.result rename to mysql-test/suite/rpl/r/rpl_udf.result diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/suite/rpl/r/rpl_user_variables.result similarity index 100% rename from mysql-test/r/rpl_user_variables.result rename to mysql-test/suite/rpl/r/rpl_user_variables.result diff --git a/mysql-test/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result similarity index 100% rename from mysql-test/r/rpl_variables.result rename to mysql-test/suite/rpl/r/rpl_variables.result diff --git a/mysql-test/r/rpl_view.result b/mysql-test/suite/rpl/r/rpl_view.result similarity index 100% rename from mysql-test/r/rpl_view.result rename to mysql-test/suite/rpl/r/rpl_view.result diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def new file mode 100644 index 00000000000..180a700acaf --- /dev/null +++ b/mysql-test/suite/rpl/t/disabled.def @@ -0,0 +1,15 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# : BUG# +# +# Do not use any TAB characters for whitespace. +# +############################################################################## + +rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master +rpl_innodb_mixed_ddl : Bug #29363 rpl.rpl_innodb_mixed_* test failures +rpl_innodb_mixed_dml : Bug #29363 rpl.rpl_innodb_mixed_* test failures diff --git a/mysql-test/t/rpl000010-slave.opt b/mysql-test/suite/rpl/t/rpl000010-slave.opt similarity index 100% rename from mysql-test/t/rpl000010-slave.opt rename to mysql-test/suite/rpl/t/rpl000010-slave.opt diff --git a/mysql-test/t/rpl000010.test b/mysql-test/suite/rpl/t/rpl000010.test similarity index 100% rename from mysql-test/t/rpl000010.test rename to mysql-test/suite/rpl/t/rpl000010.test diff --git a/mysql-test/t/rpl000011.test b/mysql-test/suite/rpl/t/rpl000011.test similarity index 100% rename from mysql-test/t/rpl000011.test rename to mysql-test/suite/rpl/t/rpl000011.test diff --git a/mysql-test/t/rpl000013.test b/mysql-test/suite/rpl/t/rpl000013.test similarity index 100% rename from mysql-test/t/rpl000013.test rename to mysql-test/suite/rpl/t/rpl000013.test diff --git a/mysql-test/t/rpl000017-slave.opt b/mysql-test/suite/rpl/t/rpl000017-slave.opt similarity index 100% rename from mysql-test/t/rpl000017-slave.opt rename to mysql-test/suite/rpl/t/rpl000017-slave.opt diff --git a/mysql-test/t/rpl000017-slave.sh b/mysql-test/suite/rpl/t/rpl000017-slave.sh similarity index 100% rename from mysql-test/t/rpl000017-slave.sh rename to mysql-test/suite/rpl/t/rpl000017-slave.sh diff --git a/mysql-test/t/rpl000017.test b/mysql-test/suite/rpl/t/rpl000017.test similarity index 100% rename from mysql-test/t/rpl000017.test rename to mysql-test/suite/rpl/t/rpl000017.test diff --git a/mysql-test/t/rpl000018-master.opt b/mysql-test/suite/rpl/t/rpl000018-master.opt similarity index 100% rename from mysql-test/t/rpl000018-master.opt rename to mysql-test/suite/rpl/t/rpl000018-master.opt diff --git a/mysql-test/t/rpl000018-slave.opt b/mysql-test/suite/rpl/t/rpl000018-slave.opt similarity index 100% rename from mysql-test/t/rpl000018-slave.opt rename to mysql-test/suite/rpl/t/rpl000018-slave.opt diff --git a/mysql-test/t/rpl_000015-slave.sh b/mysql-test/suite/rpl/t/rpl_000015-slave.sh similarity index 100% rename from mysql-test/t/rpl_000015-slave.sh rename to mysql-test/suite/rpl/t/rpl_000015-slave.sh diff --git a/mysql-test/t/rpl_000015.slave-mi b/mysql-test/suite/rpl/t/rpl_000015.slave-mi similarity index 100% rename from mysql-test/t/rpl_000015.slave-mi rename to mysql-test/suite/rpl/t/rpl_000015.slave-mi diff --git a/mysql-test/t/rpl_000015.test b/mysql-test/suite/rpl/t/rpl_000015.test similarity index 100% rename from mysql-test/t/rpl_000015.test rename to mysql-test/suite/rpl/t/rpl_000015.test diff --git a/mysql-test/t/rpl_EE_err.test b/mysql-test/suite/rpl/t/rpl_EE_err.test similarity index 100% rename from mysql-test/t/rpl_EE_err.test rename to mysql-test/suite/rpl/t/rpl_EE_err.test diff --git a/mysql-test/t/rpl_LD_INFILE.test b/mysql-test/suite/rpl/t/rpl_LD_INFILE.test similarity index 100% rename from mysql-test/t/rpl_LD_INFILE.test rename to mysql-test/suite/rpl/t/rpl_LD_INFILE.test diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/suite/rpl/t/rpl_alter.test similarity index 100% rename from mysql-test/t/rpl_alter.test rename to mysql-test/suite/rpl/t/rpl_alter.test diff --git a/mysql-test/t/rpl_alter_db.test b/mysql-test/suite/rpl/t/rpl_alter_db.test similarity index 100% rename from mysql-test/t/rpl_alter_db.test rename to mysql-test/suite/rpl/t/rpl_alter_db.test diff --git a/mysql-test/t/rpl_auto_increment-master.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-master.opt similarity index 100% rename from mysql-test/t/rpl_auto_increment-master.opt rename to mysql-test/suite/rpl/t/rpl_auto_increment-master.opt diff --git a/mysql-test/t/rpl_auto_increment-slave.opt b/mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt similarity index 100% rename from mysql-test/t/rpl_auto_increment-slave.opt rename to mysql-test/suite/rpl/t/rpl_auto_increment-slave.opt diff --git a/mysql-test/t/rpl_auto_increment.test b/mysql-test/suite/rpl/t/rpl_auto_increment.test similarity index 100% rename from mysql-test/t/rpl_auto_increment.test rename to mysql-test/suite/rpl/t/rpl_auto_increment.test diff --git a/mysql-test/t/rpl_auto_increment_11932.test b/mysql-test/suite/rpl/t/rpl_auto_increment_11932.test similarity index 100% rename from mysql-test/t/rpl_auto_increment_11932.test rename to mysql-test/suite/rpl/t/rpl_auto_increment_11932.test diff --git a/mysql-test/t/rpl_bit.test b/mysql-test/suite/rpl/t/rpl_bit.test similarity index 100% rename from mysql-test/t/rpl_bit.test rename to mysql-test/suite/rpl/t/rpl_bit.test diff --git a/mysql-test/t/rpl_bit_npk.test b/mysql-test/suite/rpl/t/rpl_bit_npk.test similarity index 100% rename from mysql-test/t/rpl_bit_npk.test rename to mysql-test/suite/rpl/t/rpl_bit_npk.test diff --git a/mysql-test/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test similarity index 100% rename from mysql-test/t/rpl_change_master.test rename to mysql-test/suite/rpl/t/rpl_change_master.test diff --git a/mysql-test/t/rpl_charset_sjis.test b/mysql-test/suite/rpl/t/rpl_charset_sjis.test similarity index 100% rename from mysql-test/t/rpl_charset_sjis.test rename to mysql-test/suite/rpl/t/rpl_charset_sjis.test diff --git a/mysql-test/t/rpl_commit_after_flush.test b/mysql-test/suite/rpl/t/rpl_commit_after_flush.test similarity index 100% rename from mysql-test/t/rpl_commit_after_flush.test rename to mysql-test/suite/rpl/t/rpl_commit_after_flush.test diff --git a/mysql-test/t/rpl_create_database-master.opt b/mysql-test/suite/rpl/t/rpl_create_database-master.opt similarity index 100% rename from mysql-test/t/rpl_create_database-master.opt rename to mysql-test/suite/rpl/t/rpl_create_database-master.opt diff --git a/mysql-test/t/rpl_create_database-slave.opt b/mysql-test/suite/rpl/t/rpl_create_database-slave.opt similarity index 100% rename from mysql-test/t/rpl_create_database-slave.opt rename to mysql-test/suite/rpl/t/rpl_create_database-slave.opt diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/suite/rpl/t/rpl_create_database.test similarity index 100% rename from mysql-test/t/rpl_create_database.test rename to mysql-test/suite/rpl/t/rpl_create_database.test diff --git a/mysql-test/t/rpl_critical_errors.test b/mysql-test/suite/rpl/t/rpl_critical_errors.test similarity index 100% rename from mysql-test/t/rpl_critical_errors.test rename to mysql-test/suite/rpl/t/rpl_critical_errors.test diff --git a/mysql-test/t/rpl_ddl.test b/mysql-test/suite/rpl/t/rpl_ddl.test similarity index 100% rename from mysql-test/t/rpl_ddl.test rename to mysql-test/suite/rpl/t/rpl_ddl.test diff --git a/mysql-test/t/rpl_deadlock_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_deadlock_innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_deadlock_innodb-slave.opt diff --git a/mysql-test/t/rpl_deadlock_innodb.test b/mysql-test/suite/rpl/t/rpl_deadlock_innodb.test similarity index 100% rename from mysql-test/t/rpl_deadlock_innodb.test rename to mysql-test/suite/rpl/t/rpl_deadlock_innodb.test diff --git a/mysql-test/t/rpl_delete_no_where.test b/mysql-test/suite/rpl/t/rpl_delete_no_where.test similarity index 100% rename from mysql-test/t/rpl_delete_no_where.test rename to mysql-test/suite/rpl/t/rpl_delete_no_where.test diff --git a/mysql-test/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test similarity index 100% rename from mysql-test/t/rpl_do_grant.test rename to mysql-test/suite/rpl/t/rpl_do_grant.test diff --git a/mysql-test/t/rpl_drop.test b/mysql-test/suite/rpl/t/rpl_drop.test similarity index 100% rename from mysql-test/t/rpl_drop.test rename to mysql-test/suite/rpl/t/rpl_drop.test diff --git a/mysql-test/t/rpl_drop_db.test b/mysql-test/suite/rpl/t/rpl_drop_db.test similarity index 100% rename from mysql-test/t/rpl_drop_db.test rename to mysql-test/suite/rpl/t/rpl_drop_db.test diff --git a/mysql-test/t/rpl_drop_temp-slave.opt b/mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt similarity index 100% rename from mysql-test/t/rpl_drop_temp-slave.opt rename to mysql-test/suite/rpl/t/rpl_drop_temp-slave.opt diff --git a/mysql-test/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test similarity index 100% rename from mysql-test/t/rpl_drop_temp.test rename to mysql-test/suite/rpl/t/rpl_drop_temp.test diff --git a/mysql-test/t/rpl_dual_pos_advance-master.opt b/mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt similarity index 100% rename from mysql-test/t/rpl_dual_pos_advance-master.opt rename to mysql-test/suite/rpl/t/rpl_dual_pos_advance-master.opt diff --git a/mysql-test/t/rpl_dual_pos_advance.test b/mysql-test/suite/rpl/t/rpl_dual_pos_advance.test similarity index 100% rename from mysql-test/t/rpl_dual_pos_advance.test rename to mysql-test/suite/rpl/t/rpl_dual_pos_advance.test diff --git a/mysql-test/t/rpl_empty_master_crash-master.opt b/mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt similarity index 100% rename from mysql-test/t/rpl_empty_master_crash-master.opt rename to mysql-test/suite/rpl/t/rpl_empty_master_crash-master.opt diff --git a/mysql-test/t/rpl_empty_master_crash.test b/mysql-test/suite/rpl/t/rpl_empty_master_crash.test similarity index 100% rename from mysql-test/t/rpl_empty_master_crash.test rename to mysql-test/suite/rpl/t/rpl_empty_master_crash.test diff --git a/mysql-test/t/rpl_err_ignoredtable-slave.opt b/mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt similarity index 100% rename from mysql-test/t/rpl_err_ignoredtable-slave.opt rename to mysql-test/suite/rpl/t/rpl_err_ignoredtable-slave.opt diff --git a/mysql-test/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test similarity index 100% rename from mysql-test/t/rpl_err_ignoredtable.test rename to mysql-test/suite/rpl/t/rpl_err_ignoredtable.test diff --git a/mysql-test/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test similarity index 100% rename from mysql-test/t/rpl_events.test rename to mysql-test/suite/rpl/t/rpl_events.test diff --git a/mysql-test/t/rpl_extraCol_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt similarity index 100% rename from mysql-test/t/rpl_extraCol_innodb-master.opt rename to mysql-test/suite/rpl/t/rpl_extraCol_innodb-master.opt diff --git a/mysql-test/t/rpl_extraCol_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_extraCol_innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_extraCol_innodb-slave.opt diff --git a/mysql-test/t/rpl_extraCol_innodb.test b/mysql-test/suite/rpl/t/rpl_extraCol_innodb.test similarity index 100% rename from mysql-test/t/rpl_extraCol_innodb.test rename to mysql-test/suite/rpl/t/rpl_extraCol_innodb.test diff --git a/mysql-test/t/rpl_extraCol_myisam.test b/mysql-test/suite/rpl/t/rpl_extraCol_myisam.test similarity index 100% rename from mysql-test/t/rpl_extraCol_myisam.test rename to mysql-test/suite/rpl/t/rpl_extraCol_myisam.test diff --git a/mysql-test/t/rpl_failed_optimize-master.opt b/mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt similarity index 100% rename from mysql-test/t/rpl_failed_optimize-master.opt rename to mysql-test/suite/rpl/t/rpl_failed_optimize-master.opt diff --git a/mysql-test/t/rpl_failed_optimize.test b/mysql-test/suite/rpl/t/rpl_failed_optimize.test similarity index 100% rename from mysql-test/t/rpl_failed_optimize.test rename to mysql-test/suite/rpl/t/rpl_failed_optimize.test diff --git a/mysql-test/t/rpl_flushlog_loop-master.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt similarity index 100% rename from mysql-test/t/rpl_flushlog_loop-master.opt rename to mysql-test/suite/rpl/t/rpl_flushlog_loop-master.opt diff --git a/mysql-test/t/rpl_flushlog_loop-master.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh similarity index 100% rename from mysql-test/t/rpl_flushlog_loop-master.sh rename to mysql-test/suite/rpl/t/rpl_flushlog_loop-master.sh diff --git a/mysql-test/t/rpl_flushlog_loop-slave.opt b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt similarity index 100% rename from mysql-test/t/rpl_flushlog_loop-slave.opt rename to mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.opt diff --git a/mysql-test/t/rpl_flushlog_loop-slave.sh b/mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh similarity index 100% rename from mysql-test/t/rpl_flushlog_loop-slave.sh rename to mysql-test/suite/rpl/t/rpl_flushlog_loop-slave.sh diff --git a/mysql-test/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test similarity index 100% rename from mysql-test/t/rpl_flushlog_loop.test rename to mysql-test/suite/rpl/t/rpl_flushlog_loop.test diff --git a/mysql-test/t/rpl_foreign_key_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_foreign_key_innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_foreign_key_innodb-slave.opt diff --git a/mysql-test/t/rpl_foreign_key_innodb.test b/mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test similarity index 100% rename from mysql-test/t/rpl_foreign_key_innodb.test rename to mysql-test/suite/rpl/t/rpl_foreign_key_innodb.test diff --git a/mysql-test/t/rpl_free_items-slave.opt b/mysql-test/suite/rpl/t/rpl_free_items-slave.opt similarity index 100% rename from mysql-test/t/rpl_free_items-slave.opt rename to mysql-test/suite/rpl/t/rpl_free_items-slave.opt diff --git a/mysql-test/t/rpl_free_items.test b/mysql-test/suite/rpl/t/rpl_free_items.test similarity index 100% rename from mysql-test/t/rpl_free_items.test rename to mysql-test/suite/rpl/t/rpl_free_items.test diff --git a/mysql-test/t/rpl_get_lock.test b/mysql-test/suite/rpl/t/rpl_get_lock.test similarity index 100% rename from mysql-test/t/rpl_get_lock.test rename to mysql-test/suite/rpl/t/rpl_get_lock.test diff --git a/mysql-test/t/rpl_ignore_grant-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt similarity index 100% rename from mysql-test/t/rpl_ignore_grant-slave.opt rename to mysql-test/suite/rpl/t/rpl_ignore_grant-slave.opt diff --git a/mysql-test/t/rpl_ignore_grant.test b/mysql-test/suite/rpl/t/rpl_ignore_grant.test similarity index 100% rename from mysql-test/t/rpl_ignore_grant.test rename to mysql-test/suite/rpl/t/rpl_ignore_grant.test diff --git a/mysql-test/t/rpl_ignore_revoke-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt similarity index 100% rename from mysql-test/t/rpl_ignore_revoke-slave.opt rename to mysql-test/suite/rpl/t/rpl_ignore_revoke-slave.opt diff --git a/mysql-test/t/rpl_ignore_revoke.test b/mysql-test/suite/rpl/t/rpl_ignore_revoke.test similarity index 100% rename from mysql-test/t/rpl_ignore_revoke.test rename to mysql-test/suite/rpl/t/rpl_ignore_revoke.test diff --git a/mysql-test/t/rpl_ignore_table-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt similarity index 100% rename from mysql-test/t/rpl_ignore_table-slave.opt rename to mysql-test/suite/rpl/t/rpl_ignore_table-slave.opt diff --git a/mysql-test/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test similarity index 100% rename from mysql-test/t/rpl_ignore_table.test rename to mysql-test/suite/rpl/t/rpl_ignore_table.test diff --git a/mysql-test/t/rpl_ignore_table_update-slave.opt b/mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt similarity index 100% rename from mysql-test/t/rpl_ignore_table_update-slave.opt rename to mysql-test/suite/rpl/t/rpl_ignore_table_update-slave.opt diff --git a/mysql-test/t/rpl_ignore_table_update.test b/mysql-test/suite/rpl/t/rpl_ignore_table_update.test similarity index 100% rename from mysql-test/t/rpl_ignore_table_update.test rename to mysql-test/suite/rpl/t/rpl_ignore_table_update.test diff --git a/mysql-test/t/rpl_incident-master.opt b/mysql-test/suite/rpl/t/rpl_incident-master.opt similarity index 100% rename from mysql-test/t/rpl_incident-master.opt rename to mysql-test/suite/rpl/t/rpl_incident-master.opt diff --git a/mysql-test/t/rpl_incident.test b/mysql-test/suite/rpl/t/rpl_incident.test similarity index 100% rename from mysql-test/t/rpl_incident.test rename to mysql-test/suite/rpl/t/rpl_incident.test diff --git a/mysql-test/t/rpl_init_slave-slave.opt b/mysql-test/suite/rpl/t/rpl_init_slave-slave.opt similarity index 100% rename from mysql-test/t/rpl_init_slave-slave.opt rename to mysql-test/suite/rpl/t/rpl_init_slave-slave.opt diff --git a/mysql-test/t/rpl_init_slave.test b/mysql-test/suite/rpl/t/rpl_init_slave.test similarity index 100% rename from mysql-test/t/rpl_init_slave.test rename to mysql-test/suite/rpl/t/rpl_init_slave.test diff --git a/mysql-test/t/rpl_innodb.test b/mysql-test/suite/rpl/t/rpl_innodb.test similarity index 100% rename from mysql-test/t/rpl_innodb.test rename to mysql-test/suite/rpl/t/rpl_innodb.test diff --git a/mysql-test/t/rpl_insert.test b/mysql-test/suite/rpl/t/rpl_insert.test similarity index 100% rename from mysql-test/t/rpl_insert.test rename to mysql-test/suite/rpl/t/rpl_insert.test diff --git a/mysql-test/t/rpl_insert_id-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id-slave.opt similarity index 100% rename from mysql-test/t/rpl_insert_id-slave.opt rename to mysql-test/suite/rpl/t/rpl_insert_id-slave.opt diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/suite/rpl/t/rpl_insert_id.test similarity index 100% rename from mysql-test/t/rpl_insert_id.test rename to mysql-test/suite/rpl/t/rpl_insert_id.test diff --git a/mysql-test/t/rpl_insert_id_pk-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt similarity index 100% rename from mysql-test/t/rpl_insert_id_pk-slave.opt rename to mysql-test/suite/rpl/t/rpl_insert_id_pk-slave.opt diff --git a/mysql-test/t/rpl_insert_id_pk.test b/mysql-test/suite/rpl/t/rpl_insert_id_pk.test similarity index 100% rename from mysql-test/t/rpl_insert_id_pk.test rename to mysql-test/suite/rpl/t/rpl_insert_id_pk.test diff --git a/mysql-test/t/rpl_insert_ignore-slave.opt b/mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt similarity index 100% rename from mysql-test/t/rpl_insert_ignore-slave.opt rename to mysql-test/suite/rpl/t/rpl_insert_ignore-slave.opt diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/suite/rpl/t/rpl_insert_ignore.test similarity index 100% rename from mysql-test/t/rpl_insert_ignore.test rename to mysql-test/suite/rpl/t/rpl_insert_ignore.test diff --git a/mysql-test/t/rpl_insert_select.test b/mysql-test/suite/rpl/t/rpl_insert_select.test similarity index 100% rename from mysql-test/t/rpl_insert_select.test rename to mysql-test/suite/rpl/t/rpl_insert_select.test diff --git a/mysql-test/t/rpl_known_bugs_detection-master.opt b/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt similarity index 100% rename from mysql-test/t/rpl_known_bugs_detection-master.opt rename to mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt diff --git a/mysql-test/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test similarity index 100% rename from mysql-test/t/rpl_known_bugs_detection.test rename to mysql-test/suite/rpl/t/rpl_known_bugs_detection.test diff --git a/mysql-test/t/rpl_load_from_master-slave.opt b/mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt similarity index 100% rename from mysql-test/t/rpl_load_from_master-slave.opt rename to mysql-test/suite/rpl/t/rpl_load_from_master-slave.opt diff --git a/mysql-test/t/rpl_load_from_master.test b/mysql-test/suite/rpl/t/rpl_load_from_master.test similarity index 100% rename from mysql-test/t/rpl_load_from_master.test rename to mysql-test/suite/rpl/t/rpl_load_from_master.test diff --git a/mysql-test/t/rpl_load_table_from_master.test b/mysql-test/suite/rpl/t/rpl_load_table_from_master.test similarity index 100% rename from mysql-test/t/rpl_load_table_from_master.test rename to mysql-test/suite/rpl/t/rpl_load_table_from_master.test diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/suite/rpl/t/rpl_loaddata.test similarity index 100% rename from mysql-test/t/rpl_loaddata.test rename to mysql-test/suite/rpl/t/rpl_loaddata.test diff --git a/mysql-test/t/rpl_loaddata_charset.test b/mysql-test/suite/rpl/t/rpl_loaddata_charset.test similarity index 100% rename from mysql-test/t/rpl_loaddata_charset.test rename to mysql-test/suite/rpl/t/rpl_loaddata_charset.test diff --git a/mysql-test/t/rpl_loaddata_m-master.opt b/mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt similarity index 100% rename from mysql-test/t/rpl_loaddata_m-master.opt rename to mysql-test/suite/rpl/t/rpl_loaddata_m-master.opt diff --git a/mysql-test/t/rpl_loaddata_m.test b/mysql-test/suite/rpl/t/rpl_loaddata_m.test similarity index 100% rename from mysql-test/t/rpl_loaddata_m.test rename to mysql-test/suite/rpl/t/rpl_loaddata_m.test diff --git a/mysql-test/t/rpl_loaddata_s-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt similarity index 100% rename from mysql-test/t/rpl_loaddata_s-slave.opt rename to mysql-test/suite/rpl/t/rpl_loaddata_s-slave.opt diff --git a/mysql-test/t/rpl_loaddata_s.test b/mysql-test/suite/rpl/t/rpl_loaddata_s.test similarity index 100% rename from mysql-test/t/rpl_loaddata_s.test rename to mysql-test/suite/rpl/t/rpl_loaddata_s.test diff --git a/mysql-test/t/rpl_loaddata_simple.test b/mysql-test/suite/rpl/t/rpl_loaddata_simple.test similarity index 100% rename from mysql-test/t/rpl_loaddata_simple.test rename to mysql-test/suite/rpl/t/rpl_loaddata_simple.test diff --git a/mysql-test/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test similarity index 100% rename from mysql-test/t/rpl_loaddatalocal.test rename to mysql-test/suite/rpl/t/rpl_loaddatalocal.test diff --git a/mysql-test/t/rpl_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test similarity index 100% rename from mysql-test/t/rpl_loadfile.test rename to mysql-test/suite/rpl/t/rpl_loadfile.test diff --git a/mysql-test/t/rpl_locale.test b/mysql-test/suite/rpl/t/rpl_locale.test similarity index 100% rename from mysql-test/t/rpl_locale.test rename to mysql-test/suite/rpl/t/rpl_locale.test diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test similarity index 100% rename from mysql-test/t/rpl_log_pos.test rename to mysql-test/suite/rpl/t/rpl_log_pos.test diff --git a/mysql-test/t/rpl_many_optimize.test b/mysql-test/suite/rpl/t/rpl_many_optimize.test similarity index 100% rename from mysql-test/t/rpl_many_optimize.test rename to mysql-test/suite/rpl/t/rpl_many_optimize.test diff --git a/mysql-test/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test similarity index 100% rename from mysql-test/t/rpl_master_pos_wait.test rename to mysql-test/suite/rpl/t/rpl_master_pos_wait.test diff --git a/mysql-test/t/rpl_misc_functions-slave.sh b/mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh similarity index 100% rename from mysql-test/t/rpl_misc_functions-slave.sh rename to mysql-test/suite/rpl/t/rpl_misc_functions-slave.sh diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test similarity index 100% rename from mysql-test/t/rpl_misc_functions.test rename to mysql-test/suite/rpl/t/rpl_misc_functions.test diff --git a/mysql-test/t/rpl_mixed_ddl_dml.test b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test similarity index 100% rename from mysql-test/t/rpl_mixed_ddl_dml.test rename to mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test diff --git a/mysql-test/t/rpl_multi_delete-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt similarity index 100% rename from mysql-test/t/rpl_multi_delete-slave.opt rename to mysql-test/suite/rpl/t/rpl_multi_delete-slave.opt diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/suite/rpl/t/rpl_multi_delete.test similarity index 100% rename from mysql-test/t/rpl_multi_delete.test rename to mysql-test/suite/rpl/t/rpl_multi_delete.test diff --git a/mysql-test/t/rpl_multi_delete2-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt similarity index 100% rename from mysql-test/t/rpl_multi_delete2-slave.opt rename to mysql-test/suite/rpl/t/rpl_multi_delete2-slave.opt diff --git a/mysql-test/t/rpl_multi_delete2.test b/mysql-test/suite/rpl/t/rpl_multi_delete2.test similarity index 100% rename from mysql-test/t/rpl_multi_delete2.test rename to mysql-test/suite/rpl/t/rpl_multi_delete2.test diff --git a/mysql-test/t/rpl_multi_engine-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt similarity index 100% rename from mysql-test/t/rpl_multi_engine-slave.opt rename to mysql-test/suite/rpl/t/rpl_multi_engine-slave.opt diff --git a/mysql-test/t/rpl_multi_engine.test b/mysql-test/suite/rpl/t/rpl_multi_engine.test similarity index 100% rename from mysql-test/t/rpl_multi_engine.test rename to mysql-test/suite/rpl/t/rpl_multi_engine.test diff --git a/mysql-test/t/rpl_multi_update.test b/mysql-test/suite/rpl/t/rpl_multi_update.test similarity index 100% rename from mysql-test/t/rpl_multi_update.test rename to mysql-test/suite/rpl/t/rpl_multi_update.test diff --git a/mysql-test/t/rpl_multi_update2-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt similarity index 100% rename from mysql-test/t/rpl_multi_update2-slave.opt rename to mysql-test/suite/rpl/t/rpl_multi_update2-slave.opt diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/suite/rpl/t/rpl_multi_update2.test similarity index 100% rename from mysql-test/t/rpl_multi_update2.test rename to mysql-test/suite/rpl/t/rpl_multi_update2.test diff --git a/mysql-test/t/rpl_multi_update3.test b/mysql-test/suite/rpl/t/rpl_multi_update3.test similarity index 100% rename from mysql-test/t/rpl_multi_update3.test rename to mysql-test/suite/rpl/t/rpl_multi_update3.test diff --git a/mysql-test/t/rpl_multi_update4-slave.opt b/mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt similarity index 100% rename from mysql-test/t/rpl_multi_update4-slave.opt rename to mysql-test/suite/rpl/t/rpl_multi_update4-slave.opt diff --git a/mysql-test/t/rpl_multi_update4.test b/mysql-test/suite/rpl/t/rpl_multi_update4.test similarity index 100% rename from mysql-test/t/rpl_multi_update4.test rename to mysql-test/suite/rpl/t/rpl_multi_update4.test diff --git a/mysql-test/t/rpl_optimize.test b/mysql-test/suite/rpl/t/rpl_optimize.test similarity index 100% rename from mysql-test/t/rpl_optimize.test rename to mysql-test/suite/rpl/t/rpl_optimize.test diff --git a/mysql-test/t/rpl_packet-master.opt b/mysql-test/suite/rpl/t/rpl_packet-master.opt similarity index 100% rename from mysql-test/t/rpl_packet-master.opt rename to mysql-test/suite/rpl/t/rpl_packet-master.opt diff --git a/mysql-test/t/rpl_packet-slave.opt b/mysql-test/suite/rpl/t/rpl_packet-slave.opt similarity index 100% rename from mysql-test/t/rpl_packet-slave.opt rename to mysql-test/suite/rpl/t/rpl_packet-slave.opt diff --git a/mysql-test/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test similarity index 100% rename from mysql-test/t/rpl_packet.test rename to mysql-test/suite/rpl/t/rpl_packet.test diff --git a/mysql-test/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test similarity index 100% rename from mysql-test/t/rpl_ps.test rename to mysql-test/suite/rpl/t/rpl_ps.test diff --git a/mysql-test/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test similarity index 100% rename from mysql-test/t/rpl_rbr_to_sbr.test rename to mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test diff --git a/mysql-test/t/rpl_read_only-slave.opt b/mysql-test/suite/rpl/t/rpl_read_only-slave.opt similarity index 100% rename from mysql-test/t/rpl_read_only-slave.opt rename to mysql-test/suite/rpl/t/rpl_read_only-slave.opt diff --git a/mysql-test/t/rpl_read_only.test b/mysql-test/suite/rpl/t/rpl_read_only.test similarity index 100% rename from mysql-test/t/rpl_read_only.test rename to mysql-test/suite/rpl/t/rpl_read_only.test diff --git a/mysql-test/t/rpl_redirect.test b/mysql-test/suite/rpl/t/rpl_redirect.test similarity index 100% rename from mysql-test/t/rpl_redirect.test rename to mysql-test/suite/rpl/t/rpl_redirect.test diff --git a/mysql-test/t/rpl_relay_space_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt similarity index 100% rename from mysql-test/t/rpl_relay_space_innodb-master.opt rename to mysql-test/suite/rpl/t/rpl_relay_space_innodb-master.opt diff --git a/mysql-test/t/rpl_relay_space_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_relay_space_innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_relay_space_innodb-slave.opt diff --git a/mysql-test/t/rpl_relay_space_innodb.test b/mysql-test/suite/rpl/t/rpl_relay_space_innodb.test similarity index 100% rename from mysql-test/t/rpl_relay_space_innodb.test rename to mysql-test/suite/rpl/t/rpl_relay_space_innodb.test diff --git a/mysql-test/t/rpl_relay_space_myisam.test b/mysql-test/suite/rpl/t/rpl_relay_space_myisam.test similarity index 100% rename from mysql-test/t/rpl_relay_space_myisam.test rename to mysql-test/suite/rpl/t/rpl_relay_space_myisam.test diff --git a/mysql-test/t/rpl_relayrotate-slave.opt b/mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt similarity index 100% rename from mysql-test/t/rpl_relayrotate-slave.opt rename to mysql-test/suite/rpl/t/rpl_relayrotate-slave.opt diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/suite/rpl/t/rpl_relayrotate.test similarity index 100% rename from mysql-test/t/rpl_relayrotate.test rename to mysql-test/suite/rpl/t/rpl_relayrotate.test diff --git a/mysql-test/t/rpl_relayspace-slave.opt b/mysql-test/suite/rpl/t/rpl_relayspace-slave.opt similarity index 100% rename from mysql-test/t/rpl_relayspace-slave.opt rename to mysql-test/suite/rpl/t/rpl_relayspace-slave.opt diff --git a/mysql-test/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test similarity index 100% rename from mysql-test/t/rpl_relayspace.test rename to mysql-test/suite/rpl/t/rpl_relayspace.test diff --git a/mysql-test/t/rpl_replicate_do-slave.opt b/mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt similarity index 100% rename from mysql-test/t/rpl_replicate_do-slave.opt rename to mysql-test/suite/rpl/t/rpl_replicate_do-slave.opt diff --git a/mysql-test/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test similarity index 100% rename from mysql-test/t/rpl_replicate_do.test rename to mysql-test/suite/rpl/t/rpl_replicate_do.test diff --git a/mysql-test/t/rpl_replicate_ignore_db-slave.opt b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt similarity index 100% rename from mysql-test/t/rpl_replicate_ignore_db-slave.opt rename to mysql-test/suite/rpl/t/rpl_replicate_ignore_db-slave.opt diff --git a/mysql-test/t/rpl_replicate_ignore_db.test b/mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test similarity index 100% rename from mysql-test/t/rpl_replicate_ignore_db.test rename to mysql-test/suite/rpl/t/rpl_replicate_ignore_db.test diff --git a/mysql-test/t/rpl_rewrt_db-slave.opt b/mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt similarity index 100% rename from mysql-test/t/rpl_rewrt_db-slave.opt rename to mysql-test/suite/rpl/t/rpl_rewrt_db-slave.opt diff --git a/mysql-test/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test similarity index 100% rename from mysql-test/t/rpl_rewrt_db.test rename to mysql-test/suite/rpl/t/rpl_rewrt_db.test diff --git a/mysql-test/t/rpl_rotate_logs-master.opt b/mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt similarity index 100% rename from mysql-test/t/rpl_rotate_logs-master.opt rename to mysql-test/suite/rpl/t/rpl_rotate_logs-master.opt diff --git a/mysql-test/t/rpl_rotate_logs-slave.sh b/mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh similarity index 100% rename from mysql-test/t/rpl_rotate_logs-slave.sh rename to mysql-test/suite/rpl/t/rpl_rotate_logs-slave.sh diff --git a/mysql-test/t/rpl_rotate_logs.slave-mi b/mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi similarity index 100% rename from mysql-test/t/rpl_rotate_logs.slave-mi rename to mysql-test/suite/rpl/t/rpl_rotate_logs.slave-mi diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test similarity index 100% rename from mysql-test/t/rpl_rotate_logs.test rename to mysql-test/suite/rpl/t/rpl_rotate_logs.test diff --git a/mysql-test/t/rpl_row_001.test b/mysql-test/suite/rpl/t/rpl_row_001.test similarity index 100% rename from mysql-test/t/rpl_row_001.test rename to mysql-test/suite/rpl/t/rpl_row_001.test diff --git a/mysql-test/t/rpl_row_4_bytes-master.opt b/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt similarity index 100% rename from mysql-test/t/rpl_row_4_bytes-master.opt rename to mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt diff --git a/mysql-test/t/rpl_row_4_bytes.test b/mysql-test/suite/rpl/t/rpl_row_4_bytes.test similarity index 100% rename from mysql-test/t/rpl_row_4_bytes.test rename to mysql-test/suite/rpl/t/rpl_row_4_bytes.test diff --git a/mysql-test/t/rpl_row_NOW.test b/mysql-test/suite/rpl/t/rpl_row_NOW.test similarity index 100% rename from mysql-test/t/rpl_row_NOW.test rename to mysql-test/suite/rpl/t/rpl_row_NOW.test diff --git a/mysql-test/t/rpl_row_USER.test b/mysql-test/suite/rpl/t/rpl_row_USER.test similarity index 100% rename from mysql-test/t/rpl_row_USER.test rename to mysql-test/suite/rpl/t/rpl_row_USER.test diff --git a/mysql-test/t/rpl_row_UUID.test b/mysql-test/suite/rpl/t/rpl_row_UUID.test similarity index 100% rename from mysql-test/t/rpl_row_UUID.test rename to mysql-test/suite/rpl/t/rpl_row_UUID.test diff --git a/mysql-test/t/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt similarity index 100% rename from mysql-test/t/rpl_row_basic_11bugs-master.opt rename to mysql-test/suite/rpl/t/rpl_row_basic_11bugs-master.opt diff --git a/mysql-test/t/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_basic_11bugs-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_basic_11bugs-slave.opt diff --git a/mysql-test/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test similarity index 100% rename from mysql-test/t/rpl_row_basic_11bugs.test rename to mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test diff --git a/mysql-test/t/rpl_row_basic_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test similarity index 100% rename from mysql-test/t/rpl_row_basic_2myisam.test rename to mysql-test/suite/rpl/t/rpl_row_basic_2myisam.test diff --git a/mysql-test/t/rpl_row_basic_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_basic_3innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_basic_3innodb-slave.opt diff --git a/mysql-test/t/rpl_row_basic_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test similarity index 100% rename from mysql-test/t/rpl_row_basic_3innodb.test rename to mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test diff --git a/mysql-test/t/rpl_row_basic_8partition.test b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test similarity index 100% rename from mysql-test/t/rpl_row_basic_8partition.test rename to mysql-test/suite/rpl/t/rpl_row_basic_8partition.test diff --git a/mysql-test/t/rpl_row_blob_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_blob_innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_blob_innodb-slave.opt diff --git a/mysql-test/t/rpl_row_blob_innodb.test b/mysql-test/suite/rpl/t/rpl_row_blob_innodb.test similarity index 100% rename from mysql-test/t/rpl_row_blob_innodb.test rename to mysql-test/suite/rpl/t/rpl_row_blob_innodb.test diff --git a/mysql-test/t/rpl_row_blob_myisam.test b/mysql-test/suite/rpl/t/rpl_row_blob_myisam.test similarity index 100% rename from mysql-test/t/rpl_row_blob_myisam.test rename to mysql-test/suite/rpl/t/rpl_row_blob_myisam.test diff --git a/mysql-test/t/rpl_row_charset.test b/mysql-test/suite/rpl/t/rpl_row_charset.test similarity index 100% rename from mysql-test/t/rpl_row_charset.test rename to mysql-test/suite/rpl/t/rpl_row_charset.test diff --git a/mysql-test/t/rpl_row_create_table-slave.opt b/mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_create_table-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_create_table-slave.opt diff --git a/mysql-test/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test similarity index 100% rename from mysql-test/t/rpl_row_create_table.test rename to mysql-test/suite/rpl/t/rpl_row_create_table.test diff --git a/mysql-test/t/rpl_row_delayed_ins.test b/mysql-test/suite/rpl/t/rpl_row_delayed_ins.test similarity index 100% rename from mysql-test/t/rpl_row_delayed_ins.test rename to mysql-test/suite/rpl/t/rpl_row_delayed_ins.test diff --git a/mysql-test/t/rpl_row_drop.test b/mysql-test/suite/rpl/t/rpl_row_drop.test similarity index 100% rename from mysql-test/t/rpl_row_drop.test rename to mysql-test/suite/rpl/t/rpl_row_drop.test diff --git a/mysql-test/t/rpl_row_err_daisychain-master.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt similarity index 100% rename from mysql-test/t/rpl_row_err_daisychain-master.opt rename to mysql-test/suite/rpl/t/rpl_row_err_daisychain-master.opt diff --git a/mysql-test/t/rpl_row_err_daisychain-slave.opt b/mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_err_daisychain-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_err_daisychain-slave.opt diff --git a/mysql-test/t/rpl_row_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test similarity index 100% rename from mysql-test/t/rpl_row_flsh_tbls.test rename to mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test diff --git a/mysql-test/t/rpl_row_func001.test b/mysql-test/suite/rpl/t/rpl_row_func001.test similarity index 100% rename from mysql-test/t/rpl_row_func001.test rename to mysql-test/suite/rpl/t/rpl_row_func001.test diff --git a/mysql-test/t/rpl_row_func002.test b/mysql-test/suite/rpl/t/rpl_row_func002.test similarity index 100% rename from mysql-test/t/rpl_row_func002.test rename to mysql-test/suite/rpl/t/rpl_row_func002.test diff --git a/mysql-test/t/rpl_row_func003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_func003-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_func003-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_func003-slave.opt diff --git a/mysql-test/t/rpl_row_func003.test b/mysql-test/suite/rpl/t/rpl_row_func003.test similarity index 100% rename from mysql-test/t/rpl_row_func003.test rename to mysql-test/suite/rpl/t/rpl_row_func003.test diff --git a/mysql-test/t/rpl_row_inexist_tbl-slave.opt b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_inexist_tbl-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_inexist_tbl-slave.opt diff --git a/mysql-test/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test similarity index 100% rename from mysql-test/t/rpl_row_inexist_tbl.test rename to mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test diff --git a/mysql-test/t/rpl_row_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test similarity index 100% rename from mysql-test/t/rpl_row_insert_delayed.test rename to mysql-test/suite/rpl/t/rpl_row_insert_delayed.test diff --git a/mysql-test/t/rpl_row_log-master.opt b/mysql-test/suite/rpl/t/rpl_row_log-master.opt similarity index 100% rename from mysql-test/t/rpl_row_log-master.opt rename to mysql-test/suite/rpl/t/rpl_row_log-master.opt diff --git a/mysql-test/t/rpl_row_log-slave.opt b/mysql-test/suite/rpl/t/rpl_row_log-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_log-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_log-slave.opt diff --git a/mysql-test/t/rpl_row_log.test b/mysql-test/suite/rpl/t/rpl_row_log.test similarity index 100% rename from mysql-test/t/rpl_row_log.test rename to mysql-test/suite/rpl/t/rpl_row_log.test diff --git a/mysql-test/t/rpl_row_log_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt similarity index 100% rename from mysql-test/t/rpl_row_log_innodb-master.opt rename to mysql-test/suite/rpl/t/rpl_row_log_innodb-master.opt diff --git a/mysql-test/t/rpl_row_log_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_log_innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_log_innodb-slave.opt diff --git a/mysql-test/t/rpl_row_log_innodb.test b/mysql-test/suite/rpl/t/rpl_row_log_innodb.test similarity index 100% rename from mysql-test/t/rpl_row_log_innodb.test rename to mysql-test/suite/rpl/t/rpl_row_log_innodb.test diff --git a/mysql-test/t/rpl_row_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_row_max_relay_size.test similarity index 100% rename from mysql-test/t/rpl_row_max_relay_size.test rename to mysql-test/suite/rpl/t/rpl_row_max_relay_size.test diff --git a/mysql-test/t/rpl_row_mysqlbinlog-master.opt b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt similarity index 100% rename from mysql-test/t/rpl_row_mysqlbinlog-master.opt rename to mysql-test/suite/rpl/t/rpl_row_mysqlbinlog-master.opt diff --git a/mysql-test/t/rpl_row_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test similarity index 100% rename from mysql-test/t/rpl_row_mysqlbinlog.test rename to mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test diff --git a/mysql-test/t/rpl_row_mystery22.test b/mysql-test/suite/rpl/t/rpl_row_mystery22.test similarity index 100% rename from mysql-test/t/rpl_row_mystery22.test rename to mysql-test/suite/rpl/t/rpl_row_mystery22.test diff --git a/mysql-test/t/rpl_row_reset_slave.test b/mysql-test/suite/rpl/t/rpl_row_reset_slave.test similarity index 100% rename from mysql-test/t/rpl_row_reset_slave.test rename to mysql-test/suite/rpl/t/rpl_row_reset_slave.test diff --git a/mysql-test/t/rpl_row_sp001.test b/mysql-test/suite/rpl/t/rpl_row_sp001.test similarity index 100% rename from mysql-test/t/rpl_row_sp001.test rename to mysql-test/suite/rpl/t/rpl_row_sp001.test diff --git a/mysql-test/t/rpl_row_sp002_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt similarity index 100% rename from mysql-test/t/rpl_row_sp002_innodb-master.opt rename to mysql-test/suite/rpl/t/rpl_row_sp002_innodb-master.opt diff --git a/mysql-test/t/rpl_row_sp002_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_sp002_innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_sp002_innodb-slave.opt diff --git a/mysql-test/t/rpl_row_sp002_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test similarity index 100% rename from mysql-test/t/rpl_row_sp002_innodb.test rename to mysql-test/suite/rpl/t/rpl_row_sp002_innodb.test diff --git a/mysql-test/t/rpl_row_sp003-master.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-master.opt similarity index 100% rename from mysql-test/t/rpl_row_sp003-master.opt rename to mysql-test/suite/rpl/t/rpl_row_sp003-master.opt diff --git a/mysql-test/t/rpl_row_sp003-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_sp003-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_sp003-slave.opt diff --git a/mysql-test/t/rpl_row_sp003.test b/mysql-test/suite/rpl/t/rpl_row_sp003.test similarity index 100% rename from mysql-test/t/rpl_row_sp003.test rename to mysql-test/suite/rpl/t/rpl_row_sp003.test diff --git a/mysql-test/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test similarity index 100% rename from mysql-test/t/rpl_row_sp005.test rename to mysql-test/suite/rpl/t/rpl_row_sp005.test diff --git a/mysql-test/t/rpl_row_sp006_InnoDB-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_sp006_InnoDB-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB-slave.opt diff --git a/mysql-test/t/rpl_row_sp006_InnoDB.test b/mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test similarity index 100% rename from mysql-test/t/rpl_row_sp006_InnoDB.test rename to mysql-test/suite/rpl/t/rpl_row_sp006_InnoDB.test diff --git a/mysql-test/t/rpl_row_sp007_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_sp007_innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_sp007_innodb-slave.opt diff --git a/mysql-test/t/rpl_row_sp007_innodb.test b/mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test similarity index 100% rename from mysql-test/t/rpl_row_sp007_innodb.test rename to mysql-test/suite/rpl/t/rpl_row_sp007_innodb.test diff --git a/mysql-test/t/rpl_row_sp008.test b/mysql-test/suite/rpl/t/rpl_row_sp008.test similarity index 100% rename from mysql-test/t/rpl_row_sp008.test rename to mysql-test/suite/rpl/t/rpl_row_sp008.test diff --git a/mysql-test/t/rpl_row_sp009.test b/mysql-test/suite/rpl/t/rpl_row_sp009.test similarity index 100% rename from mysql-test/t/rpl_row_sp009.test rename to mysql-test/suite/rpl/t/rpl_row_sp009.test diff --git a/mysql-test/t/rpl_row_sp010.test b/mysql-test/suite/rpl/t/rpl_row_sp010.test similarity index 100% rename from mysql-test/t/rpl_row_sp010.test rename to mysql-test/suite/rpl/t/rpl_row_sp010.test diff --git a/mysql-test/t/rpl_row_sp011.test b/mysql-test/suite/rpl/t/rpl_row_sp011.test similarity index 100% rename from mysql-test/t/rpl_row_sp011.test rename to mysql-test/suite/rpl/t/rpl_row_sp011.test diff --git a/mysql-test/t/rpl_row_sp012.test b/mysql-test/suite/rpl/t/rpl_row_sp012.test similarity index 100% rename from mysql-test/t/rpl_row_sp012.test rename to mysql-test/suite/rpl/t/rpl_row_sp012.test diff --git a/mysql-test/t/rpl_row_stop_middle.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle.test similarity index 100% rename from mysql-test/t/rpl_row_stop_middle.test rename to mysql-test/suite/rpl/t/rpl_row_stop_middle.test diff --git a/mysql-test/t/rpl_row_stop_middle_update-master.opt b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt similarity index 100% rename from mysql-test/t/rpl_row_stop_middle_update-master.opt rename to mysql-test/suite/rpl/t/rpl_row_stop_middle_update-master.opt diff --git a/mysql-test/t/rpl_row_stop_middle_update-slave.opt b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_stop_middle_update-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_stop_middle_update-slave.opt diff --git a/mysql-test/t/rpl_row_stop_middle_update.test b/mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test similarity index 100% rename from mysql-test/t/rpl_row_stop_middle_update.test rename to mysql-test/suite/rpl/t/rpl_row_stop_middle_update.test diff --git a/mysql-test/t/rpl_row_tabledefs_2myisam.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test similarity index 100% rename from mysql-test/t/rpl_row_tabledefs_2myisam.test rename to mysql-test/suite/rpl/t/rpl_row_tabledefs_2myisam.test diff --git a/mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_row_tabledefs_3innodb-slave.opt rename to mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb-slave.opt diff --git a/mysql-test/t/rpl_row_tabledefs_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test similarity index 100% rename from mysql-test/t/rpl_row_tabledefs_3innodb.test rename to mysql-test/suite/rpl/t/rpl_row_tabledefs_3innodb.test diff --git a/mysql-test/t/rpl_row_trig001.test b/mysql-test/suite/rpl/t/rpl_row_trig001.test similarity index 100% rename from mysql-test/t/rpl_row_trig001.test rename to mysql-test/suite/rpl/t/rpl_row_trig001.test diff --git a/mysql-test/t/rpl_row_trig002.test b/mysql-test/suite/rpl/t/rpl_row_trig002.test similarity index 100% rename from mysql-test/t/rpl_row_trig002.test rename to mysql-test/suite/rpl/t/rpl_row_trig002.test diff --git a/mysql-test/t/rpl_row_trig003.test b/mysql-test/suite/rpl/t/rpl_row_trig003.test similarity index 100% rename from mysql-test/t/rpl_row_trig003.test rename to mysql-test/suite/rpl/t/rpl_row_trig003.test diff --git a/mysql-test/t/rpl_row_trig004.test b/mysql-test/suite/rpl/t/rpl_row_trig004.test similarity index 100% rename from mysql-test/t/rpl_row_trig004.test rename to mysql-test/suite/rpl/t/rpl_row_trig004.test diff --git a/mysql-test/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test similarity index 100% rename from mysql-test/t/rpl_row_until.test rename to mysql-test/suite/rpl/t/rpl_row_until.test diff --git a/mysql-test/t/rpl_row_view01.test b/mysql-test/suite/rpl/t/rpl_row_view01.test similarity index 100% rename from mysql-test/t/rpl_row_view01.test rename to mysql-test/suite/rpl/t/rpl_row_view01.test diff --git a/mysql-test/t/rpl_server_id1.test b/mysql-test/suite/rpl/t/rpl_server_id1.test similarity index 100% rename from mysql-test/t/rpl_server_id1.test rename to mysql-test/suite/rpl/t/rpl_server_id1.test diff --git a/mysql-test/t/rpl_server_id2-slave.opt b/mysql-test/suite/rpl/t/rpl_server_id2-slave.opt similarity index 100% rename from mysql-test/t/rpl_server_id2-slave.opt rename to mysql-test/suite/rpl/t/rpl_server_id2-slave.opt diff --git a/mysql-test/t/rpl_server_id2.test b/mysql-test/suite/rpl/t/rpl_server_id2.test similarity index 100% rename from mysql-test/t/rpl_server_id2.test rename to mysql-test/suite/rpl/t/rpl_server_id2.test diff --git a/mysql-test/t/rpl_session_var.test b/mysql-test/suite/rpl/t/rpl_session_var.test similarity index 100% rename from mysql-test/t/rpl_session_var.test rename to mysql-test/suite/rpl/t/rpl_session_var.test diff --git a/mysql-test/t/rpl_set_charset.test b/mysql-test/suite/rpl/t/rpl_set_charset.test similarity index 100% rename from mysql-test/t/rpl_set_charset.test rename to mysql-test/suite/rpl/t/rpl_set_charset.test diff --git a/mysql-test/t/rpl_sf.test b/mysql-test/suite/rpl/t/rpl_sf.test similarity index 100% rename from mysql-test/t/rpl_sf.test rename to mysql-test/suite/rpl/t/rpl_sf.test diff --git a/mysql-test/t/rpl_skip_error-slave.opt b/mysql-test/suite/rpl/t/rpl_skip_error-slave.opt similarity index 100% rename from mysql-test/t/rpl_skip_error-slave.opt rename to mysql-test/suite/rpl/t/rpl_skip_error-slave.opt diff --git a/mysql-test/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test similarity index 100% rename from mysql-test/t/rpl_skip_error.test rename to mysql-test/suite/rpl/t/rpl_skip_error.test diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test similarity index 100% rename from mysql-test/t/rpl_slave_status.test rename to mysql-test/suite/rpl/t/rpl_slave_status.test diff --git a/mysql-test/t/rpl_sp-master.opt b/mysql-test/suite/rpl/t/rpl_sp-master.opt similarity index 100% rename from mysql-test/t/rpl_sp-master.opt rename to mysql-test/suite/rpl/t/rpl_sp-master.opt diff --git a/mysql-test/t/rpl_sp-slave.opt b/mysql-test/suite/rpl/t/rpl_sp-slave.opt similarity index 100% rename from mysql-test/t/rpl_sp-slave.opt rename to mysql-test/suite/rpl/t/rpl_sp-slave.opt diff --git a/mysql-test/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test similarity index 100% rename from mysql-test/t/rpl_sp.test rename to mysql-test/suite/rpl/t/rpl_sp.test diff --git a/mysql-test/t/rpl_sp004.test b/mysql-test/suite/rpl/t/rpl_sp004.test similarity index 100% rename from mysql-test/t/rpl_sp004.test rename to mysql-test/suite/rpl/t/rpl_sp004.test diff --git a/mysql-test/t/rpl_sp_effects-master.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-master.opt similarity index 100% rename from mysql-test/t/rpl_sp_effects-master.opt rename to mysql-test/suite/rpl/t/rpl_sp_effects-master.opt diff --git a/mysql-test/t/rpl_sp_effects-slave.opt b/mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt similarity index 100% rename from mysql-test/t/rpl_sp_effects-slave.opt rename to mysql-test/suite/rpl/t/rpl_sp_effects-slave.opt diff --git a/mysql-test/t/rpl_sp_effects.test b/mysql-test/suite/rpl/t/rpl_sp_effects.test similarity index 100% rename from mysql-test/t/rpl_sp_effects.test rename to mysql-test/suite/rpl/t/rpl_sp_effects.test diff --git a/mysql-test/t/rpl_sporadic_master-master.opt b/mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt similarity index 100% rename from mysql-test/t/rpl_sporadic_master-master.opt rename to mysql-test/suite/rpl/t/rpl_sporadic_master-master.opt diff --git a/mysql-test/t/rpl_sporadic_master.test b/mysql-test/suite/rpl/t/rpl_sporadic_master.test similarity index 100% rename from mysql-test/t/rpl_sporadic_master.test rename to mysql-test/suite/rpl/t/rpl_sporadic_master.test diff --git a/mysql-test/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test similarity index 100% rename from mysql-test/t/rpl_ssl.test rename to mysql-test/suite/rpl/t/rpl_ssl.test diff --git a/mysql-test/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test similarity index 100% rename from mysql-test/t/rpl_ssl1.test rename to mysql-test/suite/rpl/t/rpl_ssl1.test diff --git a/mysql-test/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test similarity index 100% rename from mysql-test/t/rpl_start_stop_slave.test rename to mysql-test/suite/rpl/t/rpl_start_stop_slave.test diff --git a/mysql-test/t/rpl_stm_000001-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt similarity index 100% rename from mysql-test/t/rpl_stm_000001-slave.opt rename to mysql-test/suite/rpl/t/rpl_stm_000001-slave.opt diff --git a/mysql-test/t/rpl_stm_000001.test b/mysql-test/suite/rpl/t/rpl_stm_000001.test similarity index 100% rename from mysql-test/t/rpl_stm_000001.test rename to mysql-test/suite/rpl/t/rpl_stm_000001.test diff --git a/mysql-test/t/rpl_stm_EE_err2.test b/mysql-test/suite/rpl/t/rpl_stm_EE_err2.test similarity index 100% rename from mysql-test/t/rpl_stm_EE_err2.test rename to mysql-test/suite/rpl/t/rpl_stm_EE_err2.test diff --git a/mysql-test/t/rpl_stm_charset.test b/mysql-test/suite/rpl/t/rpl_stm_charset.test similarity index 100% rename from mysql-test/t/rpl_stm_charset.test rename to mysql-test/suite/rpl/t/rpl_stm_charset.test diff --git a/mysql-test/t/rpl_stm_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test similarity index 100% rename from mysql-test/t/rpl_stm_flsh_tbls.test rename to mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test diff --git a/mysql-test/t/rpl_stm_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test similarity index 100% rename from mysql-test/t/rpl_stm_insert_delayed.test rename to mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test diff --git a/mysql-test/t/rpl_stm_log-master.opt b/mysql-test/suite/rpl/t/rpl_stm_log-master.opt similarity index 100% rename from mysql-test/t/rpl_stm_log-master.opt rename to mysql-test/suite/rpl/t/rpl_stm_log-master.opt diff --git a/mysql-test/t/rpl_stm_log-slave.opt b/mysql-test/suite/rpl/t/rpl_stm_log-slave.opt similarity index 100% rename from mysql-test/t/rpl_stm_log-slave.opt rename to mysql-test/suite/rpl/t/rpl_stm_log-slave.opt diff --git a/mysql-test/t/rpl_stm_log.test b/mysql-test/suite/rpl/t/rpl_stm_log.test similarity index 100% rename from mysql-test/t/rpl_stm_log.test rename to mysql-test/suite/rpl/t/rpl_stm_log.test diff --git a/mysql-test/t/rpl_stm_max_relay_size.test b/mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test similarity index 100% rename from mysql-test/t/rpl_stm_max_relay_size.test rename to mysql-test/suite/rpl/t/rpl_stm_max_relay_size.test diff --git a/mysql-test/t/rpl_stm_multi_query.test b/mysql-test/suite/rpl/t/rpl_stm_multi_query.test similarity index 100% rename from mysql-test/t/rpl_stm_multi_query.test rename to mysql-test/suite/rpl/t/rpl_stm_multi_query.test diff --git a/mysql-test/t/rpl_stm_mystery22.test b/mysql-test/suite/rpl/t/rpl_stm_mystery22.test similarity index 100% rename from mysql-test/t/rpl_stm_mystery22.test rename to mysql-test/suite/rpl/t/rpl_stm_mystery22.test diff --git a/mysql-test/t/rpl_stm_no_op.test b/mysql-test/suite/rpl/t/rpl_stm_no_op.test similarity index 100% rename from mysql-test/t/rpl_stm_no_op.test rename to mysql-test/suite/rpl/t/rpl_stm_no_op.test diff --git a/mysql-test/t/rpl_stm_reset_slave.test b/mysql-test/suite/rpl/t/rpl_stm_reset_slave.test similarity index 100% rename from mysql-test/t/rpl_stm_reset_slave.test rename to mysql-test/suite/rpl/t/rpl_stm_reset_slave.test diff --git a/mysql-test/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test similarity index 100% rename from mysql-test/t/rpl_stm_until.test rename to mysql-test/suite/rpl/t/rpl_stm_until.test diff --git a/mysql-test/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test similarity index 100% rename from mysql-test/t/rpl_switch_stm_row_mixed.test rename to mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test diff --git a/mysql-test/t/rpl_temp_table.test b/mysql-test/suite/rpl/t/rpl_temp_table.test similarity index 100% rename from mysql-test/t/rpl_temp_table.test rename to mysql-test/suite/rpl/t/rpl_temp_table.test diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/suite/rpl/t/rpl_temporary.test similarity index 100% rename from mysql-test/t/rpl_temporary.test rename to mysql-test/suite/rpl/t/rpl_temporary.test diff --git a/mysql-test/t/rpl_timezone-master.opt b/mysql-test/suite/rpl/t/rpl_timezone-master.opt similarity index 100% rename from mysql-test/t/rpl_timezone-master.opt rename to mysql-test/suite/rpl/t/rpl_timezone-master.opt diff --git a/mysql-test/t/rpl_timezone-slave.opt b/mysql-test/suite/rpl/t/rpl_timezone-slave.opt similarity index 100% rename from mysql-test/t/rpl_timezone-slave.opt rename to mysql-test/suite/rpl/t/rpl_timezone-slave.opt diff --git a/mysql-test/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test similarity index 100% rename from mysql-test/t/rpl_timezone.test rename to mysql-test/suite/rpl/t/rpl_timezone.test diff --git a/mysql-test/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test similarity index 100% rename from mysql-test/t/rpl_trigger.test rename to mysql-test/suite/rpl/t/rpl_trigger.test diff --git a/mysql-test/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test similarity index 100% rename from mysql-test/t/rpl_trunc_temp.test rename to mysql-test/suite/rpl/t/rpl_trunc_temp.test diff --git a/mysql-test/t/rpl_truncate_2myisam.test b/mysql-test/suite/rpl/t/rpl_truncate_2myisam.test similarity index 100% rename from mysql-test/t/rpl_truncate_2myisam.test rename to mysql-test/suite/rpl/t/rpl_truncate_2myisam.test diff --git a/mysql-test/t/rpl_truncate_3innodb.test b/mysql-test/suite/rpl/t/rpl_truncate_3innodb.test similarity index 100% rename from mysql-test/t/rpl_truncate_3innodb.test rename to mysql-test/suite/rpl/t/rpl_truncate_3innodb.test diff --git a/mysql-test/t/rpl_truncate_7ndb_2-master.opt b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt similarity index 100% rename from mysql-test/t/rpl_truncate_7ndb_2-master.opt rename to mysql-test/suite/rpl/t/rpl_truncate_7ndb_2-master.opt diff --git a/mysql-test/t/rpl_truncate_7ndb_2.test b/mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test similarity index 100% rename from mysql-test/t/rpl_truncate_7ndb_2.test rename to mysql-test/suite/rpl/t/rpl_truncate_7ndb_2.test diff --git a/mysql-test/t/rpl_udf-master.opt b/mysql-test/suite/rpl/t/rpl_udf-master.opt similarity index 100% rename from mysql-test/t/rpl_udf-master.opt rename to mysql-test/suite/rpl/t/rpl_udf-master.opt diff --git a/mysql-test/t/rpl_udf-slave.opt b/mysql-test/suite/rpl/t/rpl_udf-slave.opt similarity index 100% rename from mysql-test/t/rpl_udf-slave.opt rename to mysql-test/suite/rpl/t/rpl_udf-slave.opt diff --git a/mysql-test/t/rpl_udf.test b/mysql-test/suite/rpl/t/rpl_udf.test similarity index 100% rename from mysql-test/t/rpl_udf.test rename to mysql-test/suite/rpl/t/rpl_udf.test diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/suite/rpl/t/rpl_user_variables.test similarity index 100% rename from mysql-test/t/rpl_user_variables.test rename to mysql-test/suite/rpl/t/rpl_user_variables.test diff --git a/mysql-test/t/rpl_variables-master.opt b/mysql-test/suite/rpl/t/rpl_variables-master.opt similarity index 100% rename from mysql-test/t/rpl_variables-master.opt rename to mysql-test/suite/rpl/t/rpl_variables-master.opt diff --git a/mysql-test/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test similarity index 100% rename from mysql-test/t/rpl_variables.test rename to mysql-test/suite/rpl/t/rpl_variables.test diff --git a/mysql-test/t/rpl_view-slave.opt b/mysql-test/suite/rpl/t/rpl_view-slave.opt similarity index 100% rename from mysql-test/t/rpl_view-slave.opt rename to mysql-test/suite/rpl/t/rpl_view-slave.opt diff --git a/mysql-test/t/rpl_view.test b/mysql-test/suite/rpl/t/rpl_view.test similarity index 100% rename from mysql-test/t/rpl_view.test rename to mysql-test/suite/rpl/t/rpl_view.test diff --git a/mysql-test/r/rpl_ndb_2innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result similarity index 100% rename from mysql-test/r/rpl_ndb_2innodb.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result diff --git a/mysql-test/r/rpl_ndb_2myisam.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result similarity index 100% rename from mysql-test/r/rpl_ndb_2myisam.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result diff --git a/mysql-test/r/rpl_ndb_UUID.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result similarity index 100% rename from mysql-test/r/rpl_ndb_UUID.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_UUID.result diff --git a/mysql-test/r/rpl_ndb_auto_inc.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result similarity index 100% rename from mysql-test/r/rpl_ndb_auto_inc.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result diff --git a/mysql-test/r/rpl_ndb_bank.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result similarity index 100% rename from mysql-test/r/rpl_ndb_bank.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_bank.result diff --git a/mysql-test/r/rpl_ndb_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result similarity index 100% rename from mysql-test/r/rpl_ndb_basic.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result diff --git a/mysql-test/r/rpl_ndb_blob.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result similarity index 100% rename from mysql-test/r/rpl_ndb_blob.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result diff --git a/mysql-test/r/rpl_ndb_blob2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result similarity index 100% rename from mysql-test/r/rpl_ndb_blob2.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_blob2.result diff --git a/mysql-test/r/rpl_ndb_charset.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result similarity index 100% rename from mysql-test/r/rpl_ndb_charset.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result diff --git a/mysql-test/r/rpl_ndb_circular.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result similarity index 100% rename from mysql-test/r/rpl_ndb_circular.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result diff --git a/mysql-test/r/rpl_ndb_circular_simplex.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result similarity index 100% rename from mysql-test/r/rpl_ndb_circular_simplex.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result diff --git a/mysql-test/r/rpl_ndb_commit_afterflush.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result similarity index 100% rename from mysql-test/r/rpl_ndb_commit_afterflush.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_commit_afterflush.result diff --git a/mysql-test/r/rpl_ndb_dd_advance.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result similarity index 100% rename from mysql-test/r/rpl_ndb_dd_advance.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result diff --git a/mysql-test/r/rpl_ndb_dd_basic.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result similarity index 100% rename from mysql-test/r/rpl_ndb_dd_basic.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_basic.result diff --git a/mysql-test/r/rpl_ndb_dd_partitions.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result similarity index 100% rename from mysql-test/r/rpl_ndb_dd_partitions.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result diff --git a/mysql-test/r/rpl_ndb_ddl.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result similarity index 100% rename from mysql-test/r/rpl_ndb_ddl.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result diff --git a/mysql-test/r/rpl_ndb_delete_nowhere.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result similarity index 100% rename from mysql-test/r/rpl_ndb_delete_nowhere.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_delete_nowhere.result diff --git a/mysql-test/r/rpl_ndb_do_db.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result similarity index 100% rename from mysql-test/r/rpl_ndb_do_db.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_do_db.result diff --git a/mysql-test/r/rpl_ndb_do_table.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result similarity index 100% rename from mysql-test/r/rpl_ndb_do_table.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_do_table.result diff --git a/mysql-test/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result similarity index 100% rename from mysql-test/r/rpl_ndb_extraCol.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result diff --git a/mysql-test/r/rpl_ndb_func003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result similarity index 100% rename from mysql-test/r/rpl_ndb_func003.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result diff --git a/mysql-test/r/rpl_ndb_idempotent.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result similarity index 100% rename from mysql-test/r/rpl_ndb_idempotent.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result diff --git a/mysql-test/r/rpl_ndb_innodb_trans.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result similarity index 100% rename from mysql-test/r/rpl_ndb_innodb_trans.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb_trans.result diff --git a/mysql-test/r/rpl_ndb_insert_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result similarity index 100% rename from mysql-test/r/rpl_ndb_insert_ignore.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result diff --git a/mysql-test/r/rpl_ndb_load.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result similarity index 100% rename from mysql-test/r/rpl_ndb_load.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_load.result diff --git a/mysql-test/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result similarity index 100% rename from mysql-test/r/rpl_ndb_log.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result diff --git a/mysql-test/r/rpl_ndb_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result similarity index 100% rename from mysql-test/r/rpl_ndb_multi.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result diff --git a/mysql-test/r/rpl_ndb_multi_update2.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result similarity index 100% rename from mysql-test/r/rpl_ndb_multi_update2.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update2.result diff --git a/mysql-test/r/rpl_ndb_multi_update3.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result similarity index 100% rename from mysql-test/r/rpl_ndb_multi_update3.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_multi_update3.result diff --git a/mysql-test/r/rpl_ndb_relayrotate.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result similarity index 100% rename from mysql-test/r/rpl_ndb_relayrotate.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_relayrotate.result diff --git a/mysql-test/r/rpl_ndb_rep_ignore.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result similarity index 100% rename from mysql-test/r/rpl_ndb_rep_ignore.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_ignore.result diff --git a/mysql-test/r/rpl_ndb_row_001.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result similarity index 100% rename from mysql-test/r/rpl_ndb_row_001.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_row_001.result diff --git a/mysql-test/r/rpl_ndb_sp003.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result similarity index 100% rename from mysql-test/r/rpl_ndb_sp003.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_sp003.result diff --git a/mysql-test/r/rpl_ndb_sp006.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result similarity index 100% rename from mysql-test/r/rpl_ndb_sp006.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result diff --git a/mysql-test/r/rpl_ndb_stm_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result similarity index 100% rename from mysql-test/r/rpl_ndb_stm_innodb.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_stm_innodb.result diff --git a/mysql-test/r/rpl_ndb_sync.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result similarity index 100% rename from mysql-test/r/rpl_ndb_sync.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result diff --git a/mysql-test/r/rpl_ndb_trig004.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result similarity index 100% rename from mysql-test/r/rpl_ndb_trig004.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_trig004.result diff --git a/mysql-test/r/rpl_ndbapi_multi.result b/mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result similarity index 100% rename from mysql-test/r/rpl_ndbapi_multi.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndbapi_multi.result diff --git a/mysql-test/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result similarity index 100% rename from mysql-test/r/rpl_row_basic_7ndb.result rename to mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result diff --git a/mysql-test/r/rpl_truncate_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result similarity index 100% rename from mysql-test/r/rpl_truncate_7ndb.result rename to mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def new file mode 100644 index 00000000000..b238c8ac9c5 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -0,0 +1,27 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# : BUG# +# +# Do not use any TAB characters for whitespace. +# +############################################################################## + + +rpl_ndb_circular_simplex : BUG#27972 2007-04-20 mats Slave cannot start where it stopped +rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated +rpl_ndb_2myisam : BUG#19227 Seems to pass currently +rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD +rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master +rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement +rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement +#rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly +rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB + + +# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open + +#rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly diff --git a/mysql-test/t/rpl_ndb_2innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt similarity index 100% rename from mysql-test/t/rpl_ndb_2innodb-master.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-master.opt diff --git a/mysql-test/t/rpl_ndb_2innodb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_2innodb-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb-slave.opt diff --git a/mysql-test/t/rpl_ndb_2innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test similarity index 100% rename from mysql-test/t/rpl_ndb_2innodb.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test diff --git a/mysql-test/t/rpl_ndb_2myisam-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt similarity index 100% rename from mysql-test/t/rpl_ndb_2myisam-master.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-master.opt diff --git a/mysql-test/t/rpl_ndb_2myisam-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_2myisam-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam-slave.opt diff --git a/mysql-test/t/rpl_ndb_2myisam.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test similarity index 100% rename from mysql-test/t/rpl_ndb_2myisam.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test diff --git a/mysql-test/t/rpl_ndb_UUID.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test similarity index 100% rename from mysql-test/t/rpl_ndb_UUID.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test diff --git a/mysql-test/t/rpl_ndb_auto_inc.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test similarity index 100% rename from mysql-test/t/rpl_ndb_auto_inc.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test diff --git a/mysql-test/t/rpl_ndb_bank.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test similarity index 100% rename from mysql-test/t/rpl_ndb_bank.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test diff --git a/mysql-test/t/rpl_ndb_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test similarity index 100% rename from mysql-test/t/rpl_ndb_basic.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test diff --git a/mysql-test/t/rpl_ndb_blob.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test similarity index 100% rename from mysql-test/t/rpl_ndb_blob.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test diff --git a/mysql-test/t/rpl_ndb_blob2.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test similarity index 100% rename from mysql-test/t/rpl_ndb_blob2.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test diff --git a/mysql-test/t/rpl_ndb_charset.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test similarity index 100% rename from mysql-test/t/rpl_ndb_charset.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test diff --git a/mysql-test/t/rpl_ndb_circular.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test similarity index 100% rename from mysql-test/t/rpl_ndb_circular.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test diff --git a/mysql-test/t/rpl_ndb_circular_simplex.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test similarity index 100% rename from mysql-test/t/rpl_ndb_circular_simplex.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test diff --git a/mysql-test/t/rpl_ndb_commit_afterflush.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test similarity index 100% rename from mysql-test/t/rpl_ndb_commit_afterflush.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test diff --git a/mysql-test/t/rpl_ndb_dd_advance.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test similarity index 100% rename from mysql-test/t/rpl_ndb_dd_advance.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test diff --git a/mysql-test/t/rpl_ndb_dd_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test similarity index 100% rename from mysql-test/t/rpl_ndb_dd_basic.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test diff --git a/mysql-test/t/rpl_ndb_dd_partitions.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test similarity index 100% rename from mysql-test/t/rpl_ndb_dd_partitions.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test diff --git a/mysql-test/t/rpl_ndb_ddl.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test similarity index 100% rename from mysql-test/t/rpl_ndb_ddl.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test diff --git a/mysql-test/t/rpl_ndb_delete_nowhere.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test similarity index 100% rename from mysql-test/t/rpl_ndb_delete_nowhere.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test diff --git a/mysql-test/t/rpl_ndb_do_db-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_do_db-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db-slave.opt diff --git a/mysql-test/t/rpl_ndb_do_db.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test similarity index 100% rename from mysql-test/t/rpl_ndb_do_db.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test diff --git a/mysql-test/t/rpl_ndb_do_table-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_do_table-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table-slave.opt diff --git a/mysql-test/t/rpl_ndb_do_table.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test similarity index 100% rename from mysql-test/t/rpl_ndb_do_table.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test diff --git a/mysql-test/t/rpl_ndb_extraCol.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test similarity index 100% rename from mysql-test/t/rpl_ndb_extraCol.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test diff --git a/mysql-test/t/rpl_ndb_func003.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test similarity index 100% rename from mysql-test/t/rpl_ndb_func003.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test diff --git a/mysql-test/t/rpl_ndb_idempotent.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test similarity index 100% rename from mysql-test/t/rpl_ndb_idempotent.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test diff --git a/mysql-test/t/rpl_ndb_innodb2ndb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt similarity index 100% rename from mysql-test/t/rpl_ndb_innodb2ndb-master.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-master.opt diff --git a/mysql-test/t/rpl_ndb_innodb2ndb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_innodb2ndb-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt diff --git a/mysql-test/t/rpl_ndb_innodb2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test similarity index 100% rename from mysql-test/t/rpl_ndb_innodb2ndb.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test diff --git a/mysql-test/t/rpl_ndb_innodb_trans-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_innodb_trans-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans-slave.opt diff --git a/mysql-test/t/rpl_ndb_innodb_trans.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test similarity index 100% rename from mysql-test/t/rpl_ndb_innodb_trans.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test diff --git a/mysql-test/t/rpl_ndb_insert_ignore.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test similarity index 100% rename from mysql-test/t/rpl_ndb_insert_ignore.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test diff --git a/mysql-test/t/rpl_ndb_load.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test similarity index 100% rename from mysql-test/t/rpl_ndb_load.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test diff --git a/mysql-test/t/rpl_ndb_log-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt similarity index 100% rename from mysql-test/t/rpl_ndb_log-master.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_log-master.opt diff --git a/mysql-test/t/rpl_ndb_log.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test similarity index 100% rename from mysql-test/t/rpl_ndb_log.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_log.test diff --git a/mysql-test/t/rpl_ndb_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test similarity index 100% rename from mysql-test/t/rpl_ndb_multi.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test diff --git a/mysql-test/t/rpl_ndb_multi_update2-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_multi_update2-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2-slave.opt diff --git a/mysql-test/t/rpl_ndb_multi_update2.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test similarity index 100% rename from mysql-test/t/rpl_ndb_multi_update2.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test diff --git a/mysql-test/t/rpl_ndb_multi_update3.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test similarity index 100% rename from mysql-test/t/rpl_ndb_multi_update3.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test diff --git a/mysql-test/t/rpl_ndb_myisam2ndb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt similarity index 100% rename from mysql-test/t/rpl_ndb_myisam2ndb-master.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-master.opt diff --git a/mysql-test/t/rpl_ndb_myisam2ndb-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_myisam2ndb-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt diff --git a/mysql-test/t/rpl_ndb_myisam2ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test similarity index 100% rename from mysql-test/t/rpl_ndb_myisam2ndb.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test diff --git a/mysql-test/t/rpl_ndb_relayrotate-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_relayrotate-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate-slave.opt diff --git a/mysql-test/t/rpl_ndb_relayrotate.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test similarity index 100% rename from mysql-test/t/rpl_ndb_relayrotate.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test diff --git a/mysql-test/t/rpl_ndb_rep_ignore-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt similarity index 100% rename from mysql-test/t/rpl_ndb_rep_ignore-slave.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore-slave.opt diff --git a/mysql-test/t/rpl_ndb_rep_ignore.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test similarity index 100% rename from mysql-test/t/rpl_ndb_rep_ignore.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test diff --git a/mysql-test/t/rpl_ndb_row_001.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test similarity index 100% rename from mysql-test/t/rpl_ndb_row_001.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test diff --git a/mysql-test/t/rpl_ndb_sp003.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test similarity index 100% rename from mysql-test/t/rpl_ndb_sp003.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test diff --git a/mysql-test/t/rpl_ndb_sp006.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test similarity index 100% rename from mysql-test/t/rpl_ndb_sp006.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test diff --git a/mysql-test/t/rpl_ndb_stm_innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt similarity index 100% rename from mysql-test/t/rpl_ndb_stm_innodb-master.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb-master.opt diff --git a/mysql-test/t/rpl_ndb_stm_innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test similarity index 100% rename from mysql-test/t/rpl_ndb_stm_innodb.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test diff --git a/mysql-test/t/rpl_ndb_sync.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test similarity index 100% rename from mysql-test/t/rpl_ndb_sync.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test diff --git a/mysql-test/t/rpl_ndb_trig004.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test similarity index 100% rename from mysql-test/t/rpl_ndb_trig004.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test diff --git a/mysql-test/t/rpl_ndbapi_multi.test b/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test similarity index 100% rename from mysql-test/t/rpl_ndbapi_multi.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test diff --git a/mysql-test/t/rpl_row_basic_7ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test similarity index 100% rename from mysql-test/t/rpl_row_basic_7ndb.test rename to mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test diff --git a/mysql-test/t/rpl_truncate_7ndb.test b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test similarity index 100% rename from mysql-test/t/rpl_truncate_7ndb.test rename to mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 27e3b9bc614..31ff0d58477 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -21,29 +21,6 @@ im_instance_conf : BUG#28743 Instance manager generates warnings in test im_utils : BUG#28743 Instance manager generates warnings in test suite concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences -ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog -ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog -ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed - -partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table -rpl_ndb_circular_simplex : BUG#27972 2007-04-20 mats Slave cannot start where it stopped -rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated -rpl_ndb_2myisam : BUG#19227 Seems to pass currently -rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD -rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master -rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement -rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement -#rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly -rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB - -# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open -#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events -#ndb_binlog_discover : bug#21806 2006-08-24 -#ndb_autodiscover3 : bug#21806 - -#rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly - -ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms im_options_set : Bug#20294: Instance manager tests fail randomly im_options_unset : Bug#20294: Instance manager tests fail randomly From 030d98d3971aaabbbeb37ed641629944a97186f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 18:10:19 +0500 Subject: [PATCH 038/227] BUG#29299 - repeatable myisam fulltext index corruption Fulltext index may get corrupt by certain gbk characters. The problem was that when skipping leading non-true-word-characters, we assumed that these characters are always 1 byte long. This is not the case with gbk character set, since non-true-word-characters may be 2 bytes long. Affects 5.0 only. myisam/ft_parser.c: Leading non-true-word-characters may also be multi-byte (e.g. in gbk character set). mysql-test/r/fulltext2.result: A test case for BUG#29299. mysql-test/t/fulltext2.test: A test case for BUG#29299. --- myisam/ft_parser.c | 6 ++++-- mysql-test/r/fulltext2.result | 12 ++++++++++++ mysql-test/t/fulltext2.test | 12 ++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c index 6c79f9249cf..6d68542e4e2 100644 --- a/myisam/ft_parser.c +++ b/myisam/ft_parser.c @@ -111,7 +111,7 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end, while (docquot) @@ -120,6 +120,7 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end, *start=doc+1; return 3; /* FTB_RBR */ } + mbl= my_mbcharlen(cs, *(uchar *)doc); if (!param->quot) { if (*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT) @@ -187,10 +188,11 @@ byte ft_simple_get_word(CHARSET_INFO *cs, byte **start, const byte *end, do { - for (;; doc++) + for (;; doc+= mbl) { if (doc >= end) DBUG_RETURN(0); if (true_word_char(cs, *doc)) break; + mbl= my_mbcharlen(cs, *(uchar *)doc); } mwc= length= 0; diff --git a/mysql-test/r/fulltext2.result b/mysql-test/r/fulltext2.result index f6a4b20bc22..f6bb4e4965a 100644 --- a/mysql-test/r/fulltext2.result +++ b/mysql-test/r/fulltext2.result @@ -241,3 +241,15 @@ select * from t1 where match a against('ab c' in boolean mode); a drop table t1; set names latin1; +CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); +SET NAMES utf8; +INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); +SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); +HEX(a) +BEF361616197C22061616161 +DELETE FROM t1 LIMIT 1; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SET NAMES latin1; +DROP TABLE t1; diff --git a/mysql-test/t/fulltext2.test b/mysql-test/t/fulltext2.test index fd97f795534..99209dc8543 100644 --- a/mysql-test/t/fulltext2.test +++ b/mysql-test/t/fulltext2.test @@ -220,4 +220,16 @@ select * from t1 where match a against('ab c' in boolean mode); drop table t1; set names latin1; +# +# BUG#29299 - repeatable myisam fulltext index corruption +# +CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); +SET NAMES utf8; +INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); +SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); +DELETE FROM t1 LIMIT 1; +CHECK TABLE t1; +SET NAMES latin1; +DROP TABLE t1; + # End of 4.1 tests From 530dc0451f2202e5f76ead17169979cfd301a5af Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 16:49:32 +0200 Subject: [PATCH 039/227] Move disabling of rpl_invoked_features to suite/rpl/t/disabled.def Move tests to their respective suite mysql-test/suite/binlog/t/binlog_innodb.test: Rename: mysql-test/t/binlog_innodb.test -> mysql-test/suite/binlog/t/binlog_innodb.test mysql-test/suite/binlog/r/binlog_innodb.result: Rename: mysql-test/r/binlog_innodb.result -> mysql-test/suite/binlog/r/binlog_innodb.result mysql-test/suite/binlog/t/binlog_multi_engine.test: Rename: mysql-test/t/binlog_multi_engine.test -> mysql-test/suite/binlog/t/binlog_multi_engine.test mysql-test/suite/binlog/r/binlog_multi_engine.result: Rename: mysql-test/r/binlog_multi_engine.result -> mysql-test/suite/binlog/r/binlog_multi_engine.result mysql-test/suite/rpl/t/rpl_grant.test: Rename: mysql-test/t/rpl_grant.test -> mysql-test/suite/rpl/t/rpl_grant.test mysql-test/suite/rpl/t/rpl_invoked_features-master.opt: Rename: mysql-test/t/rpl_invoked_features-master.opt -> mysql-test/suite/rpl/t/rpl_invoked_features-master.opt mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt: Rename: mysql-test/t/rpl_invoked_features-slave.opt -> mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt mysql-test/suite/rpl/t/rpl_invoked_features.test: Rename: mysql-test/t/rpl_invoked_features.test -> mysql-test/suite/rpl/t/rpl_invoked_features.test mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt: Rename: mysql-test/t/rpl_loaddata_fatal-slave.opt -> mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt mysql-test/suite/rpl/t/rpl_loaddata_fatal.test: Rename: mysql-test/t/rpl_loaddata_fatal.test -> mysql-test/suite/rpl/t/rpl_loaddata_fatal.test mysql-test/suite/rpl/t/rpl_slave_skip.test: Rename: mysql-test/t/rpl_slave_skip.test -> mysql-test/suite/rpl/t/rpl_slave_skip.test mysql-test/suite/rpl/r/rpl_grant.result: Rename: mysql-test/r/rpl_grant.result -> mysql-test/suite/rpl/r/rpl_grant.result mysql-test/suite/rpl/r/rpl_invoked_features.result: Rename: mysql-test/r/rpl_invoked_features.result -> mysql-test/suite/rpl/r/rpl_invoked_features.result mysql-test/suite/rpl/r/rpl_loaddata_fatal.result: Rename: mysql-test/r/rpl_loaddata_fatal.result -> mysql-test/suite/rpl/r/rpl_loaddata_fatal.result mysql-test/suite/rpl/r/rpl_slave_skip.result: Rename: mysql-test/r/rpl_slave_skip.result -> mysql-test/suite/rpl/r/rpl_slave_skip.result mysql-test/suite/rpl/t/disabled.def: Move disabling of rpl_invoked_features to suite/rpl/t/disabled.def mysql-test/t/disabled.def: Move disabling of rpl_invoked_features to suite/rpl/t/disabled.def --- mysql-test/{ => suite/binlog}/r/binlog_innodb.result | 0 mysql-test/{ => suite/binlog}/r/binlog_multi_engine.result | 0 mysql-test/{ => suite/binlog}/t/binlog_innodb.test | 0 mysql-test/{ => suite/binlog}/t/binlog_multi_engine.test | 0 mysql-test/{ => suite/rpl}/r/rpl_grant.result | 0 mysql-test/{ => suite/rpl}/r/rpl_invoked_features.result | 0 mysql-test/{ => suite/rpl}/r/rpl_loaddata_fatal.result | 0 mysql-test/{ => suite/rpl}/r/rpl_slave_skip.result | 0 mysql-test/suite/rpl/t/disabled.def | 1 + mysql-test/{ => suite/rpl}/t/rpl_grant.test | 0 mysql-test/{ => suite/rpl}/t/rpl_invoked_features-master.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_invoked_features-slave.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_invoked_features.test | 0 mysql-test/{ => suite/rpl}/t/rpl_loaddata_fatal-slave.opt | 0 mysql-test/{ => suite/rpl}/t/rpl_loaddata_fatal.test | 0 mysql-test/{ => suite/rpl}/t/rpl_slave_skip.test | 0 mysql-test/t/disabled.def | 1 - 17 files changed, 1 insertion(+), 1 deletion(-) rename mysql-test/{ => suite/binlog}/r/binlog_innodb.result (100%) rename mysql-test/{ => suite/binlog}/r/binlog_multi_engine.result (100%) rename mysql-test/{ => suite/binlog}/t/binlog_innodb.test (100%) rename mysql-test/{ => suite/binlog}/t/binlog_multi_engine.test (100%) rename mysql-test/{ => suite/rpl}/r/rpl_grant.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_invoked_features.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_loaddata_fatal.result (100%) rename mysql-test/{ => suite/rpl}/r/rpl_slave_skip.result (100%) rename mysql-test/{ => suite/rpl}/t/rpl_grant.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_invoked_features-master.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_invoked_features-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_invoked_features.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddata_fatal-slave.opt (100%) rename mysql-test/{ => suite/rpl}/t/rpl_loaddata_fatal.test (100%) rename mysql-test/{ => suite/rpl}/t/rpl_slave_skip.test (100%) diff --git a/mysql-test/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result similarity index 100% rename from mysql-test/r/binlog_innodb.result rename to mysql-test/suite/binlog/r/binlog_innodb.result diff --git a/mysql-test/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result similarity index 100% rename from mysql-test/r/binlog_multi_engine.result rename to mysql-test/suite/binlog/r/binlog_multi_engine.result diff --git a/mysql-test/t/binlog_innodb.test b/mysql-test/suite/binlog/t/binlog_innodb.test similarity index 100% rename from mysql-test/t/binlog_innodb.test rename to mysql-test/suite/binlog/t/binlog_innodb.test diff --git a/mysql-test/t/binlog_multi_engine.test b/mysql-test/suite/binlog/t/binlog_multi_engine.test similarity index 100% rename from mysql-test/t/binlog_multi_engine.test rename to mysql-test/suite/binlog/t/binlog_multi_engine.test diff --git a/mysql-test/r/rpl_grant.result b/mysql-test/suite/rpl/r/rpl_grant.result similarity index 100% rename from mysql-test/r/rpl_grant.result rename to mysql-test/suite/rpl/r/rpl_grant.result diff --git a/mysql-test/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result similarity index 100% rename from mysql-test/r/rpl_invoked_features.result rename to mysql-test/suite/rpl/r/rpl_invoked_features.result diff --git a/mysql-test/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result similarity index 100% rename from mysql-test/r/rpl_loaddata_fatal.result rename to mysql-test/suite/rpl/r/rpl_loaddata_fatal.result diff --git a/mysql-test/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result similarity index 100% rename from mysql-test/r/rpl_slave_skip.result rename to mysql-test/suite/rpl/r/rpl_slave_skip.result diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 180a700acaf..fda40c30340 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -13,3 +13,4 @@ rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master rpl_innodb_mixed_ddl : Bug #29363 rpl.rpl_innodb_mixed_* test failures rpl_innodb_mixed_dml : Bug #29363 rpl.rpl_innodb_mixed_* test failures +rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case diff --git a/mysql-test/t/rpl_grant.test b/mysql-test/suite/rpl/t/rpl_grant.test similarity index 100% rename from mysql-test/t/rpl_grant.test rename to mysql-test/suite/rpl/t/rpl_grant.test diff --git a/mysql-test/t/rpl_invoked_features-master.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-master.opt similarity index 100% rename from mysql-test/t/rpl_invoked_features-master.opt rename to mysql-test/suite/rpl/t/rpl_invoked_features-master.opt diff --git a/mysql-test/t/rpl_invoked_features-slave.opt b/mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt similarity index 100% rename from mysql-test/t/rpl_invoked_features-slave.opt rename to mysql-test/suite/rpl/t/rpl_invoked_features-slave.opt diff --git a/mysql-test/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test similarity index 100% rename from mysql-test/t/rpl_invoked_features.test rename to mysql-test/suite/rpl/t/rpl_invoked_features.test diff --git a/mysql-test/t/rpl_loaddata_fatal-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt similarity index 100% rename from mysql-test/t/rpl_loaddata_fatal-slave.opt rename to mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt diff --git a/mysql-test/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test similarity index 100% rename from mysql-test/t/rpl_loaddata_fatal.test rename to mysql-test/suite/rpl/t/rpl_loaddata_fatal.test diff --git a/mysql-test/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test similarity index 100% rename from mysql-test/t/rpl_slave_skip.test rename to mysql-test/suite/rpl/t/rpl_slave_skip.test diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 61d81811ec1..5d31a8060e8 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -21,7 +21,6 @@ im_instance_conf : BUG#28743 Instance manager generates warnings in test im_utils : BUG#28743 Instance manager generates warnings in test suite innodb : Disabling test case awaiting reply from Innobase concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences -rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Double Whopper From 61c423a2bd186bd6488df89216238a6e81a76df6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Jun 2007 18:21:20 +0200 Subject: [PATCH 040/227] Change "exec rm" to "remove_file" mysql-test/t/sp.test: Change "exec rm" to "remove_file" Change two "remove file if exists" to "check that file not exist" --- mysql-test/include/have_outfile.inc | 2 +- mysql-test/t/sp.test | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/mysql-test/include/have_outfile.inc b/mysql-test/include/have_outfile.inc index 10f093ec3ef..ae4a2723840 100644 --- a/mysql-test/include/have_outfile.inc +++ b/mysql-test/include/have_outfile.inc @@ -1,5 +1,5 @@ -- require r/have_outfile.require disable_query_log; select load_file(concat(@tmpdir,"/outfile.test")); ---exec rm $MYSQLTEST_VARDIR/tmp/outfile.test +--remove_file $MYSQLTEST_VARDIR/tmp/outfile.test enable_query_log; diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index c94a526e10c..460c10d88d0 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -705,9 +705,11 @@ begin insert into test.t1 values (concat(x, "2"), y+2); end| ---system rm -f $MYSQLTEST_VARDIR/tmp/spout +# Check that file does not exists +--error 1 +--file_exists $MYSQLTEST_VARDIR/tmp/spout call into_outfile("ofile", 1)| ---system rm -f $MYSQLTEST_VARDIR/tmp/spout +--remove_file $MYSQLTEST_VARDIR/tmp/spout delete from t1| drop procedure into_outfile| @@ -722,9 +724,11 @@ begin insert into test.t1 values (concat(x, "2"), y+2); end| ---system rm -f $MYSQLTEST_VARDIR/tmp/spdump +# Check that file does not exists +--error 1 +--file_exists $MYSQLTEST_VARDIR/tmp/spdump call into_dumpfile("dfile", 1)| ---system rm -f $MYSQLTEST_VARDIR/tmp/spdump +--remove_file $MYSQLTEST_VARDIR/tmp/spdump delete from t1| drop procedure into_dumpfile| From 0e5e884b118baeea9d47520acc5da2caa905dca8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jun 2007 00:23:14 -0700 Subject: [PATCH 041/227] Bug#29019 "REPLACE/INSERT IGNORE/UPDATE IGNORE doesn't work" Federated does not record neccessary HA_EXTRA flags in order to support REPLACE/INSERT IGNORE/UPDATE IGNORE. Implement ::extra() to capture flags neccessary for functionality. New function append_ident() to better escape identifiers consistantly. mysql-test/r/federated.result: test for bug29019 mysql-test/t/federated.test: test for bug29019 sql/ha_federated.cc: Bug29019 Federated does not record neccessary HA_EXTRA flags in order to support REPLACE/INSERT IGNORE/UPDATE IGNORE. Implement ::extra() to capture flags neccessary for functionality. New function append_ident() to better escape identifiers consistantly. sql/ha_federated.h: bug29019 add 2 member values to ha_federated class ignore_duplicates and replace_duplicates. add 1 member method to ha_federated class extra() --- mysql-test/r/federated.result | 24 ++++ mysql-test/t/federated.test | 27 +++++ sql/ha_federated.cc | 211 +++++++++++++++++++++++----------- sql/ha_federated.h | 2 + 4 files changed, 200 insertions(+), 64 deletions(-) diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index cecffbb1471..52304de7609 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -1843,6 +1843,30 @@ C3A4C3B6C3BCC39F D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E drop table federated.t1; drop table federated.t1; +create table federated.t1 (a int primary key, b varchar(64)) +DEFAULT CHARSET=utf8; +create table federated.t1 (a int primary key, b varchar(64)) +ENGINE=FEDERATED +connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1' + DEFAULT CHARSET=utf8; +insert ignore into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); +select * from federated.t1; +a b +1 Larry +2 Curly +truncate federated.t1; +replace into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); +select * from federated.t1; +a b +1 Moe +2 Curly +update ignore federated.t1 set a=a+1; +select * from federated.t1; +a b +1 Moe +3 Curly +drop table federated.t1; +drop table federated.t1; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 894cd513914..bdd6076064a 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1576,4 +1576,31 @@ connection slave; drop table federated.t1; +# +# BUG#21019 Federated Engine does not support REPLACE/INSERT IGNORE/UPDATE IGNORE +# +connection slave; +create table federated.t1 (a int primary key, b varchar(64)) + DEFAULT CHARSET=utf8; +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval create table federated.t1 (a int primary key, b varchar(64)) + ENGINE=FEDERATED + connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1' + DEFAULT CHARSET=utf8; + +insert ignore into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); +select * from federated.t1; + +truncate federated.t1; +replace into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); +select * from federated.t1; + +update ignore federated.t1 set a=a+1; +select * from federated.t1; + +drop table federated.t1; +connection slave; +drop table federated.t1; + source include/federated_cleanup.inc; diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index dd4dd725be4..9412db4b6a6 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -348,6 +348,10 @@ pthread_mutex_t federated_mutex; // This is the mutex we use to // init the hash static int federated_init= FALSE; // Variable for checking the // init state of hash +static char ident_quote_char= '`'; // Character for quoting + // identifiers +static char value_quote_char= '\''; // Character for quoting + // literals /* Federated storage engine handlerton */ @@ -440,6 +444,58 @@ bool federated_db_end() return FALSE; } + +/** + @brief Append identifiers to the string. + + @param[in,out] string The target string. + @param[in] name Identifier name + @param[in] length Length of identifier name in bytes + @param[in] quote_char Quote char to use for quoting identifier. + + @return Operation Status + @retval FALSE OK + @retval TRUE There was an error appending to the string. + + @note This function is based upon the append_identifier() function + in sql_show.cc except that quoting always occurs. +*/ + +static bool append_ident(String *string, const char *name, uint length, + const char quote_char) +{ + bool result; + uint clen; + const char *name_end; + DBUG_ENTER("append_ident"); + + if (quote_char) + { + string->reserve(length * 2 + 2); + if ((result= string->append("e_char, 1, system_charset_info))) + goto err; + + for (name_end= name+length; name < name_end; name+= clen) + { + uchar c= *(uchar *) name; + if (!(clen= my_mbcharlen(system_charset_info, c))) + clen= 1; + if (clen == 1 && c == (uchar) quote_char && + (result= string->append("e_char, 1, system_charset_info))) + goto err; + if ((result= string->append(name, clen, string->charset()))) + goto err; + } + result= string->append("e_char, 1, system_charset_info); + } + else + result= string->append(name, length, system_charset_info); + +err: + DBUG_RETURN(result); +} + + /* Check (in create) whether the tables exists, and that it can be connected to @@ -458,7 +514,6 @@ bool federated_db_end() static int check_foreign_data_source(FEDERATED_SHARE *share, bool table_create_flag) { - char escaped_table_name[NAME_LEN*2]; char query_buffer[FEDERATED_QUERY_BUFFER_SIZE]; char error_buffer[FEDERATED_QUERY_BUFFER_SIZE]; uint error_code; @@ -499,7 +554,6 @@ static int check_foreign_data_source(FEDERATED_SHARE *share, } else { - int escaped_table_name_length= 0; /* Since we do not support transactions at this version, we can let the client API silently reconnect. For future versions, we will need more @@ -517,14 +571,8 @@ static int check_foreign_data_source(FEDERATED_SHARE *share, query.append(FEDERATED_SELECT); query.append(FEDERATED_STAR); query.append(FEDERATED_FROM); - query.append(FEDERATED_BTICK); - escaped_table_name_length= - escape_string_for_mysql(&my_charset_bin, (char*)escaped_table_name, - sizeof(escaped_table_name), - share->table_name, - share->table_name_length); - query.append(escaped_table_name, escaped_table_name_length); - query.append(FEDERATED_BTICK); + append_ident(&query, share->table_name, share->table_name_length, + ident_quote_char); query.append(FEDERATED_WHERE); query.append(FEDERATED_FALSE); @@ -784,9 +832,8 @@ uint ha_federated::convert_row_to_internal_format(byte *record, static bool emit_key_part_name(String *to, KEY_PART_INFO *part) { DBUG_ENTER("emit_key_part_name"); - if (to->append(FEDERATED_BTICK) || - to->append(part->field->field_name) || - to->append(FEDERATED_BTICK)) + if (append_ident(to, part->field->field_name, + strlen(part->field->field_name), ident_quote_char)) DBUG_RETURN(1); // Out of memory DBUG_RETURN(0); } @@ -1309,31 +1356,28 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table) query.append(FEDERATED_SELECT); for (field= table->field; *field; field++) { - query.append(FEDERATED_BTICK); - query.append((*field)->field_name); - query.append(FEDERATED_BTICK); + append_ident(&query, (*field)->field_name, + strlen((*field)->field_name), ident_quote_char); query.append(FEDERATED_COMMA); } query.length(query.length()- strlen(FEDERATED_COMMA)); query.append(FEDERATED_FROM); - query.append(FEDERATED_BTICK); + + tmp_share.table_name_length= strlen(tmp_share.table_name); + append_ident(&query, tmp_share.table_name, + tmp_share.table_name_length, ident_quote_char); if (!(share= (FEDERATED_SHARE *) my_multi_malloc(MYF(MY_WME), &share, sizeof(*share), - &select_query, - query.length()+table->s->connect_string.length+1, + &select_query, query.length()+1, NullS))) goto error; memcpy(share, &tmp_share, sizeof(tmp_share)); + memcpy(select_query, query.ptr(), query.length()+1); - share->table_name_length= strlen(share->table_name); - /* TODO: share->table_name to LEX_STRING object */ - query.append(share->table_name, share->table_name_length); - query.append(FEDERATED_BTICK); share->select_query= select_query; - strmov(share->select_query, query.ptr()); share->use_count= 0; DBUG_PRINT("info", ("share->select_query %s", share->select_query)); @@ -1467,6 +1511,8 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked) table->s->reclength); DBUG_PRINT("info", ("ref_length: %u", ref_length)); + reset(); + DBUG_RETURN(0); } @@ -1579,10 +1625,14 @@ int ha_federated::write_row(byte *buf) /* start both our field and field values strings */ - insert_string.append(FEDERATED_INSERT); - insert_string.append(FEDERATED_BTICK); - insert_string.append(share->table_name, share->table_name_length); - insert_string.append(FEDERATED_BTICK); + if (replace_duplicates) + insert_string.append(STRING_WITH_LEN("REPLACE INTO ")); + else if (ignore_duplicates) + insert_string.append(STRING_WITH_LEN("INSERT IGNORE INTO ")); + else + insert_string.append(STRING_WITH_LEN("INSERT INTO ")); + append_ident(&insert_string, share->table_name, + share->table_name_length, ident_quote_char); insert_string.append(FEDERATED_OPENPAREN); values_string.append(FEDERATED_VALUES); @@ -1599,14 +1649,15 @@ int ha_federated::write_row(byte *buf) else { (*field)->val_str(&insert_field_value_string); - values_string.append('\''); + values_string.append(value_quote_char); insert_field_value_string.print(&values_string); - values_string.append('\''); + values_string.append(value_quote_char); insert_field_value_string.length(0); } /* append the field name */ - insert_string.append((*field)->field_name); + append_ident(&insert_string, (*field)->field_name, + strlen((*field)->field_name), ident_quote_char); /* append the value */ values_string.append(insert_field_value_string); @@ -1688,9 +1739,8 @@ int ha_federated::optimize(THD* thd, HA_CHECK_OPT* check_opt) query.set_charset(system_charset_info); query.append(FEDERATED_OPTIMIZE); - query.append(FEDERATED_BTICK); - query.append(share->table_name, share->table_name_length); - query.append(FEDERATED_BTICK); + append_ident(&query, share->table_name, share->table_name_length, + ident_quote_char); if (mysql_real_query(mysql, query.ptr(), query.length())) { @@ -1711,9 +1761,8 @@ int ha_federated::repair(THD* thd, HA_CHECK_OPT* check_opt) query.set_charset(system_charset_info); query.append(FEDERATED_REPAIR); - query.append(FEDERATED_BTICK); - query.append(share->table_name, share->table_name_length); - query.append(FEDERATED_BTICK); + append_ident(&query, share->table_name, share->table_name_length, + ident_quote_char); if (check_opt->flags & T_QUICK) query.append(FEDERATED_QUICK); if (check_opt->flags & T_EXTEND) @@ -1788,10 +1837,12 @@ int ha_federated::update_row(const byte *old_data, byte *new_data) update_string.length(0); where_string.length(0); - update_string.append(FEDERATED_UPDATE); - update_string.append(FEDERATED_BTICK); - update_string.append(share->table_name); - update_string.append(FEDERATED_BTICK); + if (ignore_duplicates) + update_string.append(STRING_WITH_LEN("UPDATE IGNORE ")); + else + update_string.append(STRING_WITH_LEN("UPDATE ")); + append_ident(&update_string, share->table_name, + share->table_name_length, ident_quote_char); update_string.append(FEDERATED_SET); /* @@ -1806,8 +1857,11 @@ int ha_federated::update_row(const byte *old_data, byte *new_data) for (Field **field= table->field; *field; field++) { - where_string.append((*field)->field_name); - update_string.append((*field)->field_name); + uint field_name_length= strlen((*field)->field_name); + append_ident(&where_string, (*field)->field_name, field_name_length, + ident_quote_char); + append_ident(&update_string, (*field)->field_name, field_name_length, + ident_quote_char); update_string.append(FEDERATED_EQ); if ((*field)->is_null()) @@ -1816,9 +1870,9 @@ int ha_federated::update_row(const byte *old_data, byte *new_data) { /* otherwise = */ (*field)->val_str(&field_value); - update_string.append('\''); + update_string.append(value_quote_char); field_value.print(&update_string); - update_string.append('\''); + update_string.append(value_quote_char); field_value.length(0); } @@ -1829,9 +1883,9 @@ int ha_federated::update_row(const byte *old_data, byte *new_data) where_string.append(FEDERATED_EQ); (*field)->val_str(&field_value, (char*) (old_data + (*field)->offset())); - where_string.append('\''); + where_string.append(value_quote_char); field_value.print(&where_string); - where_string.append('\''); + where_string.append(value_quote_char); field_value.length(0); } @@ -1888,16 +1942,16 @@ int ha_federated::delete_row(const byte *buf) delete_string.length(0); delete_string.append(FEDERATED_DELETE); delete_string.append(FEDERATED_FROM); - delete_string.append(FEDERATED_BTICK); - delete_string.append(share->table_name); - delete_string.append(FEDERATED_BTICK); + append_ident(&delete_string, share->table_name, + share->table_name_length, ident_quote_char); delete_string.append(FEDERATED_WHERE); for (Field **field= table->field; *field; field++) { Field *cur_field= *field; data_string.length(0); - delete_string.append(cur_field->field_name); + append_ident(&delete_string, (*field)->field_name, + strlen((*field)->field_name), ident_quote_char); if (cur_field->is_null()) { @@ -1907,9 +1961,9 @@ int ha_federated::delete_row(const byte *buf) { delete_string.append(FEDERATED_EQ); cur_field->val_str(&data_string); - delete_string.append('\''); + delete_string.append(value_quote_char); data_string.print(&delete_string); - delete_string.append('\''); + delete_string.append(value_quote_char); } delete_string.append(FEDERATED_AND); @@ -2411,14 +2465,8 @@ int ha_federated::info(uint flag) { status_query_string.length(0); status_query_string.append(FEDERATED_INFO); - status_query_string.append(FEDERATED_SQUOTE); - - escape_string_for_mysql(&my_charset_bin, (char *)escaped_table_name, - sizeof(escaped_table_name), - share->table_name, - share->table_name_length); - status_query_string.append(escaped_table_name); - status_query_string.append(FEDERATED_SQUOTE); + append_ident(&status_query_string, share->table_name, + share->table_name_length, value_quote_char); if (mysql_real_query(mysql, status_query_string.ptr(), status_query_string.length())) @@ -2484,6 +2532,42 @@ error: } +/** + @brief Handles extra signals from MySQL server + + @param[in] operation Hint for storage engine + + @return Operation Status + @retval 0 OK + */ +int ha_federated::extra(ha_extra_function operation) +{ + DBUG_ENTER("ha_federated::extra"); + switch (operation) { + case HA_EXTRA_IGNORE_DUP_KEY: + ignore_duplicates= TRUE; + break; + case HA_EXTRA_NO_IGNORE_DUP_KEY: + ignore_duplicates= FALSE; + break; + case HA_EXTRA_WRITE_CAN_REPLACE: + replace_duplicates= TRUE; + break; + case HA_EXTRA_WRITE_CANNOT_REPLACE: + replace_duplicates= FALSE; + break; + case HA_EXTRA_RESET: + ignore_duplicates= FALSE; + replace_duplicates= FALSE; + break; + default: + /* do nothing */ + DBUG_PRINT("info",("unhandled operation: %d", (uint) operation)); + } + DBUG_RETURN(0); +} + + /* Used to delete all rows in a table. Both for cases of truncate and for cases where the optimizer realizes that all rows will be @@ -2506,9 +2590,8 @@ int ha_federated::delete_all_rows() query.set_charset(system_charset_info); query.append(FEDERATED_TRUNCATE); - query.append(FEDERATED_BTICK); - query.append(share->table_name); - query.append(FEDERATED_BTICK); + append_ident(&query, share->table_name, share->table_name_length, + ident_quote_char); /* TRUNCATE won't return anything in mysql_affected_rows diff --git a/sql/ha_federated.h b/sql/ha_federated.h index 09c934cb493..11a7547880a 100644 --- a/sql/ha_federated.h +++ b/sql/ha_federated.h @@ -157,6 +157,7 @@ class ha_federated: public handler MYSQL_ROW_OFFSET current_position; // Current position used by ::position() int remote_error_number; char remote_error_buf[FEDERATED_QUERY_BUFFER_SIZE]; + bool ignore_duplicates, replace_duplicates; private: /* @@ -284,6 +285,7 @@ public: int rnd_pos(byte *buf, byte *pos); //required void position(const byte *record); //required int info(uint); //required + int extra(ha_extra_function operation); void update_auto_increment(void); int repair(THD* thd, HA_CHECK_OPT* check_opt); From c69012d3e71a9bbf13228ae491f7ac27690f7bf8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jun 2007 14:04:20 +0500 Subject: [PATCH 042/227] BUG#29207 - archive table reported as corrupt by check table After merge fix. mysql-test/r/archive.result: After merge fix. --- mysql-test/r/archive.result | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 59462e848d2..36b013703d8 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12675,3 +12675,10 @@ select * from t1; i 1 drop table t1; +create table t1(a longblob) engine=archive; +insert into t1 set a=''; +insert into t1 set a='a'; +check table t1 extended; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; From b98c96e6a11fae7a2e3e96fb112dff6dead5f27a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jun 2007 11:13:18 +0200 Subject: [PATCH 043/227] Bug#29414 HPUX build fails - 'noinst_HEADERS' does not exist sql/Makefile.am: Avoid "noinst_HEADERS" being sucked into mysql_LDADD target if @MYSQLD_EXTRA_IBS@ are empty --- sql/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/Makefile.am b/sql/Makefile.am index fae35222128..52a4c96f451 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -43,8 +43,7 @@ mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \ @innodb_system_libs@ \ @ndbcluster_libs@ @ndbcluster_system_libs@ \ $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \ - $(yassl_libs) $(openssl_libs) \ - @MYSQLD_EXTRA_LIBS@ + $(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ item_strfunc.h item_timefunc.h item_uniq.h \ From db693e4143e6d03a71aaedc641462f98fc7e8ce7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jun 2007 11:18:15 +0200 Subject: [PATCH 044/227] WL#3933 Split main test suite to rpl, rpl_ndb and ndb - Cleaup Makefile.am in mysql-test making it easier to add new test files and suite directories mysql-test/Makefile.am: Cleanup Makefile.am in mysql-test to simplify inclusion of subdirectories without own Makefile. Add subdirs to EXTRA_DIST --- mysql-test/Makefile.am | 126 +++++++---------------------------------- 1 file changed, 21 insertions(+), 105 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 0a6dbc3663a..549a9b8ac7d 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -18,125 +18,41 @@ ## Process this file with automake to create Makefile.in SUBDIRS = ndb -DIST_SUBDIRS=ndb -benchdir_root= $(prefix) -testdir = $(benchdir_root)/mysql-test -EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \ - valgrind.supp $(PRESCRIPTS) -EXTRA_DIST = $(EXTRA_SCRIPTS) suite -GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run PRESCRIPTS = mysql-test-run.pl + +GENSCRIPTS = mysql-test-run-shell \ + install_test_db \ + mtr \ + mysql-test-run + +EXTRA_SCRIPTS = mysql-test-run-shell.sh \ + install_test_db.sh \ + valgrind.supp $(PRESCRIPTS) + +EXTRA_DIST_DIRS = t r include lib std_data suite extra + +EXTRA_DIST = $(EXTRA_DIST_DIRS) $(EXTRA_SCRIPTS) README + test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS) -test_DATA = std_data/client-key.pem std_data/client-cert.pem \ - std_data/cacert.pem std_data/server-cert.pem \ - std_data/server-key.pem + CLEANFILES = $(GENSCRIPTS) -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I.. - - -dist-hook: - mkdir -p \ - $(distdir)/t \ - $(distdir)/extra/binlog_tests \ - $(distdir)/extra/rpl_tests \ - $(distdir)/r \ - $(distdir)/include \ - $(distdir)/std_data \ - $(distdir)/std_data/ndb_backup50 \ - $(distdir)/std_data/ndb_backup51 \ - $(distdir)/lib - -$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t - -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t - -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t - $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t - $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests - $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests - -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests - -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(distdir)/extra/rpl_tests - $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include - $(INSTALL_DATA) $(srcdir)/include/*.test $(distdir)/include - $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r - $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(distdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(distdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(distdir)/std_data/ndb_backup50 - $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51 - $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib - -rm -rf `find $(distdir)/suite -type d -name SCCS` $(distdir)/suite/row_lock - -install-data-local: - $(mkinstalldirs) \ - $(DESTDIR)$(testdir)/t \ - $(DESTDIR)$(testdir)/extra/binlog_tests \ - $(DESTDIR)$(testdir)/extra/rpl_tests \ - $(DESTDIR)$(testdir)/r \ - $(DESTDIR)$(testdir)/include \ - $(DESTDIR)$(testdir)/std_data \ - $(DESTDIR)$(testdir)/std_data/ndb_backup50 \ - $(DESTDIR)$(testdir)/std_data/ndb_backup51 \ - $(DESTDIR)$(testdir)/lib - $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir) - -$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t - -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t - -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t - $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r - $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r - $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests - $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(DESTDIR)$(testdir)/extra/rpl_tests - -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(DESTDIR)$(testdir)/extra/binlog_tests - -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(DESTDIR)$(testdir)/extra/rpl_tests - $(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include - $(INSTALL_DATA) $(srcdir)/include/*.test $(DESTDIR)$(testdir)/include - $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data - $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50 - $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51 - $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib - for f in `(cd $(srcdir); find suite -type f | egrep -v 'SCCS|row_lock')`; \ - do \ - d=$(DESTDIR)$(testdir)/`dirname $$f`; \ - mkdir -p $$d ; \ - $(INSTALL_DATA) $(srcdir)/$$f $$d ; \ - done - -uninstall-local: - @RM@ -f -r $(DESTDIR)$(testdir) # mtr - a shortcut for executing mysql-test-run.pl mtr: - $(RM) -f mtr - $(LN_S) mysql-test-run.pl mtr + @RM@ -f mtr + @LN_S@ mysql-test-run.pl mtr # mysql-test-run - a shortcut for executing mysql-test-run.pl mysql-test-run: - $(RM) -f mysql-test-run - $(LN_S) mysql-test-run.pl mysql-test-run + @RM@ -f mysql-test-run + @LN_S@ mysql-test-run.pl mysql-test-run SUFFIXES = .sh +testdir = $(prefix)/mysql-test + .sh: @RM@ -f $@ $@-t @SED@ \ From dec626f4927598a2e85275b586f8c19031f40027 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jun 2007 11:23:59 +0200 Subject: [PATCH 045/227] Bug#29361 mysqldump creates stray file when too long path name is passed - Move the check of too long path to 'get_one_option' client/mysqldump.c: Move the check of too long path to 'get_one_option' mysql-test/r/mysqldump.result: Update result file after changing error message --- client/mysqldump.c | 23 ++++++++++++----------- mysql-test/r/mysqldump.result | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index fc461a5f559..1a024a923f5 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -686,6 +686,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case 'T': opt_disable_keys=0; + + if (strlen(argument) >= FN_REFLEN) + { + /* + This check is made because the some the file functions below + have FN_REFLEN sized stack allocated buffers and will cause + a crash even if the input destination buffer is large enough + to hold the output. + */ + die(EX_USAGE, "Input filename too long: %s", argument); + } + break; case '#': DBUG_PUSH(argument ? argument : default_dbug_option); @@ -2324,17 +2336,6 @@ static void dump_table(char *table, char *db) { char filename[FN_REFLEN], tmp_path[FN_REFLEN]; - if (strlen(path) >= FN_REFLEN) - { - /* - This check is made because the some the file functions below - have FN_REFLEN sized stack allocated buffers and will cause - a crash even if the input destination buffer is large enough - to hold the output. - */ - die(EX_USAGE, "Input filename or options too long: %s", path); - } - /* Convert the path to native os format and resolve to the full filepath. diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 7865148905e..8eac7c7e715 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -3206,7 +3206,7 @@ DROP TABLE t1; # CREATE TABLE t1(a int); INSERT INTO t1 VALUES (1), (2); -mysqldump: Input filename or options too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa DROP TABLE t1; CREATE TABLE t2 (a int); CREATE TABLE t3 (a int); From 94beb7cd8db07e816ecced8112945d9df9db67e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jun 2007 13:36:26 -0700 Subject: [PATCH 046/227] Bug#25511 "Federated INSERT failures" Federated does not correctly handle "INSERT...ON DUPLICATE KEY UPDATE" However, implementing such support is not reasonably possible without increasing complexity of the storage engine: checking that constraints on remote server match local server and parsing error messages. This patch causes 'ON DUPLICATE KEY' to fail with ER_DUP_KEY message if a conflict occurs and not to fail silently. include/my_base.h: bug25511 new storage engine hint: HA_EXTRA_INSERT_WITH_UPDATE mysql-test/r/federated.result: test for bug25511 mysql-test/t/federated.test: test for bug25511 sql/ha_federated.cc: bug25511 implement support for handling HA_EXTRA_INSERT_WITH_UPDATE hint sql/ha_federated.h: bug25511 new property: insert_dup_update sql/sql_insert.cc: bug25511 implement support for HA_EXTRA_INSERT_WITH_UPDATE When checking duplicates flag, if it is DUP_UPDATE, send hint to the storage engine. --- include/my_base.h | 8 +++++++- mysql-test/r/federated.result | 15 +++++++++++++++ mysql-test/t/federated.test | 26 ++++++++++++++++++++++++++ sql/ha_federated.cc | 10 +++++++++- sql/ha_federated.h | 1 + sql/sql_insert.cc | 8 ++++++++ 6 files changed, 66 insertions(+), 2 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index d07a4de8e6a..a26217f8050 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -168,7 +168,13 @@ enum ha_extra_function { These flags are reset by the handler::extra(HA_EXTRA_RESET) call. */ HA_EXTRA_DELETE_CANNOT_BATCH, - HA_EXTRA_UPDATE_CANNOT_BATCH + HA_EXTRA_UPDATE_CANNOT_BATCH, + /* + Inform handler that write_row() should immediately report constraint + violations because a INSERT...ON DUPLICATE KEY UPDATE is in being + performed. + */ + HA_EXTRA_INSERT_WITH_UPDATE }; /* The following is parameter to ha_panic() */ diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index 52304de7609..4bef92319fb 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -1867,6 +1867,21 @@ a b 3 Curly drop table federated.t1; drop table federated.t1; +create table federated.t1 (a int primary key, b varchar(64)) +DEFAULT CHARSET=utf8; +create table federated.t1 (a int primary key, b varchar(64)) +ENGINE=FEDERATED +connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1' + DEFAULT CHARSET=utf8; +insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe") +on duplicate key update a=a+100; +ERROR 23000: Can't write; duplicate key in table 't1' +select * from federated.t1; +a b +1 Larry +2 Curly +drop table federated.t1; +drop table federated.t1; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index bdd6076064a..bedb6b36d61 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1603,4 +1603,30 @@ drop table federated.t1; connection slave; drop table federated.t1; +# +# BUG#25511 Federated Insert failures. +# +# When the user performs a INSERT...ON DUPLICATE KEY UPDATE, we want +# it to fail if a duplicate key exists instead of ignoring it. +# +connection slave; +create table federated.t1 (a int primary key, b varchar(64)) + DEFAULT CHARSET=utf8; +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval create table federated.t1 (a int primary key, b varchar(64)) + ENGINE=FEDERATED + connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1' + DEFAULT CHARSET=utf8; + +--error ER_DUP_KEY +insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe") +on duplicate key update a=a+100; +select * from federated.t1; + +drop table federated.t1; +connection slave; +drop table federated.t1; + + source include/federated_cleanup.inc; diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 9412db4b6a6..e691831bbc9 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -1627,7 +1627,7 @@ int ha_federated::write_row(byte *buf) */ if (replace_duplicates) insert_string.append(STRING_WITH_LEN("REPLACE INTO ")); - else if (ignore_duplicates) + else if (ignore_duplicates && !insert_dup_update) insert_string.append(STRING_WITH_LEN("INSERT IGNORE INTO ")); else insert_string.append(STRING_WITH_LEN("INSERT INTO ")); @@ -2548,6 +2548,7 @@ int ha_federated::extra(ha_extra_function operation) ignore_duplicates= TRUE; break; case HA_EXTRA_NO_IGNORE_DUP_KEY: + insert_dup_update= FALSE; ignore_duplicates= FALSE; break; case HA_EXTRA_WRITE_CAN_REPLACE: @@ -2556,7 +2557,11 @@ int ha_federated::extra(ha_extra_function operation) case HA_EXTRA_WRITE_CANNOT_REPLACE: replace_duplicates= FALSE; break; + case HA_EXTRA_INSERT_WITH_UPDATE: + insert_dup_update= TRUE; + break; case HA_EXTRA_RESET: + insert_dup_update= FALSE; ignore_duplicates= FALSE; replace_duplicates= FALSE; break; @@ -2699,6 +2704,9 @@ int ha_federated::stash_remote_error() DBUG_ENTER("ha_federated::stash_remote_error()"); remote_error_number= mysql_errno(mysql); strmake(remote_error_buf, mysql_error(mysql), sizeof(remote_error_buf)-1); + if (remote_error_number == ER_DUP_ENTRY || + remote_error_number == ER_DUP_KEY) + DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY); DBUG_RETURN(HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM); } diff --git a/sql/ha_federated.h b/sql/ha_federated.h index 11a7547880a..28c89561b2c 100644 --- a/sql/ha_federated.h +++ b/sql/ha_federated.h @@ -158,6 +158,7 @@ class ha_federated: public handler int remote_error_number; char remote_error_buf[FEDERATED_QUERY_BUFFER_SIZE]; bool ignore_duplicates, replace_duplicates; + bool insert_dup_update; private: /* diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 228fc8860ae..3bfd84b324b 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -715,6 +715,8 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, */ table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); } + if (duplic == DUP_UPDATE) + table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE); /* let's *try* to start bulk inserts. It won't necessary start them as values_list.elements should be greater than @@ -2434,6 +2436,8 @@ bool Delayed_insert::handle_inserts(void) table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE); using_opt_replace= 1; } + if (info.handle_duplicates == DUP_UPDATE) + table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE); thd.clear_error(); // reset error for binlog if (write_record(&thd, table, &info)) { @@ -2761,6 +2765,8 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE); table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); } + if (info.handle_duplicates == DUP_UPDATE) + table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE); thd->no_trans_update.stmt= FALSE; thd->abort_on_warning= (!info.ignore && (thd->variables.sql_mode & @@ -3218,6 +3224,8 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) table->file->extra(HA_EXTRA_WRITE_CAN_REPLACE); table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); } + if (info.handle_duplicates == DUP_UPDATE) + table->file->extra(HA_EXTRA_INSERT_WITH_UPDATE); if (!thd->prelocked_mode) table->file->start_bulk_insert((ha_rows) 0); thd->no_trans_update.stmt= FALSE; From dba70720a7a3d6ae7e8504cb5414124f5c5d5c60 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Jun 2007 16:03:01 -0700 Subject: [PATCH 047/227] Bug#25513 "Federared Transactions Failure" Bug occurs when the user performs an operation which inserts more than one row into the federated table and the federated table references a remote table stored within a transactional storage engine. When the insert operation for any one row in the statement fails due to constraint violation, the federated engine is unable to perform statement rollback and so the remote table contains a partial commit. The user would expect a statement to perform the same so a statement rollback is expected. This bug was fixed by implementing bulk-insert handling into the federated storage engine. This will relieve the bug for most common situations by enabling the generation of a multi-row insert into the remote table and thus permitting the remote table to perform statement rollback when neccessary. The multi-row insert is limited to the maximum packet size between servers and should the size overflow, more than one insert statement will be sent and this bug will reappear. Multi-row insert is disabled when an "INSERT...ON DUPLICATE KEY UPDATE" is being performed. The bulk-insert handling will offer a significant performance boost when inserting a large number of small rows. This patch builds on Bug29019 and Bug25511 sql/ha_federated.cc: bug25513 new member methods: start_bulk_insert() - initializes memory for bulk insert end_bulk_insert() - sends any remaining bulk insert and frees memory append_stmt_insert() - create the INSERT statement sql/ha_federated.h: bug25513 new member value: bulk_insert new member methods: start_bulk_insert(), end_bulk_insert(), append_stmt_insert() make member methods private: read_next(), index_read_idx_with_result_set() mysql-test/r/federated_innodb.result: New BitKeeper file ``mysql-test/r/federated_innodb.result'' mysql-test/t/federated_innodb-slave.opt: New BitKeeper file ``mysql-test/t/federated_innodb-slave.opt'' mysql-test/t/federated_innodb.test: New BitKeeper file ``mysql-test/t/federated_innodb.test'' --- mysql-test/r/federated_innodb.result | 34 ++++ mysql-test/t/federated_innodb-slave.opt | 1 + mysql-test/t/federated_innodb.test | 34 ++++ sql/ha_federated.cc | 232 +++++++++++++++++++++--- sql/ha_federated.h | 20 +- 5 files changed, 283 insertions(+), 38 deletions(-) create mode 100644 mysql-test/r/federated_innodb.result create mode 100644 mysql-test/t/federated_innodb-slave.opt create mode 100644 mysql-test/t/federated_innodb.test diff --git a/mysql-test/r/federated_innodb.result b/mysql-test/r/federated_innodb.result new file mode 100644 index 00000000000..70ba3acb279 --- /dev/null +++ b/mysql-test/r/federated_innodb.result @@ -0,0 +1,34 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +stop slave; +DROP DATABASE IF EXISTS federated; +CREATE DATABASE federated; +DROP DATABASE IF EXISTS federated; +CREATE DATABASE federated; +create table federated.t1 (a int primary key, b varchar(64)) +engine=myisam; +create table federated.t1 (a int primary key, b varchar(64)) +engine=federated +connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; +insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); +ERROR 23000: Can't write; duplicate key in table 't1' +select * from federated.t1; +a b +1 Larry +2 Curly +truncate federated.t1; +alter table federated.t1 engine=innodb; +insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); +ERROR 23000: Can't write; duplicate key in table 't1' +select * from federated.t1; +a b +drop table federated.t1; +drop table federated.t1; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; +DROP TABLE IF EXISTS federated.t1; +DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/t/federated_innodb-slave.opt b/mysql-test/t/federated_innodb-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/federated_innodb-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/federated_innodb.test b/mysql-test/t/federated_innodb.test new file mode 100644 index 00000000000..772e37a2929 --- /dev/null +++ b/mysql-test/t/federated_innodb.test @@ -0,0 +1,34 @@ +source include/federated.inc; +source include/have_innodb.inc; + +# +# Bug#25513 Federated transaction failures +# +connection slave; +create table federated.t1 (a int primary key, b varchar(64)) + engine=myisam; +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval create table federated.t1 (a int primary key, b varchar(64)) + engine=federated + connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1'; + +--error ER_DUP_KEY +insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); +select * from federated.t1; + +connection slave; +truncate federated.t1; +alter table federated.t1 engine=innodb; +connection master; + +--error ER_DUP_KEY +insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe"); +select * from federated.t1; + +drop table federated.t1; +connection slave; +drop table federated.t1; + + +source include/federated_cleanup.inc; diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index e691831bbc9..8551db6be16 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -352,6 +352,7 @@ static char ident_quote_char= '`'; // Character for quoting // identifiers static char value_quote_char= '\''; // Character for quoting // literals +static const int bulk_padding= 64; // bytes "overhead" in packet /* Federated storage engine handlerton */ @@ -773,7 +774,9 @@ error: ha_federated::ha_federated(TABLE *table_arg) :handler(&federated_hton, table_arg), mysql(0), stored_result(0) -{} +{ + bzero(&bulk_insert, sizeof(bulk_insert)); +} /* @@ -1584,6 +1587,83 @@ inline uint field_in_record_is_null(TABLE *table, DBUG_RETURN(0); } + +/** + @brief Construct the INSERT statement. + + @details This method will construct the INSERT statement and appends it to + the supplied query string buffer. + + @return + @retval FALSE No error + @retval TRUE Failure +*/ + +bool ha_federated::append_stmt_insert(String *query) +{ + char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE]; + Field **field; + uint tmp_length; + + /* The main insert query string */ + String insert_string(insert_buffer, sizeof(insert_buffer), &my_charset_bin); + DBUG_ENTER("ha_federated::append_stmt_insert"); + + insert_string.length(0); + + if (replace_duplicates) + insert_string.append(STRING_WITH_LEN("REPLACE INTO ")); + else if (ignore_duplicates && !insert_dup_update) + insert_string.append(STRING_WITH_LEN("INSERT IGNORE INTO ")); + else + insert_string.append(STRING_WITH_LEN("INSERT INTO ")); + append_ident(&insert_string, share->table_name, share->table_name_length, + ident_quote_char); + insert_string.append(FEDERATED_OPENPAREN); + tmp_length= insert_string.length() - strlen(FEDERATED_COMMA); + + /* + loop through the field pointer array, add any fields to both the values + list and the fields list that match the current query id + */ + for (field= table->field; *field; field++) + { + /* append the field name */ + append_ident(&insert_string, (*field)->field_name, + strlen((*field)->field_name), ident_quote_char); + + /* append commas between both fields and fieldnames */ + /* + unfortunately, we can't use the logic + if *(fields + 1) to make the following + appends conditional because we may not append + if the next field doesn't match the condition: + (((*field)->query_id && (*field)->query_id == current_query_id) + */ + insert_string.append(FEDERATED_COMMA); + } + + /* + remove trailing comma + */ + insert_string.length(insert_string.length() - strlen(FEDERATED_COMMA)); + + /* + if there were no fields, we don't want to add a closing paren + AND, we don't want to chop off the last char '(' + insert will be "INSERT INTO t1 VALUES ();" + */ + if (insert_string.length() > tmp_length) + { + insert_string.append(FEDERATED_CLOSEPAREN); + } + + insert_string.append(FEDERATED_VALUES); + + DBUG_RETURN(query->append(insert_string)); +} + + /* write_row() inserts a row. No extra() hint is given currently if a bulk load is happeneding. buf() is a byte array of data. You can use the field @@ -1600,13 +1680,14 @@ inline uint field_in_record_is_null(TABLE *table, int ha_federated::write_row(byte *buf) { - char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE]; char values_buffer[FEDERATED_QUERY_BUFFER_SIZE]; char insert_field_value_buffer[STRING_BUFFER_USUAL_SIZE]; Field **field; + uint tmp_length; + int error= 0; + bool use_bulk_insert; + bool auto_increment_update_required= table->next_number_field; - /* The main insert query string */ - String insert_string(insert_buffer, sizeof(insert_buffer), &my_charset_bin); /* The string containing the values to be added to the insert */ String values_string(values_buffer, sizeof(values_buffer), &my_charset_bin); /* The actual value of the field, to be added to the values_string */ @@ -1614,7 +1695,6 @@ int ha_federated::write_row(byte *buf) sizeof(insert_field_value_buffer), &my_charset_bin); values_string.length(0); - insert_string.length(0); insert_field_value_string.length(0); DBUG_ENTER("ha_federated::write_row"); @@ -1624,19 +1704,19 @@ int ha_federated::write_row(byte *buf) /* start both our field and field values strings + We must disable multi-row insert for "INSERT...ON DUPLICATE KEY UPDATE" + Ignore duplicates is always true when insert_dup_update is true. + When replace_duplicates == TRUE, we can safely enable multi-row insert. + When performing multi-row insert, we only collect the columns values for + the row. The start of the statement is only created when the first + row is copied in to the bulk_insert string. */ - if (replace_duplicates) - insert_string.append(STRING_WITH_LEN("REPLACE INTO ")); - else if (ignore_duplicates && !insert_dup_update) - insert_string.append(STRING_WITH_LEN("INSERT IGNORE INTO ")); - else - insert_string.append(STRING_WITH_LEN("INSERT INTO ")); - append_ident(&insert_string, share->table_name, - share->table_name_length, ident_quote_char); - insert_string.append(FEDERATED_OPENPAREN); + if (!(use_bulk_insert= bulk_insert.str && + (!insert_dup_update || replace_duplicates))) + append_stmt_insert(&values_string); - values_string.append(FEDERATED_VALUES); values_string.append(FEDERATED_OPENPAREN); + tmp_length= values_string.length(); /* loop through the field pointer array, add any fields to both the values @@ -1655,9 +1735,6 @@ int ha_federated::write_row(byte *buf) insert_field_value_string.length(0); } - /* append the field name */ - append_ident(&insert_string, (*field)->field_name, - strlen((*field)->field_name), ident_quote_char); /* append the value */ values_string.append(insert_field_value_string); @@ -1671,32 +1748,61 @@ int ha_federated::write_row(byte *buf) if the next field doesn't match the condition: (((*field)->query_id && (*field)->query_id == current_query_id) */ - insert_string.append(FEDERATED_COMMA); values_string.append(FEDERATED_COMMA); } - /* - remove trailing comma - */ - insert_string.length(insert_string.length() - strlen(FEDERATED_COMMA)); /* if there were no fields, we don't want to add a closing paren AND, we don't want to chop off the last char '(' insert will be "INSERT INTO t1 VALUES ();" */ - if (table->s->fields) + if (values_string.length() > tmp_length) { /* chops off leading commas */ values_string.length(values_string.length() - strlen(FEDERATED_COMMA)); - insert_string.append(FEDERATED_CLOSEPAREN); } /* we always want to append this, even if there aren't any fields */ values_string.append(FEDERATED_CLOSEPAREN); - /* add the values */ - insert_string.append(values_string); + if (use_bulk_insert) + { + /* + Send the current bulk insert out if appending the current row would + cause the statement to overflow the packet size, otherwise set + auto_increment_update_required to FALSE as no query was executed. + */ + if (bulk_insert.length + values_string.length() + bulk_padding > + mysql->net.max_packet_size && bulk_insert.length) + { + error= mysql_real_query(mysql, bulk_insert.str, bulk_insert.length); + bulk_insert.length= 0; + } + else + auto_increment_update_required= FALSE; + + if (bulk_insert.length == 0) + { + char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE]; + String insert_string(insert_buffer, sizeof(insert_buffer), + &my_charset_bin); + insert_string.length(0); + append_stmt_insert(&insert_string); + dynstr_append_mem(&bulk_insert, insert_string.ptr(), + insert_string.length()); + } + else + dynstr_append_mem(&bulk_insert, ",", 1); - if (mysql_real_query(mysql, insert_string.ptr(), insert_string.length())) + dynstr_append_mem(&bulk_insert, values_string.ptr(), + values_string.length()); + } + else + { + error= mysql_real_query(mysql, values_string.ptr(), + values_string.length()); + } + + if (error) { DBUG_RETURN(stash_remote_error()); } @@ -1704,12 +1810,79 @@ int ha_federated::write_row(byte *buf) If the table we've just written a record to contains an auto_increment field, then store the last_insert_id() value from the foreign server */ - if (table->next_number_field) + if (auto_increment_update_required) update_auto_increment(); DBUG_RETURN(0); } + +/** + @brief Prepares the storage engine for bulk inserts. + + @param[in] rows estimated number of rows in bulk insert + or 0 if unknown. + + @details Initializes memory structures required for bulk insert. +*/ + +void ha_federated::start_bulk_insert(ha_rows rows) +{ + uint page_size; + DBUG_ENTER("ha_federated::start_bulk_insert"); + + dynstr_free(&bulk_insert); + + /** + We don't bother with bulk-insert semantics when the estimated rows == 1 + The rows value will be 0 if the server does not know how many rows + would be inserted. This can occur when performing INSERT...SELECT + */ + + if (rows == 1) + DBUG_VOID_RETURN; + + page_size= (uint) my_getpagesize(); + + if (init_dynamic_string(&bulk_insert, NULL, page_size, page_size)) + DBUG_VOID_RETURN; + + bulk_insert.length= 0; + DBUG_VOID_RETURN; +} + + +/** + @brief End bulk insert. + + @details This method will send any remaining rows to the remote server. + Finally, it will deinitialize the bulk insert data structure. + + @return Operation status + @retval 0 No error + @retval != 0 Error occured at remote server. Also sets my_errno. +*/ + +int ha_federated::end_bulk_insert() +{ + int error= 0; + DBUG_ENTER("ha_federated::end_bulk_insert"); + + if (bulk_insert.str && bulk_insert.length) + { + if (mysql_real_query(mysql, bulk_insert.str, bulk_insert.length)) + error= stash_remote_error(); + else + if (table->next_number_field) + update_auto_increment(); + } + + dynstr_free(&bulk_insert); + + DBUG_RETURN(my_errno= error); +} + + /* ha_federated::update_auto_increment @@ -2451,7 +2624,6 @@ int ha_federated::info(uint flag) { char error_buffer[FEDERATED_QUERY_BUFFER_SIZE]; char status_buf[FEDERATED_QUERY_BUFFER_SIZE]; - char escaped_table_name[FEDERATED_QUERY_BUFFER_SIZE]; int error; uint error_code; MYSQL_RES *result= 0; diff --git a/sql/ha_federated.h b/sql/ha_federated.h index 28c89561b2c..b5e1c217eb5 100644 --- a/sql/ha_federated.h +++ b/sql/ha_federated.h @@ -159,6 +159,7 @@ class ha_federated: public handler char remote_error_buf[FEDERATED_QUERY_BUFFER_SIZE]; bool ignore_duplicates, replace_duplicates; bool insert_dup_update; + DYNAMIC_STRING bulk_insert; private: /* @@ -173,6 +174,14 @@ private: bool records_in_range); int stash_remote_error(); + bool append_stmt_insert(String *query); + + int read_next(byte *buf, MYSQL_RES *result); + int index_read_idx_with_result_set(byte *buf, uint index, + const byte *key, + uint key_len, + ha_rkey_function find_flag, + MYSQL_RES **result); public: ha_federated(TABLE *table_arg); ~ha_federated() @@ -258,6 +267,8 @@ public: int open(const char *name, int mode, uint test_if_locked); // required int close(void); // required + void start_bulk_insert(ha_rows rows); + int end_bulk_insert(); int write_row(byte *buf); int update_row(const byte *old_data, byte *new_data); int delete_row(const byte *buf); @@ -301,14 +312,7 @@ public: THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); //required - virtual bool get_error_message(int error, String *buf); - - int read_next(byte *buf, MYSQL_RES *result); - int index_read_idx_with_result_set(byte *buf, uint index, - const byte *key, - uint key_len, - ha_rkey_function find_flag, - MYSQL_RES **result); + bool get_error_message(int error, String *buf); }; bool federated_db_init(void); From d55aa1804370f8c7e2040282799f9b2ec553349f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2007 09:00:52 +0200 Subject: [PATCH 048/227] Cset exclude: msvensson@pilot.(none)|ChangeSet|20070628091815|48577 mysql-test/Makefile.am: Exclude --- mysql-test/Makefile.am | 126 ++++++++++++++++++++++++++++++++++------- 1 file changed, 105 insertions(+), 21 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 549a9b8ac7d..0a6dbc3663a 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -18,41 +18,125 @@ ## Process this file with automake to create Makefile.in SUBDIRS = ndb +DIST_SUBDIRS=ndb -PRESCRIPTS = mysql-test-run.pl - -GENSCRIPTS = mysql-test-run-shell \ - install_test_db \ - mtr \ - mysql-test-run - -EXTRA_SCRIPTS = mysql-test-run-shell.sh \ - install_test_db.sh \ +benchdir_root= $(prefix) +testdir = $(benchdir_root)/mysql-test +EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \ valgrind.supp $(PRESCRIPTS) - -EXTRA_DIST_DIRS = t r include lib std_data suite extra - -EXTRA_DIST = $(EXTRA_DIST_DIRS) $(EXTRA_SCRIPTS) README - +EXTRA_DIST = $(EXTRA_SCRIPTS) suite +GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run +PRESCRIPTS = mysql-test-run.pl test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS) - +test_DATA = std_data/client-key.pem std_data/client-cert.pem \ + std_data/cacert.pem std_data/server-cert.pem \ + std_data/server-key.pem CLEANFILES = $(GENSCRIPTS) +INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I.. + + +dist-hook: + mkdir -p \ + $(distdir)/t \ + $(distdir)/extra/binlog_tests \ + $(distdir)/extra/rpl_tests \ + $(distdir)/r \ + $(distdir)/include \ + $(distdir)/std_data \ + $(distdir)/std_data/ndb_backup50 \ + $(distdir)/std_data/ndb_backup51 \ + $(distdir)/lib + -$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t + $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t + $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests + $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests + -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests + -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(distdir)/extra/rpl_tests + $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include + $(INSTALL_DATA) $(srcdir)/include/*.test $(distdir)/include + $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r + $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(distdir)/std_data/ndb_backup50 + $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51 + $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib + -rm -rf `find $(distdir)/suite -type d -name SCCS` $(distdir)/suite/row_lock + +install-data-local: + $(mkinstalldirs) \ + $(DESTDIR)$(testdir)/t \ + $(DESTDIR)$(testdir)/extra/binlog_tests \ + $(DESTDIR)$(testdir)/extra/rpl_tests \ + $(DESTDIR)$(testdir)/r \ + $(DESTDIR)$(testdir)/include \ + $(DESTDIR)$(testdir)/std_data \ + $(DESTDIR)$(testdir)/std_data/ndb_backup50 \ + $(DESTDIR)$(testdir)/std_data/ndb_backup51 \ + $(DESTDIR)$(testdir)/lib + $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir) + -$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(DESTDIR)$(testdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t + $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t + $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t + $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r + $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r + $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests + $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(DESTDIR)$(testdir)/extra/rpl_tests + -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(DESTDIR)$(testdir)/extra/binlog_tests + -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(DESTDIR)$(testdir)/extra/rpl_tests + $(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include + $(INSTALL_DATA) $(srcdir)/include/*.test $(DESTDIR)$(testdir)/include + $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50 + $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51 + $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib + for f in `(cd $(srcdir); find suite -type f | egrep -v 'SCCS|row_lock')`; \ + do \ + d=$(DESTDIR)$(testdir)/`dirname $$f`; \ + mkdir -p $$d ; \ + $(INSTALL_DATA) $(srcdir)/$$f $$d ; \ + done + +uninstall-local: + @RM@ -f -r $(DESTDIR)$(testdir) # mtr - a shortcut for executing mysql-test-run.pl mtr: - @RM@ -f mtr - @LN_S@ mysql-test-run.pl mtr + $(RM) -f mtr + $(LN_S) mysql-test-run.pl mtr # mysql-test-run - a shortcut for executing mysql-test-run.pl mysql-test-run: - @RM@ -f mysql-test-run - @LN_S@ mysql-test-run.pl mysql-test-run + $(RM) -f mysql-test-run + $(LN_S) mysql-test-run.pl mysql-test-run SUFFIXES = .sh -testdir = $(prefix)/mysql-test - .sh: @RM@ -f $@ $@-t @SED@ \ From 70fecb771ab6f7c83aef3304949021af227fd9bb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2007 09:23:42 +0200 Subject: [PATCH 049/227] WL3933 - Don't fail if mysql-test/t/ doesn't have some files mysql-test/Makefile.am: Don't fail if mysql-test/t/ doesn't have some files --- mysql-test/Makefile.am | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 0a6dbc3663a..acb9ba36bda 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -52,8 +52,8 @@ dist-hook: -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t $(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t - $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t + -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests @@ -91,9 +91,9 @@ install-data-local: -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t - $(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t + -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t + -$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests From 81f58225b4f2b7ce339e4c100f4a3cfadc715d6f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2007 09:28:51 +0200 Subject: [PATCH 050/227] Bug#22540 Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB - Update test results for --binlog-format=row mysql-test/suite/binlog/r/binlog_row_binlog.result: Update test result mysql-test/suite/rpl/r/rpl_row_create_table.result: Update test result --- .../suite/binlog/r/binlog_row_binlog.result | 131 ++++++++++++++++++ .../suite/rpl/r/rpl_row_create_table.result | 28 ++-- 2 files changed, 145 insertions(+), 14 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 6fcaad010d2..88d403c2f68 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -235,6 +235,137 @@ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 show binlog events in 'master-bin.000002' from 106; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query 1 # use `test`; drop table t1 +set @ac = @@autocommit; +set autocommit= 0; +reset master; +create table t1(n int) engine=innodb; +begin; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Query 1 273 use `test`; BEGIN +master-bin.000001 273 Table_map 1 312 table_id: # (test.t1) +master-bin.000001 312 Write_rows 1 346 table_id: # flags: STMT_END_F +master-bin.000001 346 Table_map 1 385 table_id: # (test.t1) +master-bin.000001 385 Write_rows 1 419 table_id: # flags: STMT_END_F +master-bin.000001 419 Table_map 1 458 table_id: # (test.t1) +master-bin.000001 458 Write_rows 1 492 table_id: # flags: STMT_END_F +master-bin.000001 492 Xid 1 519 COMMIT /* XID */ +master-bin.000001 519 Query 1 595 use `test`; drop table t1 +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) +master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F +master-bin.000001 278 Xid 1 305 COMMIT /* XID */ +master-bin.000001 305 Table_map 1 344 table_id: # (test.t1) +master-bin.000001 344 Write_rows 1 378 table_id: # flags: STMT_END_F +master-bin.000001 378 Xid 1 405 COMMIT /* XID */ +master-bin.000001 405 Table_map 1 444 table_id: # (test.t1) +master-bin.000001 444 Write_rows 1 478 table_id: # flags: STMT_END_F +master-bin.000001 478 Xid 1 505 COMMIT /* XID */ +master-bin.000001 505 Query 1 581 use `test`; drop table t1 +reset master; +create table t1(n int) engine=myisam; +begin; +insert into t1 values (4); +insert into t1 values (5); +insert into t1 values (6); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=myisam +master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) +master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F +master-bin.000001 278 Table_map 1 317 table_id: # (test.t1) +master-bin.000001 317 Write_rows 1 351 table_id: # flags: STMT_END_F +master-bin.000001 351 Table_map 1 390 table_id: # (test.t1) +master-bin.000001 390 Write_rows 1 424 table_id: # flags: STMT_END_F +master-bin.000001 424 Query 1 500 use `test`; drop table t1 +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 205 +insert into t1 values (1); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 305 +insert into t1 values (2); +insert into t1 values (3); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 505 +commit; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 505 +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) +master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F +master-bin.000001 278 Xid 1 305 COMMIT /* XID */ +master-bin.000001 305 Table_map 1 344 table_id: # (test.t1) +master-bin.000001 344 Write_rows 1 378 table_id: # flags: STMT_END_F +master-bin.000001 378 Xid 1 405 COMMIT /* XID */ +master-bin.000001 405 Table_map 1 444 table_id: # (test.t1) +master-bin.000001 444 Write_rows 1 478 table_id: # flags: STMT_END_F +master-bin.000001 478 Xid 1 505 COMMIT /* XID */ +master-bin.000001 505 Query 1 581 use `test`; drop table t1 +set autocommit= 0; +reset master; +create table t1(n int) engine=myisam; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 205 +insert into t1 values (4); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 278 +insert into t1 values (5); +insert into t1 values (6); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 424 +commit; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 424 +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=myisam +master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) +master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F +master-bin.000001 278 Table_map 1 317 table_id: # (test.t1) +master-bin.000001 317 Write_rows 1 351 table_id: # flags: STMT_END_F +master-bin.000001 351 Table_map 1 390 table_id: # (test.t1) +master-bin.000001 390 Write_rows 1 424 table_id: # flags: STMT_END_F +master-bin.000001 424 Query 1 500 use `test`; drop table t1 +set session autocommit = @ac; +End of 5.0 tests reset master; create table t1 (id tinyint auto_increment primary key); set insert_id=128; diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result index e76ce5b962d..f22881bd4a9 100644 --- a/mysql-test/suite/rpl/r/rpl_row_create_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result @@ -279,25 +279,25 @@ Log_name Pos Event_type Server_id End_log_pos Info # 192 Table_map # 231 table_id: # (test.t1) # 231 Write_rows # 275 table_id: # flags: STMT_END_F # 275 Query # 343 use `test`; BEGIN -# 343 Query # 125 use `test`; CREATE TABLE `t2` ( +# 343 Query # 468 use `test`; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 468 Table_map # 164 table_id: # (test.t2) -# 507 Write_rows # 208 table_id: # flags: STMT_END_F +# 468 Table_map # 507 table_id: # (test.t2) +# 507 Write_rows # 551 table_id: # flags: STMT_END_F # 551 Xid # 578 COMMIT /* XID */ # 578 Query # 646 use `test`; BEGIN -# 646 Query # 125 use `test`; CREATE TABLE `t3` ( +# 646 Query # 771 use `test`; CREATE TABLE `t3` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 771 Table_map # 164 table_id: # (test.t3) -# 810 Write_rows # 208 table_id: # flags: STMT_END_F +# 771 Table_map # 810 table_id: # (test.t3) +# 810 Write_rows # 854 table_id: # flags: STMT_END_F # 854 Xid # 881 COMMIT /* XID */ # 881 Query # 949 use `test`; BEGIN -# 949 Query # 125 use `test`; CREATE TABLE `t4` ( +# 949 Query # 1074 use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 1074 Table_map # 164 table_id: # (test.t4) -# 1113 Write_rows # 208 table_id: # flags: STMT_END_F +# 1074 Table_map # 1113 table_id: # (test.t4) +# 1113 Write_rows # 1157 table_id: # flags: STMT_END_F # 1157 Xid # 1184 COMMIT /* XID */ # 1184 Table_map # 1223 table_id: # (test.t1) # 1223 Write_rows # 1267 table_id: # flags: STMT_END_F @@ -371,10 +371,10 @@ Log_name Pos Event_type Server_id End_log_pos Info # 231 Write_rows # 275 table_id: # flags: STMT_END_F # 275 Query # 375 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB # 375 Query # 443 use `test`; BEGIN -# 443 Table_map # 39 table_id: # (test.t2) -# 482 Write_rows # 83 table_id: # flags: STMT_END_F -# 526 Table_map # 122 table_id: # (test.t2) -# 565 Write_rows # 161 table_id: # flags: STMT_END_F +# 443 Table_map # 482 table_id: # (test.t2) +# 482 Write_rows # 526 table_id: # flags: STMT_END_F +# 526 Table_map # 565 table_id: # (test.t2) +# 565 Write_rows # 604 table_id: # flags: STMT_END_F # 604 Xid # 631 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a @@ -396,7 +396,7 @@ SELECT * FROM t2 ORDER BY a; a SHOW BINLOG EVENTS FROM 631; Log_name Pos Event_type Server_id End_log_pos Info -# 631 Query # 80 use `test`; TRUNCATE TABLE t2 +# 631 Query # 711 use `test`; TRUNCATE TABLE t2 # 711 Xid # 738 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a From 0870afe37de6bac78e8099eecc175827d274c1f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2007 10:26:20 +0200 Subject: [PATCH 051/227] Bug#28356 Exec'ing "diff" from "mysqltest" loses the output, no information available - Use SQL for diffing master and slave mysql-test/r/rpl_misc_functions.result: Dump t1 on slave and load it back into temporary table on master to allow comapre with SQL mysql-test/t/rpl_misc_functions.test: Dump t1 on slave and load it back into temporary table on master to allow comapre with SQL --- mysql-test/r/rpl_misc_functions.result | 16 +++++++--- mysql-test/t/rpl_misc_functions.test | 42 ++++++++++++++++---------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/rpl_misc_functions.result b/mysql-test/r/rpl_misc_functions.result index 526414cec9c..ca7403316b1 100644 --- a/mysql-test/r/rpl_misc_functions.result +++ b/mysql-test/r/rpl_misc_functions.result @@ -40,7 +40,15 @@ CALL test_replication_sp2(); INSERT INTO t1 VALUES (test_replication_sf()); INSERT INTO t1 VALUES (test_replication_sf()); INSERT INTO t1 VALUES (test_replication_sf()); -DROP PROCEDURE IF EXISTS test_replication_sp1; -DROP PROCEDURE IF EXISTS test_replication_sp2; -DROP FUNCTION IF EXISTS test_replication_sf; -DROP TABLE IF EXISTS t1; +select * from t1 into outfile "../tmp/t1_slave.txt"; +create temporary table t1_slave select * from t1 where 1=0; +load data infile '../tmp/t1_slave.txt' into table t1_slave; +select count(*) into @aux from t1, t1_slave +where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ; +SELECT @aux; +@aux +12 +DROP PROCEDURE test_replication_sp1; +DROP PROCEDURE test_replication_sp2; +DROP FUNCTION test_replication_sf; +DROP TABLE t1, t1_slave; diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test index f00beff583a..b87fff919b2 100644 --- a/mysql-test/t/rpl_misc_functions.test +++ b/mysql-test/t/rpl_misc_functions.test @@ -77,27 +77,37 @@ INSERT INTO t1 VALUES (test_replication_sf()); INSERT INTO t1 VALUES (test_replication_sf()); INSERT INTO t1 VALUES (test_replication_sf()); -# Record the results of the query on the master ---exec $MYSQL --port=$MASTER_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql - --sync_slave_with_master -# Record the results of the query on the slave ---exec $MYSQL --port=$SLAVE_MYPORT test -e "SELECT * FROM test.t1" > $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql +# Dump table on slave +select * from t1 into outfile "../tmp/t1_slave.txt"; -# Compare the results from the master to the slave. ---exec diff $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql +# Load data from slave into temp table on master +connection master; +create temporary table t1_slave select * from t1 where 1=0; +load data infile '../tmp/t1_slave.txt' into table t1_slave; +--remove_file $MYSQLTEST_VARDIR/tmp/t1_slave.txt + +# Compare master and slave temp table, use subtraction +# for floating point comparison of "double" +select count(*) into @aux from t1, t1_slave +where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ; +SELECT @aux; +if (`SELECT @aux <> 12 OR @aux IS NULL`) +{ + --echo # ERROR: We expected to get count(*) = 12. + SELECT col_a FROM t1; + SELECT col_a FROM t1_slave; + --echo # abort + exit; +} # Cleanup connection master; ---disable_warnings -DROP PROCEDURE IF EXISTS test_replication_sp1; -DROP PROCEDURE IF EXISTS test_replication_sp2; -DROP FUNCTION IF EXISTS test_replication_sf; -DROP TABLE IF EXISTS t1; ---enable_warnings +DROP PROCEDURE test_replication_sp1; +DROP PROCEDURE test_replication_sp2; +DROP FUNCTION test_replication_sf; +DROP TABLE t1, t1_slave; --sync_slave_with_master -# If all is good, when can cleanup our dump files. ---system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_master.sql ---system rm $MYSQLTEST_VARDIR/tmp/rpl_rand_slave.sql + From 4e5990481dc49c6540e6c103dbbf0e342d00c4a5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2007 14:18:20 +0200 Subject: [PATCH 052/227] Reduce time for mysqladmin to try to shutdown servers from 70 to 20 seconds --- mysql-test/lib/mtr_process.pl | 2 +- mysql-test/mysql-test-run.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 7ac75829a28..69026d2c72f 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -359,7 +359,7 @@ sub mtr_kill_leftovers () { "socket: '$srv->{path_sock}'; ". "port: $srv->{port})"); - my $pid= mtr_mysqladmin_start($srv, "shutdown", 70); + my $pid= mtr_mysqladmin_start($srv, "shutdown", 20); # Save the pid of the mysqladmin process $admin_pids{$pid}= 1; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 0908eda061c..6ec4045bb43 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4328,7 +4328,7 @@ sub run_testcase_stop_servers($$$) { { if ( $mysqld->{'pid'} ) { - $pid= mtr_mysqladmin_start($mysqld, "shutdown", 70); + $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20); $admin_pids{$pid}= 1; @@ -4380,7 +4380,7 @@ sub run_testcase_stop_servers($$$) { { if ( $mysqld->{'pid'} ) { - $pid= mtr_mysqladmin_start($mysqld, "shutdown", 70); + $pid= mtr_mysqladmin_start($mysqld, "shutdown", 20); $admin_pids{$pid}= 1; From b863d726c577c95fc9c0f5ae96f4e4e9af29d238 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2007 14:43:54 +0200 Subject: [PATCH 053/227] Update make_win_bin_dist to also copy mysql-test/suite directory scripts/make_win_bin_dist: Copy all directories in mysql-test/suite/ Allow no *.slave-mi to be found in mysql-test/t --- scripts/make_win_bin_dist | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 6593e2c6039..480ea39b2cf 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -304,7 +304,7 @@ cp mysys/$TARGET/mysys.lib $DESTDIR/lib/opt/mysys_tls.lib mkdir -p $DESTDIR/mysql-test/include $DESTDIR/mysql-test/lib \ $DESTDIR/mysql-test/r $DESTDIR/mysql-test/std_data \ - $DESTDIR/mysql-test/t + $DESTDIR/mysql-test/t $DESTDIR/mysql-test/suite cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp mysql-test/install_test_db.sh $DESTDIR/mysql-test/install_test_db @@ -324,7 +324,7 @@ cp mysql-test/std_data/*.pem $DESTDIR/mysql-test/std_data/ cp mysql-test/std_data/*.MY* $DESTDIR/mysql-test/std_data/ cp mysql-test/t/*.opt $DESTDIR/mysql-test/t/ cp mysql-test/t/*.sh $DESTDIR/mysql-test/t/ -cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/ +cp mysql-test/t/*.slave-mi $DESTDIR/mysql-test/t/ || /bin/true cp mysql-test/t/*.sql $DESTDIR/mysql-test/t/ cp mysql-test/t/*.def $DESTDIR/mysql-test/t/ (cd mysql-test/t/ && cp *.test $ABS_DST/mysql-test/t/) @@ -335,6 +335,12 @@ if [ -d mysql-test/extra ] ; then cp -pR mysql-test/extra/* $DESTDIR/mysql-test/extra/ fi +# Copy all directories in mysql-test/suite/ +for i in `cd mysql-test/suite && ls`; do \ + mkdir -p $DESTDIR/mysql-test/suite/$i; \ + cp -R mysql-test/suite/$i $DESTDIR/mysql-test/suite/; \ +done + # ---------------------------------------------------------------------- # Copy what could be usable in the "scripts" directory. Currently # only SQL files, others are Bourne shell scripts or Perl scripts From 8aa5989174c9643381a058c90c184f1eb0f1247d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2007 21:48:22 +0500 Subject: [PATCH 054/227] Fix for bug #19328: Slave timeout with COM_REGISTER_SLAVE error causing stop Problem: "Under high load, the slave registering to the master can timeout during the COM_REGISTER_SLAVE execution. This causes an error, which prevents the slave from connecting at all." Fix: Do not abort immediately, but retry registering on master. sql/slave.cc: Fix for bug #19328: Slave timeout with COM_REGISTER_SLAVE error causing stop - retry connecting after a failed slave registration on master. Reconnecting has been factored out (see try_to_reconnect() and check_io_slave_killed()) to get rid of similar code used during registering on master/dump requesting/event reading. All messages have been moved to reconnect_messages[] array for easy usage and maintenance. - now one can force slave to reconnect using ./mtr --mysqld=--loose-debug=d,FORCE_SLAVE_TO_RECONNECT_{REG, DUMP, EVENT} --- sql/slave.cc | 308 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 208 insertions(+), 100 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index 6c7968c2b3f..d2c5b4fd254 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -59,6 +59,58 @@ ulonglong relay_log_space_limit = 0; int disconnect_slave_event_count = 0, abort_slave_event_count = 0; int events_till_abort = -1; +enum enum_slave_reconnect_actions +{ + SLAVE_RECON_ACT_REG= 0, + SLAVE_RECON_ACT_DUMP= 1, + SLAVE_RECON_ACT_EVENT= 2, + SLAVE_RECON_ACT_MAX +}; + +enum enum_slave_reconnect_messages +{ + SLAVE_RECON_MSG_WAIT= 0, + SLAVE_RECON_MSG_KILLED_WAITING= 1, + SLAVE_RECON_MSG_AFTER= 2, + SLAVE_RECON_MSG_FAILED= 3, + SLAVE_RECON_MSG_COMMAND= 4, + SLAVE_RECON_MSG_KILLED_AFTER= 5, + SLAVE_RECON_MSG_MAX +}; + +static const char *reconnect_messages[SLAVE_RECON_ACT_MAX][SLAVE_RECON_MSG_MAX]= +{ + { + "Waiting to reconnect after a failed registration on master", + "Slave I/O thread killed while waitnig to reconnect after a failed \ +registration on master", + "Reconnecting after a failed registration on master", + "failed registering on master, reconnecting to try again, \ +log '%s' at postion %s", + "COM_REGISTER_SLAVE", + "Slave I/O thread killed during or after reconnect" + }, + { + "Waiting to reconnect after a failed binlog dump request", + "Slave I/O thread killed while retrying master dump", + "Reconnecting after a failed binlog dump request", + "failed dump request, reconnecting to try again, log '%s' at postion %s", + "COM_BINLOG_DUMP", + "Slave I/O thread killed during or after reconnect" + }, + { + "Waiting to reconnect after a failed master event read", + "Slave I/O thread killed while waiting to reconnect after a failed read", + "Reconnecting after a failed master event read", + "Slave I/O thread: Failed reading log event, reconnecting to retry, \ +log '%s' at postion %s", + "", + "Slave I/O thread killed during or after a reconnect done to recover from \ +failed read" + } +}; + + typedef enum { SLAVE_THD_IO, SLAVE_THD_SQL} SLAVE_THD_TYPE; static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev); @@ -1098,12 +1150,14 @@ static void write_ignored_events_info_to_relay_log(THD *thd, MASTER_INFO *mi) } -int register_slave_on_master(MYSQL* mysql, MASTER_INFO *mi) +int register_slave_on_master(MYSQL* mysql, MASTER_INFO *mi, + bool *suppress_warnings) { uchar buf[1024], *pos= buf; uint report_host_len, report_user_len=0, report_password_len=0; DBUG_ENTER("register_slave_on_master"); + *suppress_warnings= FALSE; if (!report_host) DBUG_RETURN(0); report_host_len= strlen(report_host); @@ -1127,11 +1181,18 @@ int register_slave_on_master(MYSQL* mysql, MASTER_INFO *mi) if (simple_command(mysql, COM_REGISTER_SLAVE, buf, (size_t) (pos- buf), 0)) { - char buf[256]; - my_snprintf(buf, sizeof(buf), - "%s (Errno: %d)", mysql_error(mysql), mysql_errno(mysql)); - mi->report(ERROR_LEVEL, ER_SLAVE_MASTER_COM_FAILURE, - ER(ER_SLAVE_MASTER_COM_FAILURE), "COM_REGISTER_SLAVE", buf); + if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED) + { + *suppress_warnings= TRUE; // Suppress reconnect warning + } + else + { + char buf[256]; + my_snprintf(buf, sizeof(buf), "%s (Errno: %d)", mysql_error(mysql), + mysql_errno(mysql)); + mi->report(ERROR_LEVEL, ER_SLAVE_MASTER_COM_FAILURE, + ER(ER_SLAVE_MASTER_COM_FAILURE), "COM_REGISTER_SLAVE", buf); + } DBUG_RETURN(1); } DBUG_RETURN(0); @@ -1460,6 +1521,8 @@ static int request_dump(MYSQL* mysql, MASTER_INFO* mi, int binlog_flags = 0; // for now char* logname = mi->master_log_name; DBUG_ENTER("request_dump"); + + *suppress_warnings= FALSE; // TODO if big log files: Change next to int8store() int4store(buf, (ulong) mi->master_log_pos); @@ -1475,7 +1538,7 @@ static int request_dump(MYSQL* mysql, MASTER_INFO* mi, now we just fill up the error log :-) */ if (mysql_errno(mysql) == ER_NET_READ_INTERRUPTED) - *suppress_warnings= 1; // Suppress reconnect warning + *suppress_warnings= TRUE; // Suppress reconnect warning else sql_print_error("Error on COM_BINLOG_DUMP: %d %s, will retry in %d secs", mysql_errno(mysql), mysql_error(mysql), @@ -1539,7 +1602,7 @@ static ulong read_event(MYSQL* mysql, MASTER_INFO *mi, bool* suppress_warnings) ulong len; DBUG_ENTER("read_event"); - *suppress_warnings= 0; + *suppress_warnings= FALSE; /* my_real_read() will time us out We check if we were told to die, and if not, try reading again @@ -1879,6 +1942,94 @@ on this slave.\ } +static bool check_io_slave_killed(THD *thd, MASTER_INFO *mi, const char *info) +{ + if (io_slave_killed(thd, mi)) + { + if (global_system_variables.log_warnings) + sql_print_information(info); + return TRUE; + } + return FALSE; +} + + +/** + @brief Try to reconnect slave IO thread. + + @details Terminates current connection to master, sleeps for + @c mi->connect_retry msecs and initiates new connection with + @c safe_reconnect(). Variable pointed by @c retry_count is increased - + if it exceeds @c master_retry_count then connection is not re-established + and function signals error. + Unless @c suppres_warnings is TRUE, a warning is put in the server error log + when reconnecting. The warning message and messages used to report errors + are taken from @c messages array. In case @c master_retry_count is exceeded, + no messages are added to the log. + + @param[in] thd Thread context. + @param[in] mysql MySQL connection. + @param[in] mi Master connection information. + @param[in,out] retry_count Number of attempts to reconnect. + @param[in] suppress_warnings TRUE when a normal net read timeout + has caused to reconnecting. + @param[in] messages Messages to print/log, see + reconnect_messages[] array. + + @retval 0 OK. + @retval 1 There was an error. +*/ + +static int try_to_reconnect(THD *thd, MYSQL *mysql, MASTER_INFO *mi, + uint *retry_count, bool suppress_warnings, + const char *messages[SLAVE_RECON_MSG_MAX]) +{ + mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; + thd->proc_info= messages[SLAVE_RECON_MSG_WAIT]; +#ifdef SIGNAL_WITH_VIO_CLOSE + thd->clear_active_vio(); +#endif + end_server(mysql); + if ((*retry_count)++) + { + if (*retry_count > master_retry_count) + return 1; // Don't retry forever + safe_sleep(thd, mi->connect_retry, (CHECK_KILLED_FUNC) io_slave_killed, + (void *) mi); + } + if (check_io_slave_killed(thd, mi, messages[SLAVE_RECON_MSG_KILLED_WAITING])) + return 1; + thd->proc_info = messages[SLAVE_RECON_MSG_AFTER]; + if (!suppress_warnings) + { + char buf[256], llbuff[22]; + my_snprintf(buf, sizeof(buf), messages[SLAVE_RECON_MSG_FAILED], + IO_RPL_LOG_NAME, llstr(mi->master_log_pos, llbuff)); + /* + Raise a warining during registering on master/requesting dump. + Log a message reading event. + */ + if (messages[SLAVE_RECON_MSG_COMMAND][0]) + { + mi->report(WARNING_LEVEL, ER_SLAVE_MASTER_COM_FAILURE, + ER(ER_SLAVE_MASTER_COM_FAILURE), + messages[SLAVE_RECON_MSG_COMMAND], buf); + } + else + { + sql_print_information(buf); + } + } + if (safe_reconnect(thd, mysql, mi, 1) || io_slave_killed(thd, mi)) + { + if (global_system_variables.log_warnings) + sql_print_information(messages[SLAVE_RECON_MSG_KILLED_AFTER]); + return 1; + } + return 0; +} + + /* Slave I/O Thread entry point */ pthread_handler_t handle_slave_io(void *arg) @@ -1889,7 +2040,10 @@ pthread_handler_t handle_slave_io(void *arg) RELAY_LOG_INFO *rli= &mi->rli; char llbuff[22]; uint retry_count; - + bool suppress_warnings; +#ifndef DBUG_OFF + uint retry_count_reg= 0, retry_count_dump= 0, retry_count_event= 0; +#endif // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff my_thread_init(); DBUG_ENTER("handle_slave_io"); @@ -1975,79 +2129,56 @@ connected: Register ourselves with the master. */ thd->proc_info = "Registering slave on master"; - if (register_slave_on_master(mysql, mi)) + if (register_slave_on_master(mysql, mi, &suppress_warnings)) { sql_print_error("Slave I/O thread couldn't register on master"); - goto err; + if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \ +registering slave on master") || + try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings, + reconnect_messages[SLAVE_RECON_ACT_REG])) + goto err; + goto connected; } + DBUG_EXECUTE_IF("FORCE_SLAVE_TO_RECONNECT_REG", + if (!retry_count_reg) + { + retry_count_reg++; + sql_print_information("Forcing to reconnect slave I/O thread"); + if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings, + reconnect_messages[SLAVE_RECON_ACT_REG])) + goto err; + goto connected; + }); } DBUG_PRINT("info",("Starting reading binary log from master")); while (!io_slave_killed(thd,mi)) { - bool suppress_warnings= 0; thd->proc_info = "Requesting binlog dump"; if (request_dump(mysql, mi, &suppress_warnings)) { sql_print_error("Failed on request_dump()"); - if (io_slave_killed(thd,mi)) - { - sql_print_information("Slave I/O thread killed while requesting master \ -dump"); + if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \ +requesting master dump") || + try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings, + reconnect_messages[SLAVE_RECON_ACT_DUMP])) goto err; - } - - mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; - thd->proc_info= "Waiting to reconnect after a failed binlog dump request"; -#ifdef SIGNAL_WITH_VIO_CLOSE - thd->clear_active_vio(); -#endif - end_server(mysql); - /* - First time retry immediately, assuming that we can recover - right away - if first time fails, sleep between re-tries - hopefuly the admin can fix the problem sometime - */ - if (retry_count++) - { - if (retry_count > master_retry_count) - goto err; // Don't retry forever - safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed, - (void*)mi); - } - if (io_slave_killed(thd,mi)) - { - sql_print_information("Slave I/O thread killed while retrying master \ -dump"); - goto err; - } - - thd->proc_info = "Reconnecting after a failed binlog dump request"; - if (!suppress_warnings) { - char buf[256]; - my_snprintf(buf, sizeof(buf), - "failed dump request, reconnecting to try again," - " log '%s' at postion %s", - IO_RPL_LOG_NAME, - llstr(mi->master_log_pos,llbuff)); - mi->report(WARNING_LEVEL, ER_SLAVE_MASTER_COM_FAILURE, - ER(ER_SLAVE_MASTER_COM_FAILURE), "COM_BINLOG_DUMP", buf); - } - if (safe_reconnect(thd, mysql, mi, suppress_warnings) || - io_slave_killed(thd,mi)) - { - sql_print_information("Slave I/O thread killed during or \ -after reconnect"); - goto err; - } - goto connected; } + DBUG_EXECUTE_IF("FORCE_SLAVE_TO_RECONNECT_DUMP", + if (!retry_count_dump) + { + retry_count_dump++; + sql_print_information("Forcing to reconnect slave I/O thread"); + if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings, + reconnect_messages[SLAVE_RECON_ACT_DUMP])) + goto err; + goto connected; + }); while (!io_slave_killed(thd,mi)) { ulong event_len; - suppress_warnings= 0; /* We say "waiting" because read_event() will wait if there's nothing to read. But if there's something to read, it will not wait. The @@ -2056,12 +2187,19 @@ after reconnect"); */ thd->proc_info= "Waiting for master to send event"; event_len= read_event(mysql, mi, &suppress_warnings); - if (io_slave_killed(thd,mi)) - { - if (global_system_variables.log_warnings) - sql_print_information("Slave I/O thread killed while reading event"); + if (check_io_slave_killed(thd, mi, "Slave I/O thread killed while \ +reading event")) goto err; - } + DBUG_EXECUTE_IF("FORCE_SLAVE_TO_RECONNECT_EVENT", + if (!retry_count_event) + { + retry_count_event++; + sql_print_information("Forcing to reconnect slave I/O thread"); + if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings, + reconnect_messages[SLAVE_RECON_ACT_EVENT])) + goto err; + goto connected; + }); if (event_len == packet_error) { @@ -2081,39 +2219,9 @@ max_allowed_packet", mysql_error(mysql)); goto err; } - mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; - thd->proc_info = "Waiting to reconnect after a failed master event read"; -#ifdef SIGNAL_WITH_VIO_CLOSE - thd->clear_active_vio(); -#endif - end_server(mysql); - if (retry_count++) - { - if (retry_count > master_retry_count) - goto err; // Don't retry forever - safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed, - (void*) mi); - } - if (io_slave_killed(thd,mi)) - { - if (global_system_variables.log_warnings) - sql_print_information("Slave I/O thread killed while waiting to \ -reconnect after a failed read"); + if (try_to_reconnect(thd, mysql, mi, &retry_count, suppress_warnings, + reconnect_messages[SLAVE_RECON_ACT_EVENT])) goto err; - } - thd->proc_info = "Reconnecting after a failed master event read"; - if (!suppress_warnings) - sql_print_information("Slave I/O thread: Failed reading log event, \ -reconnecting to retry, log '%s' position %s", IO_RPL_LOG_NAME, - llstr(mi->master_log_pos, llbuff)); - if (safe_reconnect(thd, mysql, mi, suppress_warnings) || - io_slave_killed(thd,mi)) - { - if (global_system_variables.log_warnings) - sql_print_information("Slave I/O thread killed during or after a \ -reconnect done to recover from failed read"); - goto err; - } goto connected; } // if (event_len == packet_error) From b4fe5e4408dad197509976857bb7826d8c447ce0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2007 13:55:16 -0700 Subject: [PATCH 055/227] add and amend comments for clarity include/my_base.h: amend comment for clarity sql/ha_federated.cc: add comment --- include/my_base.h | 5 ++--- sql/ha_federated.cc | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index a26217f8050..4ce7a87105d 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -170,9 +170,8 @@ enum ha_extra_function { HA_EXTRA_DELETE_CANNOT_BATCH, HA_EXTRA_UPDATE_CANNOT_BATCH, /* - Inform handler that write_row() should immediately report constraint - violations because a INSERT...ON DUPLICATE KEY UPDATE is in being - performed. + Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be + executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY. */ HA_EXTRA_INSERT_WITH_UPDATE }; diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index e691831bbc9..8db091669c3 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -2555,6 +2555,10 @@ int ha_federated::extra(ha_extra_function operation) replace_duplicates= TRUE; break; case HA_EXTRA_WRITE_CANNOT_REPLACE: + /* + We use this flag to ensure that we do not create an "INSERT IGNORE" + statement when inserting new rows into the remote table. + */ replace_duplicates= FALSE; break; case HA_EXTRA_INSERT_WITH_UPDATE: From c268fd77c01bc8023ef6d3a25dc6a584c62eea94 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Jun 2007 15:14:08 -0700 Subject: [PATCH 056/227] fix Visual Studio build - strictness of compiler could not cast pointer into a BOOL type. --- sql/ha_federated.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index b981af7d8cf..3cf9c2a8b99 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -1686,7 +1686,7 @@ int ha_federated::write_row(byte *buf) uint tmp_length; int error= 0; bool use_bulk_insert; - bool auto_increment_update_required= table->next_number_field; + bool auto_increment_update_required= (table->next_number_field != NULL); /* The string containing the values to be added to the insert */ String values_string(values_buffer, sizeof(values_buffer), &my_charset_bin); From 59ab2d4612b74a4b03a532a760c696be7a9a0d2f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 30 Jun 2007 02:30:42 +0200 Subject: [PATCH 057/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB previous correction didn't. make sure "tail" is fixed up when filling cache several times; rework formulae. mysql-test/r/binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that fix for absolute end_log_pos in binlog also works when cache is read several times and headers are split across that boundary mysql-test/t/binlog.test: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that fix for absolute end_log_pos in binlog also works when cache is read several times and headers are split across that boundary --- mysql-test/r/binlog.result | 416 +++++++++++++++++++++++++++++++++++++ mysql-test/t/binlog.test | 31 ++- sql/log.cc | 73 +++---- 3 files changed, 484 insertions(+), 36 deletions(-) diff --git a/mysql-test/r/binlog.result b/mysql-test/r/binlog.result index 41c75a2067b..77b015a4688 100644 --- a/mysql-test/r/binlog.result +++ b/mysql-test/r/binlog.result @@ -248,4 +248,420 @@ master-bin.000001 285 Query 1 373 use `test`; insert into t1 values (5) master-bin.000001 373 Query 1 461 use `test`; insert into t1 values (6) master-bin.000001 461 Query 1 537 use `test`; drop table t1 set session autocommit = @ac; +set @bcs = @@binlog_cache_size; +set @ac = @@autocommit; +set global binlog_cache_size=4096; +set autocommit= 0; +reset master; +create table t1 (a int) engine=innodb; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 98 Server ver: 5.0.46-debug-log, Binlog ver: 4 +master-bin.000001 98 Query 1 198 use `test`; create table t1 (a int) engine=innodb +master-bin.000001 198 Query 1 266 use `test`; BEGIN +master-bin.000001 266 Query 1 357 use `test`; insert into t1 values( 400 ) +master-bin.000001 357 Query 1 448 use `test`; insert into t1 values( 399 ) +master-bin.000001 448 Query 1 539 use `test`; insert into t1 values( 398 ) +master-bin.000001 539 Query 1 630 use `test`; insert into t1 values( 397 ) +master-bin.000001 630 Query 1 721 use `test`; insert into t1 values( 396 ) +master-bin.000001 721 Query 1 812 use `test`; insert into t1 values( 395 ) +master-bin.000001 812 Query 1 903 use `test`; insert into t1 values( 394 ) +master-bin.000001 903 Query 1 994 use `test`; insert into t1 values( 393 ) +master-bin.000001 994 Query 1 1085 use `test`; insert into t1 values( 392 ) +master-bin.000001 1085 Query 1 1176 use `test`; insert into t1 values( 391 ) +master-bin.000001 1176 Query 1 1267 use `test`; insert into t1 values( 390 ) +master-bin.000001 1267 Query 1 1358 use `test`; insert into t1 values( 389 ) +master-bin.000001 1358 Query 1 1449 use `test`; insert into t1 values( 388 ) +master-bin.000001 1449 Query 1 1540 use `test`; insert into t1 values( 387 ) +master-bin.000001 1540 Query 1 1631 use `test`; insert into t1 values( 386 ) +master-bin.000001 1631 Query 1 1722 use `test`; insert into t1 values( 385 ) +master-bin.000001 1722 Query 1 1813 use `test`; insert into t1 values( 384 ) +master-bin.000001 1813 Query 1 1904 use `test`; insert into t1 values( 383 ) +master-bin.000001 1904 Query 1 1995 use `test`; insert into t1 values( 382 ) +master-bin.000001 1995 Query 1 2086 use `test`; insert into t1 values( 381 ) +master-bin.000001 2086 Query 1 2177 use `test`; insert into t1 values( 380 ) +master-bin.000001 2177 Query 1 2268 use `test`; insert into t1 values( 379 ) +master-bin.000001 2268 Query 1 2359 use `test`; insert into t1 values( 378 ) +master-bin.000001 2359 Query 1 2450 use `test`; insert into t1 values( 377 ) +master-bin.000001 2450 Query 1 2541 use `test`; insert into t1 values( 376 ) +master-bin.000001 2541 Query 1 2632 use `test`; insert into t1 values( 375 ) +master-bin.000001 2632 Query 1 2723 use `test`; insert into t1 values( 374 ) +master-bin.000001 2723 Query 1 2814 use `test`; insert into t1 values( 373 ) +master-bin.000001 2814 Query 1 2905 use `test`; insert into t1 values( 372 ) +master-bin.000001 2905 Query 1 2996 use `test`; insert into t1 values( 371 ) +master-bin.000001 2996 Query 1 3087 use `test`; insert into t1 values( 370 ) +master-bin.000001 3087 Query 1 3178 use `test`; insert into t1 values( 369 ) +master-bin.000001 3178 Query 1 3269 use `test`; insert into t1 values( 368 ) +master-bin.000001 3269 Query 1 3360 use `test`; insert into t1 values( 367 ) +master-bin.000001 3360 Query 1 3451 use `test`; insert into t1 values( 366 ) +master-bin.000001 3451 Query 1 3542 use `test`; insert into t1 values( 365 ) +master-bin.000001 3542 Query 1 3633 use `test`; insert into t1 values( 364 ) +master-bin.000001 3633 Query 1 3724 use `test`; insert into t1 values( 363 ) +master-bin.000001 3724 Query 1 3815 use `test`; insert into t1 values( 362 ) +master-bin.000001 3815 Query 1 3906 use `test`; insert into t1 values( 361 ) +master-bin.000001 3906 Query 1 3997 use `test`; insert into t1 values( 360 ) +master-bin.000001 3997 Query 1 4088 use `test`; insert into t1 values( 359 ) +master-bin.000001 4088 Query 1 4179 use `test`; insert into t1 values( 358 ) +master-bin.000001 4179 Query 1 4270 use `test`; insert into t1 values( 357 ) +master-bin.000001 4270 Query 1 4361 use `test`; insert into t1 values( 356 ) +master-bin.000001 4361 Query 1 4452 use `test`; insert into t1 values( 355 ) +master-bin.000001 4452 Query 1 4543 use `test`; insert into t1 values( 354 ) +master-bin.000001 4543 Query 1 4634 use `test`; insert into t1 values( 353 ) +master-bin.000001 4634 Query 1 4725 use `test`; insert into t1 values( 352 ) +master-bin.000001 4725 Query 1 4816 use `test`; insert into t1 values( 351 ) +master-bin.000001 4816 Query 1 4907 use `test`; insert into t1 values( 350 ) +master-bin.000001 4907 Query 1 4998 use `test`; insert into t1 values( 349 ) +master-bin.000001 4998 Query 1 5089 use `test`; insert into t1 values( 348 ) +master-bin.000001 5089 Query 1 5180 use `test`; insert into t1 values( 347 ) +master-bin.000001 5180 Query 1 5271 use `test`; insert into t1 values( 346 ) +master-bin.000001 5271 Query 1 5362 use `test`; insert into t1 values( 345 ) +master-bin.000001 5362 Query 1 5453 use `test`; insert into t1 values( 344 ) +master-bin.000001 5453 Query 1 5544 use `test`; insert into t1 values( 343 ) +master-bin.000001 5544 Query 1 5635 use `test`; insert into t1 values( 342 ) +master-bin.000001 5635 Query 1 5726 use `test`; insert into t1 values( 341 ) +master-bin.000001 5726 Query 1 5817 use `test`; insert into t1 values( 340 ) +master-bin.000001 5817 Query 1 5908 use `test`; insert into t1 values( 339 ) +master-bin.000001 5908 Query 1 5999 use `test`; insert into t1 values( 338 ) +master-bin.000001 5999 Query 1 6090 use `test`; insert into t1 values( 337 ) +master-bin.000001 6090 Query 1 6181 use `test`; insert into t1 values( 336 ) +master-bin.000001 6181 Query 1 6272 use `test`; insert into t1 values( 335 ) +master-bin.000001 6272 Query 1 6363 use `test`; insert into t1 values( 334 ) +master-bin.000001 6363 Query 1 6454 use `test`; insert into t1 values( 333 ) +master-bin.000001 6454 Query 1 6545 use `test`; insert into t1 values( 332 ) +master-bin.000001 6545 Query 1 6636 use `test`; insert into t1 values( 331 ) +master-bin.000001 6636 Query 1 6727 use `test`; insert into t1 values( 330 ) +master-bin.000001 6727 Query 1 6818 use `test`; insert into t1 values( 329 ) +master-bin.000001 6818 Query 1 6909 use `test`; insert into t1 values( 328 ) +master-bin.000001 6909 Query 1 7000 use `test`; insert into t1 values( 327 ) +master-bin.000001 7000 Query 1 7091 use `test`; insert into t1 values( 326 ) +master-bin.000001 7091 Query 1 7182 use `test`; insert into t1 values( 325 ) +master-bin.000001 7182 Query 1 7273 use `test`; insert into t1 values( 324 ) +master-bin.000001 7273 Query 1 7364 use `test`; insert into t1 values( 323 ) +master-bin.000001 7364 Query 1 7455 use `test`; insert into t1 values( 322 ) +master-bin.000001 7455 Query 1 7546 use `test`; insert into t1 values( 321 ) +master-bin.000001 7546 Query 1 7637 use `test`; insert into t1 values( 320 ) +master-bin.000001 7637 Query 1 7728 use `test`; insert into t1 values( 319 ) +master-bin.000001 7728 Query 1 7819 use `test`; insert into t1 values( 318 ) +master-bin.000001 7819 Query 1 7910 use `test`; insert into t1 values( 317 ) +master-bin.000001 7910 Query 1 8001 use `test`; insert into t1 values( 316 ) +master-bin.000001 8001 Query 1 8092 use `test`; insert into t1 values( 315 ) +master-bin.000001 8092 Query 1 8183 use `test`; insert into t1 values( 314 ) +master-bin.000001 8183 Query 1 8274 use `test`; insert into t1 values( 313 ) +master-bin.000001 8274 Query 1 8365 use `test`; insert into t1 values( 312 ) +master-bin.000001 8365 Query 1 8456 use `test`; insert into t1 values( 311 ) +master-bin.000001 8456 Query 1 8547 use `test`; insert into t1 values( 310 ) +master-bin.000001 8547 Query 1 8638 use `test`; insert into t1 values( 309 ) +master-bin.000001 8638 Query 1 8729 use `test`; insert into t1 values( 308 ) +master-bin.000001 8729 Query 1 8820 use `test`; insert into t1 values( 307 ) +master-bin.000001 8820 Query 1 8911 use `test`; insert into t1 values( 306 ) +master-bin.000001 8911 Query 1 9002 use `test`; insert into t1 values( 305 ) +master-bin.000001 9002 Query 1 9093 use `test`; insert into t1 values( 304 ) +master-bin.000001 9093 Query 1 9184 use `test`; insert into t1 values( 303 ) +master-bin.000001 9184 Query 1 9275 use `test`; insert into t1 values( 302 ) +master-bin.000001 9275 Query 1 9366 use `test`; insert into t1 values( 301 ) +master-bin.000001 9366 Query 1 9457 use `test`; insert into t1 values( 300 ) +master-bin.000001 9457 Query 1 9548 use `test`; insert into t1 values( 299 ) +master-bin.000001 9548 Query 1 9639 use `test`; insert into t1 values( 298 ) +master-bin.000001 9639 Query 1 9730 use `test`; insert into t1 values( 297 ) +master-bin.000001 9730 Query 1 9821 use `test`; insert into t1 values( 296 ) +master-bin.000001 9821 Query 1 9912 use `test`; insert into t1 values( 295 ) +master-bin.000001 9912 Query 1 10003 use `test`; insert into t1 values( 294 ) +master-bin.000001 10003 Query 1 10094 use `test`; insert into t1 values( 293 ) +master-bin.000001 10094 Query 1 10185 use `test`; insert into t1 values( 292 ) +master-bin.000001 10185 Query 1 10276 use `test`; insert into t1 values( 291 ) +master-bin.000001 10276 Query 1 10367 use `test`; insert into t1 values( 290 ) +master-bin.000001 10367 Query 1 10458 use `test`; insert into t1 values( 289 ) +master-bin.000001 10458 Query 1 10549 use `test`; insert into t1 values( 288 ) +master-bin.000001 10549 Query 1 10640 use `test`; insert into t1 values( 287 ) +master-bin.000001 10640 Query 1 10731 use `test`; insert into t1 values( 286 ) +master-bin.000001 10731 Query 1 10822 use `test`; insert into t1 values( 285 ) +master-bin.000001 10822 Query 1 10913 use `test`; insert into t1 values( 284 ) +master-bin.000001 10913 Query 1 11004 use `test`; insert into t1 values( 283 ) +master-bin.000001 11004 Query 1 11095 use `test`; insert into t1 values( 282 ) +master-bin.000001 11095 Query 1 11186 use `test`; insert into t1 values( 281 ) +master-bin.000001 11186 Query 1 11277 use `test`; insert into t1 values( 280 ) +master-bin.000001 11277 Query 1 11368 use `test`; insert into t1 values( 279 ) +master-bin.000001 11368 Query 1 11459 use `test`; insert into t1 values( 278 ) +master-bin.000001 11459 Query 1 11550 use `test`; insert into t1 values( 277 ) +master-bin.000001 11550 Query 1 11641 use `test`; insert into t1 values( 276 ) +master-bin.000001 11641 Query 1 11732 use `test`; insert into t1 values( 275 ) +master-bin.000001 11732 Query 1 11823 use `test`; insert into t1 values( 274 ) +master-bin.000001 11823 Query 1 11914 use `test`; insert into t1 values( 273 ) +master-bin.000001 11914 Query 1 12005 use `test`; insert into t1 values( 272 ) +master-bin.000001 12005 Query 1 12096 use `test`; insert into t1 values( 271 ) +master-bin.000001 12096 Query 1 12187 use `test`; insert into t1 values( 270 ) +master-bin.000001 12187 Query 1 12278 use `test`; insert into t1 values( 269 ) +master-bin.000001 12278 Query 1 12369 use `test`; insert into t1 values( 268 ) +master-bin.000001 12369 Query 1 12460 use `test`; insert into t1 values( 267 ) +master-bin.000001 12460 Query 1 12551 use `test`; insert into t1 values( 266 ) +master-bin.000001 12551 Query 1 12642 use `test`; insert into t1 values( 265 ) +master-bin.000001 12642 Query 1 12733 use `test`; insert into t1 values( 264 ) +master-bin.000001 12733 Query 1 12824 use `test`; insert into t1 values( 263 ) +master-bin.000001 12824 Query 1 12915 use `test`; insert into t1 values( 262 ) +master-bin.000001 12915 Query 1 13006 use `test`; insert into t1 values( 261 ) +master-bin.000001 13006 Query 1 13097 use `test`; insert into t1 values( 260 ) +master-bin.000001 13097 Query 1 13188 use `test`; insert into t1 values( 259 ) +master-bin.000001 13188 Query 1 13279 use `test`; insert into t1 values( 258 ) +master-bin.000001 13279 Query 1 13370 use `test`; insert into t1 values( 257 ) +master-bin.000001 13370 Query 1 13461 use `test`; insert into t1 values( 256 ) +master-bin.000001 13461 Query 1 13552 use `test`; insert into t1 values( 255 ) +master-bin.000001 13552 Query 1 13643 use `test`; insert into t1 values( 254 ) +master-bin.000001 13643 Query 1 13734 use `test`; insert into t1 values( 253 ) +master-bin.000001 13734 Query 1 13825 use `test`; insert into t1 values( 252 ) +master-bin.000001 13825 Query 1 13916 use `test`; insert into t1 values( 251 ) +master-bin.000001 13916 Query 1 14007 use `test`; insert into t1 values( 250 ) +master-bin.000001 14007 Query 1 14098 use `test`; insert into t1 values( 249 ) +master-bin.000001 14098 Query 1 14189 use `test`; insert into t1 values( 248 ) +master-bin.000001 14189 Query 1 14280 use `test`; insert into t1 values( 247 ) +master-bin.000001 14280 Query 1 14371 use `test`; insert into t1 values( 246 ) +master-bin.000001 14371 Query 1 14462 use `test`; insert into t1 values( 245 ) +master-bin.000001 14462 Query 1 14553 use `test`; insert into t1 values( 244 ) +master-bin.000001 14553 Query 1 14644 use `test`; insert into t1 values( 243 ) +master-bin.000001 14644 Query 1 14735 use `test`; insert into t1 values( 242 ) +master-bin.000001 14735 Query 1 14826 use `test`; insert into t1 values( 241 ) +master-bin.000001 14826 Query 1 14917 use `test`; insert into t1 values( 240 ) +master-bin.000001 14917 Query 1 15008 use `test`; insert into t1 values( 239 ) +master-bin.000001 15008 Query 1 15099 use `test`; insert into t1 values( 238 ) +master-bin.000001 15099 Query 1 15190 use `test`; insert into t1 values( 237 ) +master-bin.000001 15190 Query 1 15281 use `test`; insert into t1 values( 236 ) +master-bin.000001 15281 Query 1 15372 use `test`; insert into t1 values( 235 ) +master-bin.000001 15372 Query 1 15463 use `test`; insert into t1 values( 234 ) +master-bin.000001 15463 Query 1 15554 use `test`; insert into t1 values( 233 ) +master-bin.000001 15554 Query 1 15645 use `test`; insert into t1 values( 232 ) +master-bin.000001 15645 Query 1 15736 use `test`; insert into t1 values( 231 ) +master-bin.000001 15736 Query 1 15827 use `test`; insert into t1 values( 230 ) +master-bin.000001 15827 Query 1 15918 use `test`; insert into t1 values( 229 ) +master-bin.000001 15918 Query 1 16009 use `test`; insert into t1 values( 228 ) +master-bin.000001 16009 Query 1 16100 use `test`; insert into t1 values( 227 ) +master-bin.000001 16100 Query 1 16191 use `test`; insert into t1 values( 226 ) +master-bin.000001 16191 Query 1 16282 use `test`; insert into t1 values( 225 ) +master-bin.000001 16282 Query 1 16373 use `test`; insert into t1 values( 224 ) +master-bin.000001 16373 Query 1 16464 use `test`; insert into t1 values( 223 ) +master-bin.000001 16464 Query 1 16555 use `test`; insert into t1 values( 222 ) +master-bin.000001 16555 Query 1 16646 use `test`; insert into t1 values( 221 ) +master-bin.000001 16646 Query 1 16737 use `test`; insert into t1 values( 220 ) +master-bin.000001 16737 Query 1 16828 use `test`; insert into t1 values( 219 ) +master-bin.000001 16828 Query 1 16919 use `test`; insert into t1 values( 218 ) +master-bin.000001 16919 Query 1 17010 use `test`; insert into t1 values( 217 ) +master-bin.000001 17010 Query 1 17101 use `test`; insert into t1 values( 216 ) +master-bin.000001 17101 Query 1 17192 use `test`; insert into t1 values( 215 ) +master-bin.000001 17192 Query 1 17283 use `test`; insert into t1 values( 214 ) +master-bin.000001 17283 Query 1 17374 use `test`; insert into t1 values( 213 ) +master-bin.000001 17374 Query 1 17465 use `test`; insert into t1 values( 212 ) +master-bin.000001 17465 Query 1 17556 use `test`; insert into t1 values( 211 ) +master-bin.000001 17556 Query 1 17647 use `test`; insert into t1 values( 210 ) +master-bin.000001 17647 Query 1 17738 use `test`; insert into t1 values( 209 ) +master-bin.000001 17738 Query 1 17829 use `test`; insert into t1 values( 208 ) +master-bin.000001 17829 Query 1 17920 use `test`; insert into t1 values( 207 ) +master-bin.000001 17920 Query 1 18011 use `test`; insert into t1 values( 206 ) +master-bin.000001 18011 Query 1 18102 use `test`; insert into t1 values( 205 ) +master-bin.000001 18102 Query 1 18193 use `test`; insert into t1 values( 204 ) +master-bin.000001 18193 Query 1 18284 use `test`; insert into t1 values( 203 ) +master-bin.000001 18284 Query 1 18375 use `test`; insert into t1 values( 202 ) +master-bin.000001 18375 Query 1 18466 use `test`; insert into t1 values( 201 ) +master-bin.000001 18466 Query 1 18557 use `test`; insert into t1 values( 200 ) +master-bin.000001 18557 Query 1 18648 use `test`; insert into t1 values( 199 ) +master-bin.000001 18648 Query 1 18739 use `test`; insert into t1 values( 198 ) +master-bin.000001 18739 Query 1 18830 use `test`; insert into t1 values( 197 ) +master-bin.000001 18830 Query 1 18921 use `test`; insert into t1 values( 196 ) +master-bin.000001 18921 Query 1 19012 use `test`; insert into t1 values( 195 ) +master-bin.000001 19012 Query 1 19103 use `test`; insert into t1 values( 194 ) +master-bin.000001 19103 Query 1 19194 use `test`; insert into t1 values( 193 ) +master-bin.000001 19194 Query 1 19285 use `test`; insert into t1 values( 192 ) +master-bin.000001 19285 Query 1 19376 use `test`; insert into t1 values( 191 ) +master-bin.000001 19376 Query 1 19467 use `test`; insert into t1 values( 190 ) +master-bin.000001 19467 Query 1 19558 use `test`; insert into t1 values( 189 ) +master-bin.000001 19558 Query 1 19649 use `test`; insert into t1 values( 188 ) +master-bin.000001 19649 Query 1 19740 use `test`; insert into t1 values( 187 ) +master-bin.000001 19740 Query 1 19831 use `test`; insert into t1 values( 186 ) +master-bin.000001 19831 Query 1 19922 use `test`; insert into t1 values( 185 ) +master-bin.000001 19922 Query 1 20013 use `test`; insert into t1 values( 184 ) +master-bin.000001 20013 Query 1 20104 use `test`; insert into t1 values( 183 ) +master-bin.000001 20104 Query 1 20195 use `test`; insert into t1 values( 182 ) +master-bin.000001 20195 Query 1 20286 use `test`; insert into t1 values( 181 ) +master-bin.000001 20286 Query 1 20377 use `test`; insert into t1 values( 180 ) +master-bin.000001 20377 Query 1 20468 use `test`; insert into t1 values( 179 ) +master-bin.000001 20468 Query 1 20559 use `test`; insert into t1 values( 178 ) +master-bin.000001 20559 Query 1 20650 use `test`; insert into t1 values( 177 ) +master-bin.000001 20650 Query 1 20741 use `test`; insert into t1 values( 176 ) +master-bin.000001 20741 Query 1 20832 use `test`; insert into t1 values( 175 ) +master-bin.000001 20832 Query 1 20923 use `test`; insert into t1 values( 174 ) +master-bin.000001 20923 Query 1 21014 use `test`; insert into t1 values( 173 ) +master-bin.000001 21014 Query 1 21105 use `test`; insert into t1 values( 172 ) +master-bin.000001 21105 Query 1 21196 use `test`; insert into t1 values( 171 ) +master-bin.000001 21196 Query 1 21287 use `test`; insert into t1 values( 170 ) +master-bin.000001 21287 Query 1 21378 use `test`; insert into t1 values( 169 ) +master-bin.000001 21378 Query 1 21469 use `test`; insert into t1 values( 168 ) +master-bin.000001 21469 Query 1 21560 use `test`; insert into t1 values( 167 ) +master-bin.000001 21560 Query 1 21651 use `test`; insert into t1 values( 166 ) +master-bin.000001 21651 Query 1 21742 use `test`; insert into t1 values( 165 ) +master-bin.000001 21742 Query 1 21833 use `test`; insert into t1 values( 164 ) +master-bin.000001 21833 Query 1 21924 use `test`; insert into t1 values( 163 ) +master-bin.000001 21924 Query 1 22015 use `test`; insert into t1 values( 162 ) +master-bin.000001 22015 Query 1 22106 use `test`; insert into t1 values( 161 ) +master-bin.000001 22106 Query 1 22197 use `test`; insert into t1 values( 160 ) +master-bin.000001 22197 Query 1 22288 use `test`; insert into t1 values( 159 ) +master-bin.000001 22288 Query 1 22379 use `test`; insert into t1 values( 158 ) +master-bin.000001 22379 Query 1 22470 use `test`; insert into t1 values( 157 ) +master-bin.000001 22470 Query 1 22561 use `test`; insert into t1 values( 156 ) +master-bin.000001 22561 Query 1 22652 use `test`; insert into t1 values( 155 ) +master-bin.000001 22652 Query 1 22743 use `test`; insert into t1 values( 154 ) +master-bin.000001 22743 Query 1 22834 use `test`; insert into t1 values( 153 ) +master-bin.000001 22834 Query 1 22925 use `test`; insert into t1 values( 152 ) +master-bin.000001 22925 Query 1 23016 use `test`; insert into t1 values( 151 ) +master-bin.000001 23016 Query 1 23107 use `test`; insert into t1 values( 150 ) +master-bin.000001 23107 Query 1 23198 use `test`; insert into t1 values( 149 ) +master-bin.000001 23198 Query 1 23289 use `test`; insert into t1 values( 148 ) +master-bin.000001 23289 Query 1 23380 use `test`; insert into t1 values( 147 ) +master-bin.000001 23380 Query 1 23471 use `test`; insert into t1 values( 146 ) +master-bin.000001 23471 Query 1 23562 use `test`; insert into t1 values( 145 ) +master-bin.000001 23562 Query 1 23653 use `test`; insert into t1 values( 144 ) +master-bin.000001 23653 Query 1 23744 use `test`; insert into t1 values( 143 ) +master-bin.000001 23744 Query 1 23835 use `test`; insert into t1 values( 142 ) +master-bin.000001 23835 Query 1 23926 use `test`; insert into t1 values( 141 ) +master-bin.000001 23926 Query 1 24017 use `test`; insert into t1 values( 140 ) +master-bin.000001 24017 Query 1 24108 use `test`; insert into t1 values( 139 ) +master-bin.000001 24108 Query 1 24199 use `test`; insert into t1 values( 138 ) +master-bin.000001 24199 Query 1 24290 use `test`; insert into t1 values( 137 ) +master-bin.000001 24290 Query 1 24381 use `test`; insert into t1 values( 136 ) +master-bin.000001 24381 Query 1 24472 use `test`; insert into t1 values( 135 ) +master-bin.000001 24472 Query 1 24563 use `test`; insert into t1 values( 134 ) +master-bin.000001 24563 Query 1 24654 use `test`; insert into t1 values( 133 ) +master-bin.000001 24654 Query 1 24745 use `test`; insert into t1 values( 132 ) +master-bin.000001 24745 Query 1 24836 use `test`; insert into t1 values( 131 ) +master-bin.000001 24836 Query 1 24927 use `test`; insert into t1 values( 130 ) +master-bin.000001 24927 Query 1 25018 use `test`; insert into t1 values( 129 ) +master-bin.000001 25018 Query 1 25109 use `test`; insert into t1 values( 128 ) +master-bin.000001 25109 Query 1 25200 use `test`; insert into t1 values( 127 ) +master-bin.000001 25200 Query 1 25291 use `test`; insert into t1 values( 126 ) +master-bin.000001 25291 Query 1 25382 use `test`; insert into t1 values( 125 ) +master-bin.000001 25382 Query 1 25473 use `test`; insert into t1 values( 124 ) +master-bin.000001 25473 Query 1 25564 use `test`; insert into t1 values( 123 ) +master-bin.000001 25564 Query 1 25655 use `test`; insert into t1 values( 122 ) +master-bin.000001 25655 Query 1 25746 use `test`; insert into t1 values( 121 ) +master-bin.000001 25746 Query 1 25837 use `test`; insert into t1 values( 120 ) +master-bin.000001 25837 Query 1 25928 use `test`; insert into t1 values( 119 ) +master-bin.000001 25928 Query 1 26019 use `test`; insert into t1 values( 118 ) +master-bin.000001 26019 Query 1 26110 use `test`; insert into t1 values( 117 ) +master-bin.000001 26110 Query 1 26201 use `test`; insert into t1 values( 116 ) +master-bin.000001 26201 Query 1 26292 use `test`; insert into t1 values( 115 ) +master-bin.000001 26292 Query 1 26383 use `test`; insert into t1 values( 114 ) +master-bin.000001 26383 Query 1 26474 use `test`; insert into t1 values( 113 ) +master-bin.000001 26474 Query 1 26565 use `test`; insert into t1 values( 112 ) +master-bin.000001 26565 Query 1 26656 use `test`; insert into t1 values( 111 ) +master-bin.000001 26656 Query 1 26747 use `test`; insert into t1 values( 110 ) +master-bin.000001 26747 Query 1 26838 use `test`; insert into t1 values( 109 ) +master-bin.000001 26838 Query 1 26929 use `test`; insert into t1 values( 108 ) +master-bin.000001 26929 Query 1 27020 use `test`; insert into t1 values( 107 ) +master-bin.000001 27020 Query 1 27111 use `test`; insert into t1 values( 106 ) +master-bin.000001 27111 Query 1 27202 use `test`; insert into t1 values( 105 ) +master-bin.000001 27202 Query 1 27293 use `test`; insert into t1 values( 104 ) +master-bin.000001 27293 Query 1 27384 use `test`; insert into t1 values( 103 ) +master-bin.000001 27384 Query 1 27475 use `test`; insert into t1 values( 102 ) +master-bin.000001 27475 Query 1 27566 use `test`; insert into t1 values( 101 ) +master-bin.000001 27566 Query 1 27657 use `test`; insert into t1 values( 100 ) +master-bin.000001 27657 Query 1 27747 use `test`; insert into t1 values( 99 ) +master-bin.000001 27747 Query 1 27837 use `test`; insert into t1 values( 98 ) +master-bin.000001 27837 Query 1 27927 use `test`; insert into t1 values( 97 ) +master-bin.000001 27927 Query 1 28017 use `test`; insert into t1 values( 96 ) +master-bin.000001 28017 Query 1 28107 use `test`; insert into t1 values( 95 ) +master-bin.000001 28107 Query 1 28197 use `test`; insert into t1 values( 94 ) +master-bin.000001 28197 Query 1 28287 use `test`; insert into t1 values( 93 ) +master-bin.000001 28287 Query 1 28377 use `test`; insert into t1 values( 92 ) +master-bin.000001 28377 Query 1 28467 use `test`; insert into t1 values( 91 ) +master-bin.000001 28467 Query 1 28557 use `test`; insert into t1 values( 90 ) +master-bin.000001 28557 Query 1 28647 use `test`; insert into t1 values( 89 ) +master-bin.000001 28647 Query 1 28737 use `test`; insert into t1 values( 88 ) +master-bin.000001 28737 Query 1 28827 use `test`; insert into t1 values( 87 ) +master-bin.000001 28827 Query 1 28917 use `test`; insert into t1 values( 86 ) +master-bin.000001 28917 Query 1 29007 use `test`; insert into t1 values( 85 ) +master-bin.000001 29007 Query 1 29097 use `test`; insert into t1 values( 84 ) +master-bin.000001 29097 Query 1 29187 use `test`; insert into t1 values( 83 ) +master-bin.000001 29187 Query 1 29277 use `test`; insert into t1 values( 82 ) +master-bin.000001 29277 Query 1 29367 use `test`; insert into t1 values( 81 ) +master-bin.000001 29367 Query 1 29457 use `test`; insert into t1 values( 80 ) +master-bin.000001 29457 Query 1 29547 use `test`; insert into t1 values( 79 ) +master-bin.000001 29547 Query 1 29637 use `test`; insert into t1 values( 78 ) +master-bin.000001 29637 Query 1 29727 use `test`; insert into t1 values( 77 ) +master-bin.000001 29727 Query 1 29817 use `test`; insert into t1 values( 76 ) +master-bin.000001 29817 Query 1 29907 use `test`; insert into t1 values( 75 ) +master-bin.000001 29907 Query 1 29997 use `test`; insert into t1 values( 74 ) +master-bin.000001 29997 Query 1 30087 use `test`; insert into t1 values( 73 ) +master-bin.000001 30087 Query 1 30177 use `test`; insert into t1 values( 72 ) +master-bin.000001 30177 Query 1 30267 use `test`; insert into t1 values( 71 ) +master-bin.000001 30267 Query 1 30357 use `test`; insert into t1 values( 70 ) +master-bin.000001 30357 Query 1 30447 use `test`; insert into t1 values( 69 ) +master-bin.000001 30447 Query 1 30537 use `test`; insert into t1 values( 68 ) +master-bin.000001 30537 Query 1 30627 use `test`; insert into t1 values( 67 ) +master-bin.000001 30627 Query 1 30717 use `test`; insert into t1 values( 66 ) +master-bin.000001 30717 Query 1 30807 use `test`; insert into t1 values( 65 ) +master-bin.000001 30807 Query 1 30897 use `test`; insert into t1 values( 64 ) +master-bin.000001 30897 Query 1 30987 use `test`; insert into t1 values( 63 ) +master-bin.000001 30987 Query 1 31077 use `test`; insert into t1 values( 62 ) +master-bin.000001 31077 Query 1 31167 use `test`; insert into t1 values( 61 ) +master-bin.000001 31167 Query 1 31257 use `test`; insert into t1 values( 60 ) +master-bin.000001 31257 Query 1 31347 use `test`; insert into t1 values( 59 ) +master-bin.000001 31347 Query 1 31437 use `test`; insert into t1 values( 58 ) +master-bin.000001 31437 Query 1 31527 use `test`; insert into t1 values( 57 ) +master-bin.000001 31527 Query 1 31617 use `test`; insert into t1 values( 56 ) +master-bin.000001 31617 Query 1 31707 use `test`; insert into t1 values( 55 ) +master-bin.000001 31707 Query 1 31797 use `test`; insert into t1 values( 54 ) +master-bin.000001 31797 Query 1 31887 use `test`; insert into t1 values( 53 ) +master-bin.000001 31887 Query 1 31977 use `test`; insert into t1 values( 52 ) +master-bin.000001 31977 Query 1 32067 use `test`; insert into t1 values( 51 ) +master-bin.000001 32067 Query 1 32157 use `test`; insert into t1 values( 50 ) +master-bin.000001 32157 Query 1 32247 use `test`; insert into t1 values( 49 ) +master-bin.000001 32247 Query 1 32337 use `test`; insert into t1 values( 48 ) +master-bin.000001 32337 Query 1 32427 use `test`; insert into t1 values( 47 ) +master-bin.000001 32427 Query 1 32517 use `test`; insert into t1 values( 46 ) +master-bin.000001 32517 Query 1 32607 use `test`; insert into t1 values( 45 ) +master-bin.000001 32607 Query 1 32697 use `test`; insert into t1 values( 44 ) +master-bin.000001 32697 Query 1 32787 use `test`; insert into t1 values( 43 ) +master-bin.000001 32787 Query 1 32877 use `test`; insert into t1 values( 42 ) +master-bin.000001 32877 Query 1 32967 use `test`; insert into t1 values( 41 ) +master-bin.000001 32967 Query 1 33057 use `test`; insert into t1 values( 40 ) +master-bin.000001 33057 Query 1 33147 use `test`; insert into t1 values( 39 ) +master-bin.000001 33147 Query 1 33237 use `test`; insert into t1 values( 38 ) +master-bin.000001 33237 Query 1 33327 use `test`; insert into t1 values( 37 ) +master-bin.000001 33327 Query 1 33417 use `test`; insert into t1 values( 36 ) +master-bin.000001 33417 Query 1 33507 use `test`; insert into t1 values( 35 ) +master-bin.000001 33507 Query 1 33597 use `test`; insert into t1 values( 34 ) +master-bin.000001 33597 Query 1 33687 use `test`; insert into t1 values( 33 ) +master-bin.000001 33687 Query 1 33777 use `test`; insert into t1 values( 32 ) +master-bin.000001 33777 Query 1 33867 use `test`; insert into t1 values( 31 ) +master-bin.000001 33867 Query 1 33957 use `test`; insert into t1 values( 30 ) +master-bin.000001 33957 Query 1 34047 use `test`; insert into t1 values( 29 ) +master-bin.000001 34047 Query 1 34137 use `test`; insert into t1 values( 28 ) +master-bin.000001 34137 Query 1 34227 use `test`; insert into t1 values( 27 ) +master-bin.000001 34227 Query 1 34317 use `test`; insert into t1 values( 26 ) +master-bin.000001 34317 Query 1 34407 use `test`; insert into t1 values( 25 ) +master-bin.000001 34407 Query 1 34497 use `test`; insert into t1 values( 24 ) +master-bin.000001 34497 Query 1 34587 use `test`; insert into t1 values( 23 ) +master-bin.000001 34587 Query 1 34677 use `test`; insert into t1 values( 22 ) +master-bin.000001 34677 Query 1 34767 use `test`; insert into t1 values( 21 ) +master-bin.000001 34767 Query 1 34857 use `test`; insert into t1 values( 20 ) +master-bin.000001 34857 Query 1 34947 use `test`; insert into t1 values( 19 ) +master-bin.000001 34947 Query 1 35037 use `test`; insert into t1 values( 18 ) +master-bin.000001 35037 Query 1 35127 use `test`; insert into t1 values( 17 ) +master-bin.000001 35127 Query 1 35217 use `test`; insert into t1 values( 16 ) +master-bin.000001 35217 Query 1 35307 use `test`; insert into t1 values( 15 ) +master-bin.000001 35307 Query 1 35397 use `test`; insert into t1 values( 14 ) +master-bin.000001 35397 Query 1 35487 use `test`; insert into t1 values( 13 ) +master-bin.000001 35487 Query 1 35577 use `test`; insert into t1 values( 12 ) +master-bin.000001 35577 Query 1 35667 use `test`; insert into t1 values( 11 ) +master-bin.000001 35667 Query 1 35757 use `test`; insert into t1 values( 10 ) +master-bin.000001 35757 Query 1 35846 use `test`; insert into t1 values( 9 ) +master-bin.000001 35846 Query 1 35935 use `test`; insert into t1 values( 8 ) +master-bin.000001 35935 Query 1 36024 use `test`; insert into t1 values( 7 ) +master-bin.000001 36024 Query 1 36113 use `test`; insert into t1 values( 6 ) +master-bin.000001 36113 Query 1 36202 use `test`; insert into t1 values( 5 ) +master-bin.000001 36202 Query 1 36291 use `test`; insert into t1 values( 4 ) +master-bin.000001 36291 Query 1 36380 use `test`; insert into t1 values( 3 ) +master-bin.000001 36380 Query 1 36469 use `test`; insert into t1 values( 2 ) +master-bin.000001 36469 Query 1 36558 use `test`; insert into t1 values( 1 ) +master-bin.000001 36558 Xid 1 36585 COMMIT /* xid=186 */ +master-bin.000001 36585 Rotate 1 36629 master-bin.000002;pos=4 +drop table t1; +set global binlog_cache_size=@bcs; +set session autocommit = @ac; End of 5.0 tests diff --git a/mysql-test/t/binlog.test b/mysql-test/t/binlog.test index 6271a8f95a8..d5479a45226 100644 --- a/mysql-test/t/binlog.test +++ b/mysql-test/t/binlog.test @@ -4,7 +4,6 @@ -- source include/have_log_bin.inc -- source include/not_embedded.inc -- source include/have_innodb.inc --- source include/have_log_bin.inc --disable_warnings drop table if exists t1, t2; @@ -137,4 +136,34 @@ show binlog events from 0; set session autocommit = @ac; +# now show that nothing breaks if we need to read from the cache more +# than once, resulting in split event-headers + +set @bcs = @@binlog_cache_size; +set @ac = @@autocommit; + +set global binlog_cache_size=4096; +set autocommit= 0; +reset master; + +create table t1 (a int) engine=innodb; + +let $1=400; +disable_query_log; +begin; +while ($1) +{ + eval insert into t1 values( $1 ); + dec $1; +} +commit; +enable_query_log; + +show binlog events from 0; + +drop table t1; + +set global binlog_cache_size=@bcs; +set session autocommit = @ac; + --echo End of 5.0 tests diff --git a/sql/log.cc b/sql/log.cc index af8168c6a46..289d98e63d3 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1918,58 +1918,61 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry); /* next event header at ... */ - hdr_offs = LOG_EVENT_HEADER_LEN - carry + - uint4korr(&header[EVENT_LEN_OFFSET]); + hdr_offs = uint4korr(&header[EVENT_LEN_OFFSET]) - carry; carry= 0; } /* if there is anything to write, process it. */ - if(likely(length > 0)) + if (likely(length > 0)) { /* - next header beyond current read-buffer? we'll get it later - (though not necessarily in the very next iteration). + process all event-headers in this (partial) cache. + if next header is beyond current read-buffer, + we'll get it later (though not necessarily in the + very next iteration, just "eventually"). */ - if (hdr_offs >= length) - hdr_offs -= length; - else + while (hdr_offs < length) { + /* + partial header only? save what we can get, process once + we get the rest. + */ - /* process all event-headers in this (partial) cache. */ + if (hdr_offs + LOG_EVENT_HEADER_LEN > length) + { + carry= length - hdr_offs; + memcpy(header, (char *)cache->read_pos + hdr_offs, carry); + length= hdr_offs; + } + else + { + /* we've got a full event-header, and it came in one piece */ - do { + char *log_pos= (char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET; - /* - partial header only? save what we can get, process once - we get the rest. - */ + /* fix end_log_pos */ + val= uint4korr(log_pos) + group; + int4store(log_pos, val); - if (hdr_offs + LOG_EVENT_HEADER_LEN > length) - { - carry= length - hdr_offs; - memcpy(header, (char *)cache->read_pos + hdr_offs, carry); - length= hdr_offs; - } - else - { - /* we've got a full event-header, and it came in one piece */ + /* next event header at ... */ + log_pos= (char *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET; + hdr_offs += uint4korr(log_pos); - char *log_pos= (char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET; - - /* fix end_log_pos */ - val= uint4korr(log_pos) + group; - int4store(log_pos, val); - - /* next event header at ... */ - log_pos= (char *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET; - hdr_offs += uint4korr(log_pos); - - } - } while (hdr_offs < length); + } } + + /* + Adjust hdr_offs. Note that this doesn't mean it will necessarily + be valid in the next iteration; if the current event is very long, + it may take a couple of read-iterations (and subsequent fixings + of hdr_offs) for it to become valid again. + if we had a split header, hdr_offs was already fixed above. + */ + if (carry == 0) + hdr_offs -= length; } /* Write data to the binary log file */ From fc17829be86d3d66baed60bdcb1e8589a036bae9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 30 Jun 2007 03:32:33 +0200 Subject: [PATCH 058/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB previous correction didn't. make sure "tail" is fixed up when filling cache several times; rework formulae. --- Merge sin.intern.azundris.com:/home/tnurnberg/22540/50-22540 into sin.intern.azundris.com:/home/tnurnberg/22540/51-22540 mysql-test/extra/binlog_tests/binlog.test: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that fix for absolute end_log_pos in binlog also works when cache is read several times and headers are split across that boundary show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions. show that SHOW MASTER STATUS returns correct values while in transactions (so that mysqldump --master-data will work correctly). also remove bdb dependency. mysql-test/r/binlog_row_binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that fix for absolute end_log_pos in binlog also works when cache is read several times and headers are split across that boundary show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions. show that SHOW MASTER STATUS returns correct values while in transactions (so that mysqldump --master-data will work correctly). also remove bdb dependency. mysql-test/r/binlog_stm_binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB show that fix for absolute end_log_pos in binlog also works when cache is read several times and headers are split across that boundary show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions. show that SHOW MASTER STATUS returns correct values while in transactions (so that mysqldump --master-data will work correctly). also remove bdb dependency. mysql-test/r/rpl_row_create_table.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB expect corrent end_log_pos in binlog sql/log.cc: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB previous correction didn't. make sure "tail" is fixed up when filling cache several times; rework formulae. --- mysql-test/extra/binlog_tests/binlog.test | 31 +- mysql-test/r/binlog_row_binlog.result | 947 ++++++++++++++++++++++ mysql-test/r/binlog_stm_binlog.result | 416 ++++++++++ mysql-test/r/rpl_row_create_table.result | 28 +- sql/log.cc | 73 +- 5 files changed, 1445 insertions(+), 50 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 02d5a92ea38..0a2b84e055b 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -5,7 +5,6 @@ -- source include/have_log_bin.inc -- source include/not_embedded.inc -- source include/have_innodb.inc --- source include/have_log_bin.inc -- source include/have_debug.inc --disable_warnings @@ -139,6 +138,36 @@ show binlog events from 0; set session autocommit = @ac; +# now show that nothing breaks if we need to read from the cache more +# than once, resulting in split event-headers + +set @bcs = @@binlog_cache_size; +set @ac = @@autocommit; + +set global binlog_cache_size=4096; +set autocommit= 0; +reset master; + +create table t1 (a int) engine=innodb; + +let $1=400; +disable_query_log; +begin; +while ($1) +{ + eval insert into t1 values( $1 ); + dec $1; +} +commit; +enable_query_log; + +show binlog events from 0; + +drop table t1; + +set global binlog_cache_size=@bcs; +set session autocommit = @ac; + --echo End of 5.0 tests # Test of a too big SET INSERT_ID: see if the truncated value goes diff --git a/mysql-test/r/binlog_row_binlog.result b/mysql-test/r/binlog_row_binlog.result index 6fcaad010d2..89618d37cc1 100644 --- a/mysql-test/r/binlog_row_binlog.result +++ b/mysql-test/r/binlog_row_binlog.result @@ -235,6 +235,953 @@ master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 show binlog events in 'master-bin.000002' from 106; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Query 1 # use `test`; drop table t1 +set @ac = @@autocommit; +set autocommit= 0; +reset master; +create table t1(n int) engine=innodb; +begin; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Query 1 273 use `test`; BEGIN +master-bin.000001 273 Table_map 1 312 table_id: # (test.t1) +master-bin.000001 312 Write_rows 1 346 table_id: # flags: STMT_END_F +master-bin.000001 346 Table_map 1 385 table_id: # (test.t1) +master-bin.000001 385 Write_rows 1 419 table_id: # flags: STMT_END_F +master-bin.000001 419 Table_map 1 458 table_id: # (test.t1) +master-bin.000001 458 Write_rows 1 492 table_id: # flags: STMT_END_F +master-bin.000001 492 Xid 1 519 COMMIT /* XID */ +master-bin.000001 519 Query 1 595 use `test`; drop table t1 +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +insert into t1 values (1); +insert into t1 values (2); +insert into t1 values (3); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) +master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F +master-bin.000001 278 Xid 1 305 COMMIT /* XID */ +master-bin.000001 305 Table_map 1 344 table_id: # (test.t1) +master-bin.000001 344 Write_rows 1 378 table_id: # flags: STMT_END_F +master-bin.000001 378 Xid 1 405 COMMIT /* XID */ +master-bin.000001 405 Table_map 1 444 table_id: # (test.t1) +master-bin.000001 444 Write_rows 1 478 table_id: # flags: STMT_END_F +master-bin.000001 478 Xid 1 505 COMMIT /* XID */ +master-bin.000001 505 Query 1 581 use `test`; drop table t1 +reset master; +create table t1(n int) engine=myisam; +begin; +insert into t1 values (4); +insert into t1 values (5); +insert into t1 values (6); +commit; +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=myisam +master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) +master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F +master-bin.000001 278 Table_map 1 317 table_id: # (test.t1) +master-bin.000001 317 Write_rows 1 351 table_id: # flags: STMT_END_F +master-bin.000001 351 Table_map 1 390 table_id: # (test.t1) +master-bin.000001 390 Write_rows 1 424 table_id: # flags: STMT_END_F +master-bin.000001 424 Query 1 500 use `test`; drop table t1 +set autocommit= 1; +reset master; +create table t1(n int) engine=innodb; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 205 +insert into t1 values (1); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 305 +insert into t1 values (2); +insert into t1 values (3); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 505 +commit; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 505 +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) +master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F +master-bin.000001 278 Xid 1 305 COMMIT /* XID */ +master-bin.000001 305 Table_map 1 344 table_id: # (test.t1) +master-bin.000001 344 Write_rows 1 378 table_id: # flags: STMT_END_F +master-bin.000001 378 Xid 1 405 COMMIT /* XID */ +master-bin.000001 405 Table_map 1 444 table_id: # (test.t1) +master-bin.000001 444 Write_rows 1 478 table_id: # flags: STMT_END_F +master-bin.000001 478 Xid 1 505 COMMIT /* XID */ +master-bin.000001 505 Query 1 581 use `test`; drop table t1 +set autocommit= 0; +reset master; +create table t1(n int) engine=myisam; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 205 +insert into t1 values (4); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 278 +insert into t1 values (5); +insert into t1 values (6); +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 424 +commit; +show master status; +File Position Binlog_Do_DB Binlog_Ignore_DB +master-bin.000001 424 +drop table t1; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=myisam +master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) +master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F +master-bin.000001 278 Table_map 1 317 table_id: # (test.t1) +master-bin.000001 317 Write_rows 1 351 table_id: # flags: STMT_END_F +master-bin.000001 351 Table_map 1 390 table_id: # (test.t1) +master-bin.000001 390 Write_rows 1 424 table_id: # flags: STMT_END_F +master-bin.000001 424 Query 1 500 use `test`; drop table t1 +set session autocommit = @ac; +set @bcs = @@binlog_cache_size; +set @ac = @@autocommit; +set global binlog_cache_size=4096; +set autocommit= 0; +reset master; +create table t1 (a int) engine=innodb; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server ver: 5.1.21-beta-debug-log, Binlog ver: 4 +master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb +master-bin.000001 206 Query 1 274 use `test`; BEGIN +master-bin.000001 274 Table_map 1 313 table_id: 25 (test.t1) +master-bin.000001 313 Write_rows 1 347 table_id: 25 flags: STMT_END_F +master-bin.000001 347 Table_map 1 386 table_id: 25 (test.t1) +master-bin.000001 386 Write_rows 1 420 table_id: 25 flags: STMT_END_F +master-bin.000001 420 Table_map 1 459 table_id: 25 (test.t1) +master-bin.000001 459 Write_rows 1 493 table_id: 25 flags: STMT_END_F +master-bin.000001 493 Table_map 1 532 table_id: 25 (test.t1) +master-bin.000001 532 Write_rows 1 566 table_id: 25 flags: STMT_END_F +master-bin.000001 566 Table_map 1 605 table_id: 25 (test.t1) +master-bin.000001 605 Write_rows 1 639 table_id: 25 flags: STMT_END_F +master-bin.000001 639 Table_map 1 678 table_id: 25 (test.t1) +master-bin.000001 678 Write_rows 1 712 table_id: 25 flags: STMT_END_F +master-bin.000001 712 Table_map 1 751 table_id: 25 (test.t1) +master-bin.000001 751 Write_rows 1 785 table_id: 25 flags: STMT_END_F +master-bin.000001 785 Table_map 1 824 table_id: 25 (test.t1) +master-bin.000001 824 Write_rows 1 858 table_id: 25 flags: STMT_END_F +master-bin.000001 858 Table_map 1 897 table_id: 25 (test.t1) +master-bin.000001 897 Write_rows 1 931 table_id: 25 flags: STMT_END_F +master-bin.000001 931 Table_map 1 970 table_id: 25 (test.t1) +master-bin.000001 970 Write_rows 1 1004 table_id: 25 flags: STMT_END_F +master-bin.000001 1004 Table_map 1 1043 table_id: 25 (test.t1) +master-bin.000001 1043 Write_rows 1 1077 table_id: 25 flags: STMT_END_F +master-bin.000001 1077 Table_map 1 1116 table_id: 25 (test.t1) +master-bin.000001 1116 Write_rows 1 1150 table_id: 25 flags: STMT_END_F +master-bin.000001 1150 Table_map 1 1189 table_id: 25 (test.t1) +master-bin.000001 1189 Write_rows 1 1223 table_id: 25 flags: STMT_END_F +master-bin.000001 1223 Table_map 1 1262 table_id: 25 (test.t1) +master-bin.000001 1262 Write_rows 1 1296 table_id: 25 flags: STMT_END_F +master-bin.000001 1296 Table_map 1 1335 table_id: 25 (test.t1) +master-bin.000001 1335 Write_rows 1 1369 table_id: 25 flags: STMT_END_F +master-bin.000001 1369 Table_map 1 1408 table_id: 25 (test.t1) +master-bin.000001 1408 Write_rows 1 1442 table_id: 25 flags: STMT_END_F +master-bin.000001 1442 Table_map 1 1481 table_id: 25 (test.t1) +master-bin.000001 1481 Write_rows 1 1515 table_id: 25 flags: STMT_END_F +master-bin.000001 1515 Table_map 1 1554 table_id: 25 (test.t1) +master-bin.000001 1554 Write_rows 1 1588 table_id: 25 flags: STMT_END_F +master-bin.000001 1588 Table_map 1 1627 table_id: 25 (test.t1) +master-bin.000001 1627 Write_rows 1 1661 table_id: 25 flags: STMT_END_F +master-bin.000001 1661 Table_map 1 1700 table_id: 25 (test.t1) +master-bin.000001 1700 Write_rows 1 1734 table_id: 25 flags: STMT_END_F +master-bin.000001 1734 Table_map 1 1773 table_id: 25 (test.t1) +master-bin.000001 1773 Write_rows 1 1807 table_id: 25 flags: STMT_END_F +master-bin.000001 1807 Table_map 1 1846 table_id: 25 (test.t1) +master-bin.000001 1846 Write_rows 1 1880 table_id: 25 flags: STMT_END_F +master-bin.000001 1880 Table_map 1 1919 table_id: 25 (test.t1) +master-bin.000001 1919 Write_rows 1 1953 table_id: 25 flags: STMT_END_F +master-bin.000001 1953 Table_map 1 1992 table_id: 25 (test.t1) +master-bin.000001 1992 Write_rows 1 2026 table_id: 25 flags: STMT_END_F +master-bin.000001 2026 Table_map 1 2065 table_id: 25 (test.t1) +master-bin.000001 2065 Write_rows 1 2099 table_id: 25 flags: STMT_END_F +master-bin.000001 2099 Table_map 1 2138 table_id: 25 (test.t1) +master-bin.000001 2138 Write_rows 1 2172 table_id: 25 flags: STMT_END_F +master-bin.000001 2172 Table_map 1 2211 table_id: 25 (test.t1) +master-bin.000001 2211 Write_rows 1 2245 table_id: 25 flags: STMT_END_F +master-bin.000001 2245 Table_map 1 2284 table_id: 25 (test.t1) +master-bin.000001 2284 Write_rows 1 2318 table_id: 25 flags: STMT_END_F +master-bin.000001 2318 Table_map 1 2357 table_id: 25 (test.t1) +master-bin.000001 2357 Write_rows 1 2391 table_id: 25 flags: STMT_END_F +master-bin.000001 2391 Table_map 1 2430 table_id: 25 (test.t1) +master-bin.000001 2430 Write_rows 1 2464 table_id: 25 flags: STMT_END_F +master-bin.000001 2464 Table_map 1 2503 table_id: 25 (test.t1) +master-bin.000001 2503 Write_rows 1 2537 table_id: 25 flags: STMT_END_F +master-bin.000001 2537 Table_map 1 2576 table_id: 25 (test.t1) +master-bin.000001 2576 Write_rows 1 2610 table_id: 25 flags: STMT_END_F +master-bin.000001 2610 Table_map 1 2649 table_id: 25 (test.t1) +master-bin.000001 2649 Write_rows 1 2683 table_id: 25 flags: STMT_END_F +master-bin.000001 2683 Table_map 1 2722 table_id: 25 (test.t1) +master-bin.000001 2722 Write_rows 1 2756 table_id: 25 flags: STMT_END_F +master-bin.000001 2756 Table_map 1 2795 table_id: 25 (test.t1) +master-bin.000001 2795 Write_rows 1 2829 table_id: 25 flags: STMT_END_F +master-bin.000001 2829 Table_map 1 2868 table_id: 25 (test.t1) +master-bin.000001 2868 Write_rows 1 2902 table_id: 25 flags: STMT_END_F +master-bin.000001 2902 Table_map 1 2941 table_id: 25 (test.t1) +master-bin.000001 2941 Write_rows 1 2975 table_id: 25 flags: STMT_END_F +master-bin.000001 2975 Table_map 1 3014 table_id: 25 (test.t1) +master-bin.000001 3014 Write_rows 1 3048 table_id: 25 flags: STMT_END_F +master-bin.000001 3048 Table_map 1 3087 table_id: 25 (test.t1) +master-bin.000001 3087 Write_rows 1 3121 table_id: 25 flags: STMT_END_F +master-bin.000001 3121 Table_map 1 3160 table_id: 25 (test.t1) +master-bin.000001 3160 Write_rows 1 3194 table_id: 25 flags: STMT_END_F +master-bin.000001 3194 Table_map 1 3233 table_id: 25 (test.t1) +master-bin.000001 3233 Write_rows 1 3267 table_id: 25 flags: STMT_END_F +master-bin.000001 3267 Table_map 1 3306 table_id: 25 (test.t1) +master-bin.000001 3306 Write_rows 1 3340 table_id: 25 flags: STMT_END_F +master-bin.000001 3340 Table_map 1 3379 table_id: 25 (test.t1) +master-bin.000001 3379 Write_rows 1 3413 table_id: 25 flags: STMT_END_F +master-bin.000001 3413 Table_map 1 3452 table_id: 25 (test.t1) +master-bin.000001 3452 Write_rows 1 3486 table_id: 25 flags: STMT_END_F +master-bin.000001 3486 Table_map 1 3525 table_id: 25 (test.t1) +master-bin.000001 3525 Write_rows 1 3559 table_id: 25 flags: STMT_END_F +master-bin.000001 3559 Table_map 1 3598 table_id: 25 (test.t1) +master-bin.000001 3598 Write_rows 1 3632 table_id: 25 flags: STMT_END_F +master-bin.000001 3632 Table_map 1 3671 table_id: 25 (test.t1) +master-bin.000001 3671 Write_rows 1 3705 table_id: 25 flags: STMT_END_F +master-bin.000001 3705 Table_map 1 3744 table_id: 25 (test.t1) +master-bin.000001 3744 Write_rows 1 3778 table_id: 25 flags: STMT_END_F +master-bin.000001 3778 Table_map 1 3817 table_id: 25 (test.t1) +master-bin.000001 3817 Write_rows 1 3851 table_id: 25 flags: STMT_END_F +master-bin.000001 3851 Table_map 1 3890 table_id: 25 (test.t1) +master-bin.000001 3890 Write_rows 1 3924 table_id: 25 flags: STMT_END_F +master-bin.000001 3924 Table_map 1 3963 table_id: 25 (test.t1) +master-bin.000001 3963 Write_rows 1 3997 table_id: 25 flags: STMT_END_F +master-bin.000001 3997 Table_map 1 4036 table_id: 25 (test.t1) +master-bin.000001 4036 Write_rows 1 4070 table_id: 25 flags: STMT_END_F +master-bin.000001 4070 Table_map 1 4109 table_id: 25 (test.t1) +master-bin.000001 4109 Write_rows 1 4143 table_id: 25 flags: STMT_END_F +master-bin.000001 4143 Table_map 1 4182 table_id: 25 (test.t1) +master-bin.000001 4182 Write_rows 1 4216 table_id: 25 flags: STMT_END_F +master-bin.000001 4216 Table_map 1 4255 table_id: 25 (test.t1) +master-bin.000001 4255 Write_rows 1 4289 table_id: 25 flags: STMT_END_F +master-bin.000001 4289 Table_map 1 4328 table_id: 25 (test.t1) +master-bin.000001 4328 Write_rows 1 4362 table_id: 25 flags: STMT_END_F +master-bin.000001 4362 Table_map 1 4401 table_id: 25 (test.t1) +master-bin.000001 4401 Write_rows 1 4435 table_id: 25 flags: STMT_END_F +master-bin.000001 4435 Table_map 1 4474 table_id: 25 (test.t1) +master-bin.000001 4474 Write_rows 1 4508 table_id: 25 flags: STMT_END_F +master-bin.000001 4508 Table_map 1 4547 table_id: 25 (test.t1) +master-bin.000001 4547 Write_rows 1 4581 table_id: 25 flags: STMT_END_F +master-bin.000001 4581 Table_map 1 4620 table_id: 25 (test.t1) +master-bin.000001 4620 Write_rows 1 4654 table_id: 25 flags: STMT_END_F +master-bin.000001 4654 Table_map 1 4693 table_id: 25 (test.t1) +master-bin.000001 4693 Write_rows 1 4727 table_id: 25 flags: STMT_END_F +master-bin.000001 4727 Table_map 1 4766 table_id: 25 (test.t1) +master-bin.000001 4766 Write_rows 1 4800 table_id: 25 flags: STMT_END_F +master-bin.000001 4800 Table_map 1 4839 table_id: 25 (test.t1) +master-bin.000001 4839 Write_rows 1 4873 table_id: 25 flags: STMT_END_F +master-bin.000001 4873 Table_map 1 4912 table_id: 25 (test.t1) +master-bin.000001 4912 Write_rows 1 4946 table_id: 25 flags: STMT_END_F +master-bin.000001 4946 Table_map 1 4985 table_id: 25 (test.t1) +master-bin.000001 4985 Write_rows 1 5019 table_id: 25 flags: STMT_END_F +master-bin.000001 5019 Table_map 1 5058 table_id: 25 (test.t1) +master-bin.000001 5058 Write_rows 1 5092 table_id: 25 flags: STMT_END_F +master-bin.000001 5092 Table_map 1 5131 table_id: 25 (test.t1) +master-bin.000001 5131 Write_rows 1 5165 table_id: 25 flags: STMT_END_F +master-bin.000001 5165 Table_map 1 5204 table_id: 25 (test.t1) +master-bin.000001 5204 Write_rows 1 5238 table_id: 25 flags: STMT_END_F +master-bin.000001 5238 Table_map 1 5277 table_id: 25 (test.t1) +master-bin.000001 5277 Write_rows 1 5311 table_id: 25 flags: STMT_END_F +master-bin.000001 5311 Table_map 1 5350 table_id: 25 (test.t1) +master-bin.000001 5350 Write_rows 1 5384 table_id: 25 flags: STMT_END_F +master-bin.000001 5384 Table_map 1 5423 table_id: 25 (test.t1) +master-bin.000001 5423 Write_rows 1 5457 table_id: 25 flags: STMT_END_F +master-bin.000001 5457 Table_map 1 5496 table_id: 25 (test.t1) +master-bin.000001 5496 Write_rows 1 5530 table_id: 25 flags: STMT_END_F +master-bin.000001 5530 Table_map 1 5569 table_id: 25 (test.t1) +master-bin.000001 5569 Write_rows 1 5603 table_id: 25 flags: STMT_END_F +master-bin.000001 5603 Table_map 1 5642 table_id: 25 (test.t1) +master-bin.000001 5642 Write_rows 1 5676 table_id: 25 flags: STMT_END_F +master-bin.000001 5676 Table_map 1 5715 table_id: 25 (test.t1) +master-bin.000001 5715 Write_rows 1 5749 table_id: 25 flags: STMT_END_F +master-bin.000001 5749 Table_map 1 5788 table_id: 25 (test.t1) +master-bin.000001 5788 Write_rows 1 5822 table_id: 25 flags: STMT_END_F +master-bin.000001 5822 Table_map 1 5861 table_id: 25 (test.t1) +master-bin.000001 5861 Write_rows 1 5895 table_id: 25 flags: STMT_END_F +master-bin.000001 5895 Table_map 1 5934 table_id: 25 (test.t1) +master-bin.000001 5934 Write_rows 1 5968 table_id: 25 flags: STMT_END_F +master-bin.000001 5968 Table_map 1 6007 table_id: 25 (test.t1) +master-bin.000001 6007 Write_rows 1 6041 table_id: 25 flags: STMT_END_F +master-bin.000001 6041 Table_map 1 6080 table_id: 25 (test.t1) +master-bin.000001 6080 Write_rows 1 6114 table_id: 25 flags: STMT_END_F +master-bin.000001 6114 Table_map 1 6153 table_id: 25 (test.t1) +master-bin.000001 6153 Write_rows 1 6187 table_id: 25 flags: STMT_END_F +master-bin.000001 6187 Table_map 1 6226 table_id: 25 (test.t1) +master-bin.000001 6226 Write_rows 1 6260 table_id: 25 flags: STMT_END_F +master-bin.000001 6260 Table_map 1 6299 table_id: 25 (test.t1) +master-bin.000001 6299 Write_rows 1 6333 table_id: 25 flags: STMT_END_F +master-bin.000001 6333 Table_map 1 6372 table_id: 25 (test.t1) +master-bin.000001 6372 Write_rows 1 6406 table_id: 25 flags: STMT_END_F +master-bin.000001 6406 Table_map 1 6445 table_id: 25 (test.t1) +master-bin.000001 6445 Write_rows 1 6479 table_id: 25 flags: STMT_END_F +master-bin.000001 6479 Table_map 1 6518 table_id: 25 (test.t1) +master-bin.000001 6518 Write_rows 1 6552 table_id: 25 flags: STMT_END_F +master-bin.000001 6552 Table_map 1 6591 table_id: 25 (test.t1) +master-bin.000001 6591 Write_rows 1 6625 table_id: 25 flags: STMT_END_F +master-bin.000001 6625 Table_map 1 6664 table_id: 25 (test.t1) +master-bin.000001 6664 Write_rows 1 6698 table_id: 25 flags: STMT_END_F +master-bin.000001 6698 Table_map 1 6737 table_id: 25 (test.t1) +master-bin.000001 6737 Write_rows 1 6771 table_id: 25 flags: STMT_END_F +master-bin.000001 6771 Table_map 1 6810 table_id: 25 (test.t1) +master-bin.000001 6810 Write_rows 1 6844 table_id: 25 flags: STMT_END_F +master-bin.000001 6844 Table_map 1 6883 table_id: 25 (test.t1) +master-bin.000001 6883 Write_rows 1 6917 table_id: 25 flags: STMT_END_F +master-bin.000001 6917 Table_map 1 6956 table_id: 25 (test.t1) +master-bin.000001 6956 Write_rows 1 6990 table_id: 25 flags: STMT_END_F +master-bin.000001 6990 Table_map 1 7029 table_id: 25 (test.t1) +master-bin.000001 7029 Write_rows 1 7063 table_id: 25 flags: STMT_END_F +master-bin.000001 7063 Table_map 1 7102 table_id: 25 (test.t1) +master-bin.000001 7102 Write_rows 1 7136 table_id: 25 flags: STMT_END_F +master-bin.000001 7136 Table_map 1 7175 table_id: 25 (test.t1) +master-bin.000001 7175 Write_rows 1 7209 table_id: 25 flags: STMT_END_F +master-bin.000001 7209 Table_map 1 7248 table_id: 25 (test.t1) +master-bin.000001 7248 Write_rows 1 7282 table_id: 25 flags: STMT_END_F +master-bin.000001 7282 Table_map 1 7321 table_id: 25 (test.t1) +master-bin.000001 7321 Write_rows 1 7355 table_id: 25 flags: STMT_END_F +master-bin.000001 7355 Table_map 1 7394 table_id: 25 (test.t1) +master-bin.000001 7394 Write_rows 1 7428 table_id: 25 flags: STMT_END_F +master-bin.000001 7428 Table_map 1 7467 table_id: 25 (test.t1) +master-bin.000001 7467 Write_rows 1 7501 table_id: 25 flags: STMT_END_F +master-bin.000001 7501 Table_map 1 7540 table_id: 25 (test.t1) +master-bin.000001 7540 Write_rows 1 7574 table_id: 25 flags: STMT_END_F +master-bin.000001 7574 Table_map 1 7613 table_id: 25 (test.t1) +master-bin.000001 7613 Write_rows 1 7647 table_id: 25 flags: STMT_END_F +master-bin.000001 7647 Table_map 1 7686 table_id: 25 (test.t1) +master-bin.000001 7686 Write_rows 1 7720 table_id: 25 flags: STMT_END_F +master-bin.000001 7720 Table_map 1 7759 table_id: 25 (test.t1) +master-bin.000001 7759 Write_rows 1 7793 table_id: 25 flags: STMT_END_F +master-bin.000001 7793 Table_map 1 7832 table_id: 25 (test.t1) +master-bin.000001 7832 Write_rows 1 7866 table_id: 25 flags: STMT_END_F +master-bin.000001 7866 Table_map 1 7905 table_id: 25 (test.t1) +master-bin.000001 7905 Write_rows 1 7939 table_id: 25 flags: STMT_END_F +master-bin.000001 7939 Table_map 1 7978 table_id: 25 (test.t1) +master-bin.000001 7978 Write_rows 1 8012 table_id: 25 flags: STMT_END_F +master-bin.000001 8012 Table_map 1 8051 table_id: 25 (test.t1) +master-bin.000001 8051 Write_rows 1 8085 table_id: 25 flags: STMT_END_F +master-bin.000001 8085 Table_map 1 8124 table_id: 25 (test.t1) +master-bin.000001 8124 Write_rows 1 8158 table_id: 25 flags: STMT_END_F +master-bin.000001 8158 Table_map 1 8197 table_id: 25 (test.t1) +master-bin.000001 8197 Write_rows 1 8231 table_id: 25 flags: STMT_END_F +master-bin.000001 8231 Table_map 1 8270 table_id: 25 (test.t1) +master-bin.000001 8270 Write_rows 1 8304 table_id: 25 flags: STMT_END_F +master-bin.000001 8304 Table_map 1 8343 table_id: 25 (test.t1) +master-bin.000001 8343 Write_rows 1 8377 table_id: 25 flags: STMT_END_F +master-bin.000001 8377 Table_map 1 8416 table_id: 25 (test.t1) +master-bin.000001 8416 Write_rows 1 8450 table_id: 25 flags: STMT_END_F +master-bin.000001 8450 Table_map 1 8489 table_id: 25 (test.t1) +master-bin.000001 8489 Write_rows 1 8523 table_id: 25 flags: STMT_END_F +master-bin.000001 8523 Table_map 1 8562 table_id: 25 (test.t1) +master-bin.000001 8562 Write_rows 1 8596 table_id: 25 flags: STMT_END_F +master-bin.000001 8596 Table_map 1 8635 table_id: 25 (test.t1) +master-bin.000001 8635 Write_rows 1 8669 table_id: 25 flags: STMT_END_F +master-bin.000001 8669 Table_map 1 8708 table_id: 25 (test.t1) +master-bin.000001 8708 Write_rows 1 8742 table_id: 25 flags: STMT_END_F +master-bin.000001 8742 Table_map 1 8781 table_id: 25 (test.t1) +master-bin.000001 8781 Write_rows 1 8815 table_id: 25 flags: STMT_END_F +master-bin.000001 8815 Table_map 1 8854 table_id: 25 (test.t1) +master-bin.000001 8854 Write_rows 1 8888 table_id: 25 flags: STMT_END_F +master-bin.000001 8888 Table_map 1 8927 table_id: 25 (test.t1) +master-bin.000001 8927 Write_rows 1 8961 table_id: 25 flags: STMT_END_F +master-bin.000001 8961 Table_map 1 9000 table_id: 25 (test.t1) +master-bin.000001 9000 Write_rows 1 9034 table_id: 25 flags: STMT_END_F +master-bin.000001 9034 Table_map 1 9073 table_id: 25 (test.t1) +master-bin.000001 9073 Write_rows 1 9107 table_id: 25 flags: STMT_END_F +master-bin.000001 9107 Table_map 1 9146 table_id: 25 (test.t1) +master-bin.000001 9146 Write_rows 1 9180 table_id: 25 flags: STMT_END_F +master-bin.000001 9180 Table_map 1 9219 table_id: 25 (test.t1) +master-bin.000001 9219 Write_rows 1 9253 table_id: 25 flags: STMT_END_F +master-bin.000001 9253 Table_map 1 9292 table_id: 25 (test.t1) +master-bin.000001 9292 Write_rows 1 9326 table_id: 25 flags: STMT_END_F +master-bin.000001 9326 Table_map 1 9365 table_id: 25 (test.t1) +master-bin.000001 9365 Write_rows 1 9399 table_id: 25 flags: STMT_END_F +master-bin.000001 9399 Table_map 1 9438 table_id: 25 (test.t1) +master-bin.000001 9438 Write_rows 1 9472 table_id: 25 flags: STMT_END_F +master-bin.000001 9472 Table_map 1 9511 table_id: 25 (test.t1) +master-bin.000001 9511 Write_rows 1 9545 table_id: 25 flags: STMT_END_F +master-bin.000001 9545 Table_map 1 9584 table_id: 25 (test.t1) +master-bin.000001 9584 Write_rows 1 9618 table_id: 25 flags: STMT_END_F +master-bin.000001 9618 Table_map 1 9657 table_id: 25 (test.t1) +master-bin.000001 9657 Write_rows 1 9691 table_id: 25 flags: STMT_END_F +master-bin.000001 9691 Table_map 1 9730 table_id: 25 (test.t1) +master-bin.000001 9730 Write_rows 1 9764 table_id: 25 flags: STMT_END_F +master-bin.000001 9764 Table_map 1 9803 table_id: 25 (test.t1) +master-bin.000001 9803 Write_rows 1 9837 table_id: 25 flags: STMT_END_F +master-bin.000001 9837 Table_map 1 9876 table_id: 25 (test.t1) +master-bin.000001 9876 Write_rows 1 9910 table_id: 25 flags: STMT_END_F +master-bin.000001 9910 Table_map 1 9949 table_id: 25 (test.t1) +master-bin.000001 9949 Write_rows 1 9983 table_id: 25 flags: STMT_END_F +master-bin.000001 9983 Table_map 1 10022 table_id: 25 (test.t1) +master-bin.000001 10022 Write_rows 1 10056 table_id: 25 flags: STMT_END_F +master-bin.000001 10056 Table_map 1 10095 table_id: 25 (test.t1) +master-bin.000001 10095 Write_rows 1 10129 table_id: 25 flags: STMT_END_F +master-bin.000001 10129 Table_map 1 10168 table_id: 25 (test.t1) +master-bin.000001 10168 Write_rows 1 10202 table_id: 25 flags: STMT_END_F +master-bin.000001 10202 Table_map 1 10241 table_id: 25 (test.t1) +master-bin.000001 10241 Write_rows 1 10275 table_id: 25 flags: STMT_END_F +master-bin.000001 10275 Table_map 1 10314 table_id: 25 (test.t1) +master-bin.000001 10314 Write_rows 1 10348 table_id: 25 flags: STMT_END_F +master-bin.000001 10348 Table_map 1 10387 table_id: 25 (test.t1) +master-bin.000001 10387 Write_rows 1 10421 table_id: 25 flags: STMT_END_F +master-bin.000001 10421 Table_map 1 10460 table_id: 25 (test.t1) +master-bin.000001 10460 Write_rows 1 10494 table_id: 25 flags: STMT_END_F +master-bin.000001 10494 Table_map 1 10533 table_id: 25 (test.t1) +master-bin.000001 10533 Write_rows 1 10567 table_id: 25 flags: STMT_END_F +master-bin.000001 10567 Table_map 1 10606 table_id: 25 (test.t1) +master-bin.000001 10606 Write_rows 1 10640 table_id: 25 flags: STMT_END_F +master-bin.000001 10640 Table_map 1 10679 table_id: 25 (test.t1) +master-bin.000001 10679 Write_rows 1 10713 table_id: 25 flags: STMT_END_F +master-bin.000001 10713 Table_map 1 10752 table_id: 25 (test.t1) +master-bin.000001 10752 Write_rows 1 10786 table_id: 25 flags: STMT_END_F +master-bin.000001 10786 Table_map 1 10825 table_id: 25 (test.t1) +master-bin.000001 10825 Write_rows 1 10859 table_id: 25 flags: STMT_END_F +master-bin.000001 10859 Table_map 1 10898 table_id: 25 (test.t1) +master-bin.000001 10898 Write_rows 1 10932 table_id: 25 flags: STMT_END_F +master-bin.000001 10932 Table_map 1 10971 table_id: 25 (test.t1) +master-bin.000001 10971 Write_rows 1 11005 table_id: 25 flags: STMT_END_F +master-bin.000001 11005 Table_map 1 11044 table_id: 25 (test.t1) +master-bin.000001 11044 Write_rows 1 11078 table_id: 25 flags: STMT_END_F +master-bin.000001 11078 Table_map 1 11117 table_id: 25 (test.t1) +master-bin.000001 11117 Write_rows 1 11151 table_id: 25 flags: STMT_END_F +master-bin.000001 11151 Table_map 1 11190 table_id: 25 (test.t1) +master-bin.000001 11190 Write_rows 1 11224 table_id: 25 flags: STMT_END_F +master-bin.000001 11224 Table_map 1 11263 table_id: 25 (test.t1) +master-bin.000001 11263 Write_rows 1 11297 table_id: 25 flags: STMT_END_F +master-bin.000001 11297 Table_map 1 11336 table_id: 25 (test.t1) +master-bin.000001 11336 Write_rows 1 11370 table_id: 25 flags: STMT_END_F +master-bin.000001 11370 Table_map 1 11409 table_id: 25 (test.t1) +master-bin.000001 11409 Write_rows 1 11443 table_id: 25 flags: STMT_END_F +master-bin.000001 11443 Table_map 1 11482 table_id: 25 (test.t1) +master-bin.000001 11482 Write_rows 1 11516 table_id: 25 flags: STMT_END_F +master-bin.000001 11516 Table_map 1 11555 table_id: 25 (test.t1) +master-bin.000001 11555 Write_rows 1 11589 table_id: 25 flags: STMT_END_F +master-bin.000001 11589 Table_map 1 11628 table_id: 25 (test.t1) +master-bin.000001 11628 Write_rows 1 11662 table_id: 25 flags: STMT_END_F +master-bin.000001 11662 Table_map 1 11701 table_id: 25 (test.t1) +master-bin.000001 11701 Write_rows 1 11735 table_id: 25 flags: STMT_END_F +master-bin.000001 11735 Table_map 1 11774 table_id: 25 (test.t1) +master-bin.000001 11774 Write_rows 1 11808 table_id: 25 flags: STMT_END_F +master-bin.000001 11808 Table_map 1 11847 table_id: 25 (test.t1) +master-bin.000001 11847 Write_rows 1 11881 table_id: 25 flags: STMT_END_F +master-bin.000001 11881 Table_map 1 11920 table_id: 25 (test.t1) +master-bin.000001 11920 Write_rows 1 11954 table_id: 25 flags: STMT_END_F +master-bin.000001 11954 Table_map 1 11993 table_id: 25 (test.t1) +master-bin.000001 11993 Write_rows 1 12027 table_id: 25 flags: STMT_END_F +master-bin.000001 12027 Table_map 1 12066 table_id: 25 (test.t1) +master-bin.000001 12066 Write_rows 1 12100 table_id: 25 flags: STMT_END_F +master-bin.000001 12100 Table_map 1 12139 table_id: 25 (test.t1) +master-bin.000001 12139 Write_rows 1 12173 table_id: 25 flags: STMT_END_F +master-bin.000001 12173 Table_map 1 12212 table_id: 25 (test.t1) +master-bin.000001 12212 Write_rows 1 12246 table_id: 25 flags: STMT_END_F +master-bin.000001 12246 Table_map 1 12285 table_id: 25 (test.t1) +master-bin.000001 12285 Write_rows 1 12319 table_id: 25 flags: STMT_END_F +master-bin.000001 12319 Table_map 1 12358 table_id: 25 (test.t1) +master-bin.000001 12358 Write_rows 1 12392 table_id: 25 flags: STMT_END_F +master-bin.000001 12392 Table_map 1 12431 table_id: 25 (test.t1) +master-bin.000001 12431 Write_rows 1 12465 table_id: 25 flags: STMT_END_F +master-bin.000001 12465 Table_map 1 12504 table_id: 25 (test.t1) +master-bin.000001 12504 Write_rows 1 12538 table_id: 25 flags: STMT_END_F +master-bin.000001 12538 Table_map 1 12577 table_id: 25 (test.t1) +master-bin.000001 12577 Write_rows 1 12611 table_id: 25 flags: STMT_END_F +master-bin.000001 12611 Table_map 1 12650 table_id: 25 (test.t1) +master-bin.000001 12650 Write_rows 1 12684 table_id: 25 flags: STMT_END_F +master-bin.000001 12684 Table_map 1 12723 table_id: 25 (test.t1) +master-bin.000001 12723 Write_rows 1 12757 table_id: 25 flags: STMT_END_F +master-bin.000001 12757 Table_map 1 12796 table_id: 25 (test.t1) +master-bin.000001 12796 Write_rows 1 12830 table_id: 25 flags: STMT_END_F +master-bin.000001 12830 Table_map 1 12869 table_id: 25 (test.t1) +master-bin.000001 12869 Write_rows 1 12903 table_id: 25 flags: STMT_END_F +master-bin.000001 12903 Table_map 1 12942 table_id: 25 (test.t1) +master-bin.000001 12942 Write_rows 1 12976 table_id: 25 flags: STMT_END_F +master-bin.000001 12976 Table_map 1 13015 table_id: 25 (test.t1) +master-bin.000001 13015 Write_rows 1 13049 table_id: 25 flags: STMT_END_F +master-bin.000001 13049 Table_map 1 13088 table_id: 25 (test.t1) +master-bin.000001 13088 Write_rows 1 13122 table_id: 25 flags: STMT_END_F +master-bin.000001 13122 Table_map 1 13161 table_id: 25 (test.t1) +master-bin.000001 13161 Write_rows 1 13195 table_id: 25 flags: STMT_END_F +master-bin.000001 13195 Table_map 1 13234 table_id: 25 (test.t1) +master-bin.000001 13234 Write_rows 1 13268 table_id: 25 flags: STMT_END_F +master-bin.000001 13268 Table_map 1 13307 table_id: 25 (test.t1) +master-bin.000001 13307 Write_rows 1 13341 table_id: 25 flags: STMT_END_F +master-bin.000001 13341 Table_map 1 13380 table_id: 25 (test.t1) +master-bin.000001 13380 Write_rows 1 13414 table_id: 25 flags: STMT_END_F +master-bin.000001 13414 Table_map 1 13453 table_id: 25 (test.t1) +master-bin.000001 13453 Write_rows 1 13487 table_id: 25 flags: STMT_END_F +master-bin.000001 13487 Table_map 1 13526 table_id: 25 (test.t1) +master-bin.000001 13526 Write_rows 1 13560 table_id: 25 flags: STMT_END_F +master-bin.000001 13560 Table_map 1 13599 table_id: 25 (test.t1) +master-bin.000001 13599 Write_rows 1 13633 table_id: 25 flags: STMT_END_F +master-bin.000001 13633 Table_map 1 13672 table_id: 25 (test.t1) +master-bin.000001 13672 Write_rows 1 13706 table_id: 25 flags: STMT_END_F +master-bin.000001 13706 Table_map 1 13745 table_id: 25 (test.t1) +master-bin.000001 13745 Write_rows 1 13779 table_id: 25 flags: STMT_END_F +master-bin.000001 13779 Table_map 1 13818 table_id: 25 (test.t1) +master-bin.000001 13818 Write_rows 1 13852 table_id: 25 flags: STMT_END_F +master-bin.000001 13852 Table_map 1 13891 table_id: 25 (test.t1) +master-bin.000001 13891 Write_rows 1 13925 table_id: 25 flags: STMT_END_F +master-bin.000001 13925 Table_map 1 13964 table_id: 25 (test.t1) +master-bin.000001 13964 Write_rows 1 13998 table_id: 25 flags: STMT_END_F +master-bin.000001 13998 Table_map 1 14037 table_id: 25 (test.t1) +master-bin.000001 14037 Write_rows 1 14071 table_id: 25 flags: STMT_END_F +master-bin.000001 14071 Table_map 1 14110 table_id: 25 (test.t1) +master-bin.000001 14110 Write_rows 1 14144 table_id: 25 flags: STMT_END_F +master-bin.000001 14144 Table_map 1 14183 table_id: 25 (test.t1) +master-bin.000001 14183 Write_rows 1 14217 table_id: 25 flags: STMT_END_F +master-bin.000001 14217 Table_map 1 14256 table_id: 25 (test.t1) +master-bin.000001 14256 Write_rows 1 14290 table_id: 25 flags: STMT_END_F +master-bin.000001 14290 Table_map 1 14329 table_id: 25 (test.t1) +master-bin.000001 14329 Write_rows 1 14363 table_id: 25 flags: STMT_END_F +master-bin.000001 14363 Table_map 1 14402 table_id: 25 (test.t1) +master-bin.000001 14402 Write_rows 1 14436 table_id: 25 flags: STMT_END_F +master-bin.000001 14436 Table_map 1 14475 table_id: 25 (test.t1) +master-bin.000001 14475 Write_rows 1 14509 table_id: 25 flags: STMT_END_F +master-bin.000001 14509 Table_map 1 14548 table_id: 25 (test.t1) +master-bin.000001 14548 Write_rows 1 14582 table_id: 25 flags: STMT_END_F +master-bin.000001 14582 Table_map 1 14621 table_id: 25 (test.t1) +master-bin.000001 14621 Write_rows 1 14655 table_id: 25 flags: STMT_END_F +master-bin.000001 14655 Table_map 1 14694 table_id: 25 (test.t1) +master-bin.000001 14694 Write_rows 1 14728 table_id: 25 flags: STMT_END_F +master-bin.000001 14728 Table_map 1 14767 table_id: 25 (test.t1) +master-bin.000001 14767 Write_rows 1 14801 table_id: 25 flags: STMT_END_F +master-bin.000001 14801 Table_map 1 14840 table_id: 25 (test.t1) +master-bin.000001 14840 Write_rows 1 14874 table_id: 25 flags: STMT_END_F +master-bin.000001 14874 Table_map 1 14913 table_id: 25 (test.t1) +master-bin.000001 14913 Write_rows 1 14947 table_id: 25 flags: STMT_END_F +master-bin.000001 14947 Table_map 1 14986 table_id: 25 (test.t1) +master-bin.000001 14986 Write_rows 1 15020 table_id: 25 flags: STMT_END_F +master-bin.000001 15020 Table_map 1 15059 table_id: 25 (test.t1) +master-bin.000001 15059 Write_rows 1 15093 table_id: 25 flags: STMT_END_F +master-bin.000001 15093 Table_map 1 15132 table_id: 25 (test.t1) +master-bin.000001 15132 Write_rows 1 15166 table_id: 25 flags: STMT_END_F +master-bin.000001 15166 Table_map 1 15205 table_id: 25 (test.t1) +master-bin.000001 15205 Write_rows 1 15239 table_id: 25 flags: STMT_END_F +master-bin.000001 15239 Table_map 1 15278 table_id: 25 (test.t1) +master-bin.000001 15278 Write_rows 1 15312 table_id: 25 flags: STMT_END_F +master-bin.000001 15312 Table_map 1 15351 table_id: 25 (test.t1) +master-bin.000001 15351 Write_rows 1 15385 table_id: 25 flags: STMT_END_F +master-bin.000001 15385 Table_map 1 15424 table_id: 25 (test.t1) +master-bin.000001 15424 Write_rows 1 15458 table_id: 25 flags: STMT_END_F +master-bin.000001 15458 Table_map 1 15497 table_id: 25 (test.t1) +master-bin.000001 15497 Write_rows 1 15531 table_id: 25 flags: STMT_END_F +master-bin.000001 15531 Table_map 1 15570 table_id: 25 (test.t1) +master-bin.000001 15570 Write_rows 1 15604 table_id: 25 flags: STMT_END_F +master-bin.000001 15604 Table_map 1 15643 table_id: 25 (test.t1) +master-bin.000001 15643 Write_rows 1 15677 table_id: 25 flags: STMT_END_F +master-bin.000001 15677 Table_map 1 15716 table_id: 25 (test.t1) +master-bin.000001 15716 Write_rows 1 15750 table_id: 25 flags: STMT_END_F +master-bin.000001 15750 Table_map 1 15789 table_id: 25 (test.t1) +master-bin.000001 15789 Write_rows 1 15823 table_id: 25 flags: STMT_END_F +master-bin.000001 15823 Table_map 1 15862 table_id: 25 (test.t1) +master-bin.000001 15862 Write_rows 1 15896 table_id: 25 flags: STMT_END_F +master-bin.000001 15896 Table_map 1 15935 table_id: 25 (test.t1) +master-bin.000001 15935 Write_rows 1 15969 table_id: 25 flags: STMT_END_F +master-bin.000001 15969 Table_map 1 16008 table_id: 25 (test.t1) +master-bin.000001 16008 Write_rows 1 16042 table_id: 25 flags: STMT_END_F +master-bin.000001 16042 Table_map 1 16081 table_id: 25 (test.t1) +master-bin.000001 16081 Write_rows 1 16115 table_id: 25 flags: STMT_END_F +master-bin.000001 16115 Table_map 1 16154 table_id: 25 (test.t1) +master-bin.000001 16154 Write_rows 1 16188 table_id: 25 flags: STMT_END_F +master-bin.000001 16188 Table_map 1 16227 table_id: 25 (test.t1) +master-bin.000001 16227 Write_rows 1 16261 table_id: 25 flags: STMT_END_F +master-bin.000001 16261 Table_map 1 16300 table_id: 25 (test.t1) +master-bin.000001 16300 Write_rows 1 16334 table_id: 25 flags: STMT_END_F +master-bin.000001 16334 Table_map 1 16373 table_id: 25 (test.t1) +master-bin.000001 16373 Write_rows 1 16407 table_id: 25 flags: STMT_END_F +master-bin.000001 16407 Table_map 1 16446 table_id: 25 (test.t1) +master-bin.000001 16446 Write_rows 1 16480 table_id: 25 flags: STMT_END_F +master-bin.000001 16480 Table_map 1 16519 table_id: 25 (test.t1) +master-bin.000001 16519 Write_rows 1 16553 table_id: 25 flags: STMT_END_F +master-bin.000001 16553 Table_map 1 16592 table_id: 25 (test.t1) +master-bin.000001 16592 Write_rows 1 16626 table_id: 25 flags: STMT_END_F +master-bin.000001 16626 Table_map 1 16665 table_id: 25 (test.t1) +master-bin.000001 16665 Write_rows 1 16699 table_id: 25 flags: STMT_END_F +master-bin.000001 16699 Table_map 1 16738 table_id: 25 (test.t1) +master-bin.000001 16738 Write_rows 1 16772 table_id: 25 flags: STMT_END_F +master-bin.000001 16772 Table_map 1 16811 table_id: 25 (test.t1) +master-bin.000001 16811 Write_rows 1 16845 table_id: 25 flags: STMT_END_F +master-bin.000001 16845 Table_map 1 16884 table_id: 25 (test.t1) +master-bin.000001 16884 Write_rows 1 16918 table_id: 25 flags: STMT_END_F +master-bin.000001 16918 Table_map 1 16957 table_id: 25 (test.t1) +master-bin.000001 16957 Write_rows 1 16991 table_id: 25 flags: STMT_END_F +master-bin.000001 16991 Table_map 1 17030 table_id: 25 (test.t1) +master-bin.000001 17030 Write_rows 1 17064 table_id: 25 flags: STMT_END_F +master-bin.000001 17064 Table_map 1 17103 table_id: 25 (test.t1) +master-bin.000001 17103 Write_rows 1 17137 table_id: 25 flags: STMT_END_F +master-bin.000001 17137 Table_map 1 17176 table_id: 25 (test.t1) +master-bin.000001 17176 Write_rows 1 17210 table_id: 25 flags: STMT_END_F +master-bin.000001 17210 Table_map 1 17249 table_id: 25 (test.t1) +master-bin.000001 17249 Write_rows 1 17283 table_id: 25 flags: STMT_END_F +master-bin.000001 17283 Table_map 1 17322 table_id: 25 (test.t1) +master-bin.000001 17322 Write_rows 1 17356 table_id: 25 flags: STMT_END_F +master-bin.000001 17356 Table_map 1 17395 table_id: 25 (test.t1) +master-bin.000001 17395 Write_rows 1 17429 table_id: 25 flags: STMT_END_F +master-bin.000001 17429 Table_map 1 17468 table_id: 25 (test.t1) +master-bin.000001 17468 Write_rows 1 17502 table_id: 25 flags: STMT_END_F +master-bin.000001 17502 Table_map 1 17541 table_id: 25 (test.t1) +master-bin.000001 17541 Write_rows 1 17575 table_id: 25 flags: STMT_END_F +master-bin.000001 17575 Table_map 1 17614 table_id: 25 (test.t1) +master-bin.000001 17614 Write_rows 1 17648 table_id: 25 flags: STMT_END_F +master-bin.000001 17648 Table_map 1 17687 table_id: 25 (test.t1) +master-bin.000001 17687 Write_rows 1 17721 table_id: 25 flags: STMT_END_F +master-bin.000001 17721 Table_map 1 17760 table_id: 25 (test.t1) +master-bin.000001 17760 Write_rows 1 17794 table_id: 25 flags: STMT_END_F +master-bin.000001 17794 Table_map 1 17833 table_id: 25 (test.t1) +master-bin.000001 17833 Write_rows 1 17867 table_id: 25 flags: STMT_END_F +master-bin.000001 17867 Table_map 1 17906 table_id: 25 (test.t1) +master-bin.000001 17906 Write_rows 1 17940 table_id: 25 flags: STMT_END_F +master-bin.000001 17940 Table_map 1 17979 table_id: 25 (test.t1) +master-bin.000001 17979 Write_rows 1 18013 table_id: 25 flags: STMT_END_F +master-bin.000001 18013 Table_map 1 18052 table_id: 25 (test.t1) +master-bin.000001 18052 Write_rows 1 18086 table_id: 25 flags: STMT_END_F +master-bin.000001 18086 Table_map 1 18125 table_id: 25 (test.t1) +master-bin.000001 18125 Write_rows 1 18159 table_id: 25 flags: STMT_END_F +master-bin.000001 18159 Table_map 1 18198 table_id: 25 (test.t1) +master-bin.000001 18198 Write_rows 1 18232 table_id: 25 flags: STMT_END_F +master-bin.000001 18232 Table_map 1 18271 table_id: 25 (test.t1) +master-bin.000001 18271 Write_rows 1 18305 table_id: 25 flags: STMT_END_F +master-bin.000001 18305 Table_map 1 18344 table_id: 25 (test.t1) +master-bin.000001 18344 Write_rows 1 18378 table_id: 25 flags: STMT_END_F +master-bin.000001 18378 Table_map 1 18417 table_id: 25 (test.t1) +master-bin.000001 18417 Write_rows 1 18451 table_id: 25 flags: STMT_END_F +master-bin.000001 18451 Table_map 1 18490 table_id: 25 (test.t1) +master-bin.000001 18490 Write_rows 1 18524 table_id: 25 flags: STMT_END_F +master-bin.000001 18524 Table_map 1 18563 table_id: 25 (test.t1) +master-bin.000001 18563 Write_rows 1 18597 table_id: 25 flags: STMT_END_F +master-bin.000001 18597 Table_map 1 18636 table_id: 25 (test.t1) +master-bin.000001 18636 Write_rows 1 18670 table_id: 25 flags: STMT_END_F +master-bin.000001 18670 Table_map 1 18709 table_id: 25 (test.t1) +master-bin.000001 18709 Write_rows 1 18743 table_id: 25 flags: STMT_END_F +master-bin.000001 18743 Table_map 1 18782 table_id: 25 (test.t1) +master-bin.000001 18782 Write_rows 1 18816 table_id: 25 flags: STMT_END_F +master-bin.000001 18816 Table_map 1 18855 table_id: 25 (test.t1) +master-bin.000001 18855 Write_rows 1 18889 table_id: 25 flags: STMT_END_F +master-bin.000001 18889 Table_map 1 18928 table_id: 25 (test.t1) +master-bin.000001 18928 Write_rows 1 18962 table_id: 25 flags: STMT_END_F +master-bin.000001 18962 Table_map 1 19001 table_id: 25 (test.t1) +master-bin.000001 19001 Write_rows 1 19035 table_id: 25 flags: STMT_END_F +master-bin.000001 19035 Table_map 1 19074 table_id: 25 (test.t1) +master-bin.000001 19074 Write_rows 1 19108 table_id: 25 flags: STMT_END_F +master-bin.000001 19108 Table_map 1 19147 table_id: 25 (test.t1) +master-bin.000001 19147 Write_rows 1 19181 table_id: 25 flags: STMT_END_F +master-bin.000001 19181 Table_map 1 19220 table_id: 25 (test.t1) +master-bin.000001 19220 Write_rows 1 19254 table_id: 25 flags: STMT_END_F +master-bin.000001 19254 Table_map 1 19293 table_id: 25 (test.t1) +master-bin.000001 19293 Write_rows 1 19327 table_id: 25 flags: STMT_END_F +master-bin.000001 19327 Table_map 1 19366 table_id: 25 (test.t1) +master-bin.000001 19366 Write_rows 1 19400 table_id: 25 flags: STMT_END_F +master-bin.000001 19400 Table_map 1 19439 table_id: 25 (test.t1) +master-bin.000001 19439 Write_rows 1 19473 table_id: 25 flags: STMT_END_F +master-bin.000001 19473 Table_map 1 19512 table_id: 25 (test.t1) +master-bin.000001 19512 Write_rows 1 19546 table_id: 25 flags: STMT_END_F +master-bin.000001 19546 Table_map 1 19585 table_id: 25 (test.t1) +master-bin.000001 19585 Write_rows 1 19619 table_id: 25 flags: STMT_END_F +master-bin.000001 19619 Table_map 1 19658 table_id: 25 (test.t1) +master-bin.000001 19658 Write_rows 1 19692 table_id: 25 flags: STMT_END_F +master-bin.000001 19692 Table_map 1 19731 table_id: 25 (test.t1) +master-bin.000001 19731 Write_rows 1 19765 table_id: 25 flags: STMT_END_F +master-bin.000001 19765 Table_map 1 19804 table_id: 25 (test.t1) +master-bin.000001 19804 Write_rows 1 19838 table_id: 25 flags: STMT_END_F +master-bin.000001 19838 Table_map 1 19877 table_id: 25 (test.t1) +master-bin.000001 19877 Write_rows 1 19911 table_id: 25 flags: STMT_END_F +master-bin.000001 19911 Table_map 1 19950 table_id: 25 (test.t1) +master-bin.000001 19950 Write_rows 1 19984 table_id: 25 flags: STMT_END_F +master-bin.000001 19984 Table_map 1 20023 table_id: 25 (test.t1) +master-bin.000001 20023 Write_rows 1 20057 table_id: 25 flags: STMT_END_F +master-bin.000001 20057 Table_map 1 20096 table_id: 25 (test.t1) +master-bin.000001 20096 Write_rows 1 20130 table_id: 25 flags: STMT_END_F +master-bin.000001 20130 Table_map 1 20169 table_id: 25 (test.t1) +master-bin.000001 20169 Write_rows 1 20203 table_id: 25 flags: STMT_END_F +master-bin.000001 20203 Table_map 1 20242 table_id: 25 (test.t1) +master-bin.000001 20242 Write_rows 1 20276 table_id: 25 flags: STMT_END_F +master-bin.000001 20276 Table_map 1 20315 table_id: 25 (test.t1) +master-bin.000001 20315 Write_rows 1 20349 table_id: 25 flags: STMT_END_F +master-bin.000001 20349 Table_map 1 20388 table_id: 25 (test.t1) +master-bin.000001 20388 Write_rows 1 20422 table_id: 25 flags: STMT_END_F +master-bin.000001 20422 Table_map 1 20461 table_id: 25 (test.t1) +master-bin.000001 20461 Write_rows 1 20495 table_id: 25 flags: STMT_END_F +master-bin.000001 20495 Table_map 1 20534 table_id: 25 (test.t1) +master-bin.000001 20534 Write_rows 1 20568 table_id: 25 flags: STMT_END_F +master-bin.000001 20568 Table_map 1 20607 table_id: 25 (test.t1) +master-bin.000001 20607 Write_rows 1 20641 table_id: 25 flags: STMT_END_F +master-bin.000001 20641 Table_map 1 20680 table_id: 25 (test.t1) +master-bin.000001 20680 Write_rows 1 20714 table_id: 25 flags: STMT_END_F +master-bin.000001 20714 Table_map 1 20753 table_id: 25 (test.t1) +master-bin.000001 20753 Write_rows 1 20787 table_id: 25 flags: STMT_END_F +master-bin.000001 20787 Table_map 1 20826 table_id: 25 (test.t1) +master-bin.000001 20826 Write_rows 1 20860 table_id: 25 flags: STMT_END_F +master-bin.000001 20860 Table_map 1 20899 table_id: 25 (test.t1) +master-bin.000001 20899 Write_rows 1 20933 table_id: 25 flags: STMT_END_F +master-bin.000001 20933 Table_map 1 20972 table_id: 25 (test.t1) +master-bin.000001 20972 Write_rows 1 21006 table_id: 25 flags: STMT_END_F +master-bin.000001 21006 Table_map 1 21045 table_id: 25 (test.t1) +master-bin.000001 21045 Write_rows 1 21079 table_id: 25 flags: STMT_END_F +master-bin.000001 21079 Table_map 1 21118 table_id: 25 (test.t1) +master-bin.000001 21118 Write_rows 1 21152 table_id: 25 flags: STMT_END_F +master-bin.000001 21152 Table_map 1 21191 table_id: 25 (test.t1) +master-bin.000001 21191 Write_rows 1 21225 table_id: 25 flags: STMT_END_F +master-bin.000001 21225 Table_map 1 21264 table_id: 25 (test.t1) +master-bin.000001 21264 Write_rows 1 21298 table_id: 25 flags: STMT_END_F +master-bin.000001 21298 Table_map 1 21337 table_id: 25 (test.t1) +master-bin.000001 21337 Write_rows 1 21371 table_id: 25 flags: STMT_END_F +master-bin.000001 21371 Table_map 1 21410 table_id: 25 (test.t1) +master-bin.000001 21410 Write_rows 1 21444 table_id: 25 flags: STMT_END_F +master-bin.000001 21444 Table_map 1 21483 table_id: 25 (test.t1) +master-bin.000001 21483 Write_rows 1 21517 table_id: 25 flags: STMT_END_F +master-bin.000001 21517 Table_map 1 21556 table_id: 25 (test.t1) +master-bin.000001 21556 Write_rows 1 21590 table_id: 25 flags: STMT_END_F +master-bin.000001 21590 Table_map 1 21629 table_id: 25 (test.t1) +master-bin.000001 21629 Write_rows 1 21663 table_id: 25 flags: STMT_END_F +master-bin.000001 21663 Table_map 1 21702 table_id: 25 (test.t1) +master-bin.000001 21702 Write_rows 1 21736 table_id: 25 flags: STMT_END_F +master-bin.000001 21736 Table_map 1 21775 table_id: 25 (test.t1) +master-bin.000001 21775 Write_rows 1 21809 table_id: 25 flags: STMT_END_F +master-bin.000001 21809 Table_map 1 21848 table_id: 25 (test.t1) +master-bin.000001 21848 Write_rows 1 21882 table_id: 25 flags: STMT_END_F +master-bin.000001 21882 Table_map 1 21921 table_id: 25 (test.t1) +master-bin.000001 21921 Write_rows 1 21955 table_id: 25 flags: STMT_END_F +master-bin.000001 21955 Table_map 1 21994 table_id: 25 (test.t1) +master-bin.000001 21994 Write_rows 1 22028 table_id: 25 flags: STMT_END_F +master-bin.000001 22028 Table_map 1 22067 table_id: 25 (test.t1) +master-bin.000001 22067 Write_rows 1 22101 table_id: 25 flags: STMT_END_F +master-bin.000001 22101 Table_map 1 22140 table_id: 25 (test.t1) +master-bin.000001 22140 Write_rows 1 22174 table_id: 25 flags: STMT_END_F +master-bin.000001 22174 Table_map 1 22213 table_id: 25 (test.t1) +master-bin.000001 22213 Write_rows 1 22247 table_id: 25 flags: STMT_END_F +master-bin.000001 22247 Table_map 1 22286 table_id: 25 (test.t1) +master-bin.000001 22286 Write_rows 1 22320 table_id: 25 flags: STMT_END_F +master-bin.000001 22320 Table_map 1 22359 table_id: 25 (test.t1) +master-bin.000001 22359 Write_rows 1 22393 table_id: 25 flags: STMT_END_F +master-bin.000001 22393 Table_map 1 22432 table_id: 25 (test.t1) +master-bin.000001 22432 Write_rows 1 22466 table_id: 25 flags: STMT_END_F +master-bin.000001 22466 Table_map 1 22505 table_id: 25 (test.t1) +master-bin.000001 22505 Write_rows 1 22539 table_id: 25 flags: STMT_END_F +master-bin.000001 22539 Table_map 1 22578 table_id: 25 (test.t1) +master-bin.000001 22578 Write_rows 1 22612 table_id: 25 flags: STMT_END_F +master-bin.000001 22612 Table_map 1 22651 table_id: 25 (test.t1) +master-bin.000001 22651 Write_rows 1 22685 table_id: 25 flags: STMT_END_F +master-bin.000001 22685 Table_map 1 22724 table_id: 25 (test.t1) +master-bin.000001 22724 Write_rows 1 22758 table_id: 25 flags: STMT_END_F +master-bin.000001 22758 Table_map 1 22797 table_id: 25 (test.t1) +master-bin.000001 22797 Write_rows 1 22831 table_id: 25 flags: STMT_END_F +master-bin.000001 22831 Table_map 1 22870 table_id: 25 (test.t1) +master-bin.000001 22870 Write_rows 1 22904 table_id: 25 flags: STMT_END_F +master-bin.000001 22904 Table_map 1 22943 table_id: 25 (test.t1) +master-bin.000001 22943 Write_rows 1 22977 table_id: 25 flags: STMT_END_F +master-bin.000001 22977 Table_map 1 23016 table_id: 25 (test.t1) +master-bin.000001 23016 Write_rows 1 23050 table_id: 25 flags: STMT_END_F +master-bin.000001 23050 Table_map 1 23089 table_id: 25 (test.t1) +master-bin.000001 23089 Write_rows 1 23123 table_id: 25 flags: STMT_END_F +master-bin.000001 23123 Table_map 1 23162 table_id: 25 (test.t1) +master-bin.000001 23162 Write_rows 1 23196 table_id: 25 flags: STMT_END_F +master-bin.000001 23196 Table_map 1 23235 table_id: 25 (test.t1) +master-bin.000001 23235 Write_rows 1 23269 table_id: 25 flags: STMT_END_F +master-bin.000001 23269 Table_map 1 23308 table_id: 25 (test.t1) +master-bin.000001 23308 Write_rows 1 23342 table_id: 25 flags: STMT_END_F +master-bin.000001 23342 Table_map 1 23381 table_id: 25 (test.t1) +master-bin.000001 23381 Write_rows 1 23415 table_id: 25 flags: STMT_END_F +master-bin.000001 23415 Table_map 1 23454 table_id: 25 (test.t1) +master-bin.000001 23454 Write_rows 1 23488 table_id: 25 flags: STMT_END_F +master-bin.000001 23488 Table_map 1 23527 table_id: 25 (test.t1) +master-bin.000001 23527 Write_rows 1 23561 table_id: 25 flags: STMT_END_F +master-bin.000001 23561 Table_map 1 23600 table_id: 25 (test.t1) +master-bin.000001 23600 Write_rows 1 23634 table_id: 25 flags: STMT_END_F +master-bin.000001 23634 Table_map 1 23673 table_id: 25 (test.t1) +master-bin.000001 23673 Write_rows 1 23707 table_id: 25 flags: STMT_END_F +master-bin.000001 23707 Table_map 1 23746 table_id: 25 (test.t1) +master-bin.000001 23746 Write_rows 1 23780 table_id: 25 flags: STMT_END_F +master-bin.000001 23780 Table_map 1 23819 table_id: 25 (test.t1) +master-bin.000001 23819 Write_rows 1 23853 table_id: 25 flags: STMT_END_F +master-bin.000001 23853 Table_map 1 23892 table_id: 25 (test.t1) +master-bin.000001 23892 Write_rows 1 23926 table_id: 25 flags: STMT_END_F +master-bin.000001 23926 Table_map 1 23965 table_id: 25 (test.t1) +master-bin.000001 23965 Write_rows 1 23999 table_id: 25 flags: STMT_END_F +master-bin.000001 23999 Table_map 1 24038 table_id: 25 (test.t1) +master-bin.000001 24038 Write_rows 1 24072 table_id: 25 flags: STMT_END_F +master-bin.000001 24072 Table_map 1 24111 table_id: 25 (test.t1) +master-bin.000001 24111 Write_rows 1 24145 table_id: 25 flags: STMT_END_F +master-bin.000001 24145 Table_map 1 24184 table_id: 25 (test.t1) +master-bin.000001 24184 Write_rows 1 24218 table_id: 25 flags: STMT_END_F +master-bin.000001 24218 Table_map 1 24257 table_id: 25 (test.t1) +master-bin.000001 24257 Write_rows 1 24291 table_id: 25 flags: STMT_END_F +master-bin.000001 24291 Table_map 1 24330 table_id: 25 (test.t1) +master-bin.000001 24330 Write_rows 1 24364 table_id: 25 flags: STMT_END_F +master-bin.000001 24364 Table_map 1 24403 table_id: 25 (test.t1) +master-bin.000001 24403 Write_rows 1 24437 table_id: 25 flags: STMT_END_F +master-bin.000001 24437 Table_map 1 24476 table_id: 25 (test.t1) +master-bin.000001 24476 Write_rows 1 24510 table_id: 25 flags: STMT_END_F +master-bin.000001 24510 Table_map 1 24549 table_id: 25 (test.t1) +master-bin.000001 24549 Write_rows 1 24583 table_id: 25 flags: STMT_END_F +master-bin.000001 24583 Table_map 1 24622 table_id: 25 (test.t1) +master-bin.000001 24622 Write_rows 1 24656 table_id: 25 flags: STMT_END_F +master-bin.000001 24656 Table_map 1 24695 table_id: 25 (test.t1) +master-bin.000001 24695 Write_rows 1 24729 table_id: 25 flags: STMT_END_F +master-bin.000001 24729 Table_map 1 24768 table_id: 25 (test.t1) +master-bin.000001 24768 Write_rows 1 24802 table_id: 25 flags: STMT_END_F +master-bin.000001 24802 Table_map 1 24841 table_id: 25 (test.t1) +master-bin.000001 24841 Write_rows 1 24875 table_id: 25 flags: STMT_END_F +master-bin.000001 24875 Table_map 1 24914 table_id: 25 (test.t1) +master-bin.000001 24914 Write_rows 1 24948 table_id: 25 flags: STMT_END_F +master-bin.000001 24948 Table_map 1 24987 table_id: 25 (test.t1) +master-bin.000001 24987 Write_rows 1 25021 table_id: 25 flags: STMT_END_F +master-bin.000001 25021 Table_map 1 25060 table_id: 25 (test.t1) +master-bin.000001 25060 Write_rows 1 25094 table_id: 25 flags: STMT_END_F +master-bin.000001 25094 Table_map 1 25133 table_id: 25 (test.t1) +master-bin.000001 25133 Write_rows 1 25167 table_id: 25 flags: STMT_END_F +master-bin.000001 25167 Table_map 1 25206 table_id: 25 (test.t1) +master-bin.000001 25206 Write_rows 1 25240 table_id: 25 flags: STMT_END_F +master-bin.000001 25240 Table_map 1 25279 table_id: 25 (test.t1) +master-bin.000001 25279 Write_rows 1 25313 table_id: 25 flags: STMT_END_F +master-bin.000001 25313 Table_map 1 25352 table_id: 25 (test.t1) +master-bin.000001 25352 Write_rows 1 25386 table_id: 25 flags: STMT_END_F +master-bin.000001 25386 Table_map 1 25425 table_id: 25 (test.t1) +master-bin.000001 25425 Write_rows 1 25459 table_id: 25 flags: STMT_END_F +master-bin.000001 25459 Table_map 1 25498 table_id: 25 (test.t1) +master-bin.000001 25498 Write_rows 1 25532 table_id: 25 flags: STMT_END_F +master-bin.000001 25532 Table_map 1 25571 table_id: 25 (test.t1) +master-bin.000001 25571 Write_rows 1 25605 table_id: 25 flags: STMT_END_F +master-bin.000001 25605 Table_map 1 25644 table_id: 25 (test.t1) +master-bin.000001 25644 Write_rows 1 25678 table_id: 25 flags: STMT_END_F +master-bin.000001 25678 Table_map 1 25717 table_id: 25 (test.t1) +master-bin.000001 25717 Write_rows 1 25751 table_id: 25 flags: STMT_END_F +master-bin.000001 25751 Table_map 1 25790 table_id: 25 (test.t1) +master-bin.000001 25790 Write_rows 1 25824 table_id: 25 flags: STMT_END_F +master-bin.000001 25824 Table_map 1 25863 table_id: 25 (test.t1) +master-bin.000001 25863 Write_rows 1 25897 table_id: 25 flags: STMT_END_F +master-bin.000001 25897 Table_map 1 25936 table_id: 25 (test.t1) +master-bin.000001 25936 Write_rows 1 25970 table_id: 25 flags: STMT_END_F +master-bin.000001 25970 Table_map 1 26009 table_id: 25 (test.t1) +master-bin.000001 26009 Write_rows 1 26043 table_id: 25 flags: STMT_END_F +master-bin.000001 26043 Table_map 1 26082 table_id: 25 (test.t1) +master-bin.000001 26082 Write_rows 1 26116 table_id: 25 flags: STMT_END_F +master-bin.000001 26116 Table_map 1 26155 table_id: 25 (test.t1) +master-bin.000001 26155 Write_rows 1 26189 table_id: 25 flags: STMT_END_F +master-bin.000001 26189 Table_map 1 26228 table_id: 25 (test.t1) +master-bin.000001 26228 Write_rows 1 26262 table_id: 25 flags: STMT_END_F +master-bin.000001 26262 Table_map 1 26301 table_id: 25 (test.t1) +master-bin.000001 26301 Write_rows 1 26335 table_id: 25 flags: STMT_END_F +master-bin.000001 26335 Table_map 1 26374 table_id: 25 (test.t1) +master-bin.000001 26374 Write_rows 1 26408 table_id: 25 flags: STMT_END_F +master-bin.000001 26408 Table_map 1 26447 table_id: 25 (test.t1) +master-bin.000001 26447 Write_rows 1 26481 table_id: 25 flags: STMT_END_F +master-bin.000001 26481 Table_map 1 26520 table_id: 25 (test.t1) +master-bin.000001 26520 Write_rows 1 26554 table_id: 25 flags: STMT_END_F +master-bin.000001 26554 Table_map 1 26593 table_id: 25 (test.t1) +master-bin.000001 26593 Write_rows 1 26627 table_id: 25 flags: STMT_END_F +master-bin.000001 26627 Table_map 1 26666 table_id: 25 (test.t1) +master-bin.000001 26666 Write_rows 1 26700 table_id: 25 flags: STMT_END_F +master-bin.000001 26700 Table_map 1 26739 table_id: 25 (test.t1) +master-bin.000001 26739 Write_rows 1 26773 table_id: 25 flags: STMT_END_F +master-bin.000001 26773 Table_map 1 26812 table_id: 25 (test.t1) +master-bin.000001 26812 Write_rows 1 26846 table_id: 25 flags: STMT_END_F +master-bin.000001 26846 Table_map 1 26885 table_id: 25 (test.t1) +master-bin.000001 26885 Write_rows 1 26919 table_id: 25 flags: STMT_END_F +master-bin.000001 26919 Table_map 1 26958 table_id: 25 (test.t1) +master-bin.000001 26958 Write_rows 1 26992 table_id: 25 flags: STMT_END_F +master-bin.000001 26992 Table_map 1 27031 table_id: 25 (test.t1) +master-bin.000001 27031 Write_rows 1 27065 table_id: 25 flags: STMT_END_F +master-bin.000001 27065 Table_map 1 27104 table_id: 25 (test.t1) +master-bin.000001 27104 Write_rows 1 27138 table_id: 25 flags: STMT_END_F +master-bin.000001 27138 Table_map 1 27177 table_id: 25 (test.t1) +master-bin.000001 27177 Write_rows 1 27211 table_id: 25 flags: STMT_END_F +master-bin.000001 27211 Table_map 1 27250 table_id: 25 (test.t1) +master-bin.000001 27250 Write_rows 1 27284 table_id: 25 flags: STMT_END_F +master-bin.000001 27284 Table_map 1 27323 table_id: 25 (test.t1) +master-bin.000001 27323 Write_rows 1 27357 table_id: 25 flags: STMT_END_F +master-bin.000001 27357 Table_map 1 27396 table_id: 25 (test.t1) +master-bin.000001 27396 Write_rows 1 27430 table_id: 25 flags: STMT_END_F +master-bin.000001 27430 Table_map 1 27469 table_id: 25 (test.t1) +master-bin.000001 27469 Write_rows 1 27503 table_id: 25 flags: STMT_END_F +master-bin.000001 27503 Table_map 1 27542 table_id: 25 (test.t1) +master-bin.000001 27542 Write_rows 1 27576 table_id: 25 flags: STMT_END_F +master-bin.000001 27576 Table_map 1 27615 table_id: 25 (test.t1) +master-bin.000001 27615 Write_rows 1 27649 table_id: 25 flags: STMT_END_F +master-bin.000001 27649 Table_map 1 27688 table_id: 25 (test.t1) +master-bin.000001 27688 Write_rows 1 27722 table_id: 25 flags: STMT_END_F +master-bin.000001 27722 Table_map 1 27761 table_id: 25 (test.t1) +master-bin.000001 27761 Write_rows 1 27795 table_id: 25 flags: STMT_END_F +master-bin.000001 27795 Table_map 1 27834 table_id: 25 (test.t1) +master-bin.000001 27834 Write_rows 1 27868 table_id: 25 flags: STMT_END_F +master-bin.000001 27868 Table_map 1 27907 table_id: 25 (test.t1) +master-bin.000001 27907 Write_rows 1 27941 table_id: 25 flags: STMT_END_F +master-bin.000001 27941 Table_map 1 27980 table_id: 25 (test.t1) +master-bin.000001 27980 Write_rows 1 28014 table_id: 25 flags: STMT_END_F +master-bin.000001 28014 Table_map 1 28053 table_id: 25 (test.t1) +master-bin.000001 28053 Write_rows 1 28087 table_id: 25 flags: STMT_END_F +master-bin.000001 28087 Table_map 1 28126 table_id: 25 (test.t1) +master-bin.000001 28126 Write_rows 1 28160 table_id: 25 flags: STMT_END_F +master-bin.000001 28160 Table_map 1 28199 table_id: 25 (test.t1) +master-bin.000001 28199 Write_rows 1 28233 table_id: 25 flags: STMT_END_F +master-bin.000001 28233 Table_map 1 28272 table_id: 25 (test.t1) +master-bin.000001 28272 Write_rows 1 28306 table_id: 25 flags: STMT_END_F +master-bin.000001 28306 Table_map 1 28345 table_id: 25 (test.t1) +master-bin.000001 28345 Write_rows 1 28379 table_id: 25 flags: STMT_END_F +master-bin.000001 28379 Table_map 1 28418 table_id: 25 (test.t1) +master-bin.000001 28418 Write_rows 1 28452 table_id: 25 flags: STMT_END_F +master-bin.000001 28452 Table_map 1 28491 table_id: 25 (test.t1) +master-bin.000001 28491 Write_rows 1 28525 table_id: 25 flags: STMT_END_F +master-bin.000001 28525 Table_map 1 28564 table_id: 25 (test.t1) +master-bin.000001 28564 Write_rows 1 28598 table_id: 25 flags: STMT_END_F +master-bin.000001 28598 Table_map 1 28637 table_id: 25 (test.t1) +master-bin.000001 28637 Write_rows 1 28671 table_id: 25 flags: STMT_END_F +master-bin.000001 28671 Table_map 1 28710 table_id: 25 (test.t1) +master-bin.000001 28710 Write_rows 1 28744 table_id: 25 flags: STMT_END_F +master-bin.000001 28744 Table_map 1 28783 table_id: 25 (test.t1) +master-bin.000001 28783 Write_rows 1 28817 table_id: 25 flags: STMT_END_F +master-bin.000001 28817 Table_map 1 28856 table_id: 25 (test.t1) +master-bin.000001 28856 Write_rows 1 28890 table_id: 25 flags: STMT_END_F +master-bin.000001 28890 Table_map 1 28929 table_id: 25 (test.t1) +master-bin.000001 28929 Write_rows 1 28963 table_id: 25 flags: STMT_END_F +master-bin.000001 28963 Table_map 1 29002 table_id: 25 (test.t1) +master-bin.000001 29002 Write_rows 1 29036 table_id: 25 flags: STMT_END_F +master-bin.000001 29036 Table_map 1 29075 table_id: 25 (test.t1) +master-bin.000001 29075 Write_rows 1 29109 table_id: 25 flags: STMT_END_F +master-bin.000001 29109 Table_map 1 29148 table_id: 25 (test.t1) +master-bin.000001 29148 Write_rows 1 29182 table_id: 25 flags: STMT_END_F +master-bin.000001 29182 Table_map 1 29221 table_id: 25 (test.t1) +master-bin.000001 29221 Write_rows 1 29255 table_id: 25 flags: STMT_END_F +master-bin.000001 29255 Table_map 1 29294 table_id: 25 (test.t1) +master-bin.000001 29294 Write_rows 1 29328 table_id: 25 flags: STMT_END_F +master-bin.000001 29328 Table_map 1 29367 table_id: 25 (test.t1) +master-bin.000001 29367 Write_rows 1 29401 table_id: 25 flags: STMT_END_F +master-bin.000001 29401 Table_map 1 29440 table_id: 25 (test.t1) +master-bin.000001 29440 Write_rows 1 29474 table_id: 25 flags: STMT_END_F +master-bin.000001 29474 Xid 1 29501 COMMIT /* xid=189 */ +master-bin.000001 29501 Rotate 1 29545 master-bin.000002;pos=4 +drop table t1; +set global binlog_cache_size=@bcs; +set session autocommit = @ac; +End of 5.0 tests reset master; create table t1 (id tinyint auto_increment primary key); set insert_id=128; diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result index 1bc7430fde0..45fef628357 100644 --- a/mysql-test/r/binlog_stm_binlog.result +++ b/mysql-test/r/binlog_stm_binlog.result @@ -260,6 +260,422 @@ master-bin.000001 293 Query 1 381 use `test`; insert into t1 values (5) master-bin.000001 381 Query 1 469 use `test`; insert into t1 values (6) master-bin.000001 469 Query 1 545 use `test`; drop table t1 set session autocommit = @ac; +set @bcs = @@binlog_cache_size; +set @ac = @@autocommit; +set global binlog_cache_size=4096; +set autocommit= 0; +reset master; +create table t1 (a int) engine=innodb; +show binlog events from 0; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 4 Format_desc 1 106 Server ver: 5.1.21-beta-debug-log, Binlog ver: 4 +master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb +master-bin.000001 206 Query 1 274 use `test`; BEGIN +master-bin.000001 274 Query 1 365 use `test`; insert into t1 values( 400 ) +master-bin.000001 365 Query 1 456 use `test`; insert into t1 values( 399 ) +master-bin.000001 456 Query 1 547 use `test`; insert into t1 values( 398 ) +master-bin.000001 547 Query 1 638 use `test`; insert into t1 values( 397 ) +master-bin.000001 638 Query 1 729 use `test`; insert into t1 values( 396 ) +master-bin.000001 729 Query 1 820 use `test`; insert into t1 values( 395 ) +master-bin.000001 820 Query 1 911 use `test`; insert into t1 values( 394 ) +master-bin.000001 911 Query 1 1002 use `test`; insert into t1 values( 393 ) +master-bin.000001 1002 Query 1 1093 use `test`; insert into t1 values( 392 ) +master-bin.000001 1093 Query 1 1184 use `test`; insert into t1 values( 391 ) +master-bin.000001 1184 Query 1 1275 use `test`; insert into t1 values( 390 ) +master-bin.000001 1275 Query 1 1366 use `test`; insert into t1 values( 389 ) +master-bin.000001 1366 Query 1 1457 use `test`; insert into t1 values( 388 ) +master-bin.000001 1457 Query 1 1548 use `test`; insert into t1 values( 387 ) +master-bin.000001 1548 Query 1 1639 use `test`; insert into t1 values( 386 ) +master-bin.000001 1639 Query 1 1730 use `test`; insert into t1 values( 385 ) +master-bin.000001 1730 Query 1 1821 use `test`; insert into t1 values( 384 ) +master-bin.000001 1821 Query 1 1912 use `test`; insert into t1 values( 383 ) +master-bin.000001 1912 Query 1 2003 use `test`; insert into t1 values( 382 ) +master-bin.000001 2003 Query 1 2094 use `test`; insert into t1 values( 381 ) +master-bin.000001 2094 Query 1 2185 use `test`; insert into t1 values( 380 ) +master-bin.000001 2185 Query 1 2276 use `test`; insert into t1 values( 379 ) +master-bin.000001 2276 Query 1 2367 use `test`; insert into t1 values( 378 ) +master-bin.000001 2367 Query 1 2458 use `test`; insert into t1 values( 377 ) +master-bin.000001 2458 Query 1 2549 use `test`; insert into t1 values( 376 ) +master-bin.000001 2549 Query 1 2640 use `test`; insert into t1 values( 375 ) +master-bin.000001 2640 Query 1 2731 use `test`; insert into t1 values( 374 ) +master-bin.000001 2731 Query 1 2822 use `test`; insert into t1 values( 373 ) +master-bin.000001 2822 Query 1 2913 use `test`; insert into t1 values( 372 ) +master-bin.000001 2913 Query 1 3004 use `test`; insert into t1 values( 371 ) +master-bin.000001 3004 Query 1 3095 use `test`; insert into t1 values( 370 ) +master-bin.000001 3095 Query 1 3186 use `test`; insert into t1 values( 369 ) +master-bin.000001 3186 Query 1 3277 use `test`; insert into t1 values( 368 ) +master-bin.000001 3277 Query 1 3368 use `test`; insert into t1 values( 367 ) +master-bin.000001 3368 Query 1 3459 use `test`; insert into t1 values( 366 ) +master-bin.000001 3459 Query 1 3550 use `test`; insert into t1 values( 365 ) +master-bin.000001 3550 Query 1 3641 use `test`; insert into t1 values( 364 ) +master-bin.000001 3641 Query 1 3732 use `test`; insert into t1 values( 363 ) +master-bin.000001 3732 Query 1 3823 use `test`; insert into t1 values( 362 ) +master-bin.000001 3823 Query 1 3914 use `test`; insert into t1 values( 361 ) +master-bin.000001 3914 Query 1 4005 use `test`; insert into t1 values( 360 ) +master-bin.000001 4005 Query 1 4096 use `test`; insert into t1 values( 359 ) +master-bin.000001 4096 Query 1 4187 use `test`; insert into t1 values( 358 ) +master-bin.000001 4187 Query 1 4278 use `test`; insert into t1 values( 357 ) +master-bin.000001 4278 Query 1 4369 use `test`; insert into t1 values( 356 ) +master-bin.000001 4369 Query 1 4460 use `test`; insert into t1 values( 355 ) +master-bin.000001 4460 Query 1 4551 use `test`; insert into t1 values( 354 ) +master-bin.000001 4551 Query 1 4642 use `test`; insert into t1 values( 353 ) +master-bin.000001 4642 Query 1 4733 use `test`; insert into t1 values( 352 ) +master-bin.000001 4733 Query 1 4824 use `test`; insert into t1 values( 351 ) +master-bin.000001 4824 Query 1 4915 use `test`; insert into t1 values( 350 ) +master-bin.000001 4915 Query 1 5006 use `test`; insert into t1 values( 349 ) +master-bin.000001 5006 Query 1 5097 use `test`; insert into t1 values( 348 ) +master-bin.000001 5097 Query 1 5188 use `test`; insert into t1 values( 347 ) +master-bin.000001 5188 Query 1 5279 use `test`; insert into t1 values( 346 ) +master-bin.000001 5279 Query 1 5370 use `test`; insert into t1 values( 345 ) +master-bin.000001 5370 Query 1 5461 use `test`; insert into t1 values( 344 ) +master-bin.000001 5461 Query 1 5552 use `test`; insert into t1 values( 343 ) +master-bin.000001 5552 Query 1 5643 use `test`; insert into t1 values( 342 ) +master-bin.000001 5643 Query 1 5734 use `test`; insert into t1 values( 341 ) +master-bin.000001 5734 Query 1 5825 use `test`; insert into t1 values( 340 ) +master-bin.000001 5825 Query 1 5916 use `test`; insert into t1 values( 339 ) +master-bin.000001 5916 Query 1 6007 use `test`; insert into t1 values( 338 ) +master-bin.000001 6007 Query 1 6098 use `test`; insert into t1 values( 337 ) +master-bin.000001 6098 Query 1 6189 use `test`; insert into t1 values( 336 ) +master-bin.000001 6189 Query 1 6280 use `test`; insert into t1 values( 335 ) +master-bin.000001 6280 Query 1 6371 use `test`; insert into t1 values( 334 ) +master-bin.000001 6371 Query 1 6462 use `test`; insert into t1 values( 333 ) +master-bin.000001 6462 Query 1 6553 use `test`; insert into t1 values( 332 ) +master-bin.000001 6553 Query 1 6644 use `test`; insert into t1 values( 331 ) +master-bin.000001 6644 Query 1 6735 use `test`; insert into t1 values( 330 ) +master-bin.000001 6735 Query 1 6826 use `test`; insert into t1 values( 329 ) +master-bin.000001 6826 Query 1 6917 use `test`; insert into t1 values( 328 ) +master-bin.000001 6917 Query 1 7008 use `test`; insert into t1 values( 327 ) +master-bin.000001 7008 Query 1 7099 use `test`; insert into t1 values( 326 ) +master-bin.000001 7099 Query 1 7190 use `test`; insert into t1 values( 325 ) +master-bin.000001 7190 Query 1 7281 use `test`; insert into t1 values( 324 ) +master-bin.000001 7281 Query 1 7372 use `test`; insert into t1 values( 323 ) +master-bin.000001 7372 Query 1 7463 use `test`; insert into t1 values( 322 ) +master-bin.000001 7463 Query 1 7554 use `test`; insert into t1 values( 321 ) +master-bin.000001 7554 Query 1 7645 use `test`; insert into t1 values( 320 ) +master-bin.000001 7645 Query 1 7736 use `test`; insert into t1 values( 319 ) +master-bin.000001 7736 Query 1 7827 use `test`; insert into t1 values( 318 ) +master-bin.000001 7827 Query 1 7918 use `test`; insert into t1 values( 317 ) +master-bin.000001 7918 Query 1 8009 use `test`; insert into t1 values( 316 ) +master-bin.000001 8009 Query 1 8100 use `test`; insert into t1 values( 315 ) +master-bin.000001 8100 Query 1 8191 use `test`; insert into t1 values( 314 ) +master-bin.000001 8191 Query 1 8282 use `test`; insert into t1 values( 313 ) +master-bin.000001 8282 Query 1 8373 use `test`; insert into t1 values( 312 ) +master-bin.000001 8373 Query 1 8464 use `test`; insert into t1 values( 311 ) +master-bin.000001 8464 Query 1 8555 use `test`; insert into t1 values( 310 ) +master-bin.000001 8555 Query 1 8646 use `test`; insert into t1 values( 309 ) +master-bin.000001 8646 Query 1 8737 use `test`; insert into t1 values( 308 ) +master-bin.000001 8737 Query 1 8828 use `test`; insert into t1 values( 307 ) +master-bin.000001 8828 Query 1 8919 use `test`; insert into t1 values( 306 ) +master-bin.000001 8919 Query 1 9010 use `test`; insert into t1 values( 305 ) +master-bin.000001 9010 Query 1 9101 use `test`; insert into t1 values( 304 ) +master-bin.000001 9101 Query 1 9192 use `test`; insert into t1 values( 303 ) +master-bin.000001 9192 Query 1 9283 use `test`; insert into t1 values( 302 ) +master-bin.000001 9283 Query 1 9374 use `test`; insert into t1 values( 301 ) +master-bin.000001 9374 Query 1 9465 use `test`; insert into t1 values( 300 ) +master-bin.000001 9465 Query 1 9556 use `test`; insert into t1 values( 299 ) +master-bin.000001 9556 Query 1 9647 use `test`; insert into t1 values( 298 ) +master-bin.000001 9647 Query 1 9738 use `test`; insert into t1 values( 297 ) +master-bin.000001 9738 Query 1 9829 use `test`; insert into t1 values( 296 ) +master-bin.000001 9829 Query 1 9920 use `test`; insert into t1 values( 295 ) +master-bin.000001 9920 Query 1 10011 use `test`; insert into t1 values( 294 ) +master-bin.000001 10011 Query 1 10102 use `test`; insert into t1 values( 293 ) +master-bin.000001 10102 Query 1 10193 use `test`; insert into t1 values( 292 ) +master-bin.000001 10193 Query 1 10284 use `test`; insert into t1 values( 291 ) +master-bin.000001 10284 Query 1 10375 use `test`; insert into t1 values( 290 ) +master-bin.000001 10375 Query 1 10466 use `test`; insert into t1 values( 289 ) +master-bin.000001 10466 Query 1 10557 use `test`; insert into t1 values( 288 ) +master-bin.000001 10557 Query 1 10648 use `test`; insert into t1 values( 287 ) +master-bin.000001 10648 Query 1 10739 use `test`; insert into t1 values( 286 ) +master-bin.000001 10739 Query 1 10830 use `test`; insert into t1 values( 285 ) +master-bin.000001 10830 Query 1 10921 use `test`; insert into t1 values( 284 ) +master-bin.000001 10921 Query 1 11012 use `test`; insert into t1 values( 283 ) +master-bin.000001 11012 Query 1 11103 use `test`; insert into t1 values( 282 ) +master-bin.000001 11103 Query 1 11194 use `test`; insert into t1 values( 281 ) +master-bin.000001 11194 Query 1 11285 use `test`; insert into t1 values( 280 ) +master-bin.000001 11285 Query 1 11376 use `test`; insert into t1 values( 279 ) +master-bin.000001 11376 Query 1 11467 use `test`; insert into t1 values( 278 ) +master-bin.000001 11467 Query 1 11558 use `test`; insert into t1 values( 277 ) +master-bin.000001 11558 Query 1 11649 use `test`; insert into t1 values( 276 ) +master-bin.000001 11649 Query 1 11740 use `test`; insert into t1 values( 275 ) +master-bin.000001 11740 Query 1 11831 use `test`; insert into t1 values( 274 ) +master-bin.000001 11831 Query 1 11922 use `test`; insert into t1 values( 273 ) +master-bin.000001 11922 Query 1 12013 use `test`; insert into t1 values( 272 ) +master-bin.000001 12013 Query 1 12104 use `test`; insert into t1 values( 271 ) +master-bin.000001 12104 Query 1 12195 use `test`; insert into t1 values( 270 ) +master-bin.000001 12195 Query 1 12286 use `test`; insert into t1 values( 269 ) +master-bin.000001 12286 Query 1 12377 use `test`; insert into t1 values( 268 ) +master-bin.000001 12377 Query 1 12468 use `test`; insert into t1 values( 267 ) +master-bin.000001 12468 Query 1 12559 use `test`; insert into t1 values( 266 ) +master-bin.000001 12559 Query 1 12650 use `test`; insert into t1 values( 265 ) +master-bin.000001 12650 Query 1 12741 use `test`; insert into t1 values( 264 ) +master-bin.000001 12741 Query 1 12832 use `test`; insert into t1 values( 263 ) +master-bin.000001 12832 Query 1 12923 use `test`; insert into t1 values( 262 ) +master-bin.000001 12923 Query 1 13014 use `test`; insert into t1 values( 261 ) +master-bin.000001 13014 Query 1 13105 use `test`; insert into t1 values( 260 ) +master-bin.000001 13105 Query 1 13196 use `test`; insert into t1 values( 259 ) +master-bin.000001 13196 Query 1 13287 use `test`; insert into t1 values( 258 ) +master-bin.000001 13287 Query 1 13378 use `test`; insert into t1 values( 257 ) +master-bin.000001 13378 Query 1 13469 use `test`; insert into t1 values( 256 ) +master-bin.000001 13469 Query 1 13560 use `test`; insert into t1 values( 255 ) +master-bin.000001 13560 Query 1 13651 use `test`; insert into t1 values( 254 ) +master-bin.000001 13651 Query 1 13742 use `test`; insert into t1 values( 253 ) +master-bin.000001 13742 Query 1 13833 use `test`; insert into t1 values( 252 ) +master-bin.000001 13833 Query 1 13924 use `test`; insert into t1 values( 251 ) +master-bin.000001 13924 Query 1 14015 use `test`; insert into t1 values( 250 ) +master-bin.000001 14015 Query 1 14106 use `test`; insert into t1 values( 249 ) +master-bin.000001 14106 Query 1 14197 use `test`; insert into t1 values( 248 ) +master-bin.000001 14197 Query 1 14288 use `test`; insert into t1 values( 247 ) +master-bin.000001 14288 Query 1 14379 use `test`; insert into t1 values( 246 ) +master-bin.000001 14379 Query 1 14470 use `test`; insert into t1 values( 245 ) +master-bin.000001 14470 Query 1 14561 use `test`; insert into t1 values( 244 ) +master-bin.000001 14561 Query 1 14652 use `test`; insert into t1 values( 243 ) +master-bin.000001 14652 Query 1 14743 use `test`; insert into t1 values( 242 ) +master-bin.000001 14743 Query 1 14834 use `test`; insert into t1 values( 241 ) +master-bin.000001 14834 Query 1 14925 use `test`; insert into t1 values( 240 ) +master-bin.000001 14925 Query 1 15016 use `test`; insert into t1 values( 239 ) +master-bin.000001 15016 Query 1 15107 use `test`; insert into t1 values( 238 ) +master-bin.000001 15107 Query 1 15198 use `test`; insert into t1 values( 237 ) +master-bin.000001 15198 Query 1 15289 use `test`; insert into t1 values( 236 ) +master-bin.000001 15289 Query 1 15380 use `test`; insert into t1 values( 235 ) +master-bin.000001 15380 Query 1 15471 use `test`; insert into t1 values( 234 ) +master-bin.000001 15471 Query 1 15562 use `test`; insert into t1 values( 233 ) +master-bin.000001 15562 Query 1 15653 use `test`; insert into t1 values( 232 ) +master-bin.000001 15653 Query 1 15744 use `test`; insert into t1 values( 231 ) +master-bin.000001 15744 Query 1 15835 use `test`; insert into t1 values( 230 ) +master-bin.000001 15835 Query 1 15926 use `test`; insert into t1 values( 229 ) +master-bin.000001 15926 Query 1 16017 use `test`; insert into t1 values( 228 ) +master-bin.000001 16017 Query 1 16108 use `test`; insert into t1 values( 227 ) +master-bin.000001 16108 Query 1 16199 use `test`; insert into t1 values( 226 ) +master-bin.000001 16199 Query 1 16290 use `test`; insert into t1 values( 225 ) +master-bin.000001 16290 Query 1 16381 use `test`; insert into t1 values( 224 ) +master-bin.000001 16381 Query 1 16472 use `test`; insert into t1 values( 223 ) +master-bin.000001 16472 Query 1 16563 use `test`; insert into t1 values( 222 ) +master-bin.000001 16563 Query 1 16654 use `test`; insert into t1 values( 221 ) +master-bin.000001 16654 Query 1 16745 use `test`; insert into t1 values( 220 ) +master-bin.000001 16745 Query 1 16836 use `test`; insert into t1 values( 219 ) +master-bin.000001 16836 Query 1 16927 use `test`; insert into t1 values( 218 ) +master-bin.000001 16927 Query 1 17018 use `test`; insert into t1 values( 217 ) +master-bin.000001 17018 Query 1 17109 use `test`; insert into t1 values( 216 ) +master-bin.000001 17109 Query 1 17200 use `test`; insert into t1 values( 215 ) +master-bin.000001 17200 Query 1 17291 use `test`; insert into t1 values( 214 ) +master-bin.000001 17291 Query 1 17382 use `test`; insert into t1 values( 213 ) +master-bin.000001 17382 Query 1 17473 use `test`; insert into t1 values( 212 ) +master-bin.000001 17473 Query 1 17564 use `test`; insert into t1 values( 211 ) +master-bin.000001 17564 Query 1 17655 use `test`; insert into t1 values( 210 ) +master-bin.000001 17655 Query 1 17746 use `test`; insert into t1 values( 209 ) +master-bin.000001 17746 Query 1 17837 use `test`; insert into t1 values( 208 ) +master-bin.000001 17837 Query 1 17928 use `test`; insert into t1 values( 207 ) +master-bin.000001 17928 Query 1 18019 use `test`; insert into t1 values( 206 ) +master-bin.000001 18019 Query 1 18110 use `test`; insert into t1 values( 205 ) +master-bin.000001 18110 Query 1 18201 use `test`; insert into t1 values( 204 ) +master-bin.000001 18201 Query 1 18292 use `test`; insert into t1 values( 203 ) +master-bin.000001 18292 Query 1 18383 use `test`; insert into t1 values( 202 ) +master-bin.000001 18383 Query 1 18474 use `test`; insert into t1 values( 201 ) +master-bin.000001 18474 Query 1 18565 use `test`; insert into t1 values( 200 ) +master-bin.000001 18565 Query 1 18656 use `test`; insert into t1 values( 199 ) +master-bin.000001 18656 Query 1 18747 use `test`; insert into t1 values( 198 ) +master-bin.000001 18747 Query 1 18838 use `test`; insert into t1 values( 197 ) +master-bin.000001 18838 Query 1 18929 use `test`; insert into t1 values( 196 ) +master-bin.000001 18929 Query 1 19020 use `test`; insert into t1 values( 195 ) +master-bin.000001 19020 Query 1 19111 use `test`; insert into t1 values( 194 ) +master-bin.000001 19111 Query 1 19202 use `test`; insert into t1 values( 193 ) +master-bin.000001 19202 Query 1 19293 use `test`; insert into t1 values( 192 ) +master-bin.000001 19293 Query 1 19384 use `test`; insert into t1 values( 191 ) +master-bin.000001 19384 Query 1 19475 use `test`; insert into t1 values( 190 ) +master-bin.000001 19475 Query 1 19566 use `test`; insert into t1 values( 189 ) +master-bin.000001 19566 Query 1 19657 use `test`; insert into t1 values( 188 ) +master-bin.000001 19657 Query 1 19748 use `test`; insert into t1 values( 187 ) +master-bin.000001 19748 Query 1 19839 use `test`; insert into t1 values( 186 ) +master-bin.000001 19839 Query 1 19930 use `test`; insert into t1 values( 185 ) +master-bin.000001 19930 Query 1 20021 use `test`; insert into t1 values( 184 ) +master-bin.000001 20021 Query 1 20112 use `test`; insert into t1 values( 183 ) +master-bin.000001 20112 Query 1 20203 use `test`; insert into t1 values( 182 ) +master-bin.000001 20203 Query 1 20294 use `test`; insert into t1 values( 181 ) +master-bin.000001 20294 Query 1 20385 use `test`; insert into t1 values( 180 ) +master-bin.000001 20385 Query 1 20476 use `test`; insert into t1 values( 179 ) +master-bin.000001 20476 Query 1 20567 use `test`; insert into t1 values( 178 ) +master-bin.000001 20567 Query 1 20658 use `test`; insert into t1 values( 177 ) +master-bin.000001 20658 Query 1 20749 use `test`; insert into t1 values( 176 ) +master-bin.000001 20749 Query 1 20840 use `test`; insert into t1 values( 175 ) +master-bin.000001 20840 Query 1 20931 use `test`; insert into t1 values( 174 ) +master-bin.000001 20931 Query 1 21022 use `test`; insert into t1 values( 173 ) +master-bin.000001 21022 Query 1 21113 use `test`; insert into t1 values( 172 ) +master-bin.000001 21113 Query 1 21204 use `test`; insert into t1 values( 171 ) +master-bin.000001 21204 Query 1 21295 use `test`; insert into t1 values( 170 ) +master-bin.000001 21295 Query 1 21386 use `test`; insert into t1 values( 169 ) +master-bin.000001 21386 Query 1 21477 use `test`; insert into t1 values( 168 ) +master-bin.000001 21477 Query 1 21568 use `test`; insert into t1 values( 167 ) +master-bin.000001 21568 Query 1 21659 use `test`; insert into t1 values( 166 ) +master-bin.000001 21659 Query 1 21750 use `test`; insert into t1 values( 165 ) +master-bin.000001 21750 Query 1 21841 use `test`; insert into t1 values( 164 ) +master-bin.000001 21841 Query 1 21932 use `test`; insert into t1 values( 163 ) +master-bin.000001 21932 Query 1 22023 use `test`; insert into t1 values( 162 ) +master-bin.000001 22023 Query 1 22114 use `test`; insert into t1 values( 161 ) +master-bin.000001 22114 Query 1 22205 use `test`; insert into t1 values( 160 ) +master-bin.000001 22205 Query 1 22296 use `test`; insert into t1 values( 159 ) +master-bin.000001 22296 Query 1 22387 use `test`; insert into t1 values( 158 ) +master-bin.000001 22387 Query 1 22478 use `test`; insert into t1 values( 157 ) +master-bin.000001 22478 Query 1 22569 use `test`; insert into t1 values( 156 ) +master-bin.000001 22569 Query 1 22660 use `test`; insert into t1 values( 155 ) +master-bin.000001 22660 Query 1 22751 use `test`; insert into t1 values( 154 ) +master-bin.000001 22751 Query 1 22842 use `test`; insert into t1 values( 153 ) +master-bin.000001 22842 Query 1 22933 use `test`; insert into t1 values( 152 ) +master-bin.000001 22933 Query 1 23024 use `test`; insert into t1 values( 151 ) +master-bin.000001 23024 Query 1 23115 use `test`; insert into t1 values( 150 ) +master-bin.000001 23115 Query 1 23206 use `test`; insert into t1 values( 149 ) +master-bin.000001 23206 Query 1 23297 use `test`; insert into t1 values( 148 ) +master-bin.000001 23297 Query 1 23388 use `test`; insert into t1 values( 147 ) +master-bin.000001 23388 Query 1 23479 use `test`; insert into t1 values( 146 ) +master-bin.000001 23479 Query 1 23570 use `test`; insert into t1 values( 145 ) +master-bin.000001 23570 Query 1 23661 use `test`; insert into t1 values( 144 ) +master-bin.000001 23661 Query 1 23752 use `test`; insert into t1 values( 143 ) +master-bin.000001 23752 Query 1 23843 use `test`; insert into t1 values( 142 ) +master-bin.000001 23843 Query 1 23934 use `test`; insert into t1 values( 141 ) +master-bin.000001 23934 Query 1 24025 use `test`; insert into t1 values( 140 ) +master-bin.000001 24025 Query 1 24116 use `test`; insert into t1 values( 139 ) +master-bin.000001 24116 Query 1 24207 use `test`; insert into t1 values( 138 ) +master-bin.000001 24207 Query 1 24298 use `test`; insert into t1 values( 137 ) +master-bin.000001 24298 Query 1 24389 use `test`; insert into t1 values( 136 ) +master-bin.000001 24389 Query 1 24480 use `test`; insert into t1 values( 135 ) +master-bin.000001 24480 Query 1 24571 use `test`; insert into t1 values( 134 ) +master-bin.000001 24571 Query 1 24662 use `test`; insert into t1 values( 133 ) +master-bin.000001 24662 Query 1 24753 use `test`; insert into t1 values( 132 ) +master-bin.000001 24753 Query 1 24844 use `test`; insert into t1 values( 131 ) +master-bin.000001 24844 Query 1 24935 use `test`; insert into t1 values( 130 ) +master-bin.000001 24935 Query 1 25026 use `test`; insert into t1 values( 129 ) +master-bin.000001 25026 Query 1 25117 use `test`; insert into t1 values( 128 ) +master-bin.000001 25117 Query 1 25208 use `test`; insert into t1 values( 127 ) +master-bin.000001 25208 Query 1 25299 use `test`; insert into t1 values( 126 ) +master-bin.000001 25299 Query 1 25390 use `test`; insert into t1 values( 125 ) +master-bin.000001 25390 Query 1 25481 use `test`; insert into t1 values( 124 ) +master-bin.000001 25481 Query 1 25572 use `test`; insert into t1 values( 123 ) +master-bin.000001 25572 Query 1 25663 use `test`; insert into t1 values( 122 ) +master-bin.000001 25663 Query 1 25754 use `test`; insert into t1 values( 121 ) +master-bin.000001 25754 Query 1 25845 use `test`; insert into t1 values( 120 ) +master-bin.000001 25845 Query 1 25936 use `test`; insert into t1 values( 119 ) +master-bin.000001 25936 Query 1 26027 use `test`; insert into t1 values( 118 ) +master-bin.000001 26027 Query 1 26118 use `test`; insert into t1 values( 117 ) +master-bin.000001 26118 Query 1 26209 use `test`; insert into t1 values( 116 ) +master-bin.000001 26209 Query 1 26300 use `test`; insert into t1 values( 115 ) +master-bin.000001 26300 Query 1 26391 use `test`; insert into t1 values( 114 ) +master-bin.000001 26391 Query 1 26482 use `test`; insert into t1 values( 113 ) +master-bin.000001 26482 Query 1 26573 use `test`; insert into t1 values( 112 ) +master-bin.000001 26573 Query 1 26664 use `test`; insert into t1 values( 111 ) +master-bin.000001 26664 Query 1 26755 use `test`; insert into t1 values( 110 ) +master-bin.000001 26755 Query 1 26846 use `test`; insert into t1 values( 109 ) +master-bin.000001 26846 Query 1 26937 use `test`; insert into t1 values( 108 ) +master-bin.000001 26937 Query 1 27028 use `test`; insert into t1 values( 107 ) +master-bin.000001 27028 Query 1 27119 use `test`; insert into t1 values( 106 ) +master-bin.000001 27119 Query 1 27210 use `test`; insert into t1 values( 105 ) +master-bin.000001 27210 Query 1 27301 use `test`; insert into t1 values( 104 ) +master-bin.000001 27301 Query 1 27392 use `test`; insert into t1 values( 103 ) +master-bin.000001 27392 Query 1 27483 use `test`; insert into t1 values( 102 ) +master-bin.000001 27483 Query 1 27574 use `test`; insert into t1 values( 101 ) +master-bin.000001 27574 Query 1 27665 use `test`; insert into t1 values( 100 ) +master-bin.000001 27665 Query 1 27755 use `test`; insert into t1 values( 99 ) +master-bin.000001 27755 Query 1 27845 use `test`; insert into t1 values( 98 ) +master-bin.000001 27845 Query 1 27935 use `test`; insert into t1 values( 97 ) +master-bin.000001 27935 Query 1 28025 use `test`; insert into t1 values( 96 ) +master-bin.000001 28025 Query 1 28115 use `test`; insert into t1 values( 95 ) +master-bin.000001 28115 Query 1 28205 use `test`; insert into t1 values( 94 ) +master-bin.000001 28205 Query 1 28295 use `test`; insert into t1 values( 93 ) +master-bin.000001 28295 Query 1 28385 use `test`; insert into t1 values( 92 ) +master-bin.000001 28385 Query 1 28475 use `test`; insert into t1 values( 91 ) +master-bin.000001 28475 Query 1 28565 use `test`; insert into t1 values( 90 ) +master-bin.000001 28565 Query 1 28655 use `test`; insert into t1 values( 89 ) +master-bin.000001 28655 Query 1 28745 use `test`; insert into t1 values( 88 ) +master-bin.000001 28745 Query 1 28835 use `test`; insert into t1 values( 87 ) +master-bin.000001 28835 Query 1 28925 use `test`; insert into t1 values( 86 ) +master-bin.000001 28925 Query 1 29015 use `test`; insert into t1 values( 85 ) +master-bin.000001 29015 Query 1 29105 use `test`; insert into t1 values( 84 ) +master-bin.000001 29105 Query 1 29195 use `test`; insert into t1 values( 83 ) +master-bin.000001 29195 Query 1 29285 use `test`; insert into t1 values( 82 ) +master-bin.000001 29285 Query 1 29375 use `test`; insert into t1 values( 81 ) +master-bin.000001 29375 Query 1 29465 use `test`; insert into t1 values( 80 ) +master-bin.000001 29465 Query 1 29555 use `test`; insert into t1 values( 79 ) +master-bin.000001 29555 Query 1 29645 use `test`; insert into t1 values( 78 ) +master-bin.000001 29645 Query 1 29735 use `test`; insert into t1 values( 77 ) +master-bin.000001 29735 Query 1 29825 use `test`; insert into t1 values( 76 ) +master-bin.000001 29825 Query 1 29915 use `test`; insert into t1 values( 75 ) +master-bin.000001 29915 Query 1 30005 use `test`; insert into t1 values( 74 ) +master-bin.000001 30005 Query 1 30095 use `test`; insert into t1 values( 73 ) +master-bin.000001 30095 Query 1 30185 use `test`; insert into t1 values( 72 ) +master-bin.000001 30185 Query 1 30275 use `test`; insert into t1 values( 71 ) +master-bin.000001 30275 Query 1 30365 use `test`; insert into t1 values( 70 ) +master-bin.000001 30365 Query 1 30455 use `test`; insert into t1 values( 69 ) +master-bin.000001 30455 Query 1 30545 use `test`; insert into t1 values( 68 ) +master-bin.000001 30545 Query 1 30635 use `test`; insert into t1 values( 67 ) +master-bin.000001 30635 Query 1 30725 use `test`; insert into t1 values( 66 ) +master-bin.000001 30725 Query 1 30815 use `test`; insert into t1 values( 65 ) +master-bin.000001 30815 Query 1 30905 use `test`; insert into t1 values( 64 ) +master-bin.000001 30905 Query 1 30995 use `test`; insert into t1 values( 63 ) +master-bin.000001 30995 Query 1 31085 use `test`; insert into t1 values( 62 ) +master-bin.000001 31085 Query 1 31175 use `test`; insert into t1 values( 61 ) +master-bin.000001 31175 Query 1 31265 use `test`; insert into t1 values( 60 ) +master-bin.000001 31265 Query 1 31355 use `test`; insert into t1 values( 59 ) +master-bin.000001 31355 Query 1 31445 use `test`; insert into t1 values( 58 ) +master-bin.000001 31445 Query 1 31535 use `test`; insert into t1 values( 57 ) +master-bin.000001 31535 Query 1 31625 use `test`; insert into t1 values( 56 ) +master-bin.000001 31625 Query 1 31715 use `test`; insert into t1 values( 55 ) +master-bin.000001 31715 Query 1 31805 use `test`; insert into t1 values( 54 ) +master-bin.000001 31805 Query 1 31895 use `test`; insert into t1 values( 53 ) +master-bin.000001 31895 Query 1 31985 use `test`; insert into t1 values( 52 ) +master-bin.000001 31985 Query 1 32075 use `test`; insert into t1 values( 51 ) +master-bin.000001 32075 Query 1 32165 use `test`; insert into t1 values( 50 ) +master-bin.000001 32165 Query 1 32255 use `test`; insert into t1 values( 49 ) +master-bin.000001 32255 Query 1 32345 use `test`; insert into t1 values( 48 ) +master-bin.000001 32345 Query 1 32435 use `test`; insert into t1 values( 47 ) +master-bin.000001 32435 Query 1 32525 use `test`; insert into t1 values( 46 ) +master-bin.000001 32525 Query 1 32615 use `test`; insert into t1 values( 45 ) +master-bin.000001 32615 Query 1 32705 use `test`; insert into t1 values( 44 ) +master-bin.000001 32705 Query 1 32795 use `test`; insert into t1 values( 43 ) +master-bin.000001 32795 Query 1 32885 use `test`; insert into t1 values( 42 ) +master-bin.000001 32885 Query 1 32975 use `test`; insert into t1 values( 41 ) +master-bin.000001 32975 Query 1 33065 use `test`; insert into t1 values( 40 ) +master-bin.000001 33065 Query 1 33155 use `test`; insert into t1 values( 39 ) +master-bin.000001 33155 Query 1 33245 use `test`; insert into t1 values( 38 ) +master-bin.000001 33245 Query 1 33335 use `test`; insert into t1 values( 37 ) +master-bin.000001 33335 Query 1 33425 use `test`; insert into t1 values( 36 ) +master-bin.000001 33425 Query 1 33515 use `test`; insert into t1 values( 35 ) +master-bin.000001 33515 Query 1 33605 use `test`; insert into t1 values( 34 ) +master-bin.000001 33605 Query 1 33695 use `test`; insert into t1 values( 33 ) +master-bin.000001 33695 Query 1 33785 use `test`; insert into t1 values( 32 ) +master-bin.000001 33785 Query 1 33875 use `test`; insert into t1 values( 31 ) +master-bin.000001 33875 Query 1 33965 use `test`; insert into t1 values( 30 ) +master-bin.000001 33965 Query 1 34055 use `test`; insert into t1 values( 29 ) +master-bin.000001 34055 Query 1 34145 use `test`; insert into t1 values( 28 ) +master-bin.000001 34145 Query 1 34235 use `test`; insert into t1 values( 27 ) +master-bin.000001 34235 Query 1 34325 use `test`; insert into t1 values( 26 ) +master-bin.000001 34325 Query 1 34415 use `test`; insert into t1 values( 25 ) +master-bin.000001 34415 Query 1 34505 use `test`; insert into t1 values( 24 ) +master-bin.000001 34505 Query 1 34595 use `test`; insert into t1 values( 23 ) +master-bin.000001 34595 Query 1 34685 use `test`; insert into t1 values( 22 ) +master-bin.000001 34685 Query 1 34775 use `test`; insert into t1 values( 21 ) +master-bin.000001 34775 Query 1 34865 use `test`; insert into t1 values( 20 ) +master-bin.000001 34865 Query 1 34955 use `test`; insert into t1 values( 19 ) +master-bin.000001 34955 Query 1 35045 use `test`; insert into t1 values( 18 ) +master-bin.000001 35045 Query 1 35135 use `test`; insert into t1 values( 17 ) +master-bin.000001 35135 Query 1 35225 use `test`; insert into t1 values( 16 ) +master-bin.000001 35225 Query 1 35315 use `test`; insert into t1 values( 15 ) +master-bin.000001 35315 Query 1 35405 use `test`; insert into t1 values( 14 ) +master-bin.000001 35405 Query 1 35495 use `test`; insert into t1 values( 13 ) +master-bin.000001 35495 Query 1 35585 use `test`; insert into t1 values( 12 ) +master-bin.000001 35585 Query 1 35675 use `test`; insert into t1 values( 11 ) +master-bin.000001 35675 Query 1 35765 use `test`; insert into t1 values( 10 ) +master-bin.000001 35765 Query 1 35854 use `test`; insert into t1 values( 9 ) +master-bin.000001 35854 Query 1 35943 use `test`; insert into t1 values( 8 ) +master-bin.000001 35943 Query 1 36032 use `test`; insert into t1 values( 7 ) +master-bin.000001 36032 Query 1 36121 use `test`; insert into t1 values( 6 ) +master-bin.000001 36121 Query 1 36210 use `test`; insert into t1 values( 5 ) +master-bin.000001 36210 Query 1 36299 use `test`; insert into t1 values( 4 ) +master-bin.000001 36299 Query 1 36388 use `test`; insert into t1 values( 3 ) +master-bin.000001 36388 Query 1 36477 use `test`; insert into t1 values( 2 ) +master-bin.000001 36477 Query 1 36566 use `test`; insert into t1 values( 1 ) +master-bin.000001 36566 Xid 1 36593 COMMIT /* xid=196 */ +master-bin.000001 36593 Rotate 1 36637 master-bin.000002;pos=4 +drop table t1; +set global binlog_cache_size=@bcs; +set session autocommit = @ac; End of 5.0 tests reset master; create table t1 (id tinyint auto_increment primary key); diff --git a/mysql-test/r/rpl_row_create_table.result b/mysql-test/r/rpl_row_create_table.result index e76ce5b962d..f22881bd4a9 100644 --- a/mysql-test/r/rpl_row_create_table.result +++ b/mysql-test/r/rpl_row_create_table.result @@ -279,25 +279,25 @@ Log_name Pos Event_type Server_id End_log_pos Info # 192 Table_map # 231 table_id: # (test.t1) # 231 Write_rows # 275 table_id: # flags: STMT_END_F # 275 Query # 343 use `test`; BEGIN -# 343 Query # 125 use `test`; CREATE TABLE `t2` ( +# 343 Query # 468 use `test`; CREATE TABLE `t2` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 468 Table_map # 164 table_id: # (test.t2) -# 507 Write_rows # 208 table_id: # flags: STMT_END_F +# 468 Table_map # 507 table_id: # (test.t2) +# 507 Write_rows # 551 table_id: # flags: STMT_END_F # 551 Xid # 578 COMMIT /* XID */ # 578 Query # 646 use `test`; BEGIN -# 646 Query # 125 use `test`; CREATE TABLE `t3` ( +# 646 Query # 771 use `test`; CREATE TABLE `t3` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 771 Table_map # 164 table_id: # (test.t3) -# 810 Write_rows # 208 table_id: # flags: STMT_END_F +# 771 Table_map # 810 table_id: # (test.t3) +# 810 Write_rows # 854 table_id: # flags: STMT_END_F # 854 Xid # 881 COMMIT /* XID */ # 881 Query # 949 use `test`; BEGIN -# 949 Query # 125 use `test`; CREATE TABLE `t4` ( +# 949 Query # 1074 use `test`; CREATE TABLE `t4` ( `a` int(11) DEFAULT NULL ) ENGINE=InnoDB -# 1074 Table_map # 164 table_id: # (test.t4) -# 1113 Write_rows # 208 table_id: # flags: STMT_END_F +# 1074 Table_map # 1113 table_id: # (test.t4) +# 1113 Write_rows # 1157 table_id: # flags: STMT_END_F # 1157 Xid # 1184 COMMIT /* XID */ # 1184 Table_map # 1223 table_id: # (test.t1) # 1223 Write_rows # 1267 table_id: # flags: STMT_END_F @@ -371,10 +371,10 @@ Log_name Pos Event_type Server_id End_log_pos Info # 231 Write_rows # 275 table_id: # flags: STMT_END_F # 275 Query # 375 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB # 375 Query # 443 use `test`; BEGIN -# 443 Table_map # 39 table_id: # (test.t2) -# 482 Write_rows # 83 table_id: # flags: STMT_END_F -# 526 Table_map # 122 table_id: # (test.t2) -# 565 Write_rows # 161 table_id: # flags: STMT_END_F +# 443 Table_map # 482 table_id: # (test.t2) +# 482 Write_rows # 526 table_id: # flags: STMT_END_F +# 526 Table_map # 565 table_id: # (test.t2) +# 565 Write_rows # 604 table_id: # flags: STMT_END_F # 604 Xid # 631 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a @@ -396,7 +396,7 @@ SELECT * FROM t2 ORDER BY a; a SHOW BINLOG EVENTS FROM 631; Log_name Pos Event_type Server_id End_log_pos Info -# 631 Query # 80 use `test`; TRUNCATE TABLE t2 +# 631 Query # 711 use `test`; TRUNCATE TABLE t2 # 711 Xid # 738 COMMIT /* XID */ SELECT * FROM t2 ORDER BY a; a diff --git a/sql/log.cc b/sql/log.cc index 5f3ff9b10f7..2821fb399a4 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3995,58 +3995,61 @@ int MYSQL_BIN_LOG::write_cache(IO_CACHE *cache, bool lock_log, bool sync_log) memcpy((char *)cache->read_pos, &header[carry], LOG_EVENT_HEADER_LEN - carry); /* next event header at ... */ - hdr_offs = LOG_EVENT_HEADER_LEN - carry + - uint4korr(&header[EVENT_LEN_OFFSET]); + hdr_offs = uint4korr(&header[EVENT_LEN_OFFSET]) - carry; carry= 0; } /* if there is anything to write, process it. */ - if(likely(bytes > 0)) + if (likely(bytes > 0)) { /* - next header beyond current read-buffer? we'll get it later - (though not necessarily in the very next iteration). + process all event-headers in this (partial) cache. + if next header is beyond current read-buffer, + we'll get it later (though not necessarily in the + very next iteration, just "eventually"). */ - if (hdr_offs >= bytes) - hdr_offs -= bytes; - else + while (hdr_offs < bytes) { + /* + partial header only? save what we can get, process once + we get the rest. + */ - /* process all event-headers in this (partial) cache. */ + if (hdr_offs + LOG_EVENT_HEADER_LEN > bytes) + { + carry= bytes - hdr_offs; + memcpy(header, (char *)cache->read_pos + hdr_offs, carry); + bytes= hdr_offs; + } + else + { + /* we've got a full event-header, and it came in one piece */ - do { + uchar *log_pos= (uchar *)cache->read_pos + hdr_offs + LOG_POS_OFFSET; - /* - partial header only? save what we can get, process once - we get the rest. - */ + /* fix end_log_pos */ + val= uint4korr(log_pos) + group; + int4store(log_pos, val); - if (hdr_offs + LOG_EVENT_HEADER_LEN > bytes) - { - carry= bytes - hdr_offs; - memcpy(header, (char *)cache->read_pos + hdr_offs, carry); - bytes= hdr_offs; - } - else - { - /* we've got a full event-header, and it came in one piece */ + /* next event header at ... */ + log_pos= (uchar *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET; + hdr_offs += uint4korr(log_pos); - uchar *log_pos= (uchar *)cache->read_pos + hdr_offs + LOG_POS_OFFSET; - - /* fix end_log_pos */ - val= uint4korr(log_pos) + group; - int4store(log_pos, val); - - /* next event header at ... */ - log_pos= (uchar *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET; - hdr_offs += uint4korr(log_pos); - - } - } while (hdr_offs < bytes); + } } + + /* + Adjust hdr_offs. Note that this doesn't mean it will necessarily + be valid in the next iteration; if the current event is very long, + it may take a couple of read-iterations (and subsequent fixings + of hdr_offs) for it to become valid again. + if we had a split header, hdr_offs was already fixed above. + */ + if (carry == 0) + hdr_offs -= bytes; } /* Write data to the binary log file */ From b83c28b2ae07410fedb923b1753ca50bbf2cf5cb Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 30 Jun 2007 18:17:20 +0200 Subject: [PATCH 059/227] Post-merge fixes. sql/ha_partition.cc: Post-merge fixes. The new function HA_EXTRA_INSERT_WITH_UPDATE needs to be handled in ha_partition::extra(). storage/federated/ha_federated.cc: Post-merge fixes. Removed leftover characters. Added a missing brace. Fixed and improved parenthesis handling in ha_federated::append_stmt_insert(). Moved code from HA_EXTRA_RESET to ha_federated::reset(). storage/federated/ha_federated.h: Post-merge fixes. Changed byte to uchar. Added declaration for ha_federated::reset(). --- sql/ha_partition.cc | 9 +++++ storage/federated/ha_federated.cc | 56 +++++++++++++++++++------------ storage/federated/ha_federated.h | 7 ++-- 3 files changed, 48 insertions(+), 24 deletions(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 37e42f7a850..b6a27c8df28 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -4714,6 +4714,12 @@ void ha_partition::get_dynamic_partition_info(PARTITION_INFO *stat_info, HA_EXTRA_KEY_CACHE: HA_EXTRA_NO_KEY_CACHE: This parameters are no longer used and could be removed. + + 7) Parameters only used by federated tables for query processing + ---------------------------------------------------------------- + HA_EXTRA_INSERT_WITH_UPDATE: + Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be + executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY. */ int ha_partition::extra(enum ha_extra_function operation) @@ -4795,6 +4801,9 @@ int ha_partition::extra(enum ha_extra_function operation) */ break; } + /* Category 7), used by federated handlers */ + case HA_EXTRA_INSERT_WITH_UPDATE: + DBUG_RETURN(loop_extra(operation)); default: { /* Temporary crash to discover what is wrong */ diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 18460ad4cfc..635a6fa79e0 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -608,7 +608,7 @@ static int check_foreign_data_source(FEDERATED_SHARE *share, query.append(STRING_WITH_LEN("SELECT * FROM ")); append_ident(&query, share->table_name, share->table_name_length, ident_quote_char); - query.append(STRING_WITH_LEN(" WHERE 1=0"); + query.append(STRING_WITH_LEN(" WHERE 1=0")); if (mysql_real_query(mysql, query.ptr(), query.length())) { @@ -1572,7 +1572,7 @@ static FEDERATED_SHARE *get_share(const char *table_name, TABLE *table) /* chops off trailing comma */ query.length(query.length() - sizeof_trailing_comma); - query.append(STRING_WITH_LEN(" FROM `")); + query.append(STRING_WITH_LEN(" FROM ")); append_ident(&query, tmp_share.table_name, tmp_share.table_name_length, ident_quote_char); @@ -1809,6 +1809,7 @@ bool ha_federated::append_stmt_insert(String *query) char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE]; Field **field; uint tmp_length; + bool added_field= FALSE; /* The main insert query string */ String insert_string(insert_buffer, sizeof(insert_buffer), &my_charset_bin); @@ -1824,8 +1825,8 @@ bool ha_federated::append_stmt_insert(String *query) insert_string.append(STRING_WITH_LEN("INSERT INTO ")); append_ident(&insert_string, share->table_name, share->table_name_length, ident_quote_char); - insert_string.append(FEDERATED_OPENPAREN); - tmp_length= insert_string.length() - strlen(STRING_WITH_LEN(", ")); + tmp_length= insert_string.length(); + insert_string.append(STRING_WITH_LEN(" (")); /* loop through the field pointer array, add any fields to both the values @@ -1846,22 +1847,20 @@ bool ha_federated::append_stmt_insert(String *query) next field is in the write set */ insert_string.append(STRING_WITH_LEN(", ")); + added_field= TRUE; } } - /* - remove trailing comma - */ - insert_string.length(insert_string.length() - sizeof_trailing_comma); - - /* - if there were no fields, we don't want to add a closing paren - AND, we don't want to chop off the last char '(' - insert will be "INSERT INTO t1 VALUES ();" - */ - if (insert_string.length() > tmp_length) + if (added_field) { - insert_string.append(STRING_WITH_LEN(") "); + /* Remove trailing comma. */ + insert_string.length(insert_string.length() - sizeof_trailing_comma); + insert_string.append(STRING_WITH_LEN(") ")); + } + else + { + /* If there were no fields, we don't want to add a closing paren. */ + insert_string.length(tmp_length); } insert_string.append(STRING_WITH_LEN(" VALUES ")); @@ -2371,6 +2370,7 @@ int ha_federated::delete_row(const uchar *buf) delete_string.append(value_quote_char); } delete_string.append(STRING_WITH_LEN(" AND ")); + } } // Remove trailing AND @@ -2974,11 +2974,6 @@ int ha_federated::extra(ha_extra_function operation) case HA_EXTRA_INSERT_WITH_UPDATE: insert_dup_update= TRUE; break; - case HA_EXTRA_RESET: - insert_dup_update= FALSE; - ignore_duplicates= FALSE; - replace_duplicates= FALSE; - break; default: /* do nothing */ DBUG_PRINT("info",("unhandled operation: %d", (uint) operation)); @@ -2987,6 +2982,25 @@ int ha_federated::extra(ha_extra_function operation) } +/** + @brief Reset state of file to after 'open'. + + @detail This function is called after every statement for all tables + used by that statement. + + @return Operation status + @retval 0 OK +*/ + +int ha_federated::reset(void) +{ + insert_dup_update= FALSE; + ignore_duplicates= FALSE; + replace_duplicates= FALSE; + return 0; +} + + /* Used to delete all rows in a table. Both for cases of truncate and for cases where the optimizer realizes that all rows will be diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index 399451888e2..3443194817b 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -107,9 +107,9 @@ private: bool append_stmt_insert(String *query); - int read_next(byte *buf, MYSQL_RES *result); - int index_read_idx_with_result_set(byte *buf, uint index, - const byte *key, + int read_next(uchar *buf, MYSQL_RES *result); + int index_read_idx_with_result_set(uchar *buf, uint index, + const uchar *key, uint key_len, ha_rkey_function find_flag, MYSQL_RES **result); @@ -251,5 +251,6 @@ public: int connection_rollback(); int connection_autocommit(bool state); int execute_simple_query(const char *query, int len); + int reset(void); }; From 1cd1f7d06fdd6099d8e3378aed1f42bdfbd8c415 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Jul 2007 11:56:01 +0200 Subject: [PATCH 060/227] Post.merge fixes Fixed warnings Fixed error numbers mysql-test/extra/rpl_tests/rpl_loaddata.test: Fixed warnings mysql-test/r/ndb_single_user.result: Post-merge fixes Changed error numbers mysql-test/t/bigint.test: Fixed warnings mysql-test/t/ndb_single_user.test: Post-merge fixes Changed error numbers --- mysql-test/extra/rpl_tests/rpl_loaddata.test | 4 ++-- mysql-test/r/ndb_single_user.result | 10 +++++----- mysql-test/t/bigint.test | 2 +- mysql-test/t/ndb_single_user.test | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test index acd8fd48234..bb6afd73034 100644 --- a/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -164,8 +164,8 @@ CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB; --error ER_DUP_ENTRY LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1; ---disable warnings +--disable_warnings DROP TABLE IF EXISTS t1; ---enable warnings +--enable_warnings # End of 4.1 tests diff --git a/mysql-test/r/ndb_single_user.result b/mysql-test/r/ndb_single_user.result index 54ae99b2f4f..f916422a509 100644 --- a/mysql-test/r/ndb_single_user.result +++ b/mysql-test/r/ndb_single_user.result @@ -11,7 +11,7 @@ ERROR HY000: Failed to create LOGFILE GROUP show warnings; Level Code Message Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB -Error 1516 Failed to create LOGFILE GROUP +Error 1525 Failed to create LOGFILE GROUP create table t1 (a int key, b int unique, c int) engine ndb; CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undofile.dat' @@ -27,14 +27,14 @@ ERROR HY000: Failed to create TABLESPACE show warnings; Level Code Message Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB -Error 1516 Failed to create TABLESPACE +Error 1525 Failed to create TABLESPACE DROP LOGFILE GROUP lg1 ENGINE =NDB; ERROR HY000: Failed to drop LOGFILE GROUP show warnings; Level Code Message Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB -Error 1517 Failed to drop LOGFILE GROUP +Error 1526 Failed to drop LOGFILE GROUP CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' USE LOGFILE GROUP lg1 @@ -47,7 +47,7 @@ ERROR HY000: Failed to alter: DROP DATAFILE show warnings; Level Code Message Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB -Error 1521 Failed to alter: DROP DATAFILE +Error 1530 Failed to alter: DROP DATAFILE ALTER TABLESPACE ts1 DROP DATAFILE 'datafile.dat' ENGINE NDB; @@ -57,7 +57,7 @@ ERROR HY000: Failed to drop TABLESPACE show warnings; Level Code Message Error 1296 Got error 299 'Operation not allowed or aborted due to single user mode' from NDB -Error 1517 Failed to drop TABLESPACE +Error 1526 Failed to drop TABLESPACE DROP TABLESPACE ts1 ENGINE NDB; DROP LOGFILE GROUP lg1 diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index 9b4fc3f39b0..da10f4efa61 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -307,7 +307,7 @@ select -(9223372036854775808); select -((9223372036854775808)); select -(-(9223372036854775808)); --disable_metadata ---endble_ps_protocol +--enable_ps_protocol select --9223372036854775808, ---9223372036854775808, ----9223372036854775808; select -(-9223372036854775808), -(-(-9223372036854775808)); diff --git a/mysql-test/t/ndb_single_user.test b/mysql-test/t/ndb_single_user.test index 5d2ee0a3a8d..eb7ebe8a971 100644 --- a/mysql-test/t/ndb_single_user.test +++ b/mysql-test/t/ndb_single_user.test @@ -27,7 +27,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; create table t1 (a int key, b int unique, c int) engine ndb; # Bug #27712 Single user mode. Creating logfile group and tablespace is allowed # - before bug fix these would succeed ---error 1516 +--error ER_CREATE_FILEGROUP_FAILED CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undofile.dat' INITIAL_SIZE 16M From 07dcc80023674120eb84d41a37dd748da8e00de7 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Jul 2007 15:33:28 -0700 Subject: [PATCH 061/227] Fixed bug #25798. This bug may manifest itself not only with the queries for which the index-merge access method is chosen. It also may display itself for queries with DISTINCT. The bug was in how the Unique::get method used the merge_buffers function. To compare elements in the the queue employed by merge_buffers() it must use the buffpek_compare function rather than the function for binary comparison. mysql-test/r/innodb_mysql.result: Added a test case for bug #25798. mysql-test/t/innodb_mysql.test: Added a test case for bug #25798. sql/filesort.cc: Fixed bug #25798. The function merge_buffers() when called from the Uniques::get method must use function buffpek_compare to compare elements in the queue it employs. The pointer to buffpek_compare and the info for the function that compares sorted records are passed to merge_buffers through certain designated fields of the SORTPARAM structure. sql/sql_sort.h: Fixed bug #25798. Added fields to the SORTPARAM structure to be used in the function merge_buffers when called by the Uniques::get method. sql/uniques.cc: Fixed bug 25798. The function merge_buffers() when called from the Uniques::get method must use function buffpek_compare to compare elements in the queue it employes. --- mysql-test/r/innodb_mysql.result | 51 ++++++++++++++++++++++++++++++ mysql-test/t/innodb_mysql.test | 54 ++++++++++++++++++++++++++++++++ sql/filesort.cc | 18 ++++++++--- sql/sql_sort.h | 9 ++++++ sql/uniques.cc | 13 ++++---- 5 files changed, 134 insertions(+), 11 deletions(-) diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 11c7c2aedc9..df1c2165c45 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -676,4 +676,55 @@ INSERT INTO t1 VALUES (1); switch to connection default SET AUTOCOMMIT=default; DROP TABLE t1,t2; +CREATE TABLE t1 ( +id int NOT NULL auto_increment PRIMARY KEY, +b int NOT NULL, +c datetime NOT NULL, +INDEX idx_b(b), +INDEX idx_c(c) +) ENGINE=InnoDB; +CREATE TABLE t2 ( +b int NOT NULL auto_increment PRIMARY KEY, +c datetime NOT NULL +) ENGINE= MyISAM; +INSERT INTO t2(c) VALUES ('2007-01-01'); +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t1(b,c) SELECT b,c FROM t2; +UPDATE t2 SET c='2007-01-02'; +INSERT INTO t1(b,c) SELECT b,c FROM t2; +UPDATE t2 SET c='2007-01-03'; +INSERT INTO t1(b,c) SELECT b,c FROM t2; +set @@sort_buffer_size=8192; +SELECT COUNT(*) FROM t1; +COUNT(*) +3072 +EXPLAIN +SELECT COUNT(*) FROM t1 +WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL idx_b,idx_c NULL NULL NULL 3263 Using where +SELECT COUNT(*) FROM t1 +WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; +COUNT(*) +3072 +EXPLAIN +SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c) +WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge idx_b,idx_c idx_c,idx_b 8,4 NULL 3262 Using sort_union(idx_c,idx_b); Using where +SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c) +WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; +COUNT(*) +3072 +set @@sort_buffer_size=default; +DROP TABLE t1,t2; End of 5.0 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index 25ba9a258ff..eb995a748a5 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -670,5 +670,59 @@ DISCONNECT c1; DISCONNECT c2; DROP TABLE t1,t2; +# +# Bug #25798: a query with forced index merge returns wrong result +# + +CREATE TABLE t1 ( + id int NOT NULL auto_increment PRIMARY KEY, + b int NOT NULL, + c datetime NOT NULL, + INDEX idx_b(b), + INDEX idx_c(c) +) ENGINE=InnoDB; + +CREATE TABLE t2 ( + b int NOT NULL auto_increment PRIMARY KEY, + c datetime NOT NULL +) ENGINE= MyISAM; + +INSERT INTO t2(c) VALUES ('2007-01-01'); +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; +INSERT INTO t2(c) SELECT c FROM t2; + +INSERT INTO t1(b,c) SELECT b,c FROM t2; +UPDATE t2 SET c='2007-01-02'; +INSERT INTO t1(b,c) SELECT b,c FROM t2; +UPDATE t2 SET c='2007-01-03'; +INSERT INTO t1(b,c) SELECT b,c FROM t2; + +set @@sort_buffer_size=8192; + +SELECT COUNT(*) FROM t1; + +EXPLAIN +SELECT COUNT(*) FROM t1 + WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; +SELECT COUNT(*) FROM t1 + WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; + +EXPLAIN +SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c) + WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; +SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c) + WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; + +set @@sort_buffer_size=default; + +DROP TABLE t1,t2; --echo End of 5.0 tests diff --git a/sql/filesort.cc b/sql/filesort.cc index d518ddbb117..f8868ed6927 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1052,6 +1052,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file, BUFFPEK *buffpek; QUEUE queue; qsort2_cmp cmp; + void *first_cmp_arg; volatile THD::killed_state *killed= ¤t_thd->killed; THD::killed_state not_killable; DBUG_ENTER("merge_buffers"); @@ -1077,9 +1078,18 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file, /* The following will fire if there is not enough space in sort_buffer */ DBUG_ASSERT(maxcount!=0); + if (param->unique_buff) + { + cmp= param->compare; + first_cmp_arg= (void *) ¶m->cmp_context; + } + else + { + cmp= get_ptr_compare(sort_length); + first_cmp_arg= (void*) &sort_length; + } if (init_queue(&queue, (uint) (Tb-Fb)+1, offsetof(BUFFPEK,key), 0, - (queue_compare) (cmp= get_ptr_compare(sort_length)), - (void*) &sort_length)) + (queue_compare) cmp, first_cmp_arg)) DBUG_RETURN(1); /* purecov: inspected */ for (buffpek= Fb ; buffpek <= Tb ; buffpek++) { @@ -1132,7 +1142,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file, buffpek= (BUFFPEK*) queue_top(&queue); if (cmp) // Remove duplicates { - if (!(*cmp)(&sort_length, &(param->unique_buff), + if (!(*cmp)(first_cmp_arg, &(param->unique_buff), (uchar**) &buffpek->key)) goto skip_duplicate; memcpy(param->unique_buff, (uchar*) buffpek->key, rec_length); @@ -1184,7 +1194,7 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file, */ if (cmp) { - if (!(*cmp)(&sort_length, &(param->unique_buff), (uchar**) &buffpek->key)) + if (!(*cmp)(first_cmp_arg, &(param->unique_buff), (uchar**) &buffpek->key)) { buffpek->key+= rec_length; // Remove duplicate --buffpek->mem_count; diff --git a/sql/sql_sort.h b/sql/sql_sort.h index da28ca07e2c..1e9322f7f5b 100644 --- a/sql/sql_sort.h +++ b/sql/sql_sort.h @@ -50,6 +50,12 @@ typedef struct st_buffpek { /* Struktur om sorteringsbuffrarna */ ulong max_keys; /* Max keys in buffert */ } BUFFPEK; +struct BUFFPEK_COMPARE_CONTEXT +{ + qsort_cmp2 key_compare; + void *key_compare_arg; +}; + typedef struct st_sort_param { uint rec_length; /* Length of sorted records */ uint sort_length; /* Length of sorted columns */ @@ -65,6 +71,9 @@ typedef struct st_sort_param { uchar *unique_buff; bool not_killable; char* tmp_buffer; + /* The fields below are used only by Unique class */ + qsort2_cmp compare; + BUFFPEK_COMPARE_CONTEXT cmp_context; } SORTPARAM; diff --git a/sql/uniques.cc b/sql/uniques.cc index 9eb827f62a3..7c197d2a2e9 100644 --- a/sql/uniques.cc +++ b/sql/uniques.cc @@ -361,17 +361,12 @@ Unique::reset() } /* - The comparison function, passed to queue_init() in merge_walk() must + The comparison function, passed to queue_init() in merge_walk() and in + merge_buffers() when the latter is called from Uniques::get() must use comparison function of Uniques::tree, but compare members of struct BUFFPEK. */ -struct BUFFPEK_COMPARE_CONTEXT -{ - qsort_cmp2 key_compare; - void *key_compare_arg; -}; - C_MODE_START static int buffpek_compare(void *arg, byte *key_ptr1, byte *key_ptr2) @@ -630,6 +625,10 @@ bool Unique::get(TABLE *table) sort_param.unique_buff= sort_buffer+(sort_param.keys* sort_param.sort_length); + sort_param.compare= (qsort2_cmp) buffpek_compare; + sort_param.cmp_context.key_compare= tree.compare; + sort_param.cmp_context.key_compare_arg= tree.custom_arg; + /* Merge the buffers to one file, removing duplicates */ if (merge_many_buff(&sort_param,sort_buffer,file_ptr,&maxbuffer,&file)) goto err; From 68e1f851ed1d41923da17b5bfafdd2ad4d94f24a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jul 2007 07:13:40 +0200 Subject: [PATCH 062/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB minor fixes to appease pushbuild. mysql-test/r/binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB make test portable so it will work on servers with funny names. mysql-test/t/binlog.test: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB make test portable so it will work on servers with funny names. sql/log.cc: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB change type to uchar * so it's the same as in 5.1. --- mysql-test/r/binlog.result | 4 ++-- mysql-test/t/binlog.test | 1 + sql/log.cc | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/binlog.result b/mysql-test/r/binlog.result index 77b015a4688..aa5c6e88d65 100644 --- a/mysql-test/r/binlog.result +++ b/mysql-test/r/binlog.result @@ -256,7 +256,7 @@ reset master; create table t1 (a int) engine=innodb; show binlog events from 0; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 98 Server ver: 5.0.46-debug-log, Binlog ver: 4 +master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 master-bin.000001 98 Query 1 198 use `test`; create table t1 (a int) engine=innodb master-bin.000001 198 Query 1 266 use `test`; BEGIN master-bin.000001 266 Query 1 357 use `test`; insert into t1 values( 400 ) @@ -659,7 +659,7 @@ master-bin.000001 36202 Query 1 36291 use `test`; insert into t1 values( 4 ) master-bin.000001 36291 Query 1 36380 use `test`; insert into t1 values( 3 ) master-bin.000001 36380 Query 1 36469 use `test`; insert into t1 values( 2 ) master-bin.000001 36469 Query 1 36558 use `test`; insert into t1 values( 1 ) -master-bin.000001 36558 Xid 1 36585 COMMIT /* xid=186 */ +master-bin.000001 36558 Xid 1 36585 COMMIT /* XID */ master-bin.000001 36585 Rotate 1 36629 master-bin.000002;pos=4 drop table t1; set global binlog_cache_size=@bcs; diff --git a/mysql-test/t/binlog.test b/mysql-test/t/binlog.test index d5479a45226..b9996a2b380 100644 --- a/mysql-test/t/binlog.test +++ b/mysql-test/t/binlog.test @@ -159,6 +159,7 @@ while ($1) commit; enable_query_log; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ show binlog events from 0; drop table t1; diff --git a/sql/log.cc b/sql/log.cc index 289d98e63d3..bcaf352f620 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1951,14 +1951,14 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) { /* we've got a full event-header, and it came in one piece */ - char *log_pos= (char *)cache->read_pos + hdr_offs + LOG_POS_OFFSET; + uchar *log_pos= (uchar *)cache->read_pos + hdr_offs + LOG_POS_OFFSET; /* fix end_log_pos */ val= uint4korr(log_pos) + group; int4store(log_pos, val); /* next event header at ... */ - log_pos= (char *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET; + log_pos= (uchar *)cache->read_pos + hdr_offs + EVENT_LEN_OFFSET; hdr_offs += uint4korr(log_pos); } From 1063bf228a1fb5679ba7db762b62fa99efd941fa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jul 2007 07:34:42 +0200 Subject: [PATCH 063/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB minor fixes to appease pushbuild. --- Merge sin.intern.azundris.com:/home/tnurnberg/22540/50-22540 into sin.intern.azundris.com:/home/tnurnberg/22540/51-22540 mysql-test/extra/binlog_tests/binlog.test: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB make test portable so it will work on servers with funny names. mysql-test/suite/binlog/r/binlog_row_binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB make test portable so it will work on servers with funny names. mysql-test/suite/binlog/r/binlog_stm_binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB make test portable so it will work on servers with funny names. --- mysql-test/extra/binlog_tests/binlog.test | 1 + .../suite/binlog/r/binlog_row_binlog.result | 1604 ++++++++--------- .../suite/binlog/r/binlog_stm_binlog.result | 4 +- 3 files changed, 805 insertions(+), 804 deletions(-) diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 0a2b84e055b..57008b6af3c 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -161,6 +161,7 @@ while ($1) commit; enable_query_log; +--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ show binlog events from 0; drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 89618d37cc1..37fe49e79dc 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -373,810 +373,810 @@ reset master; create table t1 (a int) engine=innodb; show binlog events from 0; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: 5.1.21-beta-debug-log, Binlog ver: 4 +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb master-bin.000001 206 Query 1 274 use `test`; BEGIN -master-bin.000001 274 Table_map 1 313 table_id: 25 (test.t1) -master-bin.000001 313 Write_rows 1 347 table_id: 25 flags: STMT_END_F -master-bin.000001 347 Table_map 1 386 table_id: 25 (test.t1) -master-bin.000001 386 Write_rows 1 420 table_id: 25 flags: STMT_END_F -master-bin.000001 420 Table_map 1 459 table_id: 25 (test.t1) -master-bin.000001 459 Write_rows 1 493 table_id: 25 flags: STMT_END_F -master-bin.000001 493 Table_map 1 532 table_id: 25 (test.t1) -master-bin.000001 532 Write_rows 1 566 table_id: 25 flags: STMT_END_F -master-bin.000001 566 Table_map 1 605 table_id: 25 (test.t1) -master-bin.000001 605 Write_rows 1 639 table_id: 25 flags: STMT_END_F -master-bin.000001 639 Table_map 1 678 table_id: 25 (test.t1) -master-bin.000001 678 Write_rows 1 712 table_id: 25 flags: STMT_END_F -master-bin.000001 712 Table_map 1 751 table_id: 25 (test.t1) -master-bin.000001 751 Write_rows 1 785 table_id: 25 flags: STMT_END_F -master-bin.000001 785 Table_map 1 824 table_id: 25 (test.t1) -master-bin.000001 824 Write_rows 1 858 table_id: 25 flags: STMT_END_F -master-bin.000001 858 Table_map 1 897 table_id: 25 (test.t1) -master-bin.000001 897 Write_rows 1 931 table_id: 25 flags: STMT_END_F -master-bin.000001 931 Table_map 1 970 table_id: 25 (test.t1) -master-bin.000001 970 Write_rows 1 1004 table_id: 25 flags: STMT_END_F -master-bin.000001 1004 Table_map 1 1043 table_id: 25 (test.t1) -master-bin.000001 1043 Write_rows 1 1077 table_id: 25 flags: STMT_END_F -master-bin.000001 1077 Table_map 1 1116 table_id: 25 (test.t1) -master-bin.000001 1116 Write_rows 1 1150 table_id: 25 flags: STMT_END_F -master-bin.000001 1150 Table_map 1 1189 table_id: 25 (test.t1) -master-bin.000001 1189 Write_rows 1 1223 table_id: 25 flags: STMT_END_F -master-bin.000001 1223 Table_map 1 1262 table_id: 25 (test.t1) -master-bin.000001 1262 Write_rows 1 1296 table_id: 25 flags: STMT_END_F -master-bin.000001 1296 Table_map 1 1335 table_id: 25 (test.t1) -master-bin.000001 1335 Write_rows 1 1369 table_id: 25 flags: STMT_END_F -master-bin.000001 1369 Table_map 1 1408 table_id: 25 (test.t1) -master-bin.000001 1408 Write_rows 1 1442 table_id: 25 flags: STMT_END_F -master-bin.000001 1442 Table_map 1 1481 table_id: 25 (test.t1) -master-bin.000001 1481 Write_rows 1 1515 table_id: 25 flags: STMT_END_F -master-bin.000001 1515 Table_map 1 1554 table_id: 25 (test.t1) -master-bin.000001 1554 Write_rows 1 1588 table_id: 25 flags: STMT_END_F -master-bin.000001 1588 Table_map 1 1627 table_id: 25 (test.t1) -master-bin.000001 1627 Write_rows 1 1661 table_id: 25 flags: STMT_END_F -master-bin.000001 1661 Table_map 1 1700 table_id: 25 (test.t1) -master-bin.000001 1700 Write_rows 1 1734 table_id: 25 flags: STMT_END_F -master-bin.000001 1734 Table_map 1 1773 table_id: 25 (test.t1) -master-bin.000001 1773 Write_rows 1 1807 table_id: 25 flags: STMT_END_F -master-bin.000001 1807 Table_map 1 1846 table_id: 25 (test.t1) -master-bin.000001 1846 Write_rows 1 1880 table_id: 25 flags: STMT_END_F -master-bin.000001 1880 Table_map 1 1919 table_id: 25 (test.t1) -master-bin.000001 1919 Write_rows 1 1953 table_id: 25 flags: STMT_END_F -master-bin.000001 1953 Table_map 1 1992 table_id: 25 (test.t1) -master-bin.000001 1992 Write_rows 1 2026 table_id: 25 flags: STMT_END_F -master-bin.000001 2026 Table_map 1 2065 table_id: 25 (test.t1) -master-bin.000001 2065 Write_rows 1 2099 table_id: 25 flags: STMT_END_F -master-bin.000001 2099 Table_map 1 2138 table_id: 25 (test.t1) -master-bin.000001 2138 Write_rows 1 2172 table_id: 25 flags: STMT_END_F -master-bin.000001 2172 Table_map 1 2211 table_id: 25 (test.t1) -master-bin.000001 2211 Write_rows 1 2245 table_id: 25 flags: STMT_END_F -master-bin.000001 2245 Table_map 1 2284 table_id: 25 (test.t1) -master-bin.000001 2284 Write_rows 1 2318 table_id: 25 flags: STMT_END_F -master-bin.000001 2318 Table_map 1 2357 table_id: 25 (test.t1) -master-bin.000001 2357 Write_rows 1 2391 table_id: 25 flags: STMT_END_F -master-bin.000001 2391 Table_map 1 2430 table_id: 25 (test.t1) -master-bin.000001 2430 Write_rows 1 2464 table_id: 25 flags: STMT_END_F -master-bin.000001 2464 Table_map 1 2503 table_id: 25 (test.t1) -master-bin.000001 2503 Write_rows 1 2537 table_id: 25 flags: STMT_END_F -master-bin.000001 2537 Table_map 1 2576 table_id: 25 (test.t1) -master-bin.000001 2576 Write_rows 1 2610 table_id: 25 flags: STMT_END_F -master-bin.000001 2610 Table_map 1 2649 table_id: 25 (test.t1) -master-bin.000001 2649 Write_rows 1 2683 table_id: 25 flags: STMT_END_F -master-bin.000001 2683 Table_map 1 2722 table_id: 25 (test.t1) -master-bin.000001 2722 Write_rows 1 2756 table_id: 25 flags: STMT_END_F -master-bin.000001 2756 Table_map 1 2795 table_id: 25 (test.t1) -master-bin.000001 2795 Write_rows 1 2829 table_id: 25 flags: STMT_END_F -master-bin.000001 2829 Table_map 1 2868 table_id: 25 (test.t1) -master-bin.000001 2868 Write_rows 1 2902 table_id: 25 flags: STMT_END_F -master-bin.000001 2902 Table_map 1 2941 table_id: 25 (test.t1) -master-bin.000001 2941 Write_rows 1 2975 table_id: 25 flags: STMT_END_F -master-bin.000001 2975 Table_map 1 3014 table_id: 25 (test.t1) -master-bin.000001 3014 Write_rows 1 3048 table_id: 25 flags: STMT_END_F -master-bin.000001 3048 Table_map 1 3087 table_id: 25 (test.t1) -master-bin.000001 3087 Write_rows 1 3121 table_id: 25 flags: STMT_END_F -master-bin.000001 3121 Table_map 1 3160 table_id: 25 (test.t1) -master-bin.000001 3160 Write_rows 1 3194 table_id: 25 flags: STMT_END_F -master-bin.000001 3194 Table_map 1 3233 table_id: 25 (test.t1) -master-bin.000001 3233 Write_rows 1 3267 table_id: 25 flags: STMT_END_F -master-bin.000001 3267 Table_map 1 3306 table_id: 25 (test.t1) -master-bin.000001 3306 Write_rows 1 3340 table_id: 25 flags: STMT_END_F -master-bin.000001 3340 Table_map 1 3379 table_id: 25 (test.t1) -master-bin.000001 3379 Write_rows 1 3413 table_id: 25 flags: STMT_END_F -master-bin.000001 3413 Table_map 1 3452 table_id: 25 (test.t1) -master-bin.000001 3452 Write_rows 1 3486 table_id: 25 flags: STMT_END_F -master-bin.000001 3486 Table_map 1 3525 table_id: 25 (test.t1) -master-bin.000001 3525 Write_rows 1 3559 table_id: 25 flags: STMT_END_F -master-bin.000001 3559 Table_map 1 3598 table_id: 25 (test.t1) -master-bin.000001 3598 Write_rows 1 3632 table_id: 25 flags: STMT_END_F -master-bin.000001 3632 Table_map 1 3671 table_id: 25 (test.t1) -master-bin.000001 3671 Write_rows 1 3705 table_id: 25 flags: STMT_END_F -master-bin.000001 3705 Table_map 1 3744 table_id: 25 (test.t1) -master-bin.000001 3744 Write_rows 1 3778 table_id: 25 flags: STMT_END_F -master-bin.000001 3778 Table_map 1 3817 table_id: 25 (test.t1) -master-bin.000001 3817 Write_rows 1 3851 table_id: 25 flags: STMT_END_F -master-bin.000001 3851 Table_map 1 3890 table_id: 25 (test.t1) -master-bin.000001 3890 Write_rows 1 3924 table_id: 25 flags: STMT_END_F -master-bin.000001 3924 Table_map 1 3963 table_id: 25 (test.t1) -master-bin.000001 3963 Write_rows 1 3997 table_id: 25 flags: STMT_END_F -master-bin.000001 3997 Table_map 1 4036 table_id: 25 (test.t1) -master-bin.000001 4036 Write_rows 1 4070 table_id: 25 flags: STMT_END_F -master-bin.000001 4070 Table_map 1 4109 table_id: 25 (test.t1) -master-bin.000001 4109 Write_rows 1 4143 table_id: 25 flags: STMT_END_F -master-bin.000001 4143 Table_map 1 4182 table_id: 25 (test.t1) -master-bin.000001 4182 Write_rows 1 4216 table_id: 25 flags: STMT_END_F -master-bin.000001 4216 Table_map 1 4255 table_id: 25 (test.t1) -master-bin.000001 4255 Write_rows 1 4289 table_id: 25 flags: STMT_END_F -master-bin.000001 4289 Table_map 1 4328 table_id: 25 (test.t1) -master-bin.000001 4328 Write_rows 1 4362 table_id: 25 flags: STMT_END_F -master-bin.000001 4362 Table_map 1 4401 table_id: 25 (test.t1) -master-bin.000001 4401 Write_rows 1 4435 table_id: 25 flags: STMT_END_F -master-bin.000001 4435 Table_map 1 4474 table_id: 25 (test.t1) -master-bin.000001 4474 Write_rows 1 4508 table_id: 25 flags: STMT_END_F -master-bin.000001 4508 Table_map 1 4547 table_id: 25 (test.t1) -master-bin.000001 4547 Write_rows 1 4581 table_id: 25 flags: STMT_END_F -master-bin.000001 4581 Table_map 1 4620 table_id: 25 (test.t1) -master-bin.000001 4620 Write_rows 1 4654 table_id: 25 flags: STMT_END_F -master-bin.000001 4654 Table_map 1 4693 table_id: 25 (test.t1) -master-bin.000001 4693 Write_rows 1 4727 table_id: 25 flags: STMT_END_F -master-bin.000001 4727 Table_map 1 4766 table_id: 25 (test.t1) -master-bin.000001 4766 Write_rows 1 4800 table_id: 25 flags: STMT_END_F -master-bin.000001 4800 Table_map 1 4839 table_id: 25 (test.t1) -master-bin.000001 4839 Write_rows 1 4873 table_id: 25 flags: STMT_END_F -master-bin.000001 4873 Table_map 1 4912 table_id: 25 (test.t1) -master-bin.000001 4912 Write_rows 1 4946 table_id: 25 flags: STMT_END_F -master-bin.000001 4946 Table_map 1 4985 table_id: 25 (test.t1) -master-bin.000001 4985 Write_rows 1 5019 table_id: 25 flags: STMT_END_F -master-bin.000001 5019 Table_map 1 5058 table_id: 25 (test.t1) -master-bin.000001 5058 Write_rows 1 5092 table_id: 25 flags: STMT_END_F -master-bin.000001 5092 Table_map 1 5131 table_id: 25 (test.t1) -master-bin.000001 5131 Write_rows 1 5165 table_id: 25 flags: STMT_END_F -master-bin.000001 5165 Table_map 1 5204 table_id: 25 (test.t1) -master-bin.000001 5204 Write_rows 1 5238 table_id: 25 flags: STMT_END_F -master-bin.000001 5238 Table_map 1 5277 table_id: 25 (test.t1) -master-bin.000001 5277 Write_rows 1 5311 table_id: 25 flags: STMT_END_F -master-bin.000001 5311 Table_map 1 5350 table_id: 25 (test.t1) -master-bin.000001 5350 Write_rows 1 5384 table_id: 25 flags: STMT_END_F -master-bin.000001 5384 Table_map 1 5423 table_id: 25 (test.t1) -master-bin.000001 5423 Write_rows 1 5457 table_id: 25 flags: STMT_END_F -master-bin.000001 5457 Table_map 1 5496 table_id: 25 (test.t1) -master-bin.000001 5496 Write_rows 1 5530 table_id: 25 flags: STMT_END_F -master-bin.000001 5530 Table_map 1 5569 table_id: 25 (test.t1) -master-bin.000001 5569 Write_rows 1 5603 table_id: 25 flags: STMT_END_F -master-bin.000001 5603 Table_map 1 5642 table_id: 25 (test.t1) -master-bin.000001 5642 Write_rows 1 5676 table_id: 25 flags: STMT_END_F -master-bin.000001 5676 Table_map 1 5715 table_id: 25 (test.t1) -master-bin.000001 5715 Write_rows 1 5749 table_id: 25 flags: STMT_END_F -master-bin.000001 5749 Table_map 1 5788 table_id: 25 (test.t1) -master-bin.000001 5788 Write_rows 1 5822 table_id: 25 flags: STMT_END_F -master-bin.000001 5822 Table_map 1 5861 table_id: 25 (test.t1) -master-bin.000001 5861 Write_rows 1 5895 table_id: 25 flags: STMT_END_F -master-bin.000001 5895 Table_map 1 5934 table_id: 25 (test.t1) -master-bin.000001 5934 Write_rows 1 5968 table_id: 25 flags: STMT_END_F -master-bin.000001 5968 Table_map 1 6007 table_id: 25 (test.t1) -master-bin.000001 6007 Write_rows 1 6041 table_id: 25 flags: STMT_END_F -master-bin.000001 6041 Table_map 1 6080 table_id: 25 (test.t1) -master-bin.000001 6080 Write_rows 1 6114 table_id: 25 flags: STMT_END_F -master-bin.000001 6114 Table_map 1 6153 table_id: 25 (test.t1) -master-bin.000001 6153 Write_rows 1 6187 table_id: 25 flags: STMT_END_F -master-bin.000001 6187 Table_map 1 6226 table_id: 25 (test.t1) -master-bin.000001 6226 Write_rows 1 6260 table_id: 25 flags: STMT_END_F -master-bin.000001 6260 Table_map 1 6299 table_id: 25 (test.t1) -master-bin.000001 6299 Write_rows 1 6333 table_id: 25 flags: STMT_END_F -master-bin.000001 6333 Table_map 1 6372 table_id: 25 (test.t1) -master-bin.000001 6372 Write_rows 1 6406 table_id: 25 flags: STMT_END_F -master-bin.000001 6406 Table_map 1 6445 table_id: 25 (test.t1) -master-bin.000001 6445 Write_rows 1 6479 table_id: 25 flags: STMT_END_F -master-bin.000001 6479 Table_map 1 6518 table_id: 25 (test.t1) -master-bin.000001 6518 Write_rows 1 6552 table_id: 25 flags: STMT_END_F -master-bin.000001 6552 Table_map 1 6591 table_id: 25 (test.t1) -master-bin.000001 6591 Write_rows 1 6625 table_id: 25 flags: STMT_END_F -master-bin.000001 6625 Table_map 1 6664 table_id: 25 (test.t1) -master-bin.000001 6664 Write_rows 1 6698 table_id: 25 flags: STMT_END_F -master-bin.000001 6698 Table_map 1 6737 table_id: 25 (test.t1) -master-bin.000001 6737 Write_rows 1 6771 table_id: 25 flags: STMT_END_F -master-bin.000001 6771 Table_map 1 6810 table_id: 25 (test.t1) -master-bin.000001 6810 Write_rows 1 6844 table_id: 25 flags: STMT_END_F -master-bin.000001 6844 Table_map 1 6883 table_id: 25 (test.t1) -master-bin.000001 6883 Write_rows 1 6917 table_id: 25 flags: STMT_END_F -master-bin.000001 6917 Table_map 1 6956 table_id: 25 (test.t1) -master-bin.000001 6956 Write_rows 1 6990 table_id: 25 flags: STMT_END_F -master-bin.000001 6990 Table_map 1 7029 table_id: 25 (test.t1) -master-bin.000001 7029 Write_rows 1 7063 table_id: 25 flags: STMT_END_F -master-bin.000001 7063 Table_map 1 7102 table_id: 25 (test.t1) -master-bin.000001 7102 Write_rows 1 7136 table_id: 25 flags: STMT_END_F -master-bin.000001 7136 Table_map 1 7175 table_id: 25 (test.t1) -master-bin.000001 7175 Write_rows 1 7209 table_id: 25 flags: STMT_END_F -master-bin.000001 7209 Table_map 1 7248 table_id: 25 (test.t1) -master-bin.000001 7248 Write_rows 1 7282 table_id: 25 flags: STMT_END_F -master-bin.000001 7282 Table_map 1 7321 table_id: 25 (test.t1) -master-bin.000001 7321 Write_rows 1 7355 table_id: 25 flags: STMT_END_F -master-bin.000001 7355 Table_map 1 7394 table_id: 25 (test.t1) -master-bin.000001 7394 Write_rows 1 7428 table_id: 25 flags: STMT_END_F -master-bin.000001 7428 Table_map 1 7467 table_id: 25 (test.t1) -master-bin.000001 7467 Write_rows 1 7501 table_id: 25 flags: STMT_END_F -master-bin.000001 7501 Table_map 1 7540 table_id: 25 (test.t1) -master-bin.000001 7540 Write_rows 1 7574 table_id: 25 flags: STMT_END_F -master-bin.000001 7574 Table_map 1 7613 table_id: 25 (test.t1) -master-bin.000001 7613 Write_rows 1 7647 table_id: 25 flags: STMT_END_F -master-bin.000001 7647 Table_map 1 7686 table_id: 25 (test.t1) -master-bin.000001 7686 Write_rows 1 7720 table_id: 25 flags: STMT_END_F -master-bin.000001 7720 Table_map 1 7759 table_id: 25 (test.t1) -master-bin.000001 7759 Write_rows 1 7793 table_id: 25 flags: STMT_END_F -master-bin.000001 7793 Table_map 1 7832 table_id: 25 (test.t1) -master-bin.000001 7832 Write_rows 1 7866 table_id: 25 flags: STMT_END_F -master-bin.000001 7866 Table_map 1 7905 table_id: 25 (test.t1) -master-bin.000001 7905 Write_rows 1 7939 table_id: 25 flags: STMT_END_F -master-bin.000001 7939 Table_map 1 7978 table_id: 25 (test.t1) -master-bin.000001 7978 Write_rows 1 8012 table_id: 25 flags: STMT_END_F -master-bin.000001 8012 Table_map 1 8051 table_id: 25 (test.t1) -master-bin.000001 8051 Write_rows 1 8085 table_id: 25 flags: STMT_END_F -master-bin.000001 8085 Table_map 1 8124 table_id: 25 (test.t1) -master-bin.000001 8124 Write_rows 1 8158 table_id: 25 flags: STMT_END_F -master-bin.000001 8158 Table_map 1 8197 table_id: 25 (test.t1) -master-bin.000001 8197 Write_rows 1 8231 table_id: 25 flags: STMT_END_F -master-bin.000001 8231 Table_map 1 8270 table_id: 25 (test.t1) -master-bin.000001 8270 Write_rows 1 8304 table_id: 25 flags: STMT_END_F -master-bin.000001 8304 Table_map 1 8343 table_id: 25 (test.t1) -master-bin.000001 8343 Write_rows 1 8377 table_id: 25 flags: STMT_END_F -master-bin.000001 8377 Table_map 1 8416 table_id: 25 (test.t1) -master-bin.000001 8416 Write_rows 1 8450 table_id: 25 flags: STMT_END_F -master-bin.000001 8450 Table_map 1 8489 table_id: 25 (test.t1) -master-bin.000001 8489 Write_rows 1 8523 table_id: 25 flags: STMT_END_F -master-bin.000001 8523 Table_map 1 8562 table_id: 25 (test.t1) -master-bin.000001 8562 Write_rows 1 8596 table_id: 25 flags: STMT_END_F -master-bin.000001 8596 Table_map 1 8635 table_id: 25 (test.t1) -master-bin.000001 8635 Write_rows 1 8669 table_id: 25 flags: STMT_END_F -master-bin.000001 8669 Table_map 1 8708 table_id: 25 (test.t1) -master-bin.000001 8708 Write_rows 1 8742 table_id: 25 flags: STMT_END_F -master-bin.000001 8742 Table_map 1 8781 table_id: 25 (test.t1) -master-bin.000001 8781 Write_rows 1 8815 table_id: 25 flags: STMT_END_F -master-bin.000001 8815 Table_map 1 8854 table_id: 25 (test.t1) -master-bin.000001 8854 Write_rows 1 8888 table_id: 25 flags: STMT_END_F -master-bin.000001 8888 Table_map 1 8927 table_id: 25 (test.t1) -master-bin.000001 8927 Write_rows 1 8961 table_id: 25 flags: STMT_END_F -master-bin.000001 8961 Table_map 1 9000 table_id: 25 (test.t1) -master-bin.000001 9000 Write_rows 1 9034 table_id: 25 flags: STMT_END_F -master-bin.000001 9034 Table_map 1 9073 table_id: 25 (test.t1) -master-bin.000001 9073 Write_rows 1 9107 table_id: 25 flags: STMT_END_F -master-bin.000001 9107 Table_map 1 9146 table_id: 25 (test.t1) -master-bin.000001 9146 Write_rows 1 9180 table_id: 25 flags: STMT_END_F -master-bin.000001 9180 Table_map 1 9219 table_id: 25 (test.t1) -master-bin.000001 9219 Write_rows 1 9253 table_id: 25 flags: STMT_END_F -master-bin.000001 9253 Table_map 1 9292 table_id: 25 (test.t1) -master-bin.000001 9292 Write_rows 1 9326 table_id: 25 flags: STMT_END_F -master-bin.000001 9326 Table_map 1 9365 table_id: 25 (test.t1) -master-bin.000001 9365 Write_rows 1 9399 table_id: 25 flags: STMT_END_F -master-bin.000001 9399 Table_map 1 9438 table_id: 25 (test.t1) -master-bin.000001 9438 Write_rows 1 9472 table_id: 25 flags: STMT_END_F -master-bin.000001 9472 Table_map 1 9511 table_id: 25 (test.t1) -master-bin.000001 9511 Write_rows 1 9545 table_id: 25 flags: STMT_END_F -master-bin.000001 9545 Table_map 1 9584 table_id: 25 (test.t1) -master-bin.000001 9584 Write_rows 1 9618 table_id: 25 flags: STMT_END_F -master-bin.000001 9618 Table_map 1 9657 table_id: 25 (test.t1) -master-bin.000001 9657 Write_rows 1 9691 table_id: 25 flags: STMT_END_F -master-bin.000001 9691 Table_map 1 9730 table_id: 25 (test.t1) -master-bin.000001 9730 Write_rows 1 9764 table_id: 25 flags: STMT_END_F -master-bin.000001 9764 Table_map 1 9803 table_id: 25 (test.t1) -master-bin.000001 9803 Write_rows 1 9837 table_id: 25 flags: STMT_END_F -master-bin.000001 9837 Table_map 1 9876 table_id: 25 (test.t1) -master-bin.000001 9876 Write_rows 1 9910 table_id: 25 flags: STMT_END_F -master-bin.000001 9910 Table_map 1 9949 table_id: 25 (test.t1) -master-bin.000001 9949 Write_rows 1 9983 table_id: 25 flags: STMT_END_F -master-bin.000001 9983 Table_map 1 10022 table_id: 25 (test.t1) -master-bin.000001 10022 Write_rows 1 10056 table_id: 25 flags: STMT_END_F -master-bin.000001 10056 Table_map 1 10095 table_id: 25 (test.t1) -master-bin.000001 10095 Write_rows 1 10129 table_id: 25 flags: STMT_END_F -master-bin.000001 10129 Table_map 1 10168 table_id: 25 (test.t1) -master-bin.000001 10168 Write_rows 1 10202 table_id: 25 flags: STMT_END_F -master-bin.000001 10202 Table_map 1 10241 table_id: 25 (test.t1) -master-bin.000001 10241 Write_rows 1 10275 table_id: 25 flags: STMT_END_F -master-bin.000001 10275 Table_map 1 10314 table_id: 25 (test.t1) -master-bin.000001 10314 Write_rows 1 10348 table_id: 25 flags: STMT_END_F -master-bin.000001 10348 Table_map 1 10387 table_id: 25 (test.t1) -master-bin.000001 10387 Write_rows 1 10421 table_id: 25 flags: STMT_END_F -master-bin.000001 10421 Table_map 1 10460 table_id: 25 (test.t1) -master-bin.000001 10460 Write_rows 1 10494 table_id: 25 flags: STMT_END_F -master-bin.000001 10494 Table_map 1 10533 table_id: 25 (test.t1) -master-bin.000001 10533 Write_rows 1 10567 table_id: 25 flags: STMT_END_F -master-bin.000001 10567 Table_map 1 10606 table_id: 25 (test.t1) -master-bin.000001 10606 Write_rows 1 10640 table_id: 25 flags: STMT_END_F -master-bin.000001 10640 Table_map 1 10679 table_id: 25 (test.t1) -master-bin.000001 10679 Write_rows 1 10713 table_id: 25 flags: STMT_END_F -master-bin.000001 10713 Table_map 1 10752 table_id: 25 (test.t1) -master-bin.000001 10752 Write_rows 1 10786 table_id: 25 flags: STMT_END_F -master-bin.000001 10786 Table_map 1 10825 table_id: 25 (test.t1) -master-bin.000001 10825 Write_rows 1 10859 table_id: 25 flags: STMT_END_F -master-bin.000001 10859 Table_map 1 10898 table_id: 25 (test.t1) -master-bin.000001 10898 Write_rows 1 10932 table_id: 25 flags: STMT_END_F -master-bin.000001 10932 Table_map 1 10971 table_id: 25 (test.t1) -master-bin.000001 10971 Write_rows 1 11005 table_id: 25 flags: STMT_END_F -master-bin.000001 11005 Table_map 1 11044 table_id: 25 (test.t1) -master-bin.000001 11044 Write_rows 1 11078 table_id: 25 flags: STMT_END_F -master-bin.000001 11078 Table_map 1 11117 table_id: 25 (test.t1) -master-bin.000001 11117 Write_rows 1 11151 table_id: 25 flags: STMT_END_F -master-bin.000001 11151 Table_map 1 11190 table_id: 25 (test.t1) -master-bin.000001 11190 Write_rows 1 11224 table_id: 25 flags: STMT_END_F -master-bin.000001 11224 Table_map 1 11263 table_id: 25 (test.t1) -master-bin.000001 11263 Write_rows 1 11297 table_id: 25 flags: STMT_END_F -master-bin.000001 11297 Table_map 1 11336 table_id: 25 (test.t1) -master-bin.000001 11336 Write_rows 1 11370 table_id: 25 flags: STMT_END_F -master-bin.000001 11370 Table_map 1 11409 table_id: 25 (test.t1) -master-bin.000001 11409 Write_rows 1 11443 table_id: 25 flags: STMT_END_F -master-bin.000001 11443 Table_map 1 11482 table_id: 25 (test.t1) -master-bin.000001 11482 Write_rows 1 11516 table_id: 25 flags: STMT_END_F -master-bin.000001 11516 Table_map 1 11555 table_id: 25 (test.t1) -master-bin.000001 11555 Write_rows 1 11589 table_id: 25 flags: STMT_END_F -master-bin.000001 11589 Table_map 1 11628 table_id: 25 (test.t1) -master-bin.000001 11628 Write_rows 1 11662 table_id: 25 flags: STMT_END_F -master-bin.000001 11662 Table_map 1 11701 table_id: 25 (test.t1) -master-bin.000001 11701 Write_rows 1 11735 table_id: 25 flags: STMT_END_F -master-bin.000001 11735 Table_map 1 11774 table_id: 25 (test.t1) -master-bin.000001 11774 Write_rows 1 11808 table_id: 25 flags: STMT_END_F -master-bin.000001 11808 Table_map 1 11847 table_id: 25 (test.t1) -master-bin.000001 11847 Write_rows 1 11881 table_id: 25 flags: STMT_END_F -master-bin.000001 11881 Table_map 1 11920 table_id: 25 (test.t1) -master-bin.000001 11920 Write_rows 1 11954 table_id: 25 flags: STMT_END_F -master-bin.000001 11954 Table_map 1 11993 table_id: 25 (test.t1) -master-bin.000001 11993 Write_rows 1 12027 table_id: 25 flags: STMT_END_F -master-bin.000001 12027 Table_map 1 12066 table_id: 25 (test.t1) -master-bin.000001 12066 Write_rows 1 12100 table_id: 25 flags: STMT_END_F -master-bin.000001 12100 Table_map 1 12139 table_id: 25 (test.t1) -master-bin.000001 12139 Write_rows 1 12173 table_id: 25 flags: STMT_END_F -master-bin.000001 12173 Table_map 1 12212 table_id: 25 (test.t1) -master-bin.000001 12212 Write_rows 1 12246 table_id: 25 flags: STMT_END_F -master-bin.000001 12246 Table_map 1 12285 table_id: 25 (test.t1) -master-bin.000001 12285 Write_rows 1 12319 table_id: 25 flags: STMT_END_F -master-bin.000001 12319 Table_map 1 12358 table_id: 25 (test.t1) -master-bin.000001 12358 Write_rows 1 12392 table_id: 25 flags: STMT_END_F -master-bin.000001 12392 Table_map 1 12431 table_id: 25 (test.t1) -master-bin.000001 12431 Write_rows 1 12465 table_id: 25 flags: STMT_END_F -master-bin.000001 12465 Table_map 1 12504 table_id: 25 (test.t1) -master-bin.000001 12504 Write_rows 1 12538 table_id: 25 flags: STMT_END_F -master-bin.000001 12538 Table_map 1 12577 table_id: 25 (test.t1) -master-bin.000001 12577 Write_rows 1 12611 table_id: 25 flags: STMT_END_F -master-bin.000001 12611 Table_map 1 12650 table_id: 25 (test.t1) -master-bin.000001 12650 Write_rows 1 12684 table_id: 25 flags: STMT_END_F -master-bin.000001 12684 Table_map 1 12723 table_id: 25 (test.t1) -master-bin.000001 12723 Write_rows 1 12757 table_id: 25 flags: STMT_END_F -master-bin.000001 12757 Table_map 1 12796 table_id: 25 (test.t1) -master-bin.000001 12796 Write_rows 1 12830 table_id: 25 flags: STMT_END_F -master-bin.000001 12830 Table_map 1 12869 table_id: 25 (test.t1) -master-bin.000001 12869 Write_rows 1 12903 table_id: 25 flags: STMT_END_F -master-bin.000001 12903 Table_map 1 12942 table_id: 25 (test.t1) -master-bin.000001 12942 Write_rows 1 12976 table_id: 25 flags: STMT_END_F -master-bin.000001 12976 Table_map 1 13015 table_id: 25 (test.t1) -master-bin.000001 13015 Write_rows 1 13049 table_id: 25 flags: STMT_END_F -master-bin.000001 13049 Table_map 1 13088 table_id: 25 (test.t1) -master-bin.000001 13088 Write_rows 1 13122 table_id: 25 flags: STMT_END_F -master-bin.000001 13122 Table_map 1 13161 table_id: 25 (test.t1) -master-bin.000001 13161 Write_rows 1 13195 table_id: 25 flags: STMT_END_F -master-bin.000001 13195 Table_map 1 13234 table_id: 25 (test.t1) -master-bin.000001 13234 Write_rows 1 13268 table_id: 25 flags: STMT_END_F -master-bin.000001 13268 Table_map 1 13307 table_id: 25 (test.t1) -master-bin.000001 13307 Write_rows 1 13341 table_id: 25 flags: STMT_END_F -master-bin.000001 13341 Table_map 1 13380 table_id: 25 (test.t1) -master-bin.000001 13380 Write_rows 1 13414 table_id: 25 flags: STMT_END_F -master-bin.000001 13414 Table_map 1 13453 table_id: 25 (test.t1) -master-bin.000001 13453 Write_rows 1 13487 table_id: 25 flags: STMT_END_F -master-bin.000001 13487 Table_map 1 13526 table_id: 25 (test.t1) -master-bin.000001 13526 Write_rows 1 13560 table_id: 25 flags: STMT_END_F -master-bin.000001 13560 Table_map 1 13599 table_id: 25 (test.t1) -master-bin.000001 13599 Write_rows 1 13633 table_id: 25 flags: STMT_END_F -master-bin.000001 13633 Table_map 1 13672 table_id: 25 (test.t1) -master-bin.000001 13672 Write_rows 1 13706 table_id: 25 flags: STMT_END_F -master-bin.000001 13706 Table_map 1 13745 table_id: 25 (test.t1) -master-bin.000001 13745 Write_rows 1 13779 table_id: 25 flags: STMT_END_F -master-bin.000001 13779 Table_map 1 13818 table_id: 25 (test.t1) -master-bin.000001 13818 Write_rows 1 13852 table_id: 25 flags: STMT_END_F -master-bin.000001 13852 Table_map 1 13891 table_id: 25 (test.t1) -master-bin.000001 13891 Write_rows 1 13925 table_id: 25 flags: STMT_END_F -master-bin.000001 13925 Table_map 1 13964 table_id: 25 (test.t1) -master-bin.000001 13964 Write_rows 1 13998 table_id: 25 flags: STMT_END_F -master-bin.000001 13998 Table_map 1 14037 table_id: 25 (test.t1) -master-bin.000001 14037 Write_rows 1 14071 table_id: 25 flags: STMT_END_F -master-bin.000001 14071 Table_map 1 14110 table_id: 25 (test.t1) -master-bin.000001 14110 Write_rows 1 14144 table_id: 25 flags: STMT_END_F -master-bin.000001 14144 Table_map 1 14183 table_id: 25 (test.t1) -master-bin.000001 14183 Write_rows 1 14217 table_id: 25 flags: STMT_END_F -master-bin.000001 14217 Table_map 1 14256 table_id: 25 (test.t1) -master-bin.000001 14256 Write_rows 1 14290 table_id: 25 flags: STMT_END_F -master-bin.000001 14290 Table_map 1 14329 table_id: 25 (test.t1) -master-bin.000001 14329 Write_rows 1 14363 table_id: 25 flags: STMT_END_F -master-bin.000001 14363 Table_map 1 14402 table_id: 25 (test.t1) -master-bin.000001 14402 Write_rows 1 14436 table_id: 25 flags: STMT_END_F -master-bin.000001 14436 Table_map 1 14475 table_id: 25 (test.t1) -master-bin.000001 14475 Write_rows 1 14509 table_id: 25 flags: STMT_END_F -master-bin.000001 14509 Table_map 1 14548 table_id: 25 (test.t1) -master-bin.000001 14548 Write_rows 1 14582 table_id: 25 flags: STMT_END_F -master-bin.000001 14582 Table_map 1 14621 table_id: 25 (test.t1) -master-bin.000001 14621 Write_rows 1 14655 table_id: 25 flags: STMT_END_F -master-bin.000001 14655 Table_map 1 14694 table_id: 25 (test.t1) -master-bin.000001 14694 Write_rows 1 14728 table_id: 25 flags: STMT_END_F -master-bin.000001 14728 Table_map 1 14767 table_id: 25 (test.t1) -master-bin.000001 14767 Write_rows 1 14801 table_id: 25 flags: STMT_END_F -master-bin.000001 14801 Table_map 1 14840 table_id: 25 (test.t1) -master-bin.000001 14840 Write_rows 1 14874 table_id: 25 flags: STMT_END_F -master-bin.000001 14874 Table_map 1 14913 table_id: 25 (test.t1) -master-bin.000001 14913 Write_rows 1 14947 table_id: 25 flags: STMT_END_F -master-bin.000001 14947 Table_map 1 14986 table_id: 25 (test.t1) -master-bin.000001 14986 Write_rows 1 15020 table_id: 25 flags: STMT_END_F -master-bin.000001 15020 Table_map 1 15059 table_id: 25 (test.t1) -master-bin.000001 15059 Write_rows 1 15093 table_id: 25 flags: STMT_END_F -master-bin.000001 15093 Table_map 1 15132 table_id: 25 (test.t1) -master-bin.000001 15132 Write_rows 1 15166 table_id: 25 flags: STMT_END_F -master-bin.000001 15166 Table_map 1 15205 table_id: 25 (test.t1) -master-bin.000001 15205 Write_rows 1 15239 table_id: 25 flags: STMT_END_F -master-bin.000001 15239 Table_map 1 15278 table_id: 25 (test.t1) -master-bin.000001 15278 Write_rows 1 15312 table_id: 25 flags: STMT_END_F -master-bin.000001 15312 Table_map 1 15351 table_id: 25 (test.t1) -master-bin.000001 15351 Write_rows 1 15385 table_id: 25 flags: STMT_END_F -master-bin.000001 15385 Table_map 1 15424 table_id: 25 (test.t1) -master-bin.000001 15424 Write_rows 1 15458 table_id: 25 flags: STMT_END_F -master-bin.000001 15458 Table_map 1 15497 table_id: 25 (test.t1) -master-bin.000001 15497 Write_rows 1 15531 table_id: 25 flags: STMT_END_F -master-bin.000001 15531 Table_map 1 15570 table_id: 25 (test.t1) -master-bin.000001 15570 Write_rows 1 15604 table_id: 25 flags: STMT_END_F -master-bin.000001 15604 Table_map 1 15643 table_id: 25 (test.t1) -master-bin.000001 15643 Write_rows 1 15677 table_id: 25 flags: STMT_END_F -master-bin.000001 15677 Table_map 1 15716 table_id: 25 (test.t1) -master-bin.000001 15716 Write_rows 1 15750 table_id: 25 flags: STMT_END_F -master-bin.000001 15750 Table_map 1 15789 table_id: 25 (test.t1) -master-bin.000001 15789 Write_rows 1 15823 table_id: 25 flags: STMT_END_F -master-bin.000001 15823 Table_map 1 15862 table_id: 25 (test.t1) -master-bin.000001 15862 Write_rows 1 15896 table_id: 25 flags: STMT_END_F -master-bin.000001 15896 Table_map 1 15935 table_id: 25 (test.t1) -master-bin.000001 15935 Write_rows 1 15969 table_id: 25 flags: STMT_END_F -master-bin.000001 15969 Table_map 1 16008 table_id: 25 (test.t1) -master-bin.000001 16008 Write_rows 1 16042 table_id: 25 flags: STMT_END_F -master-bin.000001 16042 Table_map 1 16081 table_id: 25 (test.t1) -master-bin.000001 16081 Write_rows 1 16115 table_id: 25 flags: STMT_END_F -master-bin.000001 16115 Table_map 1 16154 table_id: 25 (test.t1) -master-bin.000001 16154 Write_rows 1 16188 table_id: 25 flags: STMT_END_F -master-bin.000001 16188 Table_map 1 16227 table_id: 25 (test.t1) -master-bin.000001 16227 Write_rows 1 16261 table_id: 25 flags: STMT_END_F -master-bin.000001 16261 Table_map 1 16300 table_id: 25 (test.t1) -master-bin.000001 16300 Write_rows 1 16334 table_id: 25 flags: STMT_END_F -master-bin.000001 16334 Table_map 1 16373 table_id: 25 (test.t1) -master-bin.000001 16373 Write_rows 1 16407 table_id: 25 flags: STMT_END_F -master-bin.000001 16407 Table_map 1 16446 table_id: 25 (test.t1) -master-bin.000001 16446 Write_rows 1 16480 table_id: 25 flags: STMT_END_F -master-bin.000001 16480 Table_map 1 16519 table_id: 25 (test.t1) -master-bin.000001 16519 Write_rows 1 16553 table_id: 25 flags: STMT_END_F -master-bin.000001 16553 Table_map 1 16592 table_id: 25 (test.t1) -master-bin.000001 16592 Write_rows 1 16626 table_id: 25 flags: STMT_END_F -master-bin.000001 16626 Table_map 1 16665 table_id: 25 (test.t1) -master-bin.000001 16665 Write_rows 1 16699 table_id: 25 flags: STMT_END_F -master-bin.000001 16699 Table_map 1 16738 table_id: 25 (test.t1) -master-bin.000001 16738 Write_rows 1 16772 table_id: 25 flags: STMT_END_F -master-bin.000001 16772 Table_map 1 16811 table_id: 25 (test.t1) -master-bin.000001 16811 Write_rows 1 16845 table_id: 25 flags: STMT_END_F -master-bin.000001 16845 Table_map 1 16884 table_id: 25 (test.t1) -master-bin.000001 16884 Write_rows 1 16918 table_id: 25 flags: STMT_END_F -master-bin.000001 16918 Table_map 1 16957 table_id: 25 (test.t1) -master-bin.000001 16957 Write_rows 1 16991 table_id: 25 flags: STMT_END_F -master-bin.000001 16991 Table_map 1 17030 table_id: 25 (test.t1) -master-bin.000001 17030 Write_rows 1 17064 table_id: 25 flags: STMT_END_F -master-bin.000001 17064 Table_map 1 17103 table_id: 25 (test.t1) -master-bin.000001 17103 Write_rows 1 17137 table_id: 25 flags: STMT_END_F -master-bin.000001 17137 Table_map 1 17176 table_id: 25 (test.t1) -master-bin.000001 17176 Write_rows 1 17210 table_id: 25 flags: STMT_END_F -master-bin.000001 17210 Table_map 1 17249 table_id: 25 (test.t1) -master-bin.000001 17249 Write_rows 1 17283 table_id: 25 flags: STMT_END_F -master-bin.000001 17283 Table_map 1 17322 table_id: 25 (test.t1) -master-bin.000001 17322 Write_rows 1 17356 table_id: 25 flags: STMT_END_F -master-bin.000001 17356 Table_map 1 17395 table_id: 25 (test.t1) -master-bin.000001 17395 Write_rows 1 17429 table_id: 25 flags: STMT_END_F -master-bin.000001 17429 Table_map 1 17468 table_id: 25 (test.t1) -master-bin.000001 17468 Write_rows 1 17502 table_id: 25 flags: STMT_END_F -master-bin.000001 17502 Table_map 1 17541 table_id: 25 (test.t1) -master-bin.000001 17541 Write_rows 1 17575 table_id: 25 flags: STMT_END_F -master-bin.000001 17575 Table_map 1 17614 table_id: 25 (test.t1) -master-bin.000001 17614 Write_rows 1 17648 table_id: 25 flags: STMT_END_F -master-bin.000001 17648 Table_map 1 17687 table_id: 25 (test.t1) -master-bin.000001 17687 Write_rows 1 17721 table_id: 25 flags: STMT_END_F -master-bin.000001 17721 Table_map 1 17760 table_id: 25 (test.t1) -master-bin.000001 17760 Write_rows 1 17794 table_id: 25 flags: STMT_END_F -master-bin.000001 17794 Table_map 1 17833 table_id: 25 (test.t1) -master-bin.000001 17833 Write_rows 1 17867 table_id: 25 flags: STMT_END_F -master-bin.000001 17867 Table_map 1 17906 table_id: 25 (test.t1) -master-bin.000001 17906 Write_rows 1 17940 table_id: 25 flags: STMT_END_F -master-bin.000001 17940 Table_map 1 17979 table_id: 25 (test.t1) -master-bin.000001 17979 Write_rows 1 18013 table_id: 25 flags: STMT_END_F -master-bin.000001 18013 Table_map 1 18052 table_id: 25 (test.t1) -master-bin.000001 18052 Write_rows 1 18086 table_id: 25 flags: STMT_END_F -master-bin.000001 18086 Table_map 1 18125 table_id: 25 (test.t1) -master-bin.000001 18125 Write_rows 1 18159 table_id: 25 flags: STMT_END_F -master-bin.000001 18159 Table_map 1 18198 table_id: 25 (test.t1) -master-bin.000001 18198 Write_rows 1 18232 table_id: 25 flags: STMT_END_F -master-bin.000001 18232 Table_map 1 18271 table_id: 25 (test.t1) -master-bin.000001 18271 Write_rows 1 18305 table_id: 25 flags: STMT_END_F -master-bin.000001 18305 Table_map 1 18344 table_id: 25 (test.t1) -master-bin.000001 18344 Write_rows 1 18378 table_id: 25 flags: STMT_END_F -master-bin.000001 18378 Table_map 1 18417 table_id: 25 (test.t1) -master-bin.000001 18417 Write_rows 1 18451 table_id: 25 flags: STMT_END_F -master-bin.000001 18451 Table_map 1 18490 table_id: 25 (test.t1) -master-bin.000001 18490 Write_rows 1 18524 table_id: 25 flags: STMT_END_F -master-bin.000001 18524 Table_map 1 18563 table_id: 25 (test.t1) -master-bin.000001 18563 Write_rows 1 18597 table_id: 25 flags: STMT_END_F -master-bin.000001 18597 Table_map 1 18636 table_id: 25 (test.t1) -master-bin.000001 18636 Write_rows 1 18670 table_id: 25 flags: STMT_END_F -master-bin.000001 18670 Table_map 1 18709 table_id: 25 (test.t1) -master-bin.000001 18709 Write_rows 1 18743 table_id: 25 flags: STMT_END_F -master-bin.000001 18743 Table_map 1 18782 table_id: 25 (test.t1) -master-bin.000001 18782 Write_rows 1 18816 table_id: 25 flags: STMT_END_F -master-bin.000001 18816 Table_map 1 18855 table_id: 25 (test.t1) -master-bin.000001 18855 Write_rows 1 18889 table_id: 25 flags: STMT_END_F -master-bin.000001 18889 Table_map 1 18928 table_id: 25 (test.t1) -master-bin.000001 18928 Write_rows 1 18962 table_id: 25 flags: STMT_END_F -master-bin.000001 18962 Table_map 1 19001 table_id: 25 (test.t1) -master-bin.000001 19001 Write_rows 1 19035 table_id: 25 flags: STMT_END_F -master-bin.000001 19035 Table_map 1 19074 table_id: 25 (test.t1) -master-bin.000001 19074 Write_rows 1 19108 table_id: 25 flags: STMT_END_F -master-bin.000001 19108 Table_map 1 19147 table_id: 25 (test.t1) -master-bin.000001 19147 Write_rows 1 19181 table_id: 25 flags: STMT_END_F -master-bin.000001 19181 Table_map 1 19220 table_id: 25 (test.t1) -master-bin.000001 19220 Write_rows 1 19254 table_id: 25 flags: STMT_END_F -master-bin.000001 19254 Table_map 1 19293 table_id: 25 (test.t1) -master-bin.000001 19293 Write_rows 1 19327 table_id: 25 flags: STMT_END_F -master-bin.000001 19327 Table_map 1 19366 table_id: 25 (test.t1) -master-bin.000001 19366 Write_rows 1 19400 table_id: 25 flags: STMT_END_F -master-bin.000001 19400 Table_map 1 19439 table_id: 25 (test.t1) -master-bin.000001 19439 Write_rows 1 19473 table_id: 25 flags: STMT_END_F -master-bin.000001 19473 Table_map 1 19512 table_id: 25 (test.t1) -master-bin.000001 19512 Write_rows 1 19546 table_id: 25 flags: STMT_END_F -master-bin.000001 19546 Table_map 1 19585 table_id: 25 (test.t1) -master-bin.000001 19585 Write_rows 1 19619 table_id: 25 flags: STMT_END_F -master-bin.000001 19619 Table_map 1 19658 table_id: 25 (test.t1) -master-bin.000001 19658 Write_rows 1 19692 table_id: 25 flags: STMT_END_F -master-bin.000001 19692 Table_map 1 19731 table_id: 25 (test.t1) -master-bin.000001 19731 Write_rows 1 19765 table_id: 25 flags: STMT_END_F -master-bin.000001 19765 Table_map 1 19804 table_id: 25 (test.t1) -master-bin.000001 19804 Write_rows 1 19838 table_id: 25 flags: STMT_END_F -master-bin.000001 19838 Table_map 1 19877 table_id: 25 (test.t1) -master-bin.000001 19877 Write_rows 1 19911 table_id: 25 flags: STMT_END_F -master-bin.000001 19911 Table_map 1 19950 table_id: 25 (test.t1) -master-bin.000001 19950 Write_rows 1 19984 table_id: 25 flags: STMT_END_F -master-bin.000001 19984 Table_map 1 20023 table_id: 25 (test.t1) -master-bin.000001 20023 Write_rows 1 20057 table_id: 25 flags: STMT_END_F -master-bin.000001 20057 Table_map 1 20096 table_id: 25 (test.t1) -master-bin.000001 20096 Write_rows 1 20130 table_id: 25 flags: STMT_END_F -master-bin.000001 20130 Table_map 1 20169 table_id: 25 (test.t1) -master-bin.000001 20169 Write_rows 1 20203 table_id: 25 flags: STMT_END_F -master-bin.000001 20203 Table_map 1 20242 table_id: 25 (test.t1) -master-bin.000001 20242 Write_rows 1 20276 table_id: 25 flags: STMT_END_F -master-bin.000001 20276 Table_map 1 20315 table_id: 25 (test.t1) -master-bin.000001 20315 Write_rows 1 20349 table_id: 25 flags: STMT_END_F -master-bin.000001 20349 Table_map 1 20388 table_id: 25 (test.t1) -master-bin.000001 20388 Write_rows 1 20422 table_id: 25 flags: STMT_END_F -master-bin.000001 20422 Table_map 1 20461 table_id: 25 (test.t1) -master-bin.000001 20461 Write_rows 1 20495 table_id: 25 flags: STMT_END_F -master-bin.000001 20495 Table_map 1 20534 table_id: 25 (test.t1) -master-bin.000001 20534 Write_rows 1 20568 table_id: 25 flags: STMT_END_F -master-bin.000001 20568 Table_map 1 20607 table_id: 25 (test.t1) -master-bin.000001 20607 Write_rows 1 20641 table_id: 25 flags: STMT_END_F -master-bin.000001 20641 Table_map 1 20680 table_id: 25 (test.t1) -master-bin.000001 20680 Write_rows 1 20714 table_id: 25 flags: STMT_END_F -master-bin.000001 20714 Table_map 1 20753 table_id: 25 (test.t1) -master-bin.000001 20753 Write_rows 1 20787 table_id: 25 flags: STMT_END_F -master-bin.000001 20787 Table_map 1 20826 table_id: 25 (test.t1) -master-bin.000001 20826 Write_rows 1 20860 table_id: 25 flags: STMT_END_F -master-bin.000001 20860 Table_map 1 20899 table_id: 25 (test.t1) -master-bin.000001 20899 Write_rows 1 20933 table_id: 25 flags: STMT_END_F -master-bin.000001 20933 Table_map 1 20972 table_id: 25 (test.t1) -master-bin.000001 20972 Write_rows 1 21006 table_id: 25 flags: STMT_END_F -master-bin.000001 21006 Table_map 1 21045 table_id: 25 (test.t1) -master-bin.000001 21045 Write_rows 1 21079 table_id: 25 flags: STMT_END_F -master-bin.000001 21079 Table_map 1 21118 table_id: 25 (test.t1) -master-bin.000001 21118 Write_rows 1 21152 table_id: 25 flags: STMT_END_F -master-bin.000001 21152 Table_map 1 21191 table_id: 25 (test.t1) -master-bin.000001 21191 Write_rows 1 21225 table_id: 25 flags: STMT_END_F -master-bin.000001 21225 Table_map 1 21264 table_id: 25 (test.t1) -master-bin.000001 21264 Write_rows 1 21298 table_id: 25 flags: STMT_END_F -master-bin.000001 21298 Table_map 1 21337 table_id: 25 (test.t1) -master-bin.000001 21337 Write_rows 1 21371 table_id: 25 flags: STMT_END_F -master-bin.000001 21371 Table_map 1 21410 table_id: 25 (test.t1) -master-bin.000001 21410 Write_rows 1 21444 table_id: 25 flags: STMT_END_F -master-bin.000001 21444 Table_map 1 21483 table_id: 25 (test.t1) -master-bin.000001 21483 Write_rows 1 21517 table_id: 25 flags: STMT_END_F -master-bin.000001 21517 Table_map 1 21556 table_id: 25 (test.t1) -master-bin.000001 21556 Write_rows 1 21590 table_id: 25 flags: STMT_END_F -master-bin.000001 21590 Table_map 1 21629 table_id: 25 (test.t1) -master-bin.000001 21629 Write_rows 1 21663 table_id: 25 flags: STMT_END_F -master-bin.000001 21663 Table_map 1 21702 table_id: 25 (test.t1) -master-bin.000001 21702 Write_rows 1 21736 table_id: 25 flags: STMT_END_F -master-bin.000001 21736 Table_map 1 21775 table_id: 25 (test.t1) -master-bin.000001 21775 Write_rows 1 21809 table_id: 25 flags: STMT_END_F -master-bin.000001 21809 Table_map 1 21848 table_id: 25 (test.t1) -master-bin.000001 21848 Write_rows 1 21882 table_id: 25 flags: STMT_END_F -master-bin.000001 21882 Table_map 1 21921 table_id: 25 (test.t1) -master-bin.000001 21921 Write_rows 1 21955 table_id: 25 flags: STMT_END_F -master-bin.000001 21955 Table_map 1 21994 table_id: 25 (test.t1) -master-bin.000001 21994 Write_rows 1 22028 table_id: 25 flags: STMT_END_F -master-bin.000001 22028 Table_map 1 22067 table_id: 25 (test.t1) -master-bin.000001 22067 Write_rows 1 22101 table_id: 25 flags: STMT_END_F -master-bin.000001 22101 Table_map 1 22140 table_id: 25 (test.t1) -master-bin.000001 22140 Write_rows 1 22174 table_id: 25 flags: STMT_END_F -master-bin.000001 22174 Table_map 1 22213 table_id: 25 (test.t1) -master-bin.000001 22213 Write_rows 1 22247 table_id: 25 flags: STMT_END_F -master-bin.000001 22247 Table_map 1 22286 table_id: 25 (test.t1) -master-bin.000001 22286 Write_rows 1 22320 table_id: 25 flags: STMT_END_F -master-bin.000001 22320 Table_map 1 22359 table_id: 25 (test.t1) -master-bin.000001 22359 Write_rows 1 22393 table_id: 25 flags: STMT_END_F -master-bin.000001 22393 Table_map 1 22432 table_id: 25 (test.t1) -master-bin.000001 22432 Write_rows 1 22466 table_id: 25 flags: STMT_END_F -master-bin.000001 22466 Table_map 1 22505 table_id: 25 (test.t1) -master-bin.000001 22505 Write_rows 1 22539 table_id: 25 flags: STMT_END_F -master-bin.000001 22539 Table_map 1 22578 table_id: 25 (test.t1) -master-bin.000001 22578 Write_rows 1 22612 table_id: 25 flags: STMT_END_F -master-bin.000001 22612 Table_map 1 22651 table_id: 25 (test.t1) -master-bin.000001 22651 Write_rows 1 22685 table_id: 25 flags: STMT_END_F -master-bin.000001 22685 Table_map 1 22724 table_id: 25 (test.t1) -master-bin.000001 22724 Write_rows 1 22758 table_id: 25 flags: STMT_END_F -master-bin.000001 22758 Table_map 1 22797 table_id: 25 (test.t1) -master-bin.000001 22797 Write_rows 1 22831 table_id: 25 flags: STMT_END_F -master-bin.000001 22831 Table_map 1 22870 table_id: 25 (test.t1) -master-bin.000001 22870 Write_rows 1 22904 table_id: 25 flags: STMT_END_F -master-bin.000001 22904 Table_map 1 22943 table_id: 25 (test.t1) -master-bin.000001 22943 Write_rows 1 22977 table_id: 25 flags: STMT_END_F -master-bin.000001 22977 Table_map 1 23016 table_id: 25 (test.t1) -master-bin.000001 23016 Write_rows 1 23050 table_id: 25 flags: STMT_END_F -master-bin.000001 23050 Table_map 1 23089 table_id: 25 (test.t1) -master-bin.000001 23089 Write_rows 1 23123 table_id: 25 flags: STMT_END_F -master-bin.000001 23123 Table_map 1 23162 table_id: 25 (test.t1) -master-bin.000001 23162 Write_rows 1 23196 table_id: 25 flags: STMT_END_F -master-bin.000001 23196 Table_map 1 23235 table_id: 25 (test.t1) -master-bin.000001 23235 Write_rows 1 23269 table_id: 25 flags: STMT_END_F -master-bin.000001 23269 Table_map 1 23308 table_id: 25 (test.t1) -master-bin.000001 23308 Write_rows 1 23342 table_id: 25 flags: STMT_END_F -master-bin.000001 23342 Table_map 1 23381 table_id: 25 (test.t1) -master-bin.000001 23381 Write_rows 1 23415 table_id: 25 flags: STMT_END_F -master-bin.000001 23415 Table_map 1 23454 table_id: 25 (test.t1) -master-bin.000001 23454 Write_rows 1 23488 table_id: 25 flags: STMT_END_F -master-bin.000001 23488 Table_map 1 23527 table_id: 25 (test.t1) -master-bin.000001 23527 Write_rows 1 23561 table_id: 25 flags: STMT_END_F -master-bin.000001 23561 Table_map 1 23600 table_id: 25 (test.t1) -master-bin.000001 23600 Write_rows 1 23634 table_id: 25 flags: STMT_END_F -master-bin.000001 23634 Table_map 1 23673 table_id: 25 (test.t1) -master-bin.000001 23673 Write_rows 1 23707 table_id: 25 flags: STMT_END_F -master-bin.000001 23707 Table_map 1 23746 table_id: 25 (test.t1) -master-bin.000001 23746 Write_rows 1 23780 table_id: 25 flags: STMT_END_F -master-bin.000001 23780 Table_map 1 23819 table_id: 25 (test.t1) -master-bin.000001 23819 Write_rows 1 23853 table_id: 25 flags: STMT_END_F -master-bin.000001 23853 Table_map 1 23892 table_id: 25 (test.t1) -master-bin.000001 23892 Write_rows 1 23926 table_id: 25 flags: STMT_END_F -master-bin.000001 23926 Table_map 1 23965 table_id: 25 (test.t1) -master-bin.000001 23965 Write_rows 1 23999 table_id: 25 flags: STMT_END_F -master-bin.000001 23999 Table_map 1 24038 table_id: 25 (test.t1) -master-bin.000001 24038 Write_rows 1 24072 table_id: 25 flags: STMT_END_F -master-bin.000001 24072 Table_map 1 24111 table_id: 25 (test.t1) -master-bin.000001 24111 Write_rows 1 24145 table_id: 25 flags: STMT_END_F -master-bin.000001 24145 Table_map 1 24184 table_id: 25 (test.t1) -master-bin.000001 24184 Write_rows 1 24218 table_id: 25 flags: STMT_END_F -master-bin.000001 24218 Table_map 1 24257 table_id: 25 (test.t1) -master-bin.000001 24257 Write_rows 1 24291 table_id: 25 flags: STMT_END_F -master-bin.000001 24291 Table_map 1 24330 table_id: 25 (test.t1) -master-bin.000001 24330 Write_rows 1 24364 table_id: 25 flags: STMT_END_F -master-bin.000001 24364 Table_map 1 24403 table_id: 25 (test.t1) -master-bin.000001 24403 Write_rows 1 24437 table_id: 25 flags: STMT_END_F -master-bin.000001 24437 Table_map 1 24476 table_id: 25 (test.t1) -master-bin.000001 24476 Write_rows 1 24510 table_id: 25 flags: STMT_END_F -master-bin.000001 24510 Table_map 1 24549 table_id: 25 (test.t1) -master-bin.000001 24549 Write_rows 1 24583 table_id: 25 flags: STMT_END_F -master-bin.000001 24583 Table_map 1 24622 table_id: 25 (test.t1) -master-bin.000001 24622 Write_rows 1 24656 table_id: 25 flags: STMT_END_F -master-bin.000001 24656 Table_map 1 24695 table_id: 25 (test.t1) -master-bin.000001 24695 Write_rows 1 24729 table_id: 25 flags: STMT_END_F -master-bin.000001 24729 Table_map 1 24768 table_id: 25 (test.t1) -master-bin.000001 24768 Write_rows 1 24802 table_id: 25 flags: STMT_END_F -master-bin.000001 24802 Table_map 1 24841 table_id: 25 (test.t1) -master-bin.000001 24841 Write_rows 1 24875 table_id: 25 flags: STMT_END_F -master-bin.000001 24875 Table_map 1 24914 table_id: 25 (test.t1) -master-bin.000001 24914 Write_rows 1 24948 table_id: 25 flags: STMT_END_F -master-bin.000001 24948 Table_map 1 24987 table_id: 25 (test.t1) -master-bin.000001 24987 Write_rows 1 25021 table_id: 25 flags: STMT_END_F -master-bin.000001 25021 Table_map 1 25060 table_id: 25 (test.t1) -master-bin.000001 25060 Write_rows 1 25094 table_id: 25 flags: STMT_END_F -master-bin.000001 25094 Table_map 1 25133 table_id: 25 (test.t1) -master-bin.000001 25133 Write_rows 1 25167 table_id: 25 flags: STMT_END_F -master-bin.000001 25167 Table_map 1 25206 table_id: 25 (test.t1) -master-bin.000001 25206 Write_rows 1 25240 table_id: 25 flags: STMT_END_F -master-bin.000001 25240 Table_map 1 25279 table_id: 25 (test.t1) -master-bin.000001 25279 Write_rows 1 25313 table_id: 25 flags: STMT_END_F -master-bin.000001 25313 Table_map 1 25352 table_id: 25 (test.t1) -master-bin.000001 25352 Write_rows 1 25386 table_id: 25 flags: STMT_END_F -master-bin.000001 25386 Table_map 1 25425 table_id: 25 (test.t1) -master-bin.000001 25425 Write_rows 1 25459 table_id: 25 flags: STMT_END_F -master-bin.000001 25459 Table_map 1 25498 table_id: 25 (test.t1) -master-bin.000001 25498 Write_rows 1 25532 table_id: 25 flags: STMT_END_F -master-bin.000001 25532 Table_map 1 25571 table_id: 25 (test.t1) -master-bin.000001 25571 Write_rows 1 25605 table_id: 25 flags: STMT_END_F -master-bin.000001 25605 Table_map 1 25644 table_id: 25 (test.t1) -master-bin.000001 25644 Write_rows 1 25678 table_id: 25 flags: STMT_END_F -master-bin.000001 25678 Table_map 1 25717 table_id: 25 (test.t1) -master-bin.000001 25717 Write_rows 1 25751 table_id: 25 flags: STMT_END_F -master-bin.000001 25751 Table_map 1 25790 table_id: 25 (test.t1) -master-bin.000001 25790 Write_rows 1 25824 table_id: 25 flags: STMT_END_F -master-bin.000001 25824 Table_map 1 25863 table_id: 25 (test.t1) -master-bin.000001 25863 Write_rows 1 25897 table_id: 25 flags: STMT_END_F -master-bin.000001 25897 Table_map 1 25936 table_id: 25 (test.t1) -master-bin.000001 25936 Write_rows 1 25970 table_id: 25 flags: STMT_END_F -master-bin.000001 25970 Table_map 1 26009 table_id: 25 (test.t1) -master-bin.000001 26009 Write_rows 1 26043 table_id: 25 flags: STMT_END_F -master-bin.000001 26043 Table_map 1 26082 table_id: 25 (test.t1) -master-bin.000001 26082 Write_rows 1 26116 table_id: 25 flags: STMT_END_F -master-bin.000001 26116 Table_map 1 26155 table_id: 25 (test.t1) -master-bin.000001 26155 Write_rows 1 26189 table_id: 25 flags: STMT_END_F -master-bin.000001 26189 Table_map 1 26228 table_id: 25 (test.t1) -master-bin.000001 26228 Write_rows 1 26262 table_id: 25 flags: STMT_END_F -master-bin.000001 26262 Table_map 1 26301 table_id: 25 (test.t1) -master-bin.000001 26301 Write_rows 1 26335 table_id: 25 flags: STMT_END_F -master-bin.000001 26335 Table_map 1 26374 table_id: 25 (test.t1) -master-bin.000001 26374 Write_rows 1 26408 table_id: 25 flags: STMT_END_F -master-bin.000001 26408 Table_map 1 26447 table_id: 25 (test.t1) -master-bin.000001 26447 Write_rows 1 26481 table_id: 25 flags: STMT_END_F -master-bin.000001 26481 Table_map 1 26520 table_id: 25 (test.t1) -master-bin.000001 26520 Write_rows 1 26554 table_id: 25 flags: STMT_END_F -master-bin.000001 26554 Table_map 1 26593 table_id: 25 (test.t1) -master-bin.000001 26593 Write_rows 1 26627 table_id: 25 flags: STMT_END_F -master-bin.000001 26627 Table_map 1 26666 table_id: 25 (test.t1) -master-bin.000001 26666 Write_rows 1 26700 table_id: 25 flags: STMT_END_F -master-bin.000001 26700 Table_map 1 26739 table_id: 25 (test.t1) -master-bin.000001 26739 Write_rows 1 26773 table_id: 25 flags: STMT_END_F -master-bin.000001 26773 Table_map 1 26812 table_id: 25 (test.t1) -master-bin.000001 26812 Write_rows 1 26846 table_id: 25 flags: STMT_END_F -master-bin.000001 26846 Table_map 1 26885 table_id: 25 (test.t1) -master-bin.000001 26885 Write_rows 1 26919 table_id: 25 flags: STMT_END_F -master-bin.000001 26919 Table_map 1 26958 table_id: 25 (test.t1) -master-bin.000001 26958 Write_rows 1 26992 table_id: 25 flags: STMT_END_F -master-bin.000001 26992 Table_map 1 27031 table_id: 25 (test.t1) -master-bin.000001 27031 Write_rows 1 27065 table_id: 25 flags: STMT_END_F -master-bin.000001 27065 Table_map 1 27104 table_id: 25 (test.t1) -master-bin.000001 27104 Write_rows 1 27138 table_id: 25 flags: STMT_END_F -master-bin.000001 27138 Table_map 1 27177 table_id: 25 (test.t1) -master-bin.000001 27177 Write_rows 1 27211 table_id: 25 flags: STMT_END_F -master-bin.000001 27211 Table_map 1 27250 table_id: 25 (test.t1) -master-bin.000001 27250 Write_rows 1 27284 table_id: 25 flags: STMT_END_F -master-bin.000001 27284 Table_map 1 27323 table_id: 25 (test.t1) -master-bin.000001 27323 Write_rows 1 27357 table_id: 25 flags: STMT_END_F -master-bin.000001 27357 Table_map 1 27396 table_id: 25 (test.t1) -master-bin.000001 27396 Write_rows 1 27430 table_id: 25 flags: STMT_END_F -master-bin.000001 27430 Table_map 1 27469 table_id: 25 (test.t1) -master-bin.000001 27469 Write_rows 1 27503 table_id: 25 flags: STMT_END_F -master-bin.000001 27503 Table_map 1 27542 table_id: 25 (test.t1) -master-bin.000001 27542 Write_rows 1 27576 table_id: 25 flags: STMT_END_F -master-bin.000001 27576 Table_map 1 27615 table_id: 25 (test.t1) -master-bin.000001 27615 Write_rows 1 27649 table_id: 25 flags: STMT_END_F -master-bin.000001 27649 Table_map 1 27688 table_id: 25 (test.t1) -master-bin.000001 27688 Write_rows 1 27722 table_id: 25 flags: STMT_END_F -master-bin.000001 27722 Table_map 1 27761 table_id: 25 (test.t1) -master-bin.000001 27761 Write_rows 1 27795 table_id: 25 flags: STMT_END_F -master-bin.000001 27795 Table_map 1 27834 table_id: 25 (test.t1) -master-bin.000001 27834 Write_rows 1 27868 table_id: 25 flags: STMT_END_F -master-bin.000001 27868 Table_map 1 27907 table_id: 25 (test.t1) -master-bin.000001 27907 Write_rows 1 27941 table_id: 25 flags: STMT_END_F -master-bin.000001 27941 Table_map 1 27980 table_id: 25 (test.t1) -master-bin.000001 27980 Write_rows 1 28014 table_id: 25 flags: STMT_END_F -master-bin.000001 28014 Table_map 1 28053 table_id: 25 (test.t1) -master-bin.000001 28053 Write_rows 1 28087 table_id: 25 flags: STMT_END_F -master-bin.000001 28087 Table_map 1 28126 table_id: 25 (test.t1) -master-bin.000001 28126 Write_rows 1 28160 table_id: 25 flags: STMT_END_F -master-bin.000001 28160 Table_map 1 28199 table_id: 25 (test.t1) -master-bin.000001 28199 Write_rows 1 28233 table_id: 25 flags: STMT_END_F -master-bin.000001 28233 Table_map 1 28272 table_id: 25 (test.t1) -master-bin.000001 28272 Write_rows 1 28306 table_id: 25 flags: STMT_END_F -master-bin.000001 28306 Table_map 1 28345 table_id: 25 (test.t1) -master-bin.000001 28345 Write_rows 1 28379 table_id: 25 flags: STMT_END_F -master-bin.000001 28379 Table_map 1 28418 table_id: 25 (test.t1) -master-bin.000001 28418 Write_rows 1 28452 table_id: 25 flags: STMT_END_F -master-bin.000001 28452 Table_map 1 28491 table_id: 25 (test.t1) -master-bin.000001 28491 Write_rows 1 28525 table_id: 25 flags: STMT_END_F -master-bin.000001 28525 Table_map 1 28564 table_id: 25 (test.t1) -master-bin.000001 28564 Write_rows 1 28598 table_id: 25 flags: STMT_END_F -master-bin.000001 28598 Table_map 1 28637 table_id: 25 (test.t1) -master-bin.000001 28637 Write_rows 1 28671 table_id: 25 flags: STMT_END_F -master-bin.000001 28671 Table_map 1 28710 table_id: 25 (test.t1) -master-bin.000001 28710 Write_rows 1 28744 table_id: 25 flags: STMT_END_F -master-bin.000001 28744 Table_map 1 28783 table_id: 25 (test.t1) -master-bin.000001 28783 Write_rows 1 28817 table_id: 25 flags: STMT_END_F -master-bin.000001 28817 Table_map 1 28856 table_id: 25 (test.t1) -master-bin.000001 28856 Write_rows 1 28890 table_id: 25 flags: STMT_END_F -master-bin.000001 28890 Table_map 1 28929 table_id: 25 (test.t1) -master-bin.000001 28929 Write_rows 1 28963 table_id: 25 flags: STMT_END_F -master-bin.000001 28963 Table_map 1 29002 table_id: 25 (test.t1) -master-bin.000001 29002 Write_rows 1 29036 table_id: 25 flags: STMT_END_F -master-bin.000001 29036 Table_map 1 29075 table_id: 25 (test.t1) -master-bin.000001 29075 Write_rows 1 29109 table_id: 25 flags: STMT_END_F -master-bin.000001 29109 Table_map 1 29148 table_id: 25 (test.t1) -master-bin.000001 29148 Write_rows 1 29182 table_id: 25 flags: STMT_END_F -master-bin.000001 29182 Table_map 1 29221 table_id: 25 (test.t1) -master-bin.000001 29221 Write_rows 1 29255 table_id: 25 flags: STMT_END_F -master-bin.000001 29255 Table_map 1 29294 table_id: 25 (test.t1) -master-bin.000001 29294 Write_rows 1 29328 table_id: 25 flags: STMT_END_F -master-bin.000001 29328 Table_map 1 29367 table_id: 25 (test.t1) -master-bin.000001 29367 Write_rows 1 29401 table_id: 25 flags: STMT_END_F -master-bin.000001 29401 Table_map 1 29440 table_id: 25 (test.t1) -master-bin.000001 29440 Write_rows 1 29474 table_id: 25 flags: STMT_END_F -master-bin.000001 29474 Xid 1 29501 COMMIT /* xid=189 */ +master-bin.000001 274 Table_map 1 313 table_id: # (test.t1) +master-bin.000001 313 Write_rows 1 347 table_id: # flags: STMT_END_F +master-bin.000001 347 Table_map 1 386 table_id: # (test.t1) +master-bin.000001 386 Write_rows 1 420 table_id: # flags: STMT_END_F +master-bin.000001 420 Table_map 1 459 table_id: # (test.t1) +master-bin.000001 459 Write_rows 1 493 table_id: # flags: STMT_END_F +master-bin.000001 493 Table_map 1 532 table_id: # (test.t1) +master-bin.000001 532 Write_rows 1 566 table_id: # flags: STMT_END_F +master-bin.000001 566 Table_map 1 605 table_id: # (test.t1) +master-bin.000001 605 Write_rows 1 639 table_id: # flags: STMT_END_F +master-bin.000001 639 Table_map 1 678 table_id: # (test.t1) +master-bin.000001 678 Write_rows 1 712 table_id: # flags: STMT_END_F +master-bin.000001 712 Table_map 1 751 table_id: # (test.t1) +master-bin.000001 751 Write_rows 1 785 table_id: # flags: STMT_END_F +master-bin.000001 785 Table_map 1 824 table_id: # (test.t1) +master-bin.000001 824 Write_rows 1 858 table_id: # flags: STMT_END_F +master-bin.000001 858 Table_map 1 897 table_id: # (test.t1) +master-bin.000001 897 Write_rows 1 931 table_id: # flags: STMT_END_F +master-bin.000001 931 Table_map 1 970 table_id: # (test.t1) +master-bin.000001 970 Write_rows 1 1004 table_id: # flags: STMT_END_F +master-bin.000001 1004 Table_map 1 1043 table_id: # (test.t1) +master-bin.000001 1043 Write_rows 1 1077 table_id: # flags: STMT_END_F +master-bin.000001 1077 Table_map 1 1116 table_id: # (test.t1) +master-bin.000001 1116 Write_rows 1 1150 table_id: # flags: STMT_END_F +master-bin.000001 1150 Table_map 1 1189 table_id: # (test.t1) +master-bin.000001 1189 Write_rows 1 1223 table_id: # flags: STMT_END_F +master-bin.000001 1223 Table_map 1 1262 table_id: # (test.t1) +master-bin.000001 1262 Write_rows 1 1296 table_id: # flags: STMT_END_F +master-bin.000001 1296 Table_map 1 1335 table_id: # (test.t1) +master-bin.000001 1335 Write_rows 1 1369 table_id: # flags: STMT_END_F +master-bin.000001 1369 Table_map 1 1408 table_id: # (test.t1) +master-bin.000001 1408 Write_rows 1 1442 table_id: # flags: STMT_END_F +master-bin.000001 1442 Table_map 1 1481 table_id: # (test.t1) +master-bin.000001 1481 Write_rows 1 1515 table_id: # flags: STMT_END_F +master-bin.000001 1515 Table_map 1 1554 table_id: # (test.t1) +master-bin.000001 1554 Write_rows 1 1588 table_id: # flags: STMT_END_F +master-bin.000001 1588 Table_map 1 1627 table_id: # (test.t1) +master-bin.000001 1627 Write_rows 1 1661 table_id: # flags: STMT_END_F +master-bin.000001 1661 Table_map 1 1700 table_id: # (test.t1) +master-bin.000001 1700 Write_rows 1 1734 table_id: # flags: STMT_END_F +master-bin.000001 1734 Table_map 1 1773 table_id: # (test.t1) +master-bin.000001 1773 Write_rows 1 1807 table_id: # flags: STMT_END_F +master-bin.000001 1807 Table_map 1 1846 table_id: # (test.t1) +master-bin.000001 1846 Write_rows 1 1880 table_id: # flags: STMT_END_F +master-bin.000001 1880 Table_map 1 1919 table_id: # (test.t1) +master-bin.000001 1919 Write_rows 1 1953 table_id: # flags: STMT_END_F +master-bin.000001 1953 Table_map 1 1992 table_id: # (test.t1) +master-bin.000001 1992 Write_rows 1 2026 table_id: # flags: STMT_END_F +master-bin.000001 2026 Table_map 1 2065 table_id: # (test.t1) +master-bin.000001 2065 Write_rows 1 2099 table_id: # flags: STMT_END_F +master-bin.000001 2099 Table_map 1 2138 table_id: # (test.t1) +master-bin.000001 2138 Write_rows 1 2172 table_id: # flags: STMT_END_F +master-bin.000001 2172 Table_map 1 2211 table_id: # (test.t1) +master-bin.000001 2211 Write_rows 1 2245 table_id: # flags: STMT_END_F +master-bin.000001 2245 Table_map 1 2284 table_id: # (test.t1) +master-bin.000001 2284 Write_rows 1 2318 table_id: # flags: STMT_END_F +master-bin.000001 2318 Table_map 1 2357 table_id: # (test.t1) +master-bin.000001 2357 Write_rows 1 2391 table_id: # flags: STMT_END_F +master-bin.000001 2391 Table_map 1 2430 table_id: # (test.t1) +master-bin.000001 2430 Write_rows 1 2464 table_id: # flags: STMT_END_F +master-bin.000001 2464 Table_map 1 2503 table_id: # (test.t1) +master-bin.000001 2503 Write_rows 1 2537 table_id: # flags: STMT_END_F +master-bin.000001 2537 Table_map 1 2576 table_id: # (test.t1) +master-bin.000001 2576 Write_rows 1 2610 table_id: # flags: STMT_END_F +master-bin.000001 2610 Table_map 1 2649 table_id: # (test.t1) +master-bin.000001 2649 Write_rows 1 2683 table_id: # flags: STMT_END_F +master-bin.000001 2683 Table_map 1 2722 table_id: # (test.t1) +master-bin.000001 2722 Write_rows 1 2756 table_id: # flags: STMT_END_F +master-bin.000001 2756 Table_map 1 2795 table_id: # (test.t1) +master-bin.000001 2795 Write_rows 1 2829 table_id: # flags: STMT_END_F +master-bin.000001 2829 Table_map 1 2868 table_id: # (test.t1) +master-bin.000001 2868 Write_rows 1 2902 table_id: # flags: STMT_END_F +master-bin.000001 2902 Table_map 1 2941 table_id: # (test.t1) +master-bin.000001 2941 Write_rows 1 2975 table_id: # flags: STMT_END_F +master-bin.000001 2975 Table_map 1 3014 table_id: # (test.t1) +master-bin.000001 3014 Write_rows 1 3048 table_id: # flags: STMT_END_F +master-bin.000001 3048 Table_map 1 3087 table_id: # (test.t1) +master-bin.000001 3087 Write_rows 1 3121 table_id: # flags: STMT_END_F +master-bin.000001 3121 Table_map 1 3160 table_id: # (test.t1) +master-bin.000001 3160 Write_rows 1 3194 table_id: # flags: STMT_END_F +master-bin.000001 3194 Table_map 1 3233 table_id: # (test.t1) +master-bin.000001 3233 Write_rows 1 3267 table_id: # flags: STMT_END_F +master-bin.000001 3267 Table_map 1 3306 table_id: # (test.t1) +master-bin.000001 3306 Write_rows 1 3340 table_id: # flags: STMT_END_F +master-bin.000001 3340 Table_map 1 3379 table_id: # (test.t1) +master-bin.000001 3379 Write_rows 1 3413 table_id: # flags: STMT_END_F +master-bin.000001 3413 Table_map 1 3452 table_id: # (test.t1) +master-bin.000001 3452 Write_rows 1 3486 table_id: # flags: STMT_END_F +master-bin.000001 3486 Table_map 1 3525 table_id: # (test.t1) +master-bin.000001 3525 Write_rows 1 3559 table_id: # flags: STMT_END_F +master-bin.000001 3559 Table_map 1 3598 table_id: # (test.t1) +master-bin.000001 3598 Write_rows 1 3632 table_id: # flags: STMT_END_F +master-bin.000001 3632 Table_map 1 3671 table_id: # (test.t1) +master-bin.000001 3671 Write_rows 1 3705 table_id: # flags: STMT_END_F +master-bin.000001 3705 Table_map 1 3744 table_id: # (test.t1) +master-bin.000001 3744 Write_rows 1 3778 table_id: # flags: STMT_END_F +master-bin.000001 3778 Table_map 1 3817 table_id: # (test.t1) +master-bin.000001 3817 Write_rows 1 3851 table_id: # flags: STMT_END_F +master-bin.000001 3851 Table_map 1 3890 table_id: # (test.t1) +master-bin.000001 3890 Write_rows 1 3924 table_id: # flags: STMT_END_F +master-bin.000001 3924 Table_map 1 3963 table_id: # (test.t1) +master-bin.000001 3963 Write_rows 1 3997 table_id: # flags: STMT_END_F +master-bin.000001 3997 Table_map 1 4036 table_id: # (test.t1) +master-bin.000001 4036 Write_rows 1 4070 table_id: # flags: STMT_END_F +master-bin.000001 4070 Table_map 1 4109 table_id: # (test.t1) +master-bin.000001 4109 Write_rows 1 4143 table_id: # flags: STMT_END_F +master-bin.000001 4143 Table_map 1 4182 table_id: # (test.t1) +master-bin.000001 4182 Write_rows 1 4216 table_id: # flags: STMT_END_F +master-bin.000001 4216 Table_map 1 4255 table_id: # (test.t1) +master-bin.000001 4255 Write_rows 1 4289 table_id: # flags: STMT_END_F +master-bin.000001 4289 Table_map 1 4328 table_id: # (test.t1) +master-bin.000001 4328 Write_rows 1 4362 table_id: # flags: STMT_END_F +master-bin.000001 4362 Table_map 1 4401 table_id: # (test.t1) +master-bin.000001 4401 Write_rows 1 4435 table_id: # flags: STMT_END_F +master-bin.000001 4435 Table_map 1 4474 table_id: # (test.t1) +master-bin.000001 4474 Write_rows 1 4508 table_id: # flags: STMT_END_F +master-bin.000001 4508 Table_map 1 4547 table_id: # (test.t1) +master-bin.000001 4547 Write_rows 1 4581 table_id: # flags: STMT_END_F +master-bin.000001 4581 Table_map 1 4620 table_id: # (test.t1) +master-bin.000001 4620 Write_rows 1 4654 table_id: # flags: STMT_END_F +master-bin.000001 4654 Table_map 1 4693 table_id: # (test.t1) +master-bin.000001 4693 Write_rows 1 4727 table_id: # flags: STMT_END_F +master-bin.000001 4727 Table_map 1 4766 table_id: # (test.t1) +master-bin.000001 4766 Write_rows 1 4800 table_id: # flags: STMT_END_F +master-bin.000001 4800 Table_map 1 4839 table_id: # (test.t1) +master-bin.000001 4839 Write_rows 1 4873 table_id: # flags: STMT_END_F +master-bin.000001 4873 Table_map 1 4912 table_id: # (test.t1) +master-bin.000001 4912 Write_rows 1 4946 table_id: # flags: STMT_END_F +master-bin.000001 4946 Table_map 1 4985 table_id: # (test.t1) +master-bin.000001 4985 Write_rows 1 5019 table_id: # flags: STMT_END_F +master-bin.000001 5019 Table_map 1 5058 table_id: # (test.t1) +master-bin.000001 5058 Write_rows 1 5092 table_id: # flags: STMT_END_F +master-bin.000001 5092 Table_map 1 5131 table_id: # (test.t1) +master-bin.000001 5131 Write_rows 1 5165 table_id: # flags: STMT_END_F +master-bin.000001 5165 Table_map 1 5204 table_id: # (test.t1) +master-bin.000001 5204 Write_rows 1 5238 table_id: # flags: STMT_END_F +master-bin.000001 5238 Table_map 1 5277 table_id: # (test.t1) +master-bin.000001 5277 Write_rows 1 5311 table_id: # flags: STMT_END_F +master-bin.000001 5311 Table_map 1 5350 table_id: # (test.t1) +master-bin.000001 5350 Write_rows 1 5384 table_id: # flags: STMT_END_F +master-bin.000001 5384 Table_map 1 5423 table_id: # (test.t1) +master-bin.000001 5423 Write_rows 1 5457 table_id: # flags: STMT_END_F +master-bin.000001 5457 Table_map 1 5496 table_id: # (test.t1) +master-bin.000001 5496 Write_rows 1 5530 table_id: # flags: STMT_END_F +master-bin.000001 5530 Table_map 1 5569 table_id: # (test.t1) +master-bin.000001 5569 Write_rows 1 5603 table_id: # flags: STMT_END_F +master-bin.000001 5603 Table_map 1 5642 table_id: # (test.t1) +master-bin.000001 5642 Write_rows 1 5676 table_id: # flags: STMT_END_F +master-bin.000001 5676 Table_map 1 5715 table_id: # (test.t1) +master-bin.000001 5715 Write_rows 1 5749 table_id: # flags: STMT_END_F +master-bin.000001 5749 Table_map 1 5788 table_id: # (test.t1) +master-bin.000001 5788 Write_rows 1 5822 table_id: # flags: STMT_END_F +master-bin.000001 5822 Table_map 1 5861 table_id: # (test.t1) +master-bin.000001 5861 Write_rows 1 5895 table_id: # flags: STMT_END_F +master-bin.000001 5895 Table_map 1 5934 table_id: # (test.t1) +master-bin.000001 5934 Write_rows 1 5968 table_id: # flags: STMT_END_F +master-bin.000001 5968 Table_map 1 6007 table_id: # (test.t1) +master-bin.000001 6007 Write_rows 1 6041 table_id: # flags: STMT_END_F +master-bin.000001 6041 Table_map 1 6080 table_id: # (test.t1) +master-bin.000001 6080 Write_rows 1 6114 table_id: # flags: STMT_END_F +master-bin.000001 6114 Table_map 1 6153 table_id: # (test.t1) +master-bin.000001 6153 Write_rows 1 6187 table_id: # flags: STMT_END_F +master-bin.000001 6187 Table_map 1 6226 table_id: # (test.t1) +master-bin.000001 6226 Write_rows 1 6260 table_id: # flags: STMT_END_F +master-bin.000001 6260 Table_map 1 6299 table_id: # (test.t1) +master-bin.000001 6299 Write_rows 1 6333 table_id: # flags: STMT_END_F +master-bin.000001 6333 Table_map 1 6372 table_id: # (test.t1) +master-bin.000001 6372 Write_rows 1 6406 table_id: # flags: STMT_END_F +master-bin.000001 6406 Table_map 1 6445 table_id: # (test.t1) +master-bin.000001 6445 Write_rows 1 6479 table_id: # flags: STMT_END_F +master-bin.000001 6479 Table_map 1 6518 table_id: # (test.t1) +master-bin.000001 6518 Write_rows 1 6552 table_id: # flags: STMT_END_F +master-bin.000001 6552 Table_map 1 6591 table_id: # (test.t1) +master-bin.000001 6591 Write_rows 1 6625 table_id: # flags: STMT_END_F +master-bin.000001 6625 Table_map 1 6664 table_id: # (test.t1) +master-bin.000001 6664 Write_rows 1 6698 table_id: # flags: STMT_END_F +master-bin.000001 6698 Table_map 1 6737 table_id: # (test.t1) +master-bin.000001 6737 Write_rows 1 6771 table_id: # flags: STMT_END_F +master-bin.000001 6771 Table_map 1 6810 table_id: # (test.t1) +master-bin.000001 6810 Write_rows 1 6844 table_id: # flags: STMT_END_F +master-bin.000001 6844 Table_map 1 6883 table_id: # (test.t1) +master-bin.000001 6883 Write_rows 1 6917 table_id: # flags: STMT_END_F +master-bin.000001 6917 Table_map 1 6956 table_id: # (test.t1) +master-bin.000001 6956 Write_rows 1 6990 table_id: # flags: STMT_END_F +master-bin.000001 6990 Table_map 1 7029 table_id: # (test.t1) +master-bin.000001 7029 Write_rows 1 7063 table_id: # flags: STMT_END_F +master-bin.000001 7063 Table_map 1 7102 table_id: # (test.t1) +master-bin.000001 7102 Write_rows 1 7136 table_id: # flags: STMT_END_F +master-bin.000001 7136 Table_map 1 7175 table_id: # (test.t1) +master-bin.000001 7175 Write_rows 1 7209 table_id: # flags: STMT_END_F +master-bin.000001 7209 Table_map 1 7248 table_id: # (test.t1) +master-bin.000001 7248 Write_rows 1 7282 table_id: # flags: STMT_END_F +master-bin.000001 7282 Table_map 1 7321 table_id: # (test.t1) +master-bin.000001 7321 Write_rows 1 7355 table_id: # flags: STMT_END_F +master-bin.000001 7355 Table_map 1 7394 table_id: # (test.t1) +master-bin.000001 7394 Write_rows 1 7428 table_id: # flags: STMT_END_F +master-bin.000001 7428 Table_map 1 7467 table_id: # (test.t1) +master-bin.000001 7467 Write_rows 1 7501 table_id: # flags: STMT_END_F +master-bin.000001 7501 Table_map 1 7540 table_id: # (test.t1) +master-bin.000001 7540 Write_rows 1 7574 table_id: # flags: STMT_END_F +master-bin.000001 7574 Table_map 1 7613 table_id: # (test.t1) +master-bin.000001 7613 Write_rows 1 7647 table_id: # flags: STMT_END_F +master-bin.000001 7647 Table_map 1 7686 table_id: # (test.t1) +master-bin.000001 7686 Write_rows 1 7720 table_id: # flags: STMT_END_F +master-bin.000001 7720 Table_map 1 7759 table_id: # (test.t1) +master-bin.000001 7759 Write_rows 1 7793 table_id: # flags: STMT_END_F +master-bin.000001 7793 Table_map 1 7832 table_id: # (test.t1) +master-bin.000001 7832 Write_rows 1 7866 table_id: # flags: STMT_END_F +master-bin.000001 7866 Table_map 1 7905 table_id: # (test.t1) +master-bin.000001 7905 Write_rows 1 7939 table_id: # flags: STMT_END_F +master-bin.000001 7939 Table_map 1 7978 table_id: # (test.t1) +master-bin.000001 7978 Write_rows 1 8012 table_id: # flags: STMT_END_F +master-bin.000001 8012 Table_map 1 8051 table_id: # (test.t1) +master-bin.000001 8051 Write_rows 1 8085 table_id: # flags: STMT_END_F +master-bin.000001 8085 Table_map 1 8124 table_id: # (test.t1) +master-bin.000001 8124 Write_rows 1 8158 table_id: # flags: STMT_END_F +master-bin.000001 8158 Table_map 1 8197 table_id: # (test.t1) +master-bin.000001 8197 Write_rows 1 8231 table_id: # flags: STMT_END_F +master-bin.000001 8231 Table_map 1 8270 table_id: # (test.t1) +master-bin.000001 8270 Write_rows 1 8304 table_id: # flags: STMT_END_F +master-bin.000001 8304 Table_map 1 8343 table_id: # (test.t1) +master-bin.000001 8343 Write_rows 1 8377 table_id: # flags: STMT_END_F +master-bin.000001 8377 Table_map 1 8416 table_id: # (test.t1) +master-bin.000001 8416 Write_rows 1 8450 table_id: # flags: STMT_END_F +master-bin.000001 8450 Table_map 1 8489 table_id: # (test.t1) +master-bin.000001 8489 Write_rows 1 8523 table_id: # flags: STMT_END_F +master-bin.000001 8523 Table_map 1 8562 table_id: # (test.t1) +master-bin.000001 8562 Write_rows 1 8596 table_id: # flags: STMT_END_F +master-bin.000001 8596 Table_map 1 8635 table_id: # (test.t1) +master-bin.000001 8635 Write_rows 1 8669 table_id: # flags: STMT_END_F +master-bin.000001 8669 Table_map 1 8708 table_id: # (test.t1) +master-bin.000001 8708 Write_rows 1 8742 table_id: # flags: STMT_END_F +master-bin.000001 8742 Table_map 1 8781 table_id: # (test.t1) +master-bin.000001 8781 Write_rows 1 8815 table_id: # flags: STMT_END_F +master-bin.000001 8815 Table_map 1 8854 table_id: # (test.t1) +master-bin.000001 8854 Write_rows 1 8888 table_id: # flags: STMT_END_F +master-bin.000001 8888 Table_map 1 8927 table_id: # (test.t1) +master-bin.000001 8927 Write_rows 1 8961 table_id: # flags: STMT_END_F +master-bin.000001 8961 Table_map 1 9000 table_id: # (test.t1) +master-bin.000001 9000 Write_rows 1 9034 table_id: # flags: STMT_END_F +master-bin.000001 9034 Table_map 1 9073 table_id: # (test.t1) +master-bin.000001 9073 Write_rows 1 9107 table_id: # flags: STMT_END_F +master-bin.000001 9107 Table_map 1 9146 table_id: # (test.t1) +master-bin.000001 9146 Write_rows 1 9180 table_id: # flags: STMT_END_F +master-bin.000001 9180 Table_map 1 9219 table_id: # (test.t1) +master-bin.000001 9219 Write_rows 1 9253 table_id: # flags: STMT_END_F +master-bin.000001 9253 Table_map 1 9292 table_id: # (test.t1) +master-bin.000001 9292 Write_rows 1 9326 table_id: # flags: STMT_END_F +master-bin.000001 9326 Table_map 1 9365 table_id: # (test.t1) +master-bin.000001 9365 Write_rows 1 9399 table_id: # flags: STMT_END_F +master-bin.000001 9399 Table_map 1 9438 table_id: # (test.t1) +master-bin.000001 9438 Write_rows 1 9472 table_id: # flags: STMT_END_F +master-bin.000001 9472 Table_map 1 9511 table_id: # (test.t1) +master-bin.000001 9511 Write_rows 1 9545 table_id: # flags: STMT_END_F +master-bin.000001 9545 Table_map 1 9584 table_id: # (test.t1) +master-bin.000001 9584 Write_rows 1 9618 table_id: # flags: STMT_END_F +master-bin.000001 9618 Table_map 1 9657 table_id: # (test.t1) +master-bin.000001 9657 Write_rows 1 9691 table_id: # flags: STMT_END_F +master-bin.000001 9691 Table_map 1 9730 table_id: # (test.t1) +master-bin.000001 9730 Write_rows 1 9764 table_id: # flags: STMT_END_F +master-bin.000001 9764 Table_map 1 9803 table_id: # (test.t1) +master-bin.000001 9803 Write_rows 1 9837 table_id: # flags: STMT_END_F +master-bin.000001 9837 Table_map 1 9876 table_id: # (test.t1) +master-bin.000001 9876 Write_rows 1 9910 table_id: # flags: STMT_END_F +master-bin.000001 9910 Table_map 1 9949 table_id: # (test.t1) +master-bin.000001 9949 Write_rows 1 9983 table_id: # flags: STMT_END_F +master-bin.000001 9983 Table_map 1 10022 table_id: # (test.t1) +master-bin.000001 10022 Write_rows 1 10056 table_id: # flags: STMT_END_F +master-bin.000001 10056 Table_map 1 10095 table_id: # (test.t1) +master-bin.000001 10095 Write_rows 1 10129 table_id: # flags: STMT_END_F +master-bin.000001 10129 Table_map 1 10168 table_id: # (test.t1) +master-bin.000001 10168 Write_rows 1 10202 table_id: # flags: STMT_END_F +master-bin.000001 10202 Table_map 1 10241 table_id: # (test.t1) +master-bin.000001 10241 Write_rows 1 10275 table_id: # flags: STMT_END_F +master-bin.000001 10275 Table_map 1 10314 table_id: # (test.t1) +master-bin.000001 10314 Write_rows 1 10348 table_id: # flags: STMT_END_F +master-bin.000001 10348 Table_map 1 10387 table_id: # (test.t1) +master-bin.000001 10387 Write_rows 1 10421 table_id: # flags: STMT_END_F +master-bin.000001 10421 Table_map 1 10460 table_id: # (test.t1) +master-bin.000001 10460 Write_rows 1 10494 table_id: # flags: STMT_END_F +master-bin.000001 10494 Table_map 1 10533 table_id: # (test.t1) +master-bin.000001 10533 Write_rows 1 10567 table_id: # flags: STMT_END_F +master-bin.000001 10567 Table_map 1 10606 table_id: # (test.t1) +master-bin.000001 10606 Write_rows 1 10640 table_id: # flags: STMT_END_F +master-bin.000001 10640 Table_map 1 10679 table_id: # (test.t1) +master-bin.000001 10679 Write_rows 1 10713 table_id: # flags: STMT_END_F +master-bin.000001 10713 Table_map 1 10752 table_id: # (test.t1) +master-bin.000001 10752 Write_rows 1 10786 table_id: # flags: STMT_END_F +master-bin.000001 10786 Table_map 1 10825 table_id: # (test.t1) +master-bin.000001 10825 Write_rows 1 10859 table_id: # flags: STMT_END_F +master-bin.000001 10859 Table_map 1 10898 table_id: # (test.t1) +master-bin.000001 10898 Write_rows 1 10932 table_id: # flags: STMT_END_F +master-bin.000001 10932 Table_map 1 10971 table_id: # (test.t1) +master-bin.000001 10971 Write_rows 1 11005 table_id: # flags: STMT_END_F +master-bin.000001 11005 Table_map 1 11044 table_id: # (test.t1) +master-bin.000001 11044 Write_rows 1 11078 table_id: # flags: STMT_END_F +master-bin.000001 11078 Table_map 1 11117 table_id: # (test.t1) +master-bin.000001 11117 Write_rows 1 11151 table_id: # flags: STMT_END_F +master-bin.000001 11151 Table_map 1 11190 table_id: # (test.t1) +master-bin.000001 11190 Write_rows 1 11224 table_id: # flags: STMT_END_F +master-bin.000001 11224 Table_map 1 11263 table_id: # (test.t1) +master-bin.000001 11263 Write_rows 1 11297 table_id: # flags: STMT_END_F +master-bin.000001 11297 Table_map 1 11336 table_id: # (test.t1) +master-bin.000001 11336 Write_rows 1 11370 table_id: # flags: STMT_END_F +master-bin.000001 11370 Table_map 1 11409 table_id: # (test.t1) +master-bin.000001 11409 Write_rows 1 11443 table_id: # flags: STMT_END_F +master-bin.000001 11443 Table_map 1 11482 table_id: # (test.t1) +master-bin.000001 11482 Write_rows 1 11516 table_id: # flags: STMT_END_F +master-bin.000001 11516 Table_map 1 11555 table_id: # (test.t1) +master-bin.000001 11555 Write_rows 1 11589 table_id: # flags: STMT_END_F +master-bin.000001 11589 Table_map 1 11628 table_id: # (test.t1) +master-bin.000001 11628 Write_rows 1 11662 table_id: # flags: STMT_END_F +master-bin.000001 11662 Table_map 1 11701 table_id: # (test.t1) +master-bin.000001 11701 Write_rows 1 11735 table_id: # flags: STMT_END_F +master-bin.000001 11735 Table_map 1 11774 table_id: # (test.t1) +master-bin.000001 11774 Write_rows 1 11808 table_id: # flags: STMT_END_F +master-bin.000001 11808 Table_map 1 11847 table_id: # (test.t1) +master-bin.000001 11847 Write_rows 1 11881 table_id: # flags: STMT_END_F +master-bin.000001 11881 Table_map 1 11920 table_id: # (test.t1) +master-bin.000001 11920 Write_rows 1 11954 table_id: # flags: STMT_END_F +master-bin.000001 11954 Table_map 1 11993 table_id: # (test.t1) +master-bin.000001 11993 Write_rows 1 12027 table_id: # flags: STMT_END_F +master-bin.000001 12027 Table_map 1 12066 table_id: # (test.t1) +master-bin.000001 12066 Write_rows 1 12100 table_id: # flags: STMT_END_F +master-bin.000001 12100 Table_map 1 12139 table_id: # (test.t1) +master-bin.000001 12139 Write_rows 1 12173 table_id: # flags: STMT_END_F +master-bin.000001 12173 Table_map 1 12212 table_id: # (test.t1) +master-bin.000001 12212 Write_rows 1 12246 table_id: # flags: STMT_END_F +master-bin.000001 12246 Table_map 1 12285 table_id: # (test.t1) +master-bin.000001 12285 Write_rows 1 12319 table_id: # flags: STMT_END_F +master-bin.000001 12319 Table_map 1 12358 table_id: # (test.t1) +master-bin.000001 12358 Write_rows 1 12392 table_id: # flags: STMT_END_F +master-bin.000001 12392 Table_map 1 12431 table_id: # (test.t1) +master-bin.000001 12431 Write_rows 1 12465 table_id: # flags: STMT_END_F +master-bin.000001 12465 Table_map 1 12504 table_id: # (test.t1) +master-bin.000001 12504 Write_rows 1 12538 table_id: # flags: STMT_END_F +master-bin.000001 12538 Table_map 1 12577 table_id: # (test.t1) +master-bin.000001 12577 Write_rows 1 12611 table_id: # flags: STMT_END_F +master-bin.000001 12611 Table_map 1 12650 table_id: # (test.t1) +master-bin.000001 12650 Write_rows 1 12684 table_id: # flags: STMT_END_F +master-bin.000001 12684 Table_map 1 12723 table_id: # (test.t1) +master-bin.000001 12723 Write_rows 1 12757 table_id: # flags: STMT_END_F +master-bin.000001 12757 Table_map 1 12796 table_id: # (test.t1) +master-bin.000001 12796 Write_rows 1 12830 table_id: # flags: STMT_END_F +master-bin.000001 12830 Table_map 1 12869 table_id: # (test.t1) +master-bin.000001 12869 Write_rows 1 12903 table_id: # flags: STMT_END_F +master-bin.000001 12903 Table_map 1 12942 table_id: # (test.t1) +master-bin.000001 12942 Write_rows 1 12976 table_id: # flags: STMT_END_F +master-bin.000001 12976 Table_map 1 13015 table_id: # (test.t1) +master-bin.000001 13015 Write_rows 1 13049 table_id: # flags: STMT_END_F +master-bin.000001 13049 Table_map 1 13088 table_id: # (test.t1) +master-bin.000001 13088 Write_rows 1 13122 table_id: # flags: STMT_END_F +master-bin.000001 13122 Table_map 1 13161 table_id: # (test.t1) +master-bin.000001 13161 Write_rows 1 13195 table_id: # flags: STMT_END_F +master-bin.000001 13195 Table_map 1 13234 table_id: # (test.t1) +master-bin.000001 13234 Write_rows 1 13268 table_id: # flags: STMT_END_F +master-bin.000001 13268 Table_map 1 13307 table_id: # (test.t1) +master-bin.000001 13307 Write_rows 1 13341 table_id: # flags: STMT_END_F +master-bin.000001 13341 Table_map 1 13380 table_id: # (test.t1) +master-bin.000001 13380 Write_rows 1 13414 table_id: # flags: STMT_END_F +master-bin.000001 13414 Table_map 1 13453 table_id: # (test.t1) +master-bin.000001 13453 Write_rows 1 13487 table_id: # flags: STMT_END_F +master-bin.000001 13487 Table_map 1 13526 table_id: # (test.t1) +master-bin.000001 13526 Write_rows 1 13560 table_id: # flags: STMT_END_F +master-bin.000001 13560 Table_map 1 13599 table_id: # (test.t1) +master-bin.000001 13599 Write_rows 1 13633 table_id: # flags: STMT_END_F +master-bin.000001 13633 Table_map 1 13672 table_id: # (test.t1) +master-bin.000001 13672 Write_rows 1 13706 table_id: # flags: STMT_END_F +master-bin.000001 13706 Table_map 1 13745 table_id: # (test.t1) +master-bin.000001 13745 Write_rows 1 13779 table_id: # flags: STMT_END_F +master-bin.000001 13779 Table_map 1 13818 table_id: # (test.t1) +master-bin.000001 13818 Write_rows 1 13852 table_id: # flags: STMT_END_F +master-bin.000001 13852 Table_map 1 13891 table_id: # (test.t1) +master-bin.000001 13891 Write_rows 1 13925 table_id: # flags: STMT_END_F +master-bin.000001 13925 Table_map 1 13964 table_id: # (test.t1) +master-bin.000001 13964 Write_rows 1 13998 table_id: # flags: STMT_END_F +master-bin.000001 13998 Table_map 1 14037 table_id: # (test.t1) +master-bin.000001 14037 Write_rows 1 14071 table_id: # flags: STMT_END_F +master-bin.000001 14071 Table_map 1 14110 table_id: # (test.t1) +master-bin.000001 14110 Write_rows 1 14144 table_id: # flags: STMT_END_F +master-bin.000001 14144 Table_map 1 14183 table_id: # (test.t1) +master-bin.000001 14183 Write_rows 1 14217 table_id: # flags: STMT_END_F +master-bin.000001 14217 Table_map 1 14256 table_id: # (test.t1) +master-bin.000001 14256 Write_rows 1 14290 table_id: # flags: STMT_END_F +master-bin.000001 14290 Table_map 1 14329 table_id: # (test.t1) +master-bin.000001 14329 Write_rows 1 14363 table_id: # flags: STMT_END_F +master-bin.000001 14363 Table_map 1 14402 table_id: # (test.t1) +master-bin.000001 14402 Write_rows 1 14436 table_id: # flags: STMT_END_F +master-bin.000001 14436 Table_map 1 14475 table_id: # (test.t1) +master-bin.000001 14475 Write_rows 1 14509 table_id: # flags: STMT_END_F +master-bin.000001 14509 Table_map 1 14548 table_id: # (test.t1) +master-bin.000001 14548 Write_rows 1 14582 table_id: # flags: STMT_END_F +master-bin.000001 14582 Table_map 1 14621 table_id: # (test.t1) +master-bin.000001 14621 Write_rows 1 14655 table_id: # flags: STMT_END_F +master-bin.000001 14655 Table_map 1 14694 table_id: # (test.t1) +master-bin.000001 14694 Write_rows 1 14728 table_id: # flags: STMT_END_F +master-bin.000001 14728 Table_map 1 14767 table_id: # (test.t1) +master-bin.000001 14767 Write_rows 1 14801 table_id: # flags: STMT_END_F +master-bin.000001 14801 Table_map 1 14840 table_id: # (test.t1) +master-bin.000001 14840 Write_rows 1 14874 table_id: # flags: STMT_END_F +master-bin.000001 14874 Table_map 1 14913 table_id: # (test.t1) +master-bin.000001 14913 Write_rows 1 14947 table_id: # flags: STMT_END_F +master-bin.000001 14947 Table_map 1 14986 table_id: # (test.t1) +master-bin.000001 14986 Write_rows 1 15020 table_id: # flags: STMT_END_F +master-bin.000001 15020 Table_map 1 15059 table_id: # (test.t1) +master-bin.000001 15059 Write_rows 1 15093 table_id: # flags: STMT_END_F +master-bin.000001 15093 Table_map 1 15132 table_id: # (test.t1) +master-bin.000001 15132 Write_rows 1 15166 table_id: # flags: STMT_END_F +master-bin.000001 15166 Table_map 1 15205 table_id: # (test.t1) +master-bin.000001 15205 Write_rows 1 15239 table_id: # flags: STMT_END_F +master-bin.000001 15239 Table_map 1 15278 table_id: # (test.t1) +master-bin.000001 15278 Write_rows 1 15312 table_id: # flags: STMT_END_F +master-bin.000001 15312 Table_map 1 15351 table_id: # (test.t1) +master-bin.000001 15351 Write_rows 1 15385 table_id: # flags: STMT_END_F +master-bin.000001 15385 Table_map 1 15424 table_id: # (test.t1) +master-bin.000001 15424 Write_rows 1 15458 table_id: # flags: STMT_END_F +master-bin.000001 15458 Table_map 1 15497 table_id: # (test.t1) +master-bin.000001 15497 Write_rows 1 15531 table_id: # flags: STMT_END_F +master-bin.000001 15531 Table_map 1 15570 table_id: # (test.t1) +master-bin.000001 15570 Write_rows 1 15604 table_id: # flags: STMT_END_F +master-bin.000001 15604 Table_map 1 15643 table_id: # (test.t1) +master-bin.000001 15643 Write_rows 1 15677 table_id: # flags: STMT_END_F +master-bin.000001 15677 Table_map 1 15716 table_id: # (test.t1) +master-bin.000001 15716 Write_rows 1 15750 table_id: # flags: STMT_END_F +master-bin.000001 15750 Table_map 1 15789 table_id: # (test.t1) +master-bin.000001 15789 Write_rows 1 15823 table_id: # flags: STMT_END_F +master-bin.000001 15823 Table_map 1 15862 table_id: # (test.t1) +master-bin.000001 15862 Write_rows 1 15896 table_id: # flags: STMT_END_F +master-bin.000001 15896 Table_map 1 15935 table_id: # (test.t1) +master-bin.000001 15935 Write_rows 1 15969 table_id: # flags: STMT_END_F +master-bin.000001 15969 Table_map 1 16008 table_id: # (test.t1) +master-bin.000001 16008 Write_rows 1 16042 table_id: # flags: STMT_END_F +master-bin.000001 16042 Table_map 1 16081 table_id: # (test.t1) +master-bin.000001 16081 Write_rows 1 16115 table_id: # flags: STMT_END_F +master-bin.000001 16115 Table_map 1 16154 table_id: # (test.t1) +master-bin.000001 16154 Write_rows 1 16188 table_id: # flags: STMT_END_F +master-bin.000001 16188 Table_map 1 16227 table_id: # (test.t1) +master-bin.000001 16227 Write_rows 1 16261 table_id: # flags: STMT_END_F +master-bin.000001 16261 Table_map 1 16300 table_id: # (test.t1) +master-bin.000001 16300 Write_rows 1 16334 table_id: # flags: STMT_END_F +master-bin.000001 16334 Table_map 1 16373 table_id: # (test.t1) +master-bin.000001 16373 Write_rows 1 16407 table_id: # flags: STMT_END_F +master-bin.000001 16407 Table_map 1 16446 table_id: # (test.t1) +master-bin.000001 16446 Write_rows 1 16480 table_id: # flags: STMT_END_F +master-bin.000001 16480 Table_map 1 16519 table_id: # (test.t1) +master-bin.000001 16519 Write_rows 1 16553 table_id: # flags: STMT_END_F +master-bin.000001 16553 Table_map 1 16592 table_id: # (test.t1) +master-bin.000001 16592 Write_rows 1 16626 table_id: # flags: STMT_END_F +master-bin.000001 16626 Table_map 1 16665 table_id: # (test.t1) +master-bin.000001 16665 Write_rows 1 16699 table_id: # flags: STMT_END_F +master-bin.000001 16699 Table_map 1 16738 table_id: # (test.t1) +master-bin.000001 16738 Write_rows 1 16772 table_id: # flags: STMT_END_F +master-bin.000001 16772 Table_map 1 16811 table_id: # (test.t1) +master-bin.000001 16811 Write_rows 1 16845 table_id: # flags: STMT_END_F +master-bin.000001 16845 Table_map 1 16884 table_id: # (test.t1) +master-bin.000001 16884 Write_rows 1 16918 table_id: # flags: STMT_END_F +master-bin.000001 16918 Table_map 1 16957 table_id: # (test.t1) +master-bin.000001 16957 Write_rows 1 16991 table_id: # flags: STMT_END_F +master-bin.000001 16991 Table_map 1 17030 table_id: # (test.t1) +master-bin.000001 17030 Write_rows 1 17064 table_id: # flags: STMT_END_F +master-bin.000001 17064 Table_map 1 17103 table_id: # (test.t1) +master-bin.000001 17103 Write_rows 1 17137 table_id: # flags: STMT_END_F +master-bin.000001 17137 Table_map 1 17176 table_id: # (test.t1) +master-bin.000001 17176 Write_rows 1 17210 table_id: # flags: STMT_END_F +master-bin.000001 17210 Table_map 1 17249 table_id: # (test.t1) +master-bin.000001 17249 Write_rows 1 17283 table_id: # flags: STMT_END_F +master-bin.000001 17283 Table_map 1 17322 table_id: # (test.t1) +master-bin.000001 17322 Write_rows 1 17356 table_id: # flags: STMT_END_F +master-bin.000001 17356 Table_map 1 17395 table_id: # (test.t1) +master-bin.000001 17395 Write_rows 1 17429 table_id: # flags: STMT_END_F +master-bin.000001 17429 Table_map 1 17468 table_id: # (test.t1) +master-bin.000001 17468 Write_rows 1 17502 table_id: # flags: STMT_END_F +master-bin.000001 17502 Table_map 1 17541 table_id: # (test.t1) +master-bin.000001 17541 Write_rows 1 17575 table_id: # flags: STMT_END_F +master-bin.000001 17575 Table_map 1 17614 table_id: # (test.t1) +master-bin.000001 17614 Write_rows 1 17648 table_id: # flags: STMT_END_F +master-bin.000001 17648 Table_map 1 17687 table_id: # (test.t1) +master-bin.000001 17687 Write_rows 1 17721 table_id: # flags: STMT_END_F +master-bin.000001 17721 Table_map 1 17760 table_id: # (test.t1) +master-bin.000001 17760 Write_rows 1 17794 table_id: # flags: STMT_END_F +master-bin.000001 17794 Table_map 1 17833 table_id: # (test.t1) +master-bin.000001 17833 Write_rows 1 17867 table_id: # flags: STMT_END_F +master-bin.000001 17867 Table_map 1 17906 table_id: # (test.t1) +master-bin.000001 17906 Write_rows 1 17940 table_id: # flags: STMT_END_F +master-bin.000001 17940 Table_map 1 17979 table_id: # (test.t1) +master-bin.000001 17979 Write_rows 1 18013 table_id: # flags: STMT_END_F +master-bin.000001 18013 Table_map 1 18052 table_id: # (test.t1) +master-bin.000001 18052 Write_rows 1 18086 table_id: # flags: STMT_END_F +master-bin.000001 18086 Table_map 1 18125 table_id: # (test.t1) +master-bin.000001 18125 Write_rows 1 18159 table_id: # flags: STMT_END_F +master-bin.000001 18159 Table_map 1 18198 table_id: # (test.t1) +master-bin.000001 18198 Write_rows 1 18232 table_id: # flags: STMT_END_F +master-bin.000001 18232 Table_map 1 18271 table_id: # (test.t1) +master-bin.000001 18271 Write_rows 1 18305 table_id: # flags: STMT_END_F +master-bin.000001 18305 Table_map 1 18344 table_id: # (test.t1) +master-bin.000001 18344 Write_rows 1 18378 table_id: # flags: STMT_END_F +master-bin.000001 18378 Table_map 1 18417 table_id: # (test.t1) +master-bin.000001 18417 Write_rows 1 18451 table_id: # flags: STMT_END_F +master-bin.000001 18451 Table_map 1 18490 table_id: # (test.t1) +master-bin.000001 18490 Write_rows 1 18524 table_id: # flags: STMT_END_F +master-bin.000001 18524 Table_map 1 18563 table_id: # (test.t1) +master-bin.000001 18563 Write_rows 1 18597 table_id: # flags: STMT_END_F +master-bin.000001 18597 Table_map 1 18636 table_id: # (test.t1) +master-bin.000001 18636 Write_rows 1 18670 table_id: # flags: STMT_END_F +master-bin.000001 18670 Table_map 1 18709 table_id: # (test.t1) +master-bin.000001 18709 Write_rows 1 18743 table_id: # flags: STMT_END_F +master-bin.000001 18743 Table_map 1 18782 table_id: # (test.t1) +master-bin.000001 18782 Write_rows 1 18816 table_id: # flags: STMT_END_F +master-bin.000001 18816 Table_map 1 18855 table_id: # (test.t1) +master-bin.000001 18855 Write_rows 1 18889 table_id: # flags: STMT_END_F +master-bin.000001 18889 Table_map 1 18928 table_id: # (test.t1) +master-bin.000001 18928 Write_rows 1 18962 table_id: # flags: STMT_END_F +master-bin.000001 18962 Table_map 1 19001 table_id: # (test.t1) +master-bin.000001 19001 Write_rows 1 19035 table_id: # flags: STMT_END_F +master-bin.000001 19035 Table_map 1 19074 table_id: # (test.t1) +master-bin.000001 19074 Write_rows 1 19108 table_id: # flags: STMT_END_F +master-bin.000001 19108 Table_map 1 19147 table_id: # (test.t1) +master-bin.000001 19147 Write_rows 1 19181 table_id: # flags: STMT_END_F +master-bin.000001 19181 Table_map 1 19220 table_id: # (test.t1) +master-bin.000001 19220 Write_rows 1 19254 table_id: # flags: STMT_END_F +master-bin.000001 19254 Table_map 1 19293 table_id: # (test.t1) +master-bin.000001 19293 Write_rows 1 19327 table_id: # flags: STMT_END_F +master-bin.000001 19327 Table_map 1 19366 table_id: # (test.t1) +master-bin.000001 19366 Write_rows 1 19400 table_id: # flags: STMT_END_F +master-bin.000001 19400 Table_map 1 19439 table_id: # (test.t1) +master-bin.000001 19439 Write_rows 1 19473 table_id: # flags: STMT_END_F +master-bin.000001 19473 Table_map 1 19512 table_id: # (test.t1) +master-bin.000001 19512 Write_rows 1 19546 table_id: # flags: STMT_END_F +master-bin.000001 19546 Table_map 1 19585 table_id: # (test.t1) +master-bin.000001 19585 Write_rows 1 19619 table_id: # flags: STMT_END_F +master-bin.000001 19619 Table_map 1 19658 table_id: # (test.t1) +master-bin.000001 19658 Write_rows 1 19692 table_id: # flags: STMT_END_F +master-bin.000001 19692 Table_map 1 19731 table_id: # (test.t1) +master-bin.000001 19731 Write_rows 1 19765 table_id: # flags: STMT_END_F +master-bin.000001 19765 Table_map 1 19804 table_id: # (test.t1) +master-bin.000001 19804 Write_rows 1 19838 table_id: # flags: STMT_END_F +master-bin.000001 19838 Table_map 1 19877 table_id: # (test.t1) +master-bin.000001 19877 Write_rows 1 19911 table_id: # flags: STMT_END_F +master-bin.000001 19911 Table_map 1 19950 table_id: # (test.t1) +master-bin.000001 19950 Write_rows 1 19984 table_id: # flags: STMT_END_F +master-bin.000001 19984 Table_map 1 20023 table_id: # (test.t1) +master-bin.000001 20023 Write_rows 1 20057 table_id: # flags: STMT_END_F +master-bin.000001 20057 Table_map 1 20096 table_id: # (test.t1) +master-bin.000001 20096 Write_rows 1 20130 table_id: # flags: STMT_END_F +master-bin.000001 20130 Table_map 1 20169 table_id: # (test.t1) +master-bin.000001 20169 Write_rows 1 20203 table_id: # flags: STMT_END_F +master-bin.000001 20203 Table_map 1 20242 table_id: # (test.t1) +master-bin.000001 20242 Write_rows 1 20276 table_id: # flags: STMT_END_F +master-bin.000001 20276 Table_map 1 20315 table_id: # (test.t1) +master-bin.000001 20315 Write_rows 1 20349 table_id: # flags: STMT_END_F +master-bin.000001 20349 Table_map 1 20388 table_id: # (test.t1) +master-bin.000001 20388 Write_rows 1 20422 table_id: # flags: STMT_END_F +master-bin.000001 20422 Table_map 1 20461 table_id: # (test.t1) +master-bin.000001 20461 Write_rows 1 20495 table_id: # flags: STMT_END_F +master-bin.000001 20495 Table_map 1 20534 table_id: # (test.t1) +master-bin.000001 20534 Write_rows 1 20568 table_id: # flags: STMT_END_F +master-bin.000001 20568 Table_map 1 20607 table_id: # (test.t1) +master-bin.000001 20607 Write_rows 1 20641 table_id: # flags: STMT_END_F +master-bin.000001 20641 Table_map 1 20680 table_id: # (test.t1) +master-bin.000001 20680 Write_rows 1 20714 table_id: # flags: STMT_END_F +master-bin.000001 20714 Table_map 1 20753 table_id: # (test.t1) +master-bin.000001 20753 Write_rows 1 20787 table_id: # flags: STMT_END_F +master-bin.000001 20787 Table_map 1 20826 table_id: # (test.t1) +master-bin.000001 20826 Write_rows 1 20860 table_id: # flags: STMT_END_F +master-bin.000001 20860 Table_map 1 20899 table_id: # (test.t1) +master-bin.000001 20899 Write_rows 1 20933 table_id: # flags: STMT_END_F +master-bin.000001 20933 Table_map 1 20972 table_id: # (test.t1) +master-bin.000001 20972 Write_rows 1 21006 table_id: # flags: STMT_END_F +master-bin.000001 21006 Table_map 1 21045 table_id: # (test.t1) +master-bin.000001 21045 Write_rows 1 21079 table_id: # flags: STMT_END_F +master-bin.000001 21079 Table_map 1 21118 table_id: # (test.t1) +master-bin.000001 21118 Write_rows 1 21152 table_id: # flags: STMT_END_F +master-bin.000001 21152 Table_map 1 21191 table_id: # (test.t1) +master-bin.000001 21191 Write_rows 1 21225 table_id: # flags: STMT_END_F +master-bin.000001 21225 Table_map 1 21264 table_id: # (test.t1) +master-bin.000001 21264 Write_rows 1 21298 table_id: # flags: STMT_END_F +master-bin.000001 21298 Table_map 1 21337 table_id: # (test.t1) +master-bin.000001 21337 Write_rows 1 21371 table_id: # flags: STMT_END_F +master-bin.000001 21371 Table_map 1 21410 table_id: # (test.t1) +master-bin.000001 21410 Write_rows 1 21444 table_id: # flags: STMT_END_F +master-bin.000001 21444 Table_map 1 21483 table_id: # (test.t1) +master-bin.000001 21483 Write_rows 1 21517 table_id: # flags: STMT_END_F +master-bin.000001 21517 Table_map 1 21556 table_id: # (test.t1) +master-bin.000001 21556 Write_rows 1 21590 table_id: # flags: STMT_END_F +master-bin.000001 21590 Table_map 1 21629 table_id: # (test.t1) +master-bin.000001 21629 Write_rows 1 21663 table_id: # flags: STMT_END_F +master-bin.000001 21663 Table_map 1 21702 table_id: # (test.t1) +master-bin.000001 21702 Write_rows 1 21736 table_id: # flags: STMT_END_F +master-bin.000001 21736 Table_map 1 21775 table_id: # (test.t1) +master-bin.000001 21775 Write_rows 1 21809 table_id: # flags: STMT_END_F +master-bin.000001 21809 Table_map 1 21848 table_id: # (test.t1) +master-bin.000001 21848 Write_rows 1 21882 table_id: # flags: STMT_END_F +master-bin.000001 21882 Table_map 1 21921 table_id: # (test.t1) +master-bin.000001 21921 Write_rows 1 21955 table_id: # flags: STMT_END_F +master-bin.000001 21955 Table_map 1 21994 table_id: # (test.t1) +master-bin.000001 21994 Write_rows 1 22028 table_id: # flags: STMT_END_F +master-bin.000001 22028 Table_map 1 22067 table_id: # (test.t1) +master-bin.000001 22067 Write_rows 1 22101 table_id: # flags: STMT_END_F +master-bin.000001 22101 Table_map 1 22140 table_id: # (test.t1) +master-bin.000001 22140 Write_rows 1 22174 table_id: # flags: STMT_END_F +master-bin.000001 22174 Table_map 1 22213 table_id: # (test.t1) +master-bin.000001 22213 Write_rows 1 22247 table_id: # flags: STMT_END_F +master-bin.000001 22247 Table_map 1 22286 table_id: # (test.t1) +master-bin.000001 22286 Write_rows 1 22320 table_id: # flags: STMT_END_F +master-bin.000001 22320 Table_map 1 22359 table_id: # (test.t1) +master-bin.000001 22359 Write_rows 1 22393 table_id: # flags: STMT_END_F +master-bin.000001 22393 Table_map 1 22432 table_id: # (test.t1) +master-bin.000001 22432 Write_rows 1 22466 table_id: # flags: STMT_END_F +master-bin.000001 22466 Table_map 1 22505 table_id: # (test.t1) +master-bin.000001 22505 Write_rows 1 22539 table_id: # flags: STMT_END_F +master-bin.000001 22539 Table_map 1 22578 table_id: # (test.t1) +master-bin.000001 22578 Write_rows 1 22612 table_id: # flags: STMT_END_F +master-bin.000001 22612 Table_map 1 22651 table_id: # (test.t1) +master-bin.000001 22651 Write_rows 1 22685 table_id: # flags: STMT_END_F +master-bin.000001 22685 Table_map 1 22724 table_id: # (test.t1) +master-bin.000001 22724 Write_rows 1 22758 table_id: # flags: STMT_END_F +master-bin.000001 22758 Table_map 1 22797 table_id: # (test.t1) +master-bin.000001 22797 Write_rows 1 22831 table_id: # flags: STMT_END_F +master-bin.000001 22831 Table_map 1 22870 table_id: # (test.t1) +master-bin.000001 22870 Write_rows 1 22904 table_id: # flags: STMT_END_F +master-bin.000001 22904 Table_map 1 22943 table_id: # (test.t1) +master-bin.000001 22943 Write_rows 1 22977 table_id: # flags: STMT_END_F +master-bin.000001 22977 Table_map 1 23016 table_id: # (test.t1) +master-bin.000001 23016 Write_rows 1 23050 table_id: # flags: STMT_END_F +master-bin.000001 23050 Table_map 1 23089 table_id: # (test.t1) +master-bin.000001 23089 Write_rows 1 23123 table_id: # flags: STMT_END_F +master-bin.000001 23123 Table_map 1 23162 table_id: # (test.t1) +master-bin.000001 23162 Write_rows 1 23196 table_id: # flags: STMT_END_F +master-bin.000001 23196 Table_map 1 23235 table_id: # (test.t1) +master-bin.000001 23235 Write_rows 1 23269 table_id: # flags: STMT_END_F +master-bin.000001 23269 Table_map 1 23308 table_id: # (test.t1) +master-bin.000001 23308 Write_rows 1 23342 table_id: # flags: STMT_END_F +master-bin.000001 23342 Table_map 1 23381 table_id: # (test.t1) +master-bin.000001 23381 Write_rows 1 23415 table_id: # flags: STMT_END_F +master-bin.000001 23415 Table_map 1 23454 table_id: # (test.t1) +master-bin.000001 23454 Write_rows 1 23488 table_id: # flags: STMT_END_F +master-bin.000001 23488 Table_map 1 23527 table_id: # (test.t1) +master-bin.000001 23527 Write_rows 1 23561 table_id: # flags: STMT_END_F +master-bin.000001 23561 Table_map 1 23600 table_id: # (test.t1) +master-bin.000001 23600 Write_rows 1 23634 table_id: # flags: STMT_END_F +master-bin.000001 23634 Table_map 1 23673 table_id: # (test.t1) +master-bin.000001 23673 Write_rows 1 23707 table_id: # flags: STMT_END_F +master-bin.000001 23707 Table_map 1 23746 table_id: # (test.t1) +master-bin.000001 23746 Write_rows 1 23780 table_id: # flags: STMT_END_F +master-bin.000001 23780 Table_map 1 23819 table_id: # (test.t1) +master-bin.000001 23819 Write_rows 1 23853 table_id: # flags: STMT_END_F +master-bin.000001 23853 Table_map 1 23892 table_id: # (test.t1) +master-bin.000001 23892 Write_rows 1 23926 table_id: # flags: STMT_END_F +master-bin.000001 23926 Table_map 1 23965 table_id: # (test.t1) +master-bin.000001 23965 Write_rows 1 23999 table_id: # flags: STMT_END_F +master-bin.000001 23999 Table_map 1 24038 table_id: # (test.t1) +master-bin.000001 24038 Write_rows 1 24072 table_id: # flags: STMT_END_F +master-bin.000001 24072 Table_map 1 24111 table_id: # (test.t1) +master-bin.000001 24111 Write_rows 1 24145 table_id: # flags: STMT_END_F +master-bin.000001 24145 Table_map 1 24184 table_id: # (test.t1) +master-bin.000001 24184 Write_rows 1 24218 table_id: # flags: STMT_END_F +master-bin.000001 24218 Table_map 1 24257 table_id: # (test.t1) +master-bin.000001 24257 Write_rows 1 24291 table_id: # flags: STMT_END_F +master-bin.000001 24291 Table_map 1 24330 table_id: # (test.t1) +master-bin.000001 24330 Write_rows 1 24364 table_id: # flags: STMT_END_F +master-bin.000001 24364 Table_map 1 24403 table_id: # (test.t1) +master-bin.000001 24403 Write_rows 1 24437 table_id: # flags: STMT_END_F +master-bin.000001 24437 Table_map 1 24476 table_id: # (test.t1) +master-bin.000001 24476 Write_rows 1 24510 table_id: # flags: STMT_END_F +master-bin.000001 24510 Table_map 1 24549 table_id: # (test.t1) +master-bin.000001 24549 Write_rows 1 24583 table_id: # flags: STMT_END_F +master-bin.000001 24583 Table_map 1 24622 table_id: # (test.t1) +master-bin.000001 24622 Write_rows 1 24656 table_id: # flags: STMT_END_F +master-bin.000001 24656 Table_map 1 24695 table_id: # (test.t1) +master-bin.000001 24695 Write_rows 1 24729 table_id: # flags: STMT_END_F +master-bin.000001 24729 Table_map 1 24768 table_id: # (test.t1) +master-bin.000001 24768 Write_rows 1 24802 table_id: # flags: STMT_END_F +master-bin.000001 24802 Table_map 1 24841 table_id: # (test.t1) +master-bin.000001 24841 Write_rows 1 24875 table_id: # flags: STMT_END_F +master-bin.000001 24875 Table_map 1 24914 table_id: # (test.t1) +master-bin.000001 24914 Write_rows 1 24948 table_id: # flags: STMT_END_F +master-bin.000001 24948 Table_map 1 24987 table_id: # (test.t1) +master-bin.000001 24987 Write_rows 1 25021 table_id: # flags: STMT_END_F +master-bin.000001 25021 Table_map 1 25060 table_id: # (test.t1) +master-bin.000001 25060 Write_rows 1 25094 table_id: # flags: STMT_END_F +master-bin.000001 25094 Table_map 1 25133 table_id: # (test.t1) +master-bin.000001 25133 Write_rows 1 25167 table_id: # flags: STMT_END_F +master-bin.000001 25167 Table_map 1 25206 table_id: # (test.t1) +master-bin.000001 25206 Write_rows 1 25240 table_id: # flags: STMT_END_F +master-bin.000001 25240 Table_map 1 25279 table_id: # (test.t1) +master-bin.000001 25279 Write_rows 1 25313 table_id: # flags: STMT_END_F +master-bin.000001 25313 Table_map 1 25352 table_id: # (test.t1) +master-bin.000001 25352 Write_rows 1 25386 table_id: # flags: STMT_END_F +master-bin.000001 25386 Table_map 1 25425 table_id: # (test.t1) +master-bin.000001 25425 Write_rows 1 25459 table_id: # flags: STMT_END_F +master-bin.000001 25459 Table_map 1 25498 table_id: # (test.t1) +master-bin.000001 25498 Write_rows 1 25532 table_id: # flags: STMT_END_F +master-bin.000001 25532 Table_map 1 25571 table_id: # (test.t1) +master-bin.000001 25571 Write_rows 1 25605 table_id: # flags: STMT_END_F +master-bin.000001 25605 Table_map 1 25644 table_id: # (test.t1) +master-bin.000001 25644 Write_rows 1 25678 table_id: # flags: STMT_END_F +master-bin.000001 25678 Table_map 1 25717 table_id: # (test.t1) +master-bin.000001 25717 Write_rows 1 25751 table_id: # flags: STMT_END_F +master-bin.000001 25751 Table_map 1 25790 table_id: # (test.t1) +master-bin.000001 25790 Write_rows 1 25824 table_id: # flags: STMT_END_F +master-bin.000001 25824 Table_map 1 25863 table_id: # (test.t1) +master-bin.000001 25863 Write_rows 1 25897 table_id: # flags: STMT_END_F +master-bin.000001 25897 Table_map 1 25936 table_id: # (test.t1) +master-bin.000001 25936 Write_rows 1 25970 table_id: # flags: STMT_END_F +master-bin.000001 25970 Table_map 1 26009 table_id: # (test.t1) +master-bin.000001 26009 Write_rows 1 26043 table_id: # flags: STMT_END_F +master-bin.000001 26043 Table_map 1 26082 table_id: # (test.t1) +master-bin.000001 26082 Write_rows 1 26116 table_id: # flags: STMT_END_F +master-bin.000001 26116 Table_map 1 26155 table_id: # (test.t1) +master-bin.000001 26155 Write_rows 1 26189 table_id: # flags: STMT_END_F +master-bin.000001 26189 Table_map 1 26228 table_id: # (test.t1) +master-bin.000001 26228 Write_rows 1 26262 table_id: # flags: STMT_END_F +master-bin.000001 26262 Table_map 1 26301 table_id: # (test.t1) +master-bin.000001 26301 Write_rows 1 26335 table_id: # flags: STMT_END_F +master-bin.000001 26335 Table_map 1 26374 table_id: # (test.t1) +master-bin.000001 26374 Write_rows 1 26408 table_id: # flags: STMT_END_F +master-bin.000001 26408 Table_map 1 26447 table_id: # (test.t1) +master-bin.000001 26447 Write_rows 1 26481 table_id: # flags: STMT_END_F +master-bin.000001 26481 Table_map 1 26520 table_id: # (test.t1) +master-bin.000001 26520 Write_rows 1 26554 table_id: # flags: STMT_END_F +master-bin.000001 26554 Table_map 1 26593 table_id: # (test.t1) +master-bin.000001 26593 Write_rows 1 26627 table_id: # flags: STMT_END_F +master-bin.000001 26627 Table_map 1 26666 table_id: # (test.t1) +master-bin.000001 26666 Write_rows 1 26700 table_id: # flags: STMT_END_F +master-bin.000001 26700 Table_map 1 26739 table_id: # (test.t1) +master-bin.000001 26739 Write_rows 1 26773 table_id: # flags: STMT_END_F +master-bin.000001 26773 Table_map 1 26812 table_id: # (test.t1) +master-bin.000001 26812 Write_rows 1 26846 table_id: # flags: STMT_END_F +master-bin.000001 26846 Table_map 1 26885 table_id: # (test.t1) +master-bin.000001 26885 Write_rows 1 26919 table_id: # flags: STMT_END_F +master-bin.000001 26919 Table_map 1 26958 table_id: # (test.t1) +master-bin.000001 26958 Write_rows 1 26992 table_id: # flags: STMT_END_F +master-bin.000001 26992 Table_map 1 27031 table_id: # (test.t1) +master-bin.000001 27031 Write_rows 1 27065 table_id: # flags: STMT_END_F +master-bin.000001 27065 Table_map 1 27104 table_id: # (test.t1) +master-bin.000001 27104 Write_rows 1 27138 table_id: # flags: STMT_END_F +master-bin.000001 27138 Table_map 1 27177 table_id: # (test.t1) +master-bin.000001 27177 Write_rows 1 27211 table_id: # flags: STMT_END_F +master-bin.000001 27211 Table_map 1 27250 table_id: # (test.t1) +master-bin.000001 27250 Write_rows 1 27284 table_id: # flags: STMT_END_F +master-bin.000001 27284 Table_map 1 27323 table_id: # (test.t1) +master-bin.000001 27323 Write_rows 1 27357 table_id: # flags: STMT_END_F +master-bin.000001 27357 Table_map 1 27396 table_id: # (test.t1) +master-bin.000001 27396 Write_rows 1 27430 table_id: # flags: STMT_END_F +master-bin.000001 27430 Table_map 1 27469 table_id: # (test.t1) +master-bin.000001 27469 Write_rows 1 27503 table_id: # flags: STMT_END_F +master-bin.000001 27503 Table_map 1 27542 table_id: # (test.t1) +master-bin.000001 27542 Write_rows 1 27576 table_id: # flags: STMT_END_F +master-bin.000001 27576 Table_map 1 27615 table_id: # (test.t1) +master-bin.000001 27615 Write_rows 1 27649 table_id: # flags: STMT_END_F +master-bin.000001 27649 Table_map 1 27688 table_id: # (test.t1) +master-bin.000001 27688 Write_rows 1 27722 table_id: # flags: STMT_END_F +master-bin.000001 27722 Table_map 1 27761 table_id: # (test.t1) +master-bin.000001 27761 Write_rows 1 27795 table_id: # flags: STMT_END_F +master-bin.000001 27795 Table_map 1 27834 table_id: # (test.t1) +master-bin.000001 27834 Write_rows 1 27868 table_id: # flags: STMT_END_F +master-bin.000001 27868 Table_map 1 27907 table_id: # (test.t1) +master-bin.000001 27907 Write_rows 1 27941 table_id: # flags: STMT_END_F +master-bin.000001 27941 Table_map 1 27980 table_id: # (test.t1) +master-bin.000001 27980 Write_rows 1 28014 table_id: # flags: STMT_END_F +master-bin.000001 28014 Table_map 1 28053 table_id: # (test.t1) +master-bin.000001 28053 Write_rows 1 28087 table_id: # flags: STMT_END_F +master-bin.000001 28087 Table_map 1 28126 table_id: # (test.t1) +master-bin.000001 28126 Write_rows 1 28160 table_id: # flags: STMT_END_F +master-bin.000001 28160 Table_map 1 28199 table_id: # (test.t1) +master-bin.000001 28199 Write_rows 1 28233 table_id: # flags: STMT_END_F +master-bin.000001 28233 Table_map 1 28272 table_id: # (test.t1) +master-bin.000001 28272 Write_rows 1 28306 table_id: # flags: STMT_END_F +master-bin.000001 28306 Table_map 1 28345 table_id: # (test.t1) +master-bin.000001 28345 Write_rows 1 28379 table_id: # flags: STMT_END_F +master-bin.000001 28379 Table_map 1 28418 table_id: # (test.t1) +master-bin.000001 28418 Write_rows 1 28452 table_id: # flags: STMT_END_F +master-bin.000001 28452 Table_map 1 28491 table_id: # (test.t1) +master-bin.000001 28491 Write_rows 1 28525 table_id: # flags: STMT_END_F +master-bin.000001 28525 Table_map 1 28564 table_id: # (test.t1) +master-bin.000001 28564 Write_rows 1 28598 table_id: # flags: STMT_END_F +master-bin.000001 28598 Table_map 1 28637 table_id: # (test.t1) +master-bin.000001 28637 Write_rows 1 28671 table_id: # flags: STMT_END_F +master-bin.000001 28671 Table_map 1 28710 table_id: # (test.t1) +master-bin.000001 28710 Write_rows 1 28744 table_id: # flags: STMT_END_F +master-bin.000001 28744 Table_map 1 28783 table_id: # (test.t1) +master-bin.000001 28783 Write_rows 1 28817 table_id: # flags: STMT_END_F +master-bin.000001 28817 Table_map 1 28856 table_id: # (test.t1) +master-bin.000001 28856 Write_rows 1 28890 table_id: # flags: STMT_END_F +master-bin.000001 28890 Table_map 1 28929 table_id: # (test.t1) +master-bin.000001 28929 Write_rows 1 28963 table_id: # flags: STMT_END_F +master-bin.000001 28963 Table_map 1 29002 table_id: # (test.t1) +master-bin.000001 29002 Write_rows 1 29036 table_id: # flags: STMT_END_F +master-bin.000001 29036 Table_map 1 29075 table_id: # (test.t1) +master-bin.000001 29075 Write_rows 1 29109 table_id: # flags: STMT_END_F +master-bin.000001 29109 Table_map 1 29148 table_id: # (test.t1) +master-bin.000001 29148 Write_rows 1 29182 table_id: # flags: STMT_END_F +master-bin.000001 29182 Table_map 1 29221 table_id: # (test.t1) +master-bin.000001 29221 Write_rows 1 29255 table_id: # flags: STMT_END_F +master-bin.000001 29255 Table_map 1 29294 table_id: # (test.t1) +master-bin.000001 29294 Write_rows 1 29328 table_id: # flags: STMT_END_F +master-bin.000001 29328 Table_map 1 29367 table_id: # (test.t1) +master-bin.000001 29367 Write_rows 1 29401 table_id: # flags: STMT_END_F +master-bin.000001 29401 Table_map 1 29440 table_id: # (test.t1) +master-bin.000001 29440 Write_rows 1 29474 table_id: # flags: STMT_END_F +master-bin.000001 29474 Xid 1 29501 COMMIT /* XID */ master-bin.000001 29501 Rotate 1 29545 master-bin.000002;pos=4 drop table t1; set global binlog_cache_size=@bcs; diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index 45fef628357..238cafa6f68 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -268,7 +268,7 @@ reset master; create table t1 (a int) engine=innodb; show binlog events from 0; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server ver: 5.1.21-beta-debug-log, Binlog ver: 4 +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb master-bin.000001 206 Query 1 274 use `test`; BEGIN master-bin.000001 274 Query 1 365 use `test`; insert into t1 values( 400 ) @@ -671,7 +671,7 @@ master-bin.000001 36210 Query 1 36299 use `test`; insert into t1 values( 4 ) master-bin.000001 36299 Query 1 36388 use `test`; insert into t1 values( 3 ) master-bin.000001 36388 Query 1 36477 use `test`; insert into t1 values( 2 ) master-bin.000001 36477 Query 1 36566 use `test`; insert into t1 values( 1 ) -master-bin.000001 36566 Xid 1 36593 COMMIT /* xid=196 */ +master-bin.000001 36566 Xid 1 36593 COMMIT /* XID */ master-bin.000001 36593 Rotate 1 36637 master-bin.000002;pos=4 drop table t1; set global binlog_cache_size=@bcs; From 289cc26c646f5a45e2c9fc6c0bb75f6f61d301a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jul 2007 19:14:48 +0200 Subject: [PATCH 064/227] Bug#21074 Large query_cache freezes mysql server sporadically under heavy load Invaldating a subset of a sufficiently large query cache can take a long time. During this time the server is efficiently frozen and no other operation can be executed. This patch addresses this problem by moving the locks which cause the freezing and also by temporarily disable the query cache while the invalidation takes place. sql/ha_ndbcluster.cc: - mysql_rm_table_part2 has a new parameter to indicate if OPEN_lock mutex protection is needed. sql/lock.cc: - Added function for acquiring table name exclusive locks. - Added function for asserting that table name lock is acquired. sql/mysql_priv.h: - Added function for acquiring table name exclusive locks. - Added function for asserting that table name lock is acquired. - Added parameter to mysql_rm_table_part2 to indicate whether OPEN_lock mutex protection is needed or not. sql/sql_cache.cc: - Changed flush_in_progress-flag into a state and added a function, is_flushing() to reflect on this state. A new state was needed to indicate that a partial invalidation was in progress. - An unused parameter 'under_guard' was removed. - The Query_cache mutex structural_guard was pushed down into one invalidate_table function to avoid multiple entry points which makes maintainens more difficult. - Instead of keeping the structural_guard mutex during the entire invalidation we set the query cache status state to TABLE_FLUSH_IN_PROGRESS to temporarily disable the cache and avoid locking other threads needing the Query_cache resource. sql/sql_cache.h: - Changed flush_in_progress-flag into a state and added a function, is_flushing() to reflect on this state. A new state was needed to indicate that a partial invalidation was in progress. - An unused parameter 'under_guard' was removed. - The Query_cache mutex structural_guard was pushed down into one invalidate_table function to avoid multiple entry points which makes maintainens more difficult. - Instead of keeping the structural_guard mutex during the entire invalidation we set the query cache status state to TABLE_FLUSH_IN_PROGRESS to temporarily disable the cache and avoid locking other threads needing the the Query_cache resource. sql/sql_db.cc: - mysql_rm_table_part2_with_lock is redundant and replaced with mysql_rm_table_part2. sql/sql_parse.cc: - Function query_cache_invalidate3 isn't protect by a lock and we have a race condition. - Moving this function into mysql_rename_tables and make sure it is protected by a exclusive table name lock. sql/sql_rename.cc: - Function query_cache_invalidation3 isn't protect by a lock and we have a race condition. - Moving this function into mysql_rename_tables and make sure it is protected by a exclusive table name lock. - Instead of using LOCK_open mutex, which excludes all other threads, the lock is changed into exclusive table name locks instead. This prevents us from locking the server if a query cache invalidation would take a long time to complete. sql/sql_table.cc: - Instead of using LOCK_open mutex, which excludes all other threads, the lock is changed into exclusive table name locks instead. This prevents us from locking the server if a query cache invalidation would take a long time to complete. - Added new parameter to mysql_rm_table_part2 to control whether OPEN_lock mutex needs to be aquired or not. This is currently needed by the NDB implemenation. sql/sql_trigger.cc: - Table_triggers don't need to be protexted by LOCK_open mutex. This patch cancel this restriction. - Refactored comments to doxygen style. --- sql/ha_ndbcluster.cc | 13 +- sql/lock.cc | 96 ++++++ sql/mysql_priv.h | 11 +- sql/sql_cache.cc | 715 +++++++++++++++++++++++++++---------------- sql/sql_cache.h | 72 ++++- sql/sql_db.cc | 2 +- sql/sql_parse.cc | 2 +- sql/sql_rename.cc | 16 +- sql/sql_table.cc | 82 ++--- sql/sql_trigger.cc | 40 ++- 10 files changed, 677 insertions(+), 372 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index aeaea90feb6..8e49ebcbe51 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -6996,7 +6996,6 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, // Lock mutex before deleting and creating frm files pthread_mutex_lock(&LOCK_open); - if (!global_read_lock) { // Delete old files @@ -7010,10 +7009,12 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, table_list.db= (char*) db; table_list.alias= table_list.table_name= (char*)file_name; (void)mysql_rm_table_part2(thd, &table_list, - /* if_exists */ FALSE, - /* drop_temporary */ FALSE, - /* drop_view */ FALSE, - /* dont_log_query*/ TRUE); + FALSE, /* if_exists */ + FALSE, /* drop_temporary */ + FALSE, /* drop_view */ + TRUE, /* dont_log_query*/ + FALSE); /* need lock open */ + /* Clear error message that is returned when table is deleted */ thd->clear_error(); } @@ -7029,7 +7030,7 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, } pthread_mutex_unlock(&LOCK_open); - + hash_free(&ok_tables); hash_free(&ndb_tables); diff --git a/sql/lock.cc b/sql/lock.cc index 6f1dd0669ee..6c1196e29c0 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -1027,6 +1027,102 @@ end: } +/** + @brief Lock all tables in list with an exclusive table name lock. + + @param thd Thread handle. + @param table_list Names of tables to lock. + + @note This function needs to be protected by LOCK_open. If we're + under LOCK TABLES, this function does not work as advertised. Namely, + it does not exclude other threads from using this table and does not + put an exclusive name lock on this table into the table cache. + + @see lock_table_names + @see unlock_table_names + + @retval TRUE An error occured. + @retval FALSE Name lock successfully acquired. +*/ + +bool lock_table_names_exclusively(THD *thd, TABLE_LIST *table_list) +{ + if (lock_table_names(thd, table_list)) + return TRUE; + + /* + Upgrade the table name locks from semi-exclusive to exclusive locks. + */ + for (TABLE_LIST *table= table_list; table; table= table->next_global) + { + if (table->table) + table->table->open_placeholder= 1; + } + return FALSE; +} + + +/** + @brief Test is 'table' is protected by an exclusive name lock. + + @param[in] thd The current thread handler + @param[in] table Table container containing the single table to be tested + + @note Needs to be protected by LOCK_open mutex. + + @return Error status code + @retval TRUE Table is protected + @retval FALSE Table is not protected +*/ + +bool +is_table_name_exclusively_locked_by_this_thread(THD *thd, + TABLE_LIST *table_list) +{ + char key[MAX_DBKEY_LENGTH]; + uint key_length; + + key_length= create_table_def_key(thd, key, table_list, 0); + + return is_table_name_exclusively_locked_by_this_thread(thd, (uchar *)key, + key_length); +} + + +/** + @brief Test is 'table key' is protected by an exclusive name lock. + + @param[in] thd The current thread handler. + @param[in] table Table container containing the single table to be tested. + + @note Needs to be protected by LOCK_open mutex + + @retval TRUE Table is protected + @retval FALSE Table is not protected + */ + +bool +is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key, + int key_length) +{ + HASH_SEARCH_STATE state; + TABLE *table; + + for (table= (TABLE*) hash_first(&open_cache, key, + key_length, &state); + table ; + table= (TABLE*) hash_next(&open_cache, key, + key_length, &state)) + { + if (table->in_use == thd && + table->open_placeholder == 1 && + table->s->version == 0) + return TRUE; + } + + return FALSE; +} + /* Unlock all tables in list with a name lock diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index f5d66696cab..3e6bdeb2775 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -820,10 +820,8 @@ void mysql_client_binlog_statement(THD *thd); bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, my_bool drop_temporary); int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, - bool drop_temporary, bool drop_view, bool log_query); -int mysql_rm_table_part2_with_lock(THD *thd, TABLE_LIST *tables, - bool if_exists, bool drop_temporary, - bool log_query); + bool drop_temporary, bool drop_view, bool log_query, + bool need_lock_open); bool quick_rm_table(handlerton *base,const char *db, const char *table_name, uint flags); void close_cached_table(THD *thd, TABLE *table); @@ -1799,6 +1797,11 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list); bool lock_table_names(THD *thd, TABLE_LIST *table_list); void unlock_table_names(THD *thd, TABLE_LIST *table_list, TABLE_LIST *last_table); +bool lock_table_names_exclusively(THD *thd, TABLE_LIST *table_list); +bool is_table_name_exclusively_locked_by_this_thread(THD *thd, + TABLE_LIST *table_list); +bool is_table_name_exclusively_locked_by_this_thread(THD *thd, uchar *key, + int key_length); /* old unireg functions */ diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 04f142c5dfb..bcf3c2b550c 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -268,6 +268,39 @@ are stored in one block. If join_results allocated new block(s) then we need call pack_cache again. +7. Interface +The query cache interfaces with the rest of the server code through 7 +functions: + 1. Query_cache::send_result_to_client + - Called before parsing and used to match a statement with the stored + queries hash. + If a match is found the cached result set is sent through repeated + calls to net_real_write. (note: calling thread doesn't have a regis- + tered result set writer: thd->net.query_cache_query=0) + 2. Query_cache::store_query + - Called just before handle_select() and is used to register a result + set writer to the statement currently being processed + (thd->net.query_cache_query). + 3. query_cache_insert + - Called from net_real_write to append a result set to a cached query + if (and only if) this query has a registered result set writer + (thd->net.query_cache_query). + 4. Query_cache::invalidate + - Called from various places to invalidate query cache based on data- + base, table and myisam file name. During an on going invalidation + the query cache is temporarily disabled. + 5. Query_cache::flush + - Used when a RESET QUERY CACHE is issued. This clears the entire + cache block by block. + 6. Query_cache::resize + - Used to change the available memory used by the query cache. This + will also invalidate the entrie query cache in one free operation. + 7. Query_cache::pack + - Used when a FLUSH QUERY CACHE is issued. This changes the order of + the used memory blocks in physical memory order and move all avail- + able memory to the 'bottom' of the memory. + + TODO list: - Delayed till after-parsing qache answer (for column rights processing) @@ -615,49 +648,55 @@ void query_cache_insert(NET *net, const char *packet, ulong length) DBUG_VOID_RETURN; STRUCT_LOCK(&query_cache.structure_guard_mutex); - - if (unlikely(query_cache.query_cache_size == 0 || - query_cache.flush_in_progress)) + bool interrupt; + query_cache.wait_while_table_flush_is_in_progress(&interrupt); + if (interrupt) { + STRUCT_UNLOCK(&query_cache.structure_guard_mutex); + return; + } + + Query_cache_block *query_block= (Query_cache_block*)net->query_cache_query; + if (!query_block) + { + /* + We lost the writer and the currently processed query has been + invalidated; there is nothing left to do. + */ STRUCT_UNLOCK(&query_cache.structure_guard_mutex); DBUG_VOID_RETURN; } - Query_cache_block *query_block = ((Query_cache_block*) - net->query_cache_query); - if (query_block) + Query_cache_query *header= query_block->query(); + Query_cache_block *result= header->result(); + + DUMP(&query_cache); + BLOCK_LOCK_WR(query_block); + DBUG_PRINT("qcache", ("insert packet %lu bytes long",length)); + + /* + On success, STRUCT_UNLOCK is done by append_result_data. Otherwise, we + still need structure_guard_mutex to free the query, and therefore unlock + it later in this function. + */ + if (!query_cache.append_result_data(&result, length, (uchar*) packet, + query_block)) { - Query_cache_query *header = query_block->query(); - Query_cache_block *result = header->result(); - - DUMP(&query_cache); - BLOCK_LOCK_WR(query_block); - DBUG_PRINT("qcache", ("insert packet %lu bytes long",length)); - - /* - On success STRUCT_UNLOCK(&query_cache.structure_guard_mutex) will be - done by query_cache.append_result_data if success (if not we need - query_cache.structure_guard_mutex locked to free query) - */ - if (!query_cache.append_result_data(&result, length, (uchar*) packet, - query_block)) - { - DBUG_PRINT("warning", ("Can't append data")); - header->result(result); - DBUG_PRINT("qcache", ("free query 0x%lx", (ulong) query_block)); - // The following call will remove the lock on query_block - query_cache.free_query(query_block); - // append_result_data no success => we need unlock - STRUCT_UNLOCK(&query_cache.structure_guard_mutex); - DBUG_VOID_RETURN; - } + DBUG_PRINT("warning", ("Can't append data")); header->result(result); - header->last_pkt_nr= net->pkt_nr; - BLOCK_UNLOCK_WR(query_block); - DBUG_EXECUTE("check_querycache",query_cache.check_integrity(0);); - } - else + DBUG_PRINT("qcache", ("free query 0x%lx", (ulong) query_block)); + // The following call will remove the lock on query_block + query_cache.free_query(query_block); + // append_result_data no success => we need unlock STRUCT_UNLOCK(&query_cache.structure_guard_mutex); + DBUG_VOID_RETURN; + } + + header->result(result); + header->last_pkt_nr= net->pkt_nr; + BLOCK_UNLOCK_WR(query_block); + DBUG_EXECUTE("check_querycache",query_cache.check_integrity(0);); + DBUG_VOID_RETURN; } @@ -671,17 +710,21 @@ void query_cache_abort(NET *net) DBUG_VOID_RETURN; STRUCT_LOCK(&query_cache.structure_guard_mutex); - - if (unlikely(query_cache.query_cache_size == 0 || - query_cache.flush_in_progress)) + bool interrupt; + query_cache.wait_while_table_flush_is_in_progress(&interrupt); + if (interrupt) { STRUCT_UNLOCK(&query_cache.structure_guard_mutex); DBUG_VOID_RETURN; } + /* + While we were waiting another thread might have changed the status + of the writer. Make sure the writer still exists before continue. + */ Query_cache_block *query_block= ((Query_cache_block*) net->query_cache_query); - if (query_block) // Test if changed by other thread + if (query_block) { DUMP(&query_cache); BLOCK_LOCK_WR(query_block); @@ -713,13 +756,22 @@ void query_cache_end_of_result(THD *thd) STRUCT_LOCK(&query_cache.structure_guard_mutex); - if (unlikely(query_cache.query_cache_size == 0 || - query_cache.flush_in_progress)) - goto end; + bool interrupt; + query_cache.wait_while_table_flush_is_in_progress(&interrupt); + if (interrupt) + { + STRUCT_UNLOCK(&query_cache.structure_guard_mutex); + DBUG_VOID_RETURN; + } query_block= ((Query_cache_block*) thd->net.query_cache_query); if (query_block) { + /* + The writer is still present; finish last result block by chopping it to + suitable size if needed and setting block type. Since this is the last + block, the writer should be dropped. + */ DUMP(&query_cache); BLOCK_LOCK_WR(query_block); Query_cache_query *header= query_block->query(); @@ -746,8 +798,11 @@ void query_cache_end_of_result(THD *thd) #endif header->found_rows(current_thd->limit_found_rows); header->result()->type= Query_cache_block::RESULT; + + /* Drop the writer. */ header->writer(0); thd->net.query_cache_query= 0; + BLOCK_UNLOCK_WR(query_block); DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1);); @@ -801,9 +856,9 @@ ulong Query_cache::resize(ulong query_cache_size_arg) DBUG_ASSERT(initialized); STRUCT_LOCK(&structure_guard_mutex); - while (flush_in_progress) - pthread_cond_wait(&COND_flush_finished, &structure_guard_mutex); - flush_in_progress= TRUE; + while (is_flushing()) + pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex); + m_cache_status= Query_cache::FLUSH_IN_PROGRESS; STRUCT_UNLOCK(&structure_guard_mutex); free_cache(); @@ -814,8 +869,8 @@ ulong Query_cache::resize(ulong query_cache_size_arg) DBUG_EXECUTE("check_querycache",check_integrity(0);); STRUCT_LOCK(&structure_guard_mutex); - flush_in_progress= FALSE; - pthread_cond_signal(&COND_flush_finished); + m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS; + pthread_cond_signal(&COND_cache_status_changed); STRUCT_UNLOCK(&structure_guard_mutex); DBUG_RETURN(new_query_cache_size); @@ -910,8 +965,13 @@ def_week_frmt: %lu", ha_release_temporary_latches(thd); STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size == 0 || flush_in_progress) + if (query_cache_size == 0 || is_flushing()) { + /* + A table- or a full flush operation can potentially take a long time to + finish. We choose not to wait for them and skip caching statements + instead. + */ STRUCT_UNLOCK(&structure_guard_mutex); DBUG_VOID_RETURN; } @@ -954,7 +1014,7 @@ def_week_frmt: %lu", Query_cache_block *query_block; query_block= write_block_data(tot_length, (uchar*) thd->query, ALIGN_SIZE(sizeof(Query_cache_query)), - Query_cache_block::QUERY, local_tables, 1); + Query_cache_block::QUERY, local_tables); if (query_block != 0) { DBUG_PRINT("qcache", ("query block 0x%lx allocated, %lu", @@ -1088,13 +1148,21 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) } STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size == 0 || flush_in_progress) + + if (query_cache_size == 0) + goto err_unlock; + + if (is_flushing()) { - DBUG_PRINT("qcache", ("query cache disabled")); + /* Return; Query cache is temporarily disabled while we flush. */ + DBUG_PRINT("qcache",("query cache disabled")); goto err_unlock; } - /* Check that we haven't forgot to reset the query cache variables */ + /* + Check that we haven't forgot to reset the query cache variables; + make sure there are no attached query cache writer to this thread. + */ DBUG_ASSERT(thd->net.query_cache_query == 0); Query_cache_block *query_block; @@ -1267,7 +1335,7 @@ def_week_frmt: %lu", ("Handler require invalidation queries of %s.%s %lu-%lu", table_list.db, table_list.alias, (ulong) engine_data, (ulong) table->engine_data())); - invalidate_table((uchar *) table->db(), table->key_length()); + invalidate_table(thd, (uchar *) table->db(), table->key_length()); } else thd->lex->safe_to_cache_query= 0; // Don't try to cache this @@ -1330,32 +1398,26 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used, my_bool using_transactions) { DBUG_ENTER("Query_cache::invalidate (table list)"); - STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size > 0 && !flush_in_progress) - { - DUMP(this); - using_transactions= using_transactions && - (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); - for (; tables_used; tables_used= tables_used->next_local) - { - DBUG_ASSERT(!using_transactions || tables_used->table!=0); - if (tables_used->derived) - continue; - if (using_transactions && - (tables_used->table->file->table_cache_type() == - HA_CACHE_TBL_TRANSACT)) - /* - Tables_used->table can't be 0 in transaction. - Only 'drop' invalidate not opened table, but 'drop' - force transaction finish. - */ - thd->add_changed_table(tables_used->table); - else - invalidate_table(tables_used); - } + using_transactions= using_transactions && + (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); + for (; tables_used; tables_used= tables_used->next_local) + { + DBUG_ASSERT(!using_transactions || tables_used->table!=0); + if (tables_used->derived) + continue; + if (using_transactions && + (tables_used->table->file->table_cache_type() == + HA_CACHE_TBL_TRANSACT)) + /* + tables_used->table can't be 0 in transaction. + Only 'drop' invalidate not opened table, but 'drop' + force transaction finish. + */ + thd->add_changed_table(tables_used->table); + else + invalidate_table(thd, tables_used); } - STRUCT_UNLOCK(&structure_guard_mutex); DBUG_VOID_RETURN; } @@ -1363,21 +1425,13 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used, void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used) { DBUG_ENTER("Query_cache::invalidate (changed table list)"); - if (tables_used) + THD *thd= current_thd; + for (; tables_used; tables_used= tables_used->next) { - STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size > 0 && !flush_in_progress) - { - DUMP(this); - for (; tables_used; tables_used= tables_used->next) - { - invalidate_table((uchar*) tables_used->key, tables_used->key_length); - DBUG_PRINT("qcache", ("db: %s table: %s", tables_used->key, - tables_used->key+ - strlen(tables_used->key)+1)); - } - } - STRUCT_UNLOCK(&structure_guard_mutex); + invalidate_table(thd, (uchar*) tables_used->key, tables_used->key_length); + DBUG_PRINT("qcache", ("db: %s table: %s", tables_used->key, + tables_used->key+ + strlen(tables_used->key)+1)); } DBUG_VOID_RETURN; } @@ -1396,20 +1450,14 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used) void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used) { DBUG_ENTER("Query_cache::invalidate_locked_for_write"); - if (tables_used) + for (; tables_used; tables_used= tables_used->next_local) { - STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size > 0 && !flush_in_progress) + if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) && + tables_used->table) { - DUMP(this); - for (; tables_used; tables_used= tables_used->next_local) - { - if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE) && - tables_used->table) - invalidate_table(tables_used->table); - } + THD *thd= current_thd; + invalidate_table(thd, tables_used->table); } - STRUCT_UNLOCK(&structure_guard_mutex); } DBUG_VOID_RETURN; } @@ -1423,18 +1471,14 @@ void Query_cache::invalidate(THD *thd, TABLE *table, { DBUG_ENTER("Query_cache::invalidate (table)"); - STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size > 0 && !flush_in_progress) - { - using_transactions= using_transactions && - (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); - if (using_transactions && - (table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT)) - thd->add_changed_table(table); - else - invalidate_table(table); - } - STRUCT_UNLOCK(&structure_guard_mutex); + using_transactions= using_transactions && + (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); + if (using_transactions && + (table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT)) + thd->add_changed_table(table); + else + invalidate_table(thd, table); + DBUG_VOID_RETURN; } @@ -1443,31 +1487,77 @@ void Query_cache::invalidate(THD *thd, const char *key, uint32 key_length, my_bool using_transactions) { DBUG_ENTER("Query_cache::invalidate (key)"); - - STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size > 0 && !flush_in_progress) - { - using_transactions= using_transactions && - (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); - if (using_transactions) // used for innodb => has_transactions() is TRUE - thd->add_changed_table(key, key_length); - else - invalidate_table((uchar*)key, key_length); - } - STRUCT_UNLOCK(&structure_guard_mutex); + + using_transactions= using_transactions && + (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)); + if (using_transactions) // used for innodb => has_transactions() is TRUE + thd->add_changed_table(key, key_length); + else + invalidate_table(thd, (uchar*)key, key_length); DBUG_VOID_RETURN; } + +/** + @brief Synchronize the thread with any flushing operations. + + This helper function is called whenever a thread needs to operate on the + query cache structure (example: during invalidation). If a table flush is in + progress this function will wait for it to stop. If a full flush is in + progress, the function will set the interrupt parameter to indicate that the + current operation is redundant and should be interrupted. + + @param[out] interrupt This out-parameter will be set to TRUE if the calling + function is redundant and should be interrupted. + + @return If the interrupt-parameter is TRUE then m_cache_status is set to + NO_FLUSH_IN_PROGRESS. If the interrupt-parameter is FALSE then + m_cache_status is set to FLUSH_IN_PROGRESS. + The structure_guard_mutex will in any case be locked. +*/ + +void Query_cache::wait_while_table_flush_is_in_progress(bool *interrupt) +{ + while (is_flushing()) + { + /* + If there already is a full flush in progress query cache isn't enabled + and additional flushes are redundant; just return instead. + */ + if (m_cache_status == Query_cache::FLUSH_IN_PROGRESS) + { + *interrupt= TRUE; + return; + } + /* + If a table flush is in progress; wait on cache status to change. + */ + if (m_cache_status == Query_cache::TABLE_FLUSH_IN_PROGRESS) + pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex); + } + *interrupt= FALSE; +} + /* Remove all cached queries that uses the given database */ - void Query_cache::invalidate(char *db) { DBUG_ENTER("Query_cache::invalidate (db)"); + STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size > 0 && !flush_in_progress) + bool interrupt; + wait_while_table_flush_is_in_progress(&interrupt); + if (interrupt) + { + STRUCT_UNLOCK(&structure_guard_mutex); + return; + } + + THD *thd= current_thd; + + if (query_cache_size > 0) { DUMP(this); restart_search: @@ -1479,7 +1569,10 @@ void Query_cache::invalidate(char *db) { next= curr->next; if (strcmp(db, (char*)(curr->table()->db())) == 0) - invalidate_table(curr); + { + Query_cache_block_table *list_root= curr->table(0); + invalidate_query_block_list(thd,list_root); + } /* invalidate_table can freed block on which point 'next' (if table of this block used only in queries which was deleted @@ -1491,6 +1584,11 @@ void Query_cache::invalidate(char *db) if (next->type == Query_cache_block::FREE) goto restart_search; curr= next; + /* + The loop will end if the circular list pointer has reached the + point where it started from, or if the current thread was signaled + to die. + */ } while (curr != tables_blocks); } } @@ -1504,21 +1602,12 @@ void Query_cache::invalidate_by_MyISAM_filename(const char *filename) { DBUG_ENTER("Query_cache::invalidate_by_MyISAM_filename"); - STRUCT_LOCK(&structure_guard_mutex); - if (query_cache_size > 0 && !flush_in_progress) - { - /* Calculate the key outside the lock to make the lock shorter */ - char key[MAX_DBKEY_LENGTH]; - uint32 db_length; - uint key_length= filename_2_table_key(key, filename, &db_length); - Query_cache_block *table_block; - if ((table_block = (Query_cache_block*) hash_search(&tables, - (uchar*) key, - key_length))) - invalidate_table(table_block); - } - STRUCT_UNLOCK(&structure_guard_mutex); - + /* Calculate the key outside the lock to make the lock shorter */ + char key[MAX_DBKEY_LENGTH]; + uint32 db_length; + uint key_length= filename_2_table_key(key, filename, &db_length); + THD *thd= current_thd; + invalidate_table(thd,(uchar *)key, key_length); DBUG_VOID_RETURN; } @@ -1540,16 +1629,43 @@ void Query_cache::flush() DBUG_VOID_RETURN; } - /* Join result in cache in 1 block (if result length > join_limit) */ + +/** + @brief Rearrange the memory blocks and join result in cache in 1 block (if + result length > join_limit) + + @param[in] join_limit If the minimum length of a result block to be joined. + @param[in] iteration_limit The maximum number of packing and joining + sequences. + +*/ void Query_cache::pack(ulong join_limit, uint iteration_limit) { DBUG_ENTER("Query_cache::pack"); + + bool interrupt; + STRUCT_LOCK(&structure_guard_mutex); + wait_while_table_flush_is_in_progress(&interrupt); + if (interrupt) + { + STRUCT_UNLOCK(&structure_guard_mutex); + DBUG_VOID_RETURN; + } + + if (query_cache_size == 0) + { + STRUCT_UNLOCK(&structure_guard_mutex); + DBUG_VOID_RETURN; + } + uint i = 0; do { pack_cache(); } while ((++i < iteration_limit) && join_results(join_limit)); + + STRUCT_UNLOCK(&structure_guard_mutex); DBUG_VOID_RETURN; } @@ -1568,7 +1684,7 @@ void Query_cache::destroy() free_cache(); STRUCT_UNLOCK(&structure_guard_mutex); - pthread_cond_destroy(&COND_flush_finished); + pthread_cond_destroy(&COND_cache_status_changed); pthread_mutex_destroy(&structure_guard_mutex); initialized = 0; } @@ -1584,8 +1700,8 @@ void Query_cache::init() { DBUG_ENTER("Query_cache::init"); pthread_mutex_init(&structure_guard_mutex,MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_flush_finished, NULL); - flush_in_progress= FALSE; + pthread_cond_init(&COND_cache_status_changed, NULL); + m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS; initialized = 1; DBUG_VOID_RETURN; } @@ -1787,9 +1903,10 @@ void Query_cache::make_disabled() /** @class Query_cache @brief Free all resources allocated by the cache. - @details This function frees all resources allocated by the cache. You - have to call init_cache() before using the cache again. This function requires - the structure_guard_mutex to be locked. + + This function frees all resources allocated by the cache. You + have to call init_cache() before using the cache again. This function + requires the structure_guard_mutex to be locked. */ void Query_cache::free_cache() @@ -1808,24 +1925,17 @@ void Query_cache::free_cache() *****************************************************************************/ -/* - flush_cache() - flush the cache. +/** + @brief Flush the cache. - SYNOPSIS - flush_cache() - - DESCRIPTION - This function will flush cache contents. It assumes we have - 'structure_guard_mutex' locked. The function sets the - flush_in_progress flag and releases the lock, so other threads may - proceed skipping the cache as if it is disabled. Concurrent - flushes are performed in turn. - - After flush_cache() call, the cache is flushed, all the freed - memory is accumulated in bin[0], and the 'structure_guard_mutex' - is locked. However, since we could release the mutex during - execution, the rest of the cache state could have been changed, - and should not be relied on. + This function will flush cache contents. It assumes we have + 'structure_guard_mutex' locked. The function sets the m_cache_status flag and + releases the lock, so other threads may proceed skipping the cache as if it + is disabled. Concurrent flushes are performed in turn. + After flush_cache() call, the cache is flushed, all the freed memory is + accumulated in bin[0], and the 'structure_guard_mutex' is locked. However, + since we could release the mutex during execution, the rest of the cache + state could have been changed, and should not be relied on. */ void Query_cache::flush_cache() @@ -1837,15 +1947,15 @@ void Query_cache::flush_cache() Query_cache::free_cache()) depends on the fact that after the flush the cache is empty. */ - while (flush_in_progress) - pthread_cond_wait(&COND_flush_finished, &structure_guard_mutex); + while (is_flushing()) + pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex); /* - Setting 'flush_in_progress' will prevent other threads from using + Setting 'FLUSH_IN_PROGRESS' will prevent other threads from using the cache while we are in the middle of the flush, and we release the lock so that other threads won't block. */ - flush_in_progress= TRUE; + m_cache_status= Query_cache::FLUSH_IN_PROGRESS; STRUCT_UNLOCK(&structure_guard_mutex); my_hash_reset(&queries); @@ -1856,8 +1966,8 @@ void Query_cache::flush_cache() } STRUCT_LOCK(&structure_guard_mutex); - flush_in_progress= FALSE; - pthread_cond_signal(&COND_flush_finished); + m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS; + pthread_cond_signal(&COND_cache_status_changed); } /* @@ -1875,7 +1985,7 @@ my_bool Query_cache::free_old_query() sequence is breached. Also we don't need remove locked queries at this point. */ - Query_cache_block *query_block = 0; + Query_cache_block *query_block= 0; if (queries_blocks != 0) { Query_cache_block *block = queries_blocks; @@ -2013,8 +2123,7 @@ Query_cache_block * Query_cache::write_block_data(ulong data_len, uchar* data, ulong header_len, Query_cache_block::block_type type, - TABLE_COUNTER_TYPE ntab, - my_bool under_guard) + TABLE_COUNTER_TYPE ntab) { ulong all_headers_len = (ALIGN_SIZE(sizeof(Query_cache_block)) + ALIGN_SIZE(ntab*sizeof(Query_cache_block_table)) + @@ -2024,9 +2133,8 @@ Query_cache::write_block_data(ulong data_len, uchar* data, DBUG_ENTER("Query_cache::write_block_data"); DBUG_PRINT("qcache", ("data: %ld, header: %ld, all header: %ld", data_len, header_len, all_headers_len)); - Query_cache_block *block = allocate_block(max(align_len, - min_allocation_unit), - 1, 0, under_guard); + Query_cache_block *block= allocate_block(max(align_len, + min_allocation_unit),1, 0); if (block != 0) { block->type = type; @@ -2243,8 +2351,7 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block, if (!(new_block= allocate_block(max(min_size, align_len), min_result_data_size == 0, - all_headers_len + min_result_data_size, - 1))) + all_headers_len + min_result_data_size))) { DBUG_PRINT("warning", ("Can't allocate block for results")); DBUG_RETURN(FALSE); @@ -2286,51 +2393,94 @@ my_bool Query_cache::allocate_data_chain(Query_cache_block **result_block, Invalidate the first table in the table_list */ -void Query_cache::invalidate_table(TABLE_LIST *table_list) +void Query_cache::invalidate_table(THD *thd, TABLE_LIST *table_list) { if (table_list->table != 0) - invalidate_table(table_list->table); // Table is open + invalidate_table(thd, table_list->table); // Table is open else { char key[MAX_DBKEY_LENGTH]; uint key_length; - Query_cache_block *table_block; + key_length=(uint) (strmov(strmov(key,table_list->db)+1, table_list->table_name) -key)+ 1; // We don't store temporary tables => no key_length+=4 ... - if ((table_block = (Query_cache_block*) - hash_search(&tables,(uchar*) key,key_length))) - invalidate_table(table_block); + invalidate_table(thd, (uchar *)key, key_length); } } -void Query_cache::invalidate_table(TABLE *table) +void Query_cache::invalidate_table(THD *thd, TABLE *table) { - invalidate_table((uchar*) table->s->table_cache_key.str, + invalidate_table(thd, (uchar*) table->s->table_cache_key.str, table->s->table_cache_key.length); } -void Query_cache::invalidate_table(uchar * key, uint32 key_length) +void Query_cache::invalidate_table(THD *thd, uchar * key, uint32 key_length) { - Query_cache_block *table_block; - if ((table_block = ((Query_cache_block*) - hash_search(&tables, key, key_length)))) - invalidate_table(table_block); + bool interrupt; + STRUCT_LOCK(&structure_guard_mutex); + wait_while_table_flush_is_in_progress(&interrupt); + if (interrupt) + { + STRUCT_UNLOCK(&structure_guard_mutex); + return; + } + + /* + Setting 'TABLE_FLUSH_IN_PROGRESS' will temporarily disable the cache + so that structural changes to cache won't block the entire server. + However, threads requesting to change the query cache will still have + to wait for the flush to finish. + */ + m_cache_status= Query_cache::TABLE_FLUSH_IN_PROGRESS; + STRUCT_UNLOCK(&structure_guard_mutex); + + Query_cache_block *table_block= + (Query_cache_block*)hash_search(&tables, key, key_length); + if (query_cache_size > 0 && table_block) + { + Query_cache_block_table *list_root= table_block->table(0); + invalidate_query_block_list(thd, list_root); + } + + STRUCT_LOCK(&structure_guard_mutex); + m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS; + + /* + net_real_write might be waiting on a change on the m_cache_status + variable. + */ + pthread_cond_signal(&COND_cache_status_changed); + STRUCT_UNLOCK(&structure_guard_mutex); } -void Query_cache::invalidate_table(Query_cache_block *table_block) + +/** + @brief Invalidate a linked list of query cache blocks. + + Each block tries to aquire a block level lock before + free_query is a called. This function will in turn affect + related table- and result-blocks. + + @param[in,out] thd Thread context. + @param[in,out] list_root A pointer to a circular list of query blocks. + +*/ + +void +Query_cache::invalidate_query_block_list(THD *thd, + Query_cache_block_table *list_root) { - Query_cache_block_table *list_root = table_block->table(0); while (list_root->next != list_root) { - Query_cache_block *query_block = list_root->next->block(); + Query_cache_block *query_block= list_root->next->block(); BLOCK_LOCK_WR(query_block); free_query(query_block); + DBUG_EXECUTE_IF("debug_cache_locks", sleep(10);); } } - /* Register given table list begining with given position in tables table of block @@ -2463,7 +2613,6 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block, if (n) { - DBUG_PRINT("qcache", ("failed at table %d", (int) n)); /* Unlink the tables we allocated above */ for (Query_cache_block_table *tmp = block->table(0) ; tmp != block_table; @@ -2473,9 +2622,13 @@ my_bool Query_cache::register_all_tables(Query_cache_block *block, return (n); } -/* - Insert used tablename in cache - Returns 0 on error + +/** + @brief Insert used table name into the cache. + + @return Error status + @retval FALSE On error + @retval TRUE On success */ my_bool @@ -2489,9 +2642,10 @@ Query_cache::insert_table(uint key_len, char *key, DBUG_PRINT("qcache", ("insert table node 0x%lx, len %d", (ulong)node, key_len)); - Query_cache_block *table_block = ((Query_cache_block *) - hash_search(&tables, (uchar*) key, - key_len)); + THD *thd= current_thd; + + Query_cache_block *table_block= + (Query_cache_block *)hash_search(&tables, (uchar*) key, key_len); if (table_block && table_block->table()->engine_data() != engine_data) @@ -2506,7 +2660,11 @@ Query_cache::insert_table(uint key_len, char *key, as far as we delete all queries with this table, table block will be deleted, too */ - invalidate_table(table_block); + { + Query_cache_block_table *list_root= table_block->table(0); + invalidate_query_block_list(thd, list_root); + } + table_block= 0; } @@ -2514,21 +2672,29 @@ Query_cache::insert_table(uint key_len, char *key, { DBUG_PRINT("qcache", ("new table block from 0x%lx (%u)", (ulong) key, (int) key_len)); - table_block = write_block_data(key_len, (uchar*) key, - ALIGN_SIZE(sizeof(Query_cache_table)), - Query_cache_block::TABLE, - 1, 1); + table_block= write_block_data(key_len, (uchar*) key, + ALIGN_SIZE(sizeof(Query_cache_table)), + Query_cache_block::TABLE, 1); if (table_block == 0) { DBUG_PRINT("qcache", ("Can't write table name to cache")); DBUG_RETURN(0); } - Query_cache_table *header = table_block->table(); + Query_cache_table *header= table_block->table(); double_linked_list_simple_include(table_block, - &tables_blocks); - Query_cache_block_table *list_root = table_block->table(0); - list_root->n = 0; - list_root->next = list_root->prev = list_root; + &tables_blocks); + /* + First node in the Query_cache_block_table-chain is the table-type + block. This block will only have one Query_cache_block_table (n=0). + */ + Query_cache_block_table *list_root= table_block->table(0); + list_root->n= 0; + + /* + The node list is circular in nature. + */ + list_root->next= list_root->prev= list_root; + if (my_hash_insert(&tables, (const uchar *) table_block)) { DBUG_PRINT("qcache", ("Can't insert table to hash")); @@ -2536,20 +2702,37 @@ Query_cache::insert_table(uint key_len, char *key, free_memory_block(table_block); DBUG_RETURN(0); } - char *db = header->db(); + char *db= header->db(); header->table(db + db_length + 1); header->key_length(key_len); header->type(cache_type); header->callback(callback); header->engine_data(engine_data); + + /* + We insert this table without the assumption that it isn't refrenenced by + any queries. + */ + header->m_cached_query_count= 0; } - Query_cache_block_table *list_root = table_block->table(0); - node->next = list_root->next; - list_root->next = node; - node->next->prev = node; - node->prev = list_root; - node->parent = table_block->table(); + /* + Table is now in the cache; link the table_block-node associated + with the currently processed query into the chain of queries depending + on the cached table. + */ + Query_cache_block_table *list_root= table_block->table(0); + node->next= list_root->next; + list_root->next= node; + node->next->prev= node; + node->prev= list_root; + node->parent= table_block->table(); + /* + Increase the counter to keep track on how long this chain + of queries is. + */ + Query_cache_table *table_block_data= table_block->table(); + table_block_data->m_cached_query_count++; DBUG_RETURN(1); } @@ -2557,15 +2740,27 @@ Query_cache::insert_table(uint key_len, char *key, void Query_cache::unlink_table(Query_cache_block_table *node) { DBUG_ENTER("Query_cache::unlink_table"); - node->prev->next = node->next; - node->next->prev = node->prev; - Query_cache_block_table *neighbour = node->next; + node->prev->next= node->next; + node->next->prev= node->prev; + Query_cache_block_table *neighbour= node->next; + Query_cache_table *table_block_data= node->parent; + table_block_data->m_cached_query_count--; + + DBUG_ASSERT(table_block_data->m_cached_query_count >= 0); + if (neighbour->next == neighbour) { - // list is empty (neighbor is root of list) - Query_cache_block *table_block = neighbour->block(); + DBUG_ASSERT(table_block_data->m_cached_query_count == 0); + /* + If neighbor is root of list, the list is empty. + The root of the list is always a table-type block + which contain exactly one Query_cache_block_table + node object, thus we can use the block() method + to calculate the Query_cache_block address. + */ + Query_cache_block *table_block= neighbour->block(); double_linked_list_exclude(table_block, - &tables_blocks); + &tables_blocks); hash_delete(&tables,(uchar *) table_block); free_memory_block(table_block); } @@ -2577,12 +2772,11 @@ void Query_cache::unlink_table(Query_cache_block_table *node) *****************************************************************************/ Query_cache_block * -Query_cache::allocate_block(ulong len, my_bool not_less, ulong min, - my_bool under_guard) +Query_cache::allocate_block(ulong len, my_bool not_less, ulong min) { DBUG_ENTER("Query_cache::allocate_block"); - DBUG_PRINT("qcache", ("len %lu, not less %d, min %lu, uder_guard %d", - len, not_less,min,under_guard)); + DBUG_PRINT("qcache", ("len %lu, not less %d, min %lu", + len, not_less,min)); if (len >= min(query_cache_size, query_cache_limit)) { @@ -2591,17 +2785,6 @@ Query_cache::allocate_block(ulong len, my_bool not_less, ulong min, DBUG_RETURN(0); // in any case we don't have such piece of memory } - if (!under_guard) - { - STRUCT_LOCK(&structure_guard_mutex); - - if (unlikely(query_cache.query_cache_size == 0 || flush_in_progress)) - { - STRUCT_UNLOCK(&structure_guard_mutex); - DBUG_RETURN(0); - } - } - /* Free old queries until we have enough memory to store this block */ Query_cache_block *block; do @@ -2616,8 +2799,6 @@ Query_cache::allocate_block(ulong len, my_bool not_less, ulong min, split_block(block,ALIGN_SIZE(len)); } - if (!under_guard) - STRUCT_UNLOCK(&structure_guard_mutex); DBUG_RETURN(block); } @@ -2852,9 +3033,7 @@ uint Query_cache::find_bin(ulong size) } uint bin = steps[left].idx - (uint)((size - steps[left].size)/steps[left].increment); -#ifndef DBUG_OFF - bins_dump(); -#endif + DBUG_PRINT("qcache", ("bin %u step %u, size %lu step size %lu", bin, left, size, steps[left].size)); DBUG_RETURN(bin); @@ -3140,18 +3319,17 @@ my_bool Query_cache::ask_handler_allowance(THD *thd, Packing *****************************************************************************/ + +/** + @brief Rearrange all memory blocks so that free memory joins at the + 'bottom' of the allocated memory block containing all cache data. + @see Query_cache::pack(ulong join_limit, uint iteration_limit) +*/ + void Query_cache::pack_cache() { DBUG_ENTER("Query_cache::pack_cache"); - STRUCT_LOCK(&structure_guard_mutex); - - if (unlikely(query_cache_size == 0 || flush_in_progress)) - { - STRUCT_UNLOCK(&structure_guard_mutex); - DBUG_VOID_RETURN; - } - DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1);); uchar *border = 0; @@ -3185,7 +3363,6 @@ void Query_cache::pack_cache() } DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1);); - STRUCT_UNLOCK(&structure_guard_mutex); DBUG_VOID_RETURN; } @@ -3460,8 +3637,7 @@ my_bool Query_cache::join_results(ulong join_limit) my_bool has_moving = 0; DBUG_ENTER("Query_cache::join_results"); - STRUCT_LOCK(&structure_guard_mutex); - if (queries_blocks != 0 && !flush_in_progress) + if (queries_blocks != 0) { DBUG_ASSERT(query_cache_size > 0); Query_cache_block *block = queries_blocks; @@ -3524,7 +3700,6 @@ my_bool Query_cache::join_results(ulong join_limit) block = block->next; } while ( block != queries_blocks ); } - STRUCT_UNLOCK(&structure_guard_mutex); DBUG_RETURN(has_moving); } @@ -3760,6 +3935,14 @@ void Query_cache::tables_dump() } +/** + @brief Checks integrity of the various linked lists + + @return Error status code + @retval FALSE Query cache is operational. + @retval TRUE Query cache is broken. +*/ + my_bool Query_cache::check_integrity(bool locked) { my_bool result = 0; @@ -3769,14 +3952,8 @@ my_bool Query_cache::check_integrity(bool locked) if (!locked) STRUCT_LOCK(&structure_guard_mutex); - if (unlikely(query_cache_size == 0 || flush_in_progress)) - { - if (!locked) - STRUCT_UNLOCK(&query_cache.structure_guard_mutex); - - DBUG_PRINT("qcache", ("Query Cache not initialized")); - DBUG_RETURN(0); - } + while (is_flushing()) + pthread_cond_wait(&COND_cache_status_changed,&structure_guard_mutex); if (hash_check(&queries)) { diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 3c5d784ce94..cfc52e5d33a 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -65,17 +65,44 @@ struct Query_cache_query; struct Query_cache_result; class Query_cache; +/** + @brief This class represents a node in the linked chain of queries + belonging to one table. + @note The root of this linked list is not a query-type block, but the table- + type block which all queries has in common. +*/ struct Query_cache_block_table { Query_cache_block_table() {} /* Remove gcc warning */ - TABLE_COUNTER_TYPE n; // numbr in table (from 0) + + /** + This node holds a position in a static table list belonging + to the associated query (base 0). + */ + TABLE_COUNTER_TYPE n; + + /** + Pointers to the next and previous node, linking all queries with + a common table. + */ Query_cache_block_table *next, *prev; + + /** + A pointer to the table-type block which all + linked queries has in common. + */ Query_cache_table *parent; + + /** + A method to calculate the address of the query cache block + owning this node. The purpose of this calculation is to + make it easier to move the query cache block without having + to modify all the pointer addresses. + */ inline Query_cache_block *block(); }; - struct Query_cache_block { Query_cache_block() {} /* Remove gcc warning */ @@ -151,6 +178,11 @@ struct Query_cache_table /* data need by some engines */ ulonglong engine_data_buff; + /** + The number of queries depending of this table. + */ + int32 m_cached_query_count; + inline char *db() { return (char *) data(); } inline char *table() { return tbl; } inline void table(char *table_arg) { tbl= table_arg; } @@ -237,9 +269,14 @@ public: ulong free_memory, queries_in_cache, hits, inserts, refused, free_memory_blocks, total_blocks, lowmem_prunes; + private: - pthread_cond_t COND_flush_finished; - bool flush_in_progress; + pthread_cond_t COND_cache_status_changed; + + enum Cache_status { NO_FLUSH_IN_PROGRESS, FLUSH_IN_PROGRESS, + TABLE_FLUSH_IN_PROGRESS }; + + Cache_status m_cache_status; void free_query_internal(Query_cache_block *point); @@ -253,7 +290,7 @@ protected: 2. query block (for operation inside query (query block/results)) Thread doing cache flush releases the mutex once it sets - flush_in_progress flag, so other threads may bypass the cache as + m_cache_status flag, so other threads may bypass the cache as if it is disabled, not waiting for reset to finish. The exception is other threads that were going to do cache flush---they'll wait till the end of a flush operation. @@ -270,6 +307,7 @@ protected: /* options */ ulong min_allocation_unit, min_result_data_size; uint def_query_hash_size, def_table_hash_size; + uint mem_bin_num, mem_bin_steps; // See at init_cache & find_bin my_bool initialized; @@ -295,10 +333,13 @@ protected: ulong data_len, Query_cache_block *query_block, my_bool first_block); - void invalidate_table(TABLE_LIST *table); - void invalidate_table(TABLE *table); - void invalidate_table(uchar *key, uint32 key_length); - void invalidate_table(Query_cache_block *table_block); + void invalidate_table(THD *thd, TABLE_LIST *table); + void invalidate_table(THD *thd, TABLE *table); + void invalidate_table(THD *thd, uchar *key, uint32 key_length); + void invalidate_table(THD *thd, Query_cache_block *table_block); + void invalidate_query_block_list(THD *thd, + Query_cache_block_table *list_root); + TABLE_COUNTER_TYPE register_tables_from_list(TABLE_LIST *tables_used, TABLE_COUNTER_TYPE counter, @@ -337,6 +378,8 @@ protected: Query_cache_block *pprev); my_bool join_results(ulong join_limit); + void wait_while_table_flush_is_in_progress(bool *interrupt); + /* Following function control structure_guard_mutex by themself or don't need structure_guard_mutex @@ -347,8 +390,7 @@ protected: Query_cache_block *write_block_data(ulong data_len, uchar* data, ulong header_len, Query_cache_block::block_type type, - TABLE_COUNTER_TYPE ntab = 0, - my_bool under_guard=0); + TABLE_COUNTER_TYPE ntab = 0); my_bool append_result_data(Query_cache_block **result, ulong data_len, uchar* data, Query_cache_block *parent); @@ -360,8 +402,7 @@ protected: inline ulong get_min_first_result_data_size(); inline ulong get_min_append_result_data_size(); Query_cache_block *allocate_block(ulong len, my_bool not_less, - ulong min, - my_bool under_guard=0); + ulong min); /* If query is cacheable return number tables in query (query without tables not cached) @@ -424,6 +465,11 @@ protected: friend void query_cache_end_of_result(THD *thd); friend void query_cache_abort(NET *net); + bool is_flushing(void) + { + return (m_cache_status != Query_cache::NO_FLUSH_IN_PROGRESS); + } + /* The following functions are only used when debugging We don't protect these with ifndef DBUG_OFF to not have to recompile diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 82938184245..49a9620d555 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1084,7 +1084,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, } } if (thd->killed || - (tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 0, 1))) + (tot_list && mysql_rm_table_part2(thd, tot_list, 1, 0, 1, 1, 1))) goto err; /* Remove RAID directories */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8e55610df36..485648d1fb1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2445,7 +2445,7 @@ end_with_restore_list: check_grant(thd, INSERT_ACL | CREATE_ACL, &new_list, 0, 1, 0))) goto error; } - query_cache_invalidate3(thd, first_table, 0); + if (end_active_trans(thd) || mysql_rename_tables(thd, first_table, 0)) goto error; break; diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index f34ec83b29c..b87c74dc179 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -144,10 +144,14 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) } } - VOID(pthread_mutex_lock(&LOCK_open)); - if (lock_table_names(thd, table_list)) + pthread_mutex_lock(&LOCK_open); + if (lock_table_names_exclusively(thd, table_list)) + { + pthread_mutex_unlock(&LOCK_open); goto err; - + } + pthread_mutex_unlock(&LOCK_open); + error=0; if ((ren_table=rename_tables(thd,table_list,0))) { @@ -183,10 +187,14 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) send_ok(thd); } + if (!error) + query_cache_invalidate3(thd, table_list, 0); + + pthread_mutex_lock(&LOCK_open); unlock_table_names(thd, table_list, (TABLE_LIST*) 0); + pthread_mutex_unlock(&LOCK_open); err: - pthread_mutex_unlock(&LOCK_open); /* enable logging back if needed */ if (disable_logs) { diff --git a/sql/sql_table.cc b/sql/sql_table.cc index bb0f7649272..ba89578ec31 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1411,14 +1411,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, LOCK_open during wait_if_global_read_lock(), other threads could not close their tables. This would make a pretty deadlock. */ - thd->mysys_var->current_mutex= &LOCK_open; - thd->mysys_var->current_cond= &COND_refresh; - VOID(pthread_mutex_lock(&LOCK_open)); - - error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0); - - pthread_mutex_unlock(&LOCK_open); - + error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0, 1); pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; thd->mysys_var->current_cond= 0; @@ -1433,49 +1426,6 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, DBUG_RETURN(FALSE); } - -/* - delete (drop) tables. - - SYNOPSIS - mysql_rm_table_part2_with_lock() - thd Thread handle - tables List of tables to delete - if_exists If 1, don't give error if one table doesn't exists - dont_log_query Don't write query to log files. This will also not - generate warnings if the handler files doesn't exists - - NOTES - Works like documented in mysql_rm_table(), but don't check - global_read_lock and don't send_ok packet to server. - - RETURN - 0 ok - 1 error -*/ - -int mysql_rm_table_part2_with_lock(THD *thd, - TABLE_LIST *tables, bool if_exists, - bool drop_temporary, bool dont_log_query) -{ - int error; - thd->mysys_var->current_mutex= &LOCK_open; - thd->mysys_var->current_cond= &COND_refresh; - VOID(pthread_mutex_lock(&LOCK_open)); - - error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 1, - dont_log_query); - - pthread_mutex_unlock(&LOCK_open); - - pthread_mutex_lock(&thd->mysys_var->mutex); - thd->mysys_var->current_mutex= 0; - thd->mysys_var->current_cond= 0; - pthread_mutex_unlock(&thd->mysys_var->mutex); - return error; -} - - /* Execute the drop of a normal or temporary table @@ -1508,7 +1458,7 @@ int mysql_rm_table_part2_with_lock(THD *thd, int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, bool drop_temporary, bool drop_view, - bool dont_log_query) + bool dont_log_query, bool need_lock_open) { TABLE_LIST *table; char path[FN_REFLEN], *alias; @@ -1520,9 +1470,11 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, String built_query; DBUG_ENTER("mysql_rm_table_part2"); + if (need_lock_open) + pthread_mutex_lock(&LOCK_open); + LINT_INIT(alias); LINT_INIT(path_length); - safe_mutex_assert_owner(&LOCK_open); if (thd->current_stmt_binlog_row_based && !dont_log_query) { @@ -1555,8 +1507,15 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, } } - if (!drop_temporary && lock_table_names(thd, tables)) + if (!drop_temporary && lock_table_names_exclusively(thd, tables)) + { + if (need_lock_open) + pthread_mutex_unlock(&LOCK_open); DBUG_RETURN(1); + } + + if (need_lock_open) + pthread_mutex_unlock(&LOCK_open); /* Don't give warnings for not found errors, as we already generate notes */ thd->no_warnings_for_error= 1; @@ -1567,7 +1526,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, handlerton *table_type; enum legacy_db_type frm_db_type; - mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL, TRUE); + mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL, !need_lock_open); if (!close_temporary_table(thd, table)) { tmp_table_deleted=1; @@ -1604,6 +1563,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, { TABLE *locked_table; abort_locked_tables(thd, db, table->table_name); + if (need_lock_open) + pthread_mutex_lock(&LOCK_open); remove_table_from_cache(thd, db, table->table_name, RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG); @@ -1614,6 +1575,9 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, if ((locked_table= drop_locked_tables(thd, db, table->table_name))) table->table= locked_table; + if (need_lock_open) + pthread_mutex_unlock(&LOCK_open); + if (thd->killed) { thd->no_warnings_for_error= 0; @@ -1739,9 +1703,11 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, */ } } - - if (!drop_temporary) - unlock_table_names(thd, tables, (TABLE_LIST*) 0); + if (need_lock_open) + pthread_mutex_lock(&LOCK_open); + unlock_table_names(thd, tables, (TABLE_LIST*) 0); + if (need_lock_open) + pthread_mutex_unlock(&LOCK_open); thd->no_warnings_for_error= 0; DBUG_RETURN(error); } diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index e15003ab243..16159150e66 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1268,8 +1268,6 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, char *db, char *name) bzero(&table, sizeof(table)); init_alloc_root(&table.mem_root, 8192, 0); - safe_mutex_assert_owner(&LOCK_open); - if (Table_triggers_list::check_n_load(thd, db, name, &table, 1)) { result= 1; @@ -1431,26 +1429,24 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name, } -/* - Update .TRG and .TRN files after renaming triggers' subject table. +/** + @brief Update .TRG and .TRN files after renaming triggers' subject table. - SYNOPSIS - change_table_name() - thd Thread context - db Old database of subject table - old_table Old name of subject table - new_db New database for subject table - new_table New name of subject table + @param[in,out] thd Thread context + @param[in] db Old database of subject table + @param[in] old_table Old name of subject table + @param[in] new_db New database for subject table + @param[in] new_table New name of subject table - NOTE + @note This method tries to leave trigger related files in consistent state, i.e. it either will complete successfully, or will fail leaving files in their initial state. Also this method assumes that subject table is not renamed to itself. + This method needs to be called under an exclusive table name lock. - RETURN VALUE - FALSE Success - TRUE Error + @retval FALSE Success + @retval TRUE Error */ bool Table_triggers_list::change_table_name(THD *thd, const char *db, @@ -1466,7 +1462,19 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db, bzero(&table, sizeof(table)); init_alloc_root(&table.mem_root, 8192, 0); - safe_mutex_assert_owner(&LOCK_open); + uchar key[MAX_DBKEY_LENGTH]; + uint key_length= (uint) (strmov(strmov((char*)&key[0], db)+1, + old_table)-(char*)&key[0])+1; + + /* + This method interfaces the mysql server code protected by + either LOCK_open mutex or with an exclusive table name lock. + In the future, only an exclusive table name lock will be enough. + */ +#ifndef DBUG_OFF + if (!is_table_name_exclusively_locked_by_this_thread(thd, key, key_length)) + safe_mutex_assert_owner(&LOCK_open); +#endif DBUG_ASSERT(my_strcasecmp(table_alias_charset, db, new_db) || my_strcasecmp(table_alias_charset, old_table, new_table)); From 6097e627b43b5486564a571e7e2cf28d2c3c834a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jul 2007 20:11:54 +0200 Subject: [PATCH 065/227] removed test case no longer supported --- mysql-test/r/partition.result | 10 ---------- mysql-test/t/partition.test | 12 +----------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index bf347aea196..5d985d053fc 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1267,14 +1267,4 @@ ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time)) ERROR HY000: Incorrect usage of PARTITION and log table ALTER TABLE general_log ENGINE = CSV; SET GLOBAL general_log = default; -CREATE TABLE `t1` ( `a` varchar(1)) ENGINE=MyISAM -PARTITION BY LIST (CASE a WHEN 'a' THEN 1 -WHEN 'b' THEN 2 -WHEN 'c' THEN 3 -END) ( -PARTITION a VALUES IN (1), -PARTITION b VALUES IN (2), -PARTITION c VALUES IN (3) -); -DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 1374c049431..42db23dadef 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1496,17 +1496,7 @@ SET GLOBAL general_log = default; # # Bug #27084 partitioning by list seems failing when using case +# BUG #18198: Case no longer supported, test case removed # -CREATE TABLE `t1` ( `a` varchar(1)) ENGINE=MyISAM - PARTITION BY LIST (CASE a WHEN 'a' THEN 1 - WHEN 'b' THEN 2 - WHEN 'c' THEN 3 - END) ( - PARTITION a VALUES IN (1), - PARTITION b VALUES IN (2), - PARTITION c VALUES IN (3) -); - -DROP TABLE t1; --echo End of 5.1 tests From b0696f545706255cbedf291b0e8f70aa10410b79 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jul 2007 22:18:41 +0400 Subject: [PATCH 066/227] Fix testcase to be platform-independent --- mysql-test/r/innodb_mysql.result | 6 +++--- mysql-test/t/innodb_mysql.test | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index df1c2165c45..8ddd3d2f1e8 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2; +drop table if exists t1,t2,t3,t4; create table t1 ( c_id int(11) not null default '0', org_id int(11) default null, @@ -711,7 +711,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL idx_b,idx_c NULL NULL NULL 3263 Using where +1 SIMPLE t1 ALL idx_b,idx_c NULL NULL NULL # Using where SELECT COUNT(*) FROM t1 WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; COUNT(*) @@ -720,7 +720,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c) WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge idx_b,idx_c idx_c,idx_b 8,4 NULL 3262 Using sort_union(idx_c,idx_b); Using where +1 SIMPLE t1 index_merge idx_b,idx_c idx_c,idx_b 8,4 NULL # Using sort_union(idx_c,idx_b); Using where SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c) WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; COUNT(*) diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index eb995a748a5..148181ee443 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -1,7 +1,7 @@ -- source include/have_innodb.inc --disable_warnings -drop table if exists t1,t2; +drop table if exists t1,t2,t3,t4; --enable_warnings # BUG#16798: Uninitialized row buffer reads in ref-or-null optimizer @@ -709,12 +709,14 @@ set @@sort_buffer_size=8192; SELECT COUNT(*) FROM t1; +--replace_column 9 # EXPLAIN SELECT COUNT(*) FROM t1 WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; SELECT COUNT(*) FROM t1 WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; +--replace_column 9 # EXPLAIN SELECT COUNT(*) FROM t1 FORCE INDEX(idx_b, idx_c) WHERE (c >= '2007-01-02' AND c <= '2007-01-03') OR b >= 1; From 416a49a669d80c24414225f0d5e232dd463d7e7c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jul 2007 14:22:03 -0400 Subject: [PATCH 067/227] Bug#24924 shared-memory-base-name that is too long causes buffer overflow - Testcase fixup. mysql-test/t/windows_shm.test: Bug#24924 shared-memory-base-name that is too long causes buffer overflow - Pass user, port and host to mysqladmin. --- mysql-test/t/windows_shm.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/windows_shm.test b/mysql-test/t/windows_shm.test index 203471aac56..1c6f05f2da0 100644 --- a/mysql-test/t/windows_shm.test +++ b/mysql-test/t/windows_shm.test @@ -4,6 +4,6 @@ # # Bug #24924: shared-memory-base-name that is too long causes buffer overflow # ---exec $MYSQLADMIN --no-defaults --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping +--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping --echo End of 5.0 tests. From 841cf4053257a96eafb203eeea796bc44a8d9330 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 10:36:37 +0300 Subject: [PATCH 068/227] Bug #28983: 'reset master' in multiple threads and innodb tables asserts debug binary We can't reliably check if the binary log is opened without acquiring its mutex. Fixed by removing this check. sql/log.cc: Bug #28983: can't reliably check if bin_log is open outside of its mutex --- sql/log.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index 818828f9557..dd989ebd76d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -85,7 +85,7 @@ bool binlog_init() static int binlog_close_connection(THD *thd) { IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot]; - DBUG_ASSERT(mysql_bin_log.is_open() && !my_b_tell(trans_log)); + DBUG_ASSERT(!my_b_tell(trans_log)); close_cached_file(trans_log); my_free((gptr)trans_log, MYF(0)); return 0; @@ -126,7 +126,7 @@ static int binlog_commit(THD *thd, bool all) { IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot]; DBUG_ENTER("binlog_commit"); - DBUG_ASSERT(mysql_bin_log.is_open() && + DBUG_ASSERT( (all || !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))); if (my_b_tell(trans_log) == 0) @@ -155,7 +155,7 @@ static int binlog_rollback(THD *thd, bool all) unnecessary, doing extra work. The cause should be found and eliminated */ DBUG_ASSERT(all || !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))); - DBUG_ASSERT(mysql_bin_log.is_open() && my_b_tell(trans_log)); + DBUG_ASSERT(my_b_tell(trans_log)); /* Update the binary log with a BEGIN/ROLLBACK block if we have cached some queries and we updated some non-transactional @@ -198,7 +198,7 @@ static int binlog_savepoint_set(THD *thd, void *sv) { IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot]; DBUG_ENTER("binlog_savepoint_set"); - DBUG_ASSERT(mysql_bin_log.is_open() && my_b_tell(trans_log)); + DBUG_ASSERT(my_b_tell(trans_log)); *(my_off_t *)sv= my_b_tell(trans_log); /* Write it to the binary log */ @@ -210,7 +210,7 @@ static int binlog_savepoint_rollback(THD *thd, void *sv) { IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot]; DBUG_ENTER("binlog_savepoint_rollback"); - DBUG_ASSERT(mysql_bin_log.is_open() && my_b_tell(trans_log)); + DBUG_ASSERT(my_b_tell(trans_log)); /* Write ROLLBACK TO SAVEPOINT to the binlog cache if we have updated some From 63e03007ebda036691aa8c430c894b5cc9306b38 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 03:56:03 -0700 Subject: [PATCH 069/227] fix bad merge --- mysql-test/r/fulltext2.result | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/fulltext2.result b/mysql-test/r/fulltext2.result index 783d9acd8ac..e9bee6f697e 100644 --- a/mysql-test/r/fulltext2.result +++ b/mysql-test/r/fulltext2.result @@ -241,14 +241,6 @@ select * from t1 where match a against('ab c' in boolean mode); a drop table t1; set names latin1; -SET NAMES utf8; -CREATE TABLE t1(a VARCHAR(255), FULLTEXT(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8; -INSERT INTO t1 VALUES('„MySQL“'); -SELECT a FROM t1 WHERE MATCH a AGAINST('“MySQL„' IN BOOLEAN MODE); -a -„MySQL“ -DROP TABLE t1; -SET NAMES latin1; CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); SET NAMES utf8; INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); @@ -261,3 +253,11 @@ Table Op Msg_type Msg_text test.t1 check status OK SET NAMES latin1; DROP TABLE t1; +SET NAMES utf8; +CREATE TABLE t1(a VARCHAR(255), FULLTEXT(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES('„MySQL“'); +SELECT a FROM t1 WHERE MATCH a AGAINST('“MySQL„' IN BOOLEAN MODE); +a +„MySQL“ +DROP TABLE t1; +SET NAMES latin1; From e6781590139d1b5a12556e8bf57eccca4b66062b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 14:12:27 +0200 Subject: [PATCH 070/227] ndb - bug#25901 handle undofile/logfile groups that were created while node was node storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Make sure that START_RECREQ is run on lgman/tsman even during initial node restart storage/ndb/src/kernel/blocks/lgman.cpp: Set state to LG_STARTING during node/system restart storage/ndb/src/kernel/blocks/lgman.hpp: add new state --- .../ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 22 +++++++++++-------- storage/ndb/src/kernel/blocks/lgman.cpp | 17 ++++++++++---- storage/ndb/src/kernel/blocks/lgman.hpp | 3 ++- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index e47fcf34471..e5adcf3f857 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -14215,15 +14215,6 @@ void Dblqh::execSTART_RECREQ(Signal* signal) * WE ALSO NEED TO SET CNEWEST_GCI TO ENSURE THAT LOG RECORDS ARE EXECUTED * WITH A PROPER GCI. *------------------------------------------------------------------------ */ - if(cstartType == NodeState::ST_INITIAL_NODE_RESTART){ - jam(); - cstartRecReq = 2; - StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend(); - conf->startingNodeId = getOwnNodeId(); - sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal, - StartRecConf::SignalLength, JBB); - return; - }//if if (c_lcp_restoring_fragments.isEmpty()) { @@ -14276,6 +14267,19 @@ void Dblqh::execSTART_RECCONF(Signal* signal) jam(); csrExecUndoLogState = EULS_COMPLETED; + + if(cstartType == NodeState::ST_INITIAL_NODE_RESTART) + { + jam(); + cstartRecReq = 2; + + StartRecConf * conf = (StartRecConf*)signal->getDataPtrSend(); + conf->startingNodeId = getOwnNodeId(); + sendSignal(cmasterDihBlockref, GSN_START_RECCONF, signal, + StartRecConf::SignalLength, JBB); + return; + } + c_lcp_complete_fragments.first(fragptr); build_acc(signal, fragptr.i); return; diff --git a/storage/ndb/src/kernel/blocks/lgman.cpp b/storage/ndb/src/kernel/blocks/lgman.cpp index 25cdac89737..23738717580 100644 --- a/storage/ndb/src/kernel/blocks/lgman.cpp +++ b/storage/ndb/src/kernel/blocks/lgman.cpp @@ -346,6 +346,12 @@ Lgman::execCREATE_FILEGROUP_REQ(Signal* signal){ m_logfile_group_hash.add(ptr); m_logfile_group_list.add(ptr); + + if (getNodeState().getNodeRestartInProgress() || + getNodeState().getSystemRestartInProgress()) + { + ptr.p->m_state = Logfile_group::LG_STARTING; + } CreateFilegroupImplConf* conf= (CreateFilegroupImplConf*)signal->getDataPtr(); @@ -370,8 +376,6 @@ Lgman::execDROP_FILEGROUP_REQ(Signal* signal) { jamEntry(); - jamEntry(); - Uint32 errorCode = 0; DropFilegroupImplReq req = *(DropFilegroupImplReq*)signal->getDataPtr(); do @@ -717,7 +721,8 @@ Lgman::create_file_commit(Signal* signal, Uint32 senderData = ptr.p->m_create.m_senderData; bool first= false; - if(ptr.p->m_state == Undofile::FS_CREATING) + if(ptr.p->m_state == Undofile::FS_CREATING && + (lg_ptr.p->m_state & Logfile_group::LG_ONLINE)) { jam(); Local_undofile_list free(m_file_pool, lg_ptr.p->m_files); @@ -2082,13 +2087,17 @@ Lgman::execSTART_RECREQ(Signal* signal) void Lgman::find_log_head(Signal* signal, Ptr ptr) { + ndbrequire(ptr.p->m_state & + (Logfile_group::LG_STARTING | Logfile_group::LG_SORTING)); + if(ptr.p->m_meta_files.isEmpty() && ptr.p->m_files.isEmpty()) { jam(); /** * Logfile_group wo/ any files */ - + ptr.p->m_state &= ~(Uint32)Logfile_group::LG_STARTING; + ptr.p->m_state |= Logfile_group::LG_ONLINE; m_logfile_group_list.next(ptr); signal->theData[0] = LgmanContinueB::FIND_LOG_HEAD; signal->theData[1] = ptr.i; diff --git a/storage/ndb/src/kernel/blocks/lgman.hpp b/storage/ndb/src/kernel/blocks/lgman.hpp index b26c3219088..d2706818144 100644 --- a/storage/ndb/src/kernel/blocks/lgman.hpp +++ b/storage/ndb/src/kernel/blocks/lgman.hpp @@ -175,13 +175,14 @@ public: ,LG_SORTING = 0x002 // Sorting files ,LG_SEARCHING = 0x004 // Searching in last file ,LG_EXEC_THREAD = 0x008 // Execute thread is running - ,LG_READ_THREAD = 0x010 // Read thread is running + ,LG_READ_THREAD = 0x010 // Read thread is running ,LG_FORCE_SYNC_THREAD = 0x020 ,LG_SYNC_WAITERS_THREAD = 0x040 ,LG_CUT_LOG_THREAD = 0x080 ,LG_WAITERS_THREAD = 0x100 ,LG_FLUSH_THREAD = 0x200 ,LG_DROPPING = 0x400 + ,LG_STARTING = 0x800 }; static const Uint32 LG_THREAD_MASK = Logfile_group::LG_FORCE_SYNC_THREAD | From b16b2683e5a7e9b1eae9a59b477b8eb0517b6c68 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 17:17:58 +0500 Subject: [PATCH 071/227] Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption New Field::store() method implemented to explicitly set thd->count_cuted_fields before value storing, instead of (incorrectly) setting it in the CSV storage engine. Thread row counter now properly incremented during check and repair in the CSV engine. include/mysql/plugin.h: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - thd_inc_row_count() function prototype added, which allows a storage engine to increment thread row counter. mysql-test/r/csv.result: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - result adjusted. sql/field.cc: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - Field::store(const char *to, uint length, CHARSET_INFO *cs, enum_check_fields check_level) method introduced in order to explicitly set count_cuted_fields before a ::store call, then reset it back after. sql/field.h: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - Field::store(const char *to, uint length, CHARSET_INFO *cs, enum_check_fields check_level) method introduced in order to explicitly set count_cuted_fields before a ::store call, then reset it back after. sql/mysql_priv.h: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - enum enum_check_fields moved from sql/sql_class.h to sql/mysql_priv.h as it's used now in the field.h sql/sql_class.cc: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - implementation of the new thd_inc_row_count() function which increments thread row counter. sql/sql_class.h: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - enum enum_check_fields moved from sql/sql_class.h to sql/mysql_priv.h as it's used now in the field.h storage/csv/ha_tina.cc: Complementary fix for bug #29353: inserting a negative value to a csv table leads to the table corruption - removed #define MYSQL_SERVER 1 - "a storage engine should not need internals of the server" - removed thd->count_cuted_fields= CHECK_FIELD_WARN as we are not allowed to access internals of THD. - used new Field::store() method to explicitly set thd->count_cuted_fields to CHECK_FIELD_WARN - thd_inc_row_count() calls added to ha_tina::repair() and ha_tina::check() to get proper row count values. --- include/mysql/plugin.h | 3 ++- mysql-test/r/csv.result | 2 +- sql/field.cc | 12 ++++++++++++ sql/field.h | 2 ++ sql/mysql_priv.h | 7 +++++++ sql/sql_class.cc | 5 +++++ sql/sql_class.h | 2 -- storage/csv/ha_tina.cc | 11 ++++------- 8 files changed, 33 insertions(+), 11 deletions(-) diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index 7b224695324..dd540225deb 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -655,7 +655,8 @@ void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton); int thd_tx_isolation(const MYSQL_THD thd); char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, unsigned int max_query_len); - +/* Increments the row counter, see THD::row_count */ +void thd_inc_row_count(MYSQL_THD thd); #ifdef __cplusplus } diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index e7cdd612a25..5076220f74b 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -5276,7 +5276,7 @@ drop table t1; create table t1(a int, b int) engine=csv; repair table t1; Table Op Msg_type Msg_text -test.t1 repair Warning Data truncated for column 'a' at row 1 +test.t1 repair Warning Data truncated for column 'a' at row 5 test.t1 repair status OK check table t1; Table Op Msg_type Msg_text diff --git a/sql/field.cc b/sql/field.cc index 55a93ed46d6..332a654c89f 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1360,6 +1360,18 @@ bool Field::send_binary(Protocol *protocol) } +int Field::store(const char *to, uint length, CHARSET_INFO *cs, + enum_check_fields check_level) +{ + int res; + enum_check_fields old_check_level= table->in_use->count_cuted_fields; + table->in_use->count_cuted_fields= check_level; + res= store(to, length, cs); + table->in_use->count_cuted_fields= old_check_level; + return res; +} + + my_decimal *Field::val_decimal(my_decimal *decimal) { /* This never have to be called */ diff --git a/sql/field.h b/sql/field.h index a0fe0f2e57e..ef76cb47d36 100644 --- a/sql/field.h +++ b/sql/field.h @@ -100,6 +100,8 @@ public: virtual int store(longlong nr, bool unsigned_val)=0; virtual int store_decimal(const my_decimal *d)=0; virtual int store_time(MYSQL_TIME *ltime, timestamp_type t_type); + int store(const char *to, uint length, CHARSET_INFO *cs, + enum_check_fields check_level); virtual double val_real(void)=0; virtual longlong val_int(void)=0; virtual my_decimal *val_decimal(my_decimal *); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 5a50b03282f..9264ca295d9 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -494,6 +494,13 @@ enum enum_parsing_place struct st_table; class THD; +enum enum_check_fields +{ + CHECK_FIELD_IGNORE, + CHECK_FIELD_WARN, + CHECK_FIELD_ERROR_FOR_NULL +}; + /* Struct to handle simple linked lists */ typedef struct st_sql_list { diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 40b37ed7405..e279e23ab69 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -253,6 +253,11 @@ int thd_tx_isolation(const THD *thd) return (int) thd->variables.tx_isolation; } +extern "C" +void thd_inc_row_count(THD *thd) +{ + thd->row_count++; +} /* Dumps a text description of a thread, its security context diff --git a/sql/sql_class.h b/sql/sql_class.h index c46adc62c7c..c3ee71e3297 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -39,8 +39,6 @@ enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME }; enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE }; enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON, DELAY_KEY_WRITE_ALL }; -enum enum_check_fields -{ CHECK_FIELD_IGNORE, CHECK_FIELD_WARN, CHECK_FIELD_ERROR_FOR_NULL }; enum enum_mark_columns { MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE}; diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 239d47890ed..2ee96fd5d05 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -45,8 +45,6 @@ TODO: #pragma implementation // gcc: Class implementation #endif -#define MYSQL_SERVER 1 - #include "mysql_priv.h" #include #include "ha_tina.h" @@ -675,7 +673,8 @@ int ha_tina::find_current_row(uchar *buf) if (bitmap_is_set(table->read_set, (*field)->field_index)) { - if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset())) + if ((*field)->store(buffer.ptr(), buffer.length(), buffer.charset(), + CHECK_FIELD_WARN)) goto err; } } @@ -1002,7 +1001,6 @@ int ha_tina::delete_row(const uchar * buf) int ha_tina::rnd_init(bool scan) { - THD *thd= table ? table->in_use : current_thd; DBUG_ENTER("ha_tina::rnd_init"); /* set buffer to the beginning of the file */ @@ -1014,7 +1012,6 @@ int ha_tina::rnd_init(bool scan) stats.records= 0; records_is_known= 0; chain_ptr= chain; - thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong values DBUG_RETURN(0); } @@ -1298,9 +1295,9 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt) current_position= next_position= 0; /* Read the file row-by-row. If everything is ok, repair is not needed. */ - thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong values while (!(rc= find_current_row(buf))) { + thd_inc_row_count(thd); rows_repaired++; current_position= next_position; } @@ -1464,9 +1461,9 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt) /* set current position to the beginning of the file */ current_position= next_position= 0; /* Read the file row-by-row. If everything is ok, repair is not needed. */ - thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong values while (!(rc= find_current_row(buf))) { + thd_inc_row_count(thd); count--; current_position= next_position; } From ac84ebf6847bb577b69d90032f11b00c1bb098af Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 16:29:25 +0200 Subject: [PATCH 072/227] ndb - bug#28642 - Tablespace returning incorrect usage status make free 64 bit (as it represents free bytes, not free extents as originally designed) storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp: make free 64 bit (as it represents free bytes, not free extents as originally designed) --- storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 68ca4edb5d0..f2b3173beff 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -390,7 +390,7 @@ struct NdbFileImpl : public NdbDictObjectImpl { NdbFileImpl(NdbDictionary::Object::Type t); Uint64 m_size; - Uint32 m_free; + Uint64 m_free; BaseString m_path; BaseString m_filegroup_name; Uint32 m_filegroup_id; From 166d3c9186539e4ebd738e368be453bdee119cc2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 19:37:46 +0500 Subject: [PATCH 073/227] Fixed bug #29294. The `SELECT 'r' INTO OUTFILE ... FIELDS ENCLOSED BY 'r' ' statement encoded the 'r' string to a 4 byte string of value x'725c7272' (sequence of 4 characters: r\rr). The LOAD DATA statement decoded this string to a 1 byte string of value x'0d' (ASCII Carriage Return character) instead of the original 'r' character. The same error also happened with the FIELDS ENCLOSED BY clause followed by special characters: 'n', 't', 'r', 'b', '0', 'Z' and 'N'. NOTE 1: This is a result of the undocumented feature: the LOAD DATA INFILE recognises 2-byte input sequences like \n, \t, \r and \Z in addition to documented 2-byte sequences: \0 and \N. This feature should be documented (here backspace character is a default ESCAPED BY character, in the real-life example it may be any ESCAPED BY character). NOTE 2, changed behaviour: Now the `SELECT INTO OUTFILE' statement with the `FIELDS ENCLOSED BY' clause followed by one of: 'n', 't', 'r', 'b', '0', 'Z' or 'N' characters encodes this special character itself by doubling it ('r' --> 'rr'), not by prepending it with an escape character. sql/sql_class.h: Fixed bug #29294. The ESCAPE_CHARS macro constant is defined to enumerate symbolic names of espace-sequences like '\n', '\t' etc. The select_export::is_ambiguous_field_sep field has been added to distinguish special values of the field_sep field from another values (see ESCAPE_CHARS). sql/sql_class.cc: Fixed bug #29294. The select_export::send_data method has been modified to encode special values of the field_sep field by doubling of those values instead of prepending them with a value of the escape_char field. Example: The SELECT 'r' INTO OUTFILE FIELDS ENCLOSED BY 'r' now produces the 'rr' output string instead of x'5c72' (i.e. instead of sequence of 2 bytes: \ and r). sql/sql_load.cc: Fixed bug #29294. Added commentary for the READ_INFO::unescape method. mysql-test/t/loaddata.test: Updated test case for bug #29294. mysql-test/r/loaddata.result: Updated test case for bug #29294. --- mysql-test/r/loaddata.result | 65 +++++++++++++++++++++++++++++++++++- mysql-test/t/loaddata.test | 38 ++++++++++++++++++++- sql/sql_class.cc | 5 ++- sql/sql_class.h | 9 +++++ sql/sql_load.cc | 1 + 5 files changed, 115 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index e1076cd3072..0906b1708c7 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1,t2; create table t1 (a date, b date, c date not null, d date); load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; Warnings: @@ -85,3 +85,66 @@ field1 field2 a"b cd"ef a"b c"d"e drop table t1; +CREATE TABLE t1 ( +id INT AUTO_INCREMENT PRIMARY KEY, +c1 VARCHAR(255) +); +CREATE TABLE t2 ( +id INT, +c2 VARCHAR(255) +); +INSERT INTO t1 (c1) VALUES +('r'), ('rr'), ('rrr'), ('rrrr'), +('.r'), ('.rr'), ('.rrr'), ('.rrrr'), +('r.'), ('rr.'), ('rrr.'), ('rrrr.'), +('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.'), +('\r'), ('\\rr'), ('\\\rr'), ('\\\\rr'); +SELECT * FROM t1; +id c1 +1 r +2 rr +3 rrr +4 rrrr +5 .r +6 .rr +7 .rrr +8 .rrrr +9 r. +10 rr. +11 rrr. +12 rrrr. +13 .r. +14 .rr. +15 .rrr. +16 .rrrr. +17 +18 \rr +19 \ r +20 \\rr +SELECT * INTO OUTFILE 'MYSQL_TEST_DIR/var/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; +r1r rrrr +r2r rrrrrr +r3r rrrrrrrr +r4r rrrrrrrrrr +r5r r.rrr +r6r r.rrrrr +r7r r.rrrrrrr +r8r r.rrrrrrrrr +r9r rrr.r +r10r rrrrr.r +r11r rrrrrrr.r +r12r rrrrrrrrr.r +r13r r.rr.r +r14r r.rrrr.r +r15r r.rrrrrr.r +r16r r.rrrrrrrr.r +r17r r r +r18r r\\rrrrr +r19r r\\ rrr +r20r r\\\\rrrrr +LOAD DATA INFILE 'MYSQL_TEST_DIR/var/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r'; +SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; +id c1 c2 +SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; +id c1 c2 +DROP TABLE t1,t2; diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index e989cb0b2ac..74d71985854 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -3,7 +3,7 @@ # --disable_warnings -drop table if exists t1; +drop table if exists t1,t2; --enable_warnings create table t1 (a date, b date, c date not null, d date); @@ -67,4 +67,40 @@ load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated select * from t1; drop table t1; +# +# Bug #29294 SELECT INTO OUTFILE/LOAD DATA INFILE with special +# characters in the FIELDS ENCLOSED BY clause +# + +CREATE TABLE t1 ( + id INT AUTO_INCREMENT PRIMARY KEY, + c1 VARCHAR(255) +); + +CREATE TABLE t2 ( + id INT, + c2 VARCHAR(255) +); + +INSERT INTO t1 (c1) VALUES + ('r'), ('rr'), ('rrr'), ('rrrr'), + ('.r'), ('.rr'), ('.rrr'), ('.rrrr'), + ('r.'), ('rr.'), ('rrr.'), ('rrrr.'), + ('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.'), + ('\r'), ('\\rr'), ('\\\rr'), ('\\\\rr'); +SELECT * FROM t1; + +--exec rm -f $MYSQL_TEST_DIR/var/tmp/t1 +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; +--exec cat $MYSQL_TEST_DIR/var/tmp/t1 + +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +eval LOAD DATA INFILE '$MYSQL_TEST_DIR/var/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r'; +SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; +SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; + +--exec rm $MYSQL_TEST_DIR/var/tmp/t1 +DROP TABLE t1,t2; + # End of 4.1 tests diff --git a/sql/sql_class.cc b/sql/sql_class.cc index b187d29021a..0f58f96cf57 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1020,6 +1020,7 @@ select_export::prepare(List &list, SELECT_LEX_UNIT *u) field_sep_char= (exchange->enclosed->length() ? (*exchange->enclosed)[0] : field_term_length ? (*exchange->field_term)[0] : INT_MAX); escape_char= (exchange->escaped->length() ? (*exchange->escaped)[0] : -1); + is_ambiguous_field_sep= strchr(ESCAPE_CHARS, field_sep_char); line_sep_char= (exchange->line_term->length() ? (*exchange->line_term)[0] : INT_MAX); if (!field_term_length) @@ -1113,7 +1114,9 @@ bool select_export::send_data(List &items) (int) *pos == line_sep_char || !*pos) { char tmp_buff[2]; - tmp_buff[0]= escape_char; + tmp_buff[0]= ((int) *pos == field_sep_char && + is_ambiguous_field_sep) ? + field_sep_char : escape_char; tmp_buff[1]= *pos ? *pos : '0'; if (my_b_write(&cache,(byte*) start,(uint) (pos-start)) || my_b_write(&cache,(byte*) tmp_buff,2)) diff --git a/sql/sql_class.h b/sql/sql_class.h index db6f65cab55..eb2c8637651 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1224,9 +1224,18 @@ public: }; +#define ESCAPE_CHARS "ntrb0ZN" // keep synchronous with READ_INFO::unescape + + class select_export :public select_to_file { uint field_term_length; int field_sep_char,escape_char,line_sep_char; + /* + The is_ambiguous_field_sep field is true if a value of the field_sep_char + field is one of the 'n', 't', 'r' etc characters + (see the READ_INFO::unescape method and the ESCAPE_CHARS constant value). + */ + bool is_ambiguous_field_sep; bool fixed_row_size; public: select_export(sql_exchange *ex) :select_to_file(ex) {} diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 10124e5f5ff..bac981651c3 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -611,6 +611,7 @@ read_sep_field(THD *thd,COPY_INFO &info,TABLE *table, char READ_INFO::unescape(char chr) { + /* keep this switch synchornous with the ESCAPE_CHARS macro */ switch(chr) { case 'n': return '\n'; case 't': return '\t'; From a3715c9771451e87f3789c29c8a602e0482986ec Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 16:56:35 +0200 Subject: [PATCH 074/227] ndb - bug#28720 - "Disk data meta information is not visible in mysqld but exists in ndbd" continue on unknown result (no contact) sql/ha_ndbcluster.cc: continue on unknown result (no contact) --- sql/ha_ndbcluster.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 7f94268f4f5..165d686abe8 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -10974,6 +10974,10 @@ static int ndbcluster_fill_files_table(handlerton *hton, { if (ndberr.classification == NdbError::SchemaError) continue; + + if (ndberr.classification == NdbError::UnknownResultError) + continue; + ERR_RETURN(ndberr); } NdbDictionary::Tablespace ts= dict->getTablespace(df.getTablespace()); From 1490e79da2448e712ed9d7be53f4b1c1e13ffc1d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 08:11:38 -0700 Subject: [PATCH 075/227] move test for bug29299 into seperate file as it requires charset gbk fixes test breakage on sles10-ia64-a which omits charset. mysql-test/r/fulltext2.result: move test for bug29299 into seperate file as it requires charset gbk mysql-test/t/fulltext2.test: move test for bug29299 into seperate file as it requires charset gbk mysql-test/r/fulltext3.result: move test for bug29299 into seperate file as it requires charset gbk mysql-test/t/fulltext3.test: move test for bug29299 into seperate file as it requires charset gbk --- mysql-test/r/fulltext2.result | 12 ------------ mysql-test/r/fulltext3.result | 13 +++++++++++++ mysql-test/t/fulltext2.test | 12 ------------ mysql-test/t/fulltext3.test | 24 ++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 mysql-test/r/fulltext3.result create mode 100644 mysql-test/t/fulltext3.test diff --git a/mysql-test/r/fulltext2.result b/mysql-test/r/fulltext2.result index e9bee6f697e..7e3e25370d3 100644 --- a/mysql-test/r/fulltext2.result +++ b/mysql-test/r/fulltext2.result @@ -241,18 +241,6 @@ select * from t1 where match a against('ab c' in boolean mode); a drop table t1; set names latin1; -CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); -SET NAMES utf8; -INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); -SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); -HEX(a) -BEF361616197C22061616161 -DELETE FROM t1 LIMIT 1; -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -SET NAMES latin1; -DROP TABLE t1; SET NAMES utf8; CREATE TABLE t1(a VARCHAR(255), FULLTEXT(a)) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO t1 VALUES('„MySQL“'); diff --git a/mysql-test/r/fulltext3.result b/mysql-test/r/fulltext3.result new file mode 100644 index 00000000000..019d5f472ed --- /dev/null +++ b/mysql-test/r/fulltext3.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); +SET NAMES utf8; +INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); +SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); +HEX(a) +BEF361616197C22061616161 +DELETE FROM t1 LIMIT 1; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SET NAMES latin1; +DROP TABLE t1; diff --git a/mysql-test/t/fulltext2.test b/mysql-test/t/fulltext2.test index cb2e839c41f..88967a5dd04 100644 --- a/mysql-test/t/fulltext2.test +++ b/mysql-test/t/fulltext2.test @@ -220,18 +220,6 @@ select * from t1 where match a against('ab c' in boolean mode); drop table t1; set names latin1; -# -# BUG#29299 - repeatable myisam fulltext index corruption -# -CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); -SET NAMES utf8; -INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); -SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); -DELETE FROM t1 LIMIT 1; -CHECK TABLE t1; -SET NAMES latin1; -DROP TABLE t1; - # End of 4.1 tests # diff --git a/mysql-test/t/fulltext3.test b/mysql-test/t/fulltext3.test new file mode 100644 index 00000000000..5ca068c066b --- /dev/null +++ b/mysql-test/t/fulltext3.test @@ -0,0 +1,24 @@ +--source include/have_gbk.inc +# +# test of new fulltext search features +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# +# BUG#29299 - repeatable myisam fulltext index corruption +# +CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); +SET NAMES utf8; +INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); +SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); +DELETE FROM t1 LIMIT 1; +CHECK TABLE t1; +SET NAMES latin1; +DROP TABLE t1; + +# End of 4.1 tests + From 5b14bc33bbed12a0b921fce109cdc81789f9f527 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 17:22:57 +0200 Subject: [PATCH 076/227] ndb - bug#28720 fix also undo files --- sql/ha_ndbcluster.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 165d686abe8..818996f5fae 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -11057,6 +11057,8 @@ static int ndbcluster_fill_files_table(handlerton *hton, { if (ndberr.classification == NdbError::SchemaError) continue; + if (ndberr.classification == NdbError::UnknownResultError) + continue; ERR_RETURN(ndberr); } NdbDictionary::LogfileGroup lfg= From 19a5d20ce3c55dece7da483964d24d9421bd63c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 21:05:17 +0500 Subject: [PATCH 077/227] sql_class.cc: Windows compilation error fix. sql/sql_class.cc: Windows compilation error fix. --- sql/sql_class.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 0f58f96cf57..3e918a6a07c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1020,7 +1020,7 @@ select_export::prepare(List &list, SELECT_LEX_UNIT *u) field_sep_char= (exchange->enclosed->length() ? (*exchange->enclosed)[0] : field_term_length ? (*exchange->field_term)[0] : INT_MAX); escape_char= (exchange->escaped->length() ? (*exchange->escaped)[0] : -1); - is_ambiguous_field_sep= strchr(ESCAPE_CHARS, field_sep_char); + is_ambiguous_field_sep= test(strchr(ESCAPE_CHARS, field_sep_char)); line_sep_char= (exchange->line_term->length() ? (*exchange->line_term)[0] : INT_MAX); if (!field_term_length) From bc3e00868803009e5f4aff258bf2427e3896c255 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 21:45:20 +0500 Subject: [PATCH 078/227] loaddata.result, loaddata.test: Test case update for bug #29294. mysql-test/t/loaddata.test: Test case update for bug #29294. mysql-test/r/loaddata.result: Test case update for bug #29294. --- mysql-test/r/loaddata.result | 11 +---------- mysql-test/t/loaddata.test | 3 +-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 0906b1708c7..83a0788b793 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -97,8 +97,7 @@ INSERT INTO t1 (c1) VALUES ('r'), ('rr'), ('rrr'), ('rrrr'), ('.r'), ('.rr'), ('.rrr'), ('.rrrr'), ('r.'), ('rr.'), ('rrr.'), ('rrrr.'), -('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.'), -('\r'), ('\\rr'), ('\\\rr'), ('\\\\rr'); +('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.'); SELECT * FROM t1; id c1 1 r @@ -117,10 +116,6 @@ id c1 14 .rr. 15 .rrr. 16 .rrrr. -17 -18 \rr -19 \ r -20 \\rr SELECT * INTO OUTFILE 'MYSQL_TEST_DIR/var/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; r1r rrrr r2r rrrrrr @@ -138,10 +133,6 @@ r13r r.rr.r r14r r.rrrr.r r15r r.rrrrrr.r r16r r.rrrrrrrr.r -r17r r r -r18r r\\rrrrr -r19r r\\ rrr -r20r r\\\\rrrrr LOAD DATA INFILE 'MYSQL_TEST_DIR/var/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r'; SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; id c1 c2 diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index 74d71985854..14f33c6b396 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -86,8 +86,7 @@ INSERT INTO t1 (c1) VALUES ('r'), ('rr'), ('rrr'), ('rrrr'), ('.r'), ('.rr'), ('.rrr'), ('.rrrr'), ('r.'), ('rr.'), ('rrr.'), ('rrrr.'), - ('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.'), - ('\r'), ('\\rr'), ('\\\rr'), ('\\\\rr'); + ('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.'); SELECT * FROM t1; --exec rm -f $MYSQL_TEST_DIR/var/tmp/t1 From 8d035c57f0c5c65ecf9652bd913b3d2f988c8f6e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jul 2007 03:15:37 +0500 Subject: [PATCH 079/227] loaddata.result, loaddata.test: Updated test case for bug #29294. mysql-test/t/loaddata.test: Updated test case for bug #29294. mysql-test/r/loaddata.result: Updated test case for bug #29294. --- mysql-test/r/loaddata.result | 4 ++-- mysql-test/t/loaddata.test | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 0aa95983264..031aa5c700c 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -117,7 +117,7 @@ id c1 14 .rr. 15 .rrr. 16 .rrrr. -SELECT * INTO OUTFILE 'MYSQL_TEST_DIR/var/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; r1r rrrr r2r rrrrrr r3r rrrrrrrr @@ -134,7 +134,7 @@ r13r r.rr.r r14r r.rrrr.r r15r r.rrrrrr.r r16r r.rrrrrrrr.r -LOAD DATA INFILE 'MYSQL_TEST_DIR/var/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r'; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r'; SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; id c1 c2 SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index c7f16fc303b..cdd3bb80b6e 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -89,17 +89,17 @@ INSERT INTO t1 (c1) VALUES ('.r.'), ('.rr.'), ('.rrr.'), ('.rrrr.'); SELECT * FROM t1; ---exec rm -f $MYSQL_TEST_DIR/var/tmp/t1 ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; ---exec cat $MYSQL_TEST_DIR/var/tmp/t1 +--exec rm -f $MYSQLTEST_VARDIR/tmp/t1 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY 'r' FROM t1; +--exec cat $MYSQLTEST_VARDIR/tmp/t1 ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval LOAD DATA INFILE '$MYSQL_TEST_DIR/var/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r'; +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t2 FIELDS ENCLOSED BY 'r'; SELECT t1.id, c1, c2 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; SELECT t1.id, c1, c2 FROM t1 RIGHT JOIN t2 ON t1.id=t2.id WHERE c1 != c2; ---exec rm $MYSQL_TEST_DIR/var/tmp/t1 +--exec rm $MYSQLTEST_VARDIR/tmp/t1 DROP TABLE t1,t2; # End of 4.1 tests From d7282f136b898b66ca3bafcd5eeceee30aab3c0f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Jul 2007 19:51:32 -0600 Subject: [PATCH 080/227] rpl_misc_functions.result, rpl_misc_functions.test: work around bug 29537, which was revealed by patch for bug 28356: move DROP TABLE before DROP PROCEDURE in cleanup mysql-test/suite/rpl/r/rpl_misc_functions.result: work around bug 29537, which was revealed by patch for bug 28356: move DROP TABLE before DROP PROCEDURE in cleanup mysql-test/suite/rpl/t/rpl_misc_functions.test: work around bug 29537, which was revealed by patch for bug 28356: move DROP TABLE before DROP PROCEDURE in cleanup --- mysql-test/suite/rpl/r/rpl_misc_functions.result | 2 +- mysql-test/suite/rpl/t/rpl_misc_functions.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result index ca7403316b1..94aa1bb61a7 100644 --- a/mysql-test/suite/rpl/r/rpl_misc_functions.result +++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result @@ -48,7 +48,7 @@ where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ; SELECT @aux; @aux 12 +DROP TABLE t1, t1_slave; DROP PROCEDURE test_replication_sp1; DROP PROCEDURE test_replication_sp2; DROP FUNCTION test_replication_sf; -DROP TABLE t1, t1_slave; diff --git a/mysql-test/suite/rpl/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test index b87fff919b2..d56402cbe76 100644 --- a/mysql-test/suite/rpl/t/rpl_misc_functions.test +++ b/mysql-test/suite/rpl/t/rpl_misc_functions.test @@ -104,10 +104,10 @@ if (`SELECT @aux <> 12 OR @aux IS NULL`) # Cleanup connection master; +DROP TABLE t1, t1_slave; DROP PROCEDURE test_replication_sp1; DROP PROCEDURE test_replication_sp2; DROP FUNCTION test_replication_sf; -DROP TABLE t1, t1_slave; --sync_slave_with_master From 6413db8567aff526a377606281869e9f8935d78e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jul 2007 11:58:56 +0300 Subject: [PATCH 081/227] merge 5.0-opt -> 5.1-opt --- mysql-test/include/mix1.inc | 2 +- mysql-test/r/innodb_mysql.result | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index c901cea9cba..d8034e19898 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -28,7 +28,7 @@ eval SET SESSION STORAGE_ENGINE = $engine_type; --disable_warnings -drop table if exists t1,t2,t3,t4,t1m,t1i,t2m,t2i,t4; +drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4; --enable_warnings diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index cf403bddf6a..db912c650c3 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -1,5 +1,5 @@ SET SESSION STORAGE_ENGINE = InnoDB; -drop table if exists t1,t2,t3,t4,t1m,t1i,t2m,t2i,t4; +drop table if exists t1,t2,t3,t1m,t1i,t2m,t2i,t4; create table t1 ( c_id int(11) not null default '0', org_id int(11) default null, From e2ccd8f8496836a253e7c1621c5d2781d17b18cd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jul 2007 17:11:56 +0400 Subject: [PATCH 082/227] Backport from 5.2: Fix valgrind failure: Don't access item_func->arguments() if item_func->argument_count()==0 --- sql/sql_show.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 902b298e423..dc1a7bc3bd3 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1909,11 +1909,9 @@ bool uses_only_table_name_fields(Item *item, TABLE_LIST *table) if (item->type() == Item::FUNC_ITEM) { Item_func *item_func= (Item_func*)item; - Item **child; - Item **item_end= (item_func->arguments()) + item_func->argument_count(); - for (child= item_func->arguments(); child != item_end; child++) + for (uint i=0; iargument_count(); i++) { - if (!uses_only_table_name_fields(*child, table)) + if (!uses_only_table_name_fields(item_func->arguments()[i], table)) return 0; } } From 1b84121688041f80d1fe63e7288842d7033d1cae Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jul 2007 20:16:42 +0200 Subject: [PATCH 083/227] backport compute hash --- storage/ndb/include/ndbapi/Ndb.hpp | 34 ++++++ storage/ndb/src/ndbapi/Ndb.cpp | 176 +++++++++++++++++++++++++++++ 2 files changed, 210 insertions(+) diff --git a/storage/ndb/include/ndbapi/Ndb.hpp b/storage/ndb/include/ndbapi/Ndb.hpp index a6a3df92ddb..4d0219d1a3c 100644 --- a/storage/ndb/include/ndbapi/Ndb.hpp +++ b/storage/ndb/include/ndbapi/Ndb.hpp @@ -1280,6 +1280,16 @@ public: * @{ */ + /** + * Structure for passing in pointers to startTransaction + * + */ + struct Key_part_ptr + { + const void * ptr; + unsigned len; + }; + /** * Start a transaction * @@ -1300,6 +1310,30 @@ public: const char *keyData = 0, Uint32 keyLen = 0); + /** + * Compute hash value given table/keys + * + * @param hashvalueptr - OUT, is set to hashvalue if return value is 0 + * @param table Pointer to table object + * @param keyData Null-terminated array of pointers to keyParts that is + * part of distribution key. + * Length of resp. keyPart will be read from + * metadata and checked against passed value + * @param xfrmbuf Pointer to temporary buffer that will be used + * to calculate hashvalue + * @param xfrmbuflen Lengh of buffer + * + * @note if xfrmbuf is null (default) malloc/free will be made + * if xfrmbuf is not null but length is too short, method will fail + * + * @return 0 - ok - hashvalueptr is set + * else - fail, return error code + */ + static int computeHash(Uint32* hashvalueptr, + const NdbDictionary::Table*, + const struct Key_part_ptr * keyData, + void* xfrmbuf = 0, Uint32 xfrmbuflen = 0); + /** * Close a transaction. * diff --git a/storage/ndb/src/ndbapi/Ndb.cpp b/storage/ndb/src/ndbapi/Ndb.cpp index 9b8e4e86d30..bbeeed3ae70 100644 --- a/storage/ndb/src/ndbapi/Ndb.cpp +++ b/storage/ndb/src/ndbapi/Ndb.cpp @@ -37,6 +37,7 @@ Name: Ndb.cpp #include "API.hpp" #include #include +#include /**************************************************************************** void connect(); @@ -304,6 +305,181 @@ Return Value: Returns a pointer to a connection object. Return NULL otherwise. Remark: Start transaction. Synchronous. *****************************************************************************/ +int +Ndb::computeHash(Uint32 *retval, + const NdbDictionary::Table *table, + const struct Key_part_ptr * keyData, + void* buf, Uint32 bufLen) +{ + Uint32 j = 0; + Uint32 sumlen = 0; // Needed len + const NdbTableImpl* impl = &NdbTableImpl::getImpl(*table); + const NdbColumnImpl* const * cols = impl->m_columns.getBase(); + Uint32 len; + NdbTransaction* trans; + char* pos; + + Uint32 colcnt = impl->m_columns.size(); + Uint32 parts = impl->m_noOfDistributionKeys; + if (parts == 0) + { + parts = impl->m_noOfKeys; + } + + for (Uint32 i = 0; im_distributionKey) + { + // wl3717_todo + // char allowed now as dist key so this case should be tested + partcols[j++] = cols[i]; + } + } + + for (Uint32 i = 0; im_type, + keyData[i].ptr, + keyData[i].len, + lb, len))) + goto emalformedkey; + + if (unlikely(keyData[i].len < (lb + len))) + goto elentosmall; + + Uint32 maxlen = (partcols[i]->m_attrSize * partcols[i]->m_arraySize); + + if (unlikely(lb == 0 && keyData[i].len != maxlen)) + goto emalformedkey; + + if (partcols[i]->m_cs) + { + Uint32 xmul = partcols[i]->m_cs->strxfrm_multiply; + xmul = xmul ? xmul : 1; + len = xmul * (maxlen - lb); + } + + len = (lb + len + 3) & ~(Uint32)3; + sumlen += len; + + } + + if (buf) + { + UintPtr org = UintPtr(buf); + UintPtr use = (org + 7) & ~(UintPtr)7; + + buf = (void*)use; + bufLen -= (use - org); + + if (unlikely(sumlen > bufLen)) + goto ebuftosmall; + } + else + { + buf = malloc(sumlen); + if (unlikely(buf == 0)) + goto enomem; + bufLen = 0; + assert((UintPtr(buf) & 7) == 0); + } + + pos = (char*)buf; + for (Uint32 i = 0; im_type, + keyData[i].ptr, keyData[i].len, lb, len); + CHARSET_INFO* cs; + if ((cs = partcols[i]->m_cs)) + { + Uint32 xmul = cs->strxfrm_multiply; + if (xmul == 0) + xmul = 1; + /* + * Varchar end-spaces are ignored in comparisons. To get same hash + * we blank-pad to maximum length via strnxfrm. + */ + Uint32 maxlen = (partcols[i]->m_attrSize * partcols[i]->m_arraySize); + Uint32 dstLen = xmul * (maxlen - lb); + int n = NdbSqlUtil::strnxfrm_bug7284(cs, + (unsigned char*)pos, + dstLen, + ((unsigned char*)keyData[i].ptr)+lb, + len); + + if (unlikely(n == -1)) + goto emalformedstring; + + while ((n & 3) != 0) + { + pos[n++] = 0; + } + pos += n; + } + else + { + len += lb; + memcpy(pos, keyData[i].ptr, len); + while (len & 3) + { + * (pos + len++) = 0; + } + pos += len; + } + } + len = UintPtr(pos) - UintPtr(buf); + assert((len & 3) == 0); + + Uint32 values[4]; + md5_hash(values, (const Uint64*)buf, len >> 2); + + if (retval) + { + * retval = values[1]; + } + + if (bufLen == 0) + free(buf); + + return 0; + +enullptr: + return 4316; + +emissingnullptr: + return 4276; + +elentosmall: + return 4277; + +ebuftosmall: + return 4278; + +emalformedstring: + if (bufLen == 0) + free(buf); + + return 4279; + +emalformedkey: + return 4280; + +enomem: + return 4000; +} + NdbTransaction* Ndb::startTransaction(const NdbDictionary::Table *table, const char * keyData, Uint32 keyLen) From 793c189667c81bb61bb98b875b769665942b4935 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jul 2007 12:26:39 -0600 Subject: [PATCH 084/227] rpl_misc_functions.result, rpl_misc_functions.test: Remove indeterministic behavior from a test mysql-test/suite/rpl/r/rpl_misc_functions.result: Remove indeterministic behavior from a test mysql-test/suite/rpl/t/rpl_misc_functions.test: Remove indeterministic behavior from a test --- .../suite/rpl/r/rpl_misc_functions.result | 17 ++++++++------- .../suite/rpl/t/rpl_misc_functions.test | 21 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result index 94aa1bb61a7..a8e5520ca8f 100644 --- a/mysql-test/suite/rpl/r/rpl_misc_functions.result +++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result @@ -20,11 +20,12 @@ select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t id i r1 r2 p id i r1 r2 p drop table t1; DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (col_a double default NULL); +CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +col_a DOUBLE DEFAULT NULL); CREATE PROCEDURE test_replication_sp1() BEGIN -INSERT INTO t1 VALUES (rand()), (rand()); -INSERT INTO t1 VALUES (rand()); +INSERT INTO t1 (col_a) VALUES (rand()), (rand()); +INSERT INTO t1 (col_a) VALUES (rand()); END| CREATE PROCEDURE test_replication_sp2() BEGIN @@ -37,14 +38,14 @@ RETURN (rand() + rand()); END| CALL test_replication_sp1(); CALL test_replication_sp2(); -INSERT INTO t1 VALUES (test_replication_sf()); -INSERT INTO t1 VALUES (test_replication_sf()); -INSERT INTO t1 VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); select * from t1 into outfile "../tmp/t1_slave.txt"; create temporary table t1_slave select * from t1 where 1=0; load data infile '../tmp/t1_slave.txt' into table t1_slave; -select count(*) into @aux from t1, t1_slave -where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ; +select count(*) into @aux from t1 join t1_slave using (id) +where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ; SELECT @aux; @aux 12 diff --git a/mysql-test/suite/rpl/t/rpl_misc_functions.test b/mysql-test/suite/rpl/t/rpl_misc_functions.test index d56402cbe76..1c94471c975 100644 --- a/mysql-test/suite/rpl/t/rpl_misc_functions.test +++ b/mysql-test/suite/rpl/t/rpl_misc_functions.test @@ -43,15 +43,16 @@ drop table t1; DROP TABLE IF EXISTS t1; --enable_warnings -CREATE TABLE t1 (col_a double default NULL); +CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + col_a DOUBLE DEFAULT NULL); DELIMITER |; # Use a SP that calls rand() multiple times CREATE PROCEDURE test_replication_sp1() BEGIN - INSERT INTO t1 VALUES (rand()), (rand()); - INSERT INTO t1 VALUES (rand()); + INSERT INTO t1 (col_a) VALUES (rand()), (rand()); + INSERT INTO t1 (col_a) VALUES (rand()); END| # Use a SP that calls another SP to call rand() multiple times @@ -73,9 +74,9 @@ DELIMITER ;| # the master to those on the slave. CALL test_replication_sp1(); CALL test_replication_sp2(); -INSERT INTO t1 VALUES (test_replication_sf()); -INSERT INTO t1 VALUES (test_replication_sf()); -INSERT INTO t1 VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); --sync_slave_with_master @@ -90,14 +91,14 @@ load data infile '../tmp/t1_slave.txt' into table t1_slave; # Compare master and slave temp table, use subtraction # for floating point comparison of "double" -select count(*) into @aux from t1, t1_slave -where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ; +select count(*) into @aux from t1 join t1_slave using (id) +where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ; SELECT @aux; if (`SELECT @aux <> 12 OR @aux IS NULL`) { --echo # ERROR: We expected to get count(*) = 12. - SELECT col_a FROM t1; - SELECT col_a FROM t1_slave; + SELECT id, col_a FROM t1; + SELECT id, col_a FROM t1_slave; --echo # abort exit; } From 435df1859fc503c884cdec9eaceb7f5f102af70d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jul 2007 21:55:26 +0200 Subject: [PATCH 085/227] Bug#26827 - table->read_set is set incorrectly, causing update of a different column For efficiency some storage engines do not read a complete record for update, but only the columns required for selecting the rows. When updating a row of a partitioned table, modifying a column that is part of the partition or subpartition expression, then the row may need to move from one [sub]partition to another one. This is done by inserting the new row into the target [sub]partition and deleting the old row from the originating one. For the insert we need a complete record. If an above mentioned engine was used for a partitioned table, we did not have a complete record in update_row(). The implicitly executed write_row() got an incomplete record. This is solved by instructing the engine to read a complete record if one of the columns of the partition or subpartiton is to be updated. No testcase. This can be reproduced with Falcon only. The engines contained in standard 5.1 do always return complete records on update. sql/ha_partition.cc: Bug#26827 - table->read_set is set incorrectly, causing update of a different column Setting partition field bits in read_set if a writing operation is going on. This replaces the old function include_partition_fields_in_used_fields(). Setting all bits in read_set if write_set contains a column used in a partition or subpartition expression. Removed include_partition_fields_in_used_fields(). sql/ha_partition.h: Bug#26827 - table->read_set is set incorrectly, causing update of a different column Removed declaration of include_partition_fields_in_used_fields(). sql/partition_info.h: Bug#26827 - table->read_set is set incorrectly, causing update of a different column Added a bitmap to partition_info for a quick check of columns used in a partition or subpartition expression. sql/sql_partition.cc: Bug#26827 - table->read_set is set incorrectly, causing update of a different column Initializing the new bitmap with all columns used in a partition or subpartition expression. --- sql/ha_partition.cc | 69 ++++++++++++++++++++++++-------------------- sql/ha_partition.h | 1 - sql/partition_info.h | 7 +++++ sql/sql_partition.cc | 35 ++++++++++++++++++++-- 4 files changed, 77 insertions(+), 35 deletions(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 31f59c662d4..e4924e8e8f2 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -2961,8 +2961,34 @@ int ha_partition::rnd_init(bool scan) uint32 part_id; DBUG_ENTER("ha_partition::rnd_init"); - include_partition_fields_in_used_fields(); - + /* + For operations that may need to change data, we may need to extend + read_set. + */ + if (m_lock_type == F_WRLCK) + { + /* + If write_set contains any of the fields used in partition and + subpartition expression, we need to set all bits in read_set because + the row may need to be inserted in a different [sub]partition. In + other words update_row() can be converted into write_row(), which + requires a complete record. + */ + if (bitmap_is_overlapping(&m_part_info->full_part_field_set, + table->write_set)) + bitmap_set_all(table->read_set); + else + { + /* + Some handlers only read fields as specified by the bitmap for the + read set. For partitioned handlers we always require that the + fields of the partition functions are read such that we can + calculate the partition id to place updated and deleted records. + */ + bitmap_union(table->read_set, &m_part_info->full_part_field_set); + } + } + /* Now we see what the index of our first important partition is */ DBUG_PRINT("info", ("m_part_info->used_partitions: 0x%lx", (long) m_part_info->used_partitions.bitmap)); @@ -3276,7 +3302,15 @@ int ha_partition::index_init(uint inx, bool sorted) m_start_key.length= 0; m_ordered= sorted; m_curr_key_info= table->key_info+inx; - include_partition_fields_in_used_fields(); + /* + Some handlers only read fields as specified by the bitmap for the + read set. For partitioned handlers we always require that the + fields of the partition functions are read such that we can + calculate the partition id to place updated and deleted records. + But this is required for operations that may need to change data only. + */ + if (m_lock_type == F_WRLCK) + bitmap_union(table->read_set, &m_part_info->full_part_field_set); file= m_file; do { @@ -4145,35 +4179,6 @@ int ha_partition::handle_ordered_prev(uchar *buf) } -/* - Set fields in partition functions in read set for underlying handlers - - SYNOPSIS - include_partition_fields_in_used_fields() - - RETURN VALUE - NONE - - DESCRIPTION - Some handlers only read fields as specified by the bitmap for the - read set. For partitioned handlers we always require that the - fields of the partition functions are read such that we can - calculate the partition id to place updated and deleted records. -*/ - -void ha_partition::include_partition_fields_in_used_fields() -{ - Field **ptr= m_part_field_array; - DBUG_ENTER("ha_partition::include_partition_fields_in_used_fields"); - - do - { - bitmap_set_bit(table->read_set, (*ptr)->field_index); - } while (*(++ptr)); - DBUG_VOID_RETURN; -} - - /**************************************************************************** MODULE information calls ****************************************************************************/ diff --git a/sql/ha_partition.h b/sql/ha_partition.h index a168007ea04..895f001fa6a 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -449,7 +449,6 @@ private: int handle_ordered_next(uchar * buf, bool next_same); int handle_ordered_prev(uchar * buf); void return_top_record(uchar * buf); - void include_partition_fields_in_used_fields(); public: /* ------------------------------------------------------------------------- diff --git a/sql/partition_info.h b/sql/partition_info.h index ce2f2a7b358..10edea074c0 100644 --- a/sql/partition_info.h +++ b/sql/partition_info.h @@ -81,6 +81,13 @@ public: */ Field **full_part_field_array; Field **full_part_charset_field_array; + /* + Set of all fields used in partition and subpartition expression. + Required for testing of partition fields in write_set when + updating. We need to set all bits in read_set because the row may + need to be inserted in a different [sub]partition. + */ + MY_BITMAP full_part_field_set; /* When we have a field that requires transformation before calling the diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index ad3cf2d3e7a..a44af968d9f 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -523,6 +523,7 @@ static bool set_up_field_array(TABLE *table, SYNOPSIS create_full_part_field_array() + thd Thread handle table TABLE object for which partition fields are set-up part_info Reference to partitioning data structure @@ -537,11 +538,12 @@ static bool set_up_field_array(TABLE *table, This function is called from fix_partition_func */ -static bool create_full_part_field_array(TABLE *table, +static bool create_full_part_field_array(THD *thd, TABLE *table, partition_info *part_info) { bool result= FALSE; Field **ptr; + my_bitmap_map *bitmap_buf; DBUG_ENTER("create_full_part_field_array"); if (!part_info->is_sub_partitioned()) @@ -578,6 +580,35 @@ static bool create_full_part_field_array(TABLE *table, part_info->full_part_field_array= field_array; part_info->no_full_part_fields= no_part_fields; } + + /* + Initialize the set of all fields used in partition and subpartition + expression. Required for testing of partition fields in write_set + when updating. We need to set all bits in read_set because the row + may need to be inserted in a different [sub]partition. + */ + if (!(bitmap_buf= (my_bitmap_map*) + thd->alloc(bitmap_buffer_size(table->s->fields)))) + { + mem_alloc_error(bitmap_buffer_size(table->s->fields)); + result= TRUE; + goto end; + } + if (bitmap_init(&part_info->full_part_field_set, bitmap_buf, + table->s->fields, FALSE)) + { + mem_alloc_error(table->s->fields); + result= TRUE; + goto end; + } + /* + full_part_field_array may be NULL if storage engine supports native + partitioning. + */ + if ((ptr= part_info->full_part_field_array)) + while (*ptr) + bitmap_set_bit(&part_info->full_part_field_set, (*ptr++)->field_index); + end: DBUG_RETURN(result); } @@ -1636,7 +1667,7 @@ bool fix_partition_func(THD *thd, TABLE *table, my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0)); goto end; } - if (unlikely(create_full_part_field_array(table, part_info))) + if (unlikely(create_full_part_field_array(thd, table, part_info))) goto end; if (unlikely(check_primary_key(table))) goto end; From 7ebebf5e273056013a6c25ee474755000569f867 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jul 2007 22:39:55 +0200 Subject: [PATCH 086/227] ndb - bug#29354 - fix bug in bug fix, dont assert if 2 LCP's are being run during a node recovery --- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 7dac07c28e9..1539b726c6a 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -11165,7 +11165,7 @@ void Dblqh::sendLCP_COMPLETE_REP(Signal* signal, Uint32 lcpId) sendEMPTY_LCP_CONF(signal, true); } - if (getNodeState().getNodeRestartInProgress()) + if (getNodeState().getNodeRestartInProgress() && cstartRecReq != 3) { jam(); ndbrequire(cstartRecReq == 2); From a7489ed189cdb05cc3d021a20c18ba122d889d02 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jul 2007 23:41:15 +0200 Subject: [PATCH 087/227] Many tests have been moved to suite/*. Some tests have been removed. Update the disabled.def files to reflect actual contents of the t/* directories. Also, move a few more tests into suite/*. mysql-test/suite/parts/t/rpl_partition.test: Rename: mysql-test/t/rpl_partition.test -> mysql-test/suite/parts/t/rpl_partition.test mysql-test/suite/parts/r/rpl_partition.result: Rename: mysql-test/r/rpl_partition.result -> mysql-test/suite/parts/r/rpl_partition.result mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt: Rename: mysql-test/t/rpl_ndb_ctype_ucs2_def-master.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test: Rename: mysql-test/t/rpl_ndb_ctype_ucs2_def.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt: Rename: mysql-test/t/rpl_ndb_mix_innodb-master.opt -> mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test: Rename: mysql-test/t/rpl_ndb_mix_innodb.test -> mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result: Rename: mysql-test/r/rpl_ndb_ctype_ucs2_def.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result: Rename: mysql-test/r/rpl_ndb_mix_innodb.result -> mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result mysql-test/suite/ndb/t/disabled.def: Some tests have moved to suite/*, and some have been removed. Update disabled.def files to be consistent with actual t/* contents. mysql-test/suite/parts/t/disabled.def: Some tests have moved to suite/*, and some have been removed. Update disabled.def files to be consistent with actual t/* contents. mysql-test/suite/rpl/t/disabled.def: Some tests have moved to suite/*, and some have been removed. Update disabled.def files to be consistent with actual t/* contents. mysql-test/suite/rpl_ndb/t/disabled.def: Some tests have moved to suite/*, and some have been removed. Update disabled.def files to be consistent with actual t/* contents. mysql-test/t/disabled.def: Some tests have moved to suite/*, and some have been removed. Update disabled.def files to be consistent with actual t/* contents. --- mysql-test/suite/ndb/t/disabled.def | 1 + mysql-test/{ => suite/parts}/r/rpl_partition.result | 0 mysql-test/suite/parts/t/disabled.def | 1 - mysql-test/{ => suite/parts}/t/rpl_partition.test | 0 mysql-test/suite/rpl/t/disabled.def | 1 + .../{ => suite/rpl_ndb}/r/rpl_ndb_ctype_ucs2_def.result | 0 mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_mix_innodb.result | 0 mysql-test/suite/rpl_ndb/t/disabled.def | 3 ++- .../{ => suite/rpl_ndb}/t/rpl_ndb_ctype_ucs2_def-master.opt | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_ctype_ucs2_def.test | 0 .../{ => suite/rpl_ndb}/t/rpl_ndb_mix_innodb-master.opt | 0 mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_mix_innodb.test | 0 mysql-test/t/disabled.def | 6 ------ 13 files changed, 4 insertions(+), 8 deletions(-) rename mysql-test/{ => suite/parts}/r/rpl_partition.result (100%) rename mysql-test/{ => suite/parts}/t/rpl_partition.test (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_ctype_ucs2_def.result (100%) rename mysql-test/{ => suite/rpl_ndb}/r/rpl_ndb_mix_innodb.result (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_ctype_ucs2_def-master.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_ctype_ucs2_def.test (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_mix_innodb-master.opt (100%) rename mysql-test/{ => suite/rpl_ndb}/t/rpl_ndb_mix_innodb.test (100%) diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def index ec1dc26039f..96ef152f513 100644 --- a/mysql-test/suite/ndb/t/disabled.def +++ b/mysql-test/suite/ndb/t/disabled.def @@ -11,6 +11,7 @@ ############################################################################## ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog +ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table diff --git a/mysql-test/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result similarity index 100% rename from mysql-test/r/rpl_partition.result rename to mysql-test/suite/parts/r/rpl_partition.result diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def index 212ca0206e2..36bf08e9851 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -13,4 +13,3 @@ partition_alter2_ndb : cannot create t1 partition_char_innodb : crash. Bug? More investigations partition_sessions : needs system_3_init.inc partition_engine_ndb : cannot create t1 -partition_supported_sql_func_ndb : cannot create t1 diff --git a/mysql-test/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test similarity index 100% rename from mysql-test/t/rpl_partition.test rename to mysql-test/suite/parts/t/rpl_partition.test diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index fda40c30340..1c72d184739 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -14,3 +14,4 @@ rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after C rpl_innodb_mixed_ddl : Bug #29363 rpl.rpl_innodb_mixed_* test failures rpl_innodb_mixed_dml : Bug #29363 rpl.rpl_innodb_mixed_* test failures rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case +rpl_udf : Bug#28993 rpl_udf test causes server crash and valgrind warning in pushbuild diff --git a/mysql-test/r/rpl_ndb_ctype_ucs2_def.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result similarity index 100% rename from mysql-test/r/rpl_ndb_ctype_ucs2_def.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_ctype_ucs2_def.result diff --git a/mysql-test/r/rpl_ndb_mix_innodb.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result similarity index 100% rename from mysql-test/r/rpl_ndb_mix_innodb.result rename to mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index b238c8ac9c5..f5c99129c89 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -15,11 +15,12 @@ rpl_ndb_circular_simplex : BUG#27972 2007-04-20 mats Slave cannot start where it rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2myisam : BUG#19227 Seems to pass currently rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD -rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement #rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB +rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a +rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open diff --git a/mysql-test/t/rpl_ndb_ctype_ucs2_def-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt similarity index 100% rename from mysql-test/t/rpl_ndb_ctype_ucs2_def-master.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def-master.opt diff --git a/mysql-test/t/rpl_ndb_ctype_ucs2_def.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test similarity index 100% rename from mysql-test/t/rpl_ndb_ctype_ucs2_def.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test diff --git a/mysql-test/t/rpl_ndb_mix_innodb-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt similarity index 100% rename from mysql-test/t/rpl_ndb_mix_innodb-master.opt rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb-master.opt diff --git a/mysql-test/t/rpl_ndb_mix_innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test similarity index 100% rename from mysql-test/t/rpl_ndb_mix_innodb.test rename to mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index abc8e6bc0bd..88af556725e 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -23,10 +23,4 @@ concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Double Whopper -im_options_set : Bug#20294: Instance manager tests fail randomly -im_options_unset : Bug#20294: Instance manager tests fail randomly mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage -rpl_udf : Bug#28993 rpl_udf test causes server crash and valgrind warning in pushbuild -ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild -rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a -rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset From b1ec3b534d530807995955c1c249496b0912a906 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 02:20:32 +0400 Subject: [PATCH 088/227] A fix and a teset case for Bug#28551 The warning 'No database selected' is reported when calling stored procedures Remove the offending warning introduced by the fix for Bug 25082 This minimal patch relies on the intrinsic knowledge of the fact that mysql_change_db is never called with 'force_switch' set to TRUE when such a warning may be needed: * every stored routine belongs to a database (unlike, e.g., a user defined function, which does not), so if we're activating the database of a stored routine, it can never be NULL. Therefore, this branch is never called for activation. * if we're restoring the 'old' current database after routine execution is complete, we should not issue a warning, since it's OK to call a routine without having previously selected the current database. TODO: 'force_switch' is an ambiguous flag, since we do not actually have to 'force' the switch in case of stored routines at all. When we activate the routine's database, we should perform all the checks as in case of 'use db', and so we already do (in this case 'force_switch' is unused). When we load a routine into cache, we should not use mysql_change_db at all, since there it's enough to call thd->reset_db(). We do it this way for triggers, but code for routines is different (wrongly). TODO: bugs are lurking in replication, since it bypasses mysql_change_db and calls thd->[re_]set_db to set the current database. The latter does not change thd->db_charset, thd->sctx->db_access and thd->variables.collation_database (and this may have nasty side effects). These todo items are to be addressed in a separate patch, if at all. mysql-test/r/sp.result: Update results (Bug#28551) mysql-test/t/sp.test: Add a test case (Bug#28551) sql/sp.cc: Remove an obsolete comment. Replace a check with an assert. sql/sql_db.cc: Remove the offending warning introduced by the fix for Bug 25082 This minimal patch relies on the intrinsic knowledge of the fact that mysql_change_db is never called with 'force_switch' set to TRUE when such a warning may be needed. --- mysql-test/r/sp.result | 7 +++++++ mysql-test/t/sp.test | 12 ++++++++++++ sql/sp.cc | 12 ++++-------- sql/sql_db.cc | 8 ++++---- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index b411c65faee..5d7371b0991 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6176,4 +6176,11 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI DROP VIEW v1; DROP FUNCTION metered; DROP TABLE t1; +drop database if exists mysqltest_db1; +create database mysqltest_db1; +create procedure mysqltest_db1.sp_bug28551() begin end; +call mysqltest_db1.sp_bug28551(); +show warnings; +Level Code Message +drop database mysqltest_db1; End of 5.0 tests diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 0de416cdffa..cfc97fab777 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -7130,5 +7130,17 @@ DROP VIEW v1; DROP FUNCTION metered; DROP TABLE t1; +# +# Bug#28551 "The warning 'No database selected' is reported when calling +# stored procedures" +# +--disable_warnings +drop database if exists mysqltest_db1; +--enable_warnings +create database mysqltest_db1; +create procedure mysqltest_db1.sp_bug28551() begin end; +call mysqltest_db1.sp_bug28551(); +show warnings; +drop database mysqltest_db1; --echo End of 5.0 tests diff --git a/sql/sp.cc b/sql/sp.cc index d28e9138fa8..3c8ebed4ae6 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1873,15 +1873,11 @@ sp_use_new_db(THD *thd, LEX_STRING new_db, LEX_STRING *old_db, DBUG_PRINT("enter", ("newdb: %s", new_db.str)); /* - Set new_db to an empty string if it's NULL, because mysql_change_db - requires a non-NULL argument. - new_db.str can be NULL only if we're restoring the old database after - execution of a stored procedure and there were no current database - selected. The stored procedure itself must always have its database - initialized. + A stored routine always belongs to some database. The + old database (old_db) might be NULL, but to restore the + old database we will use mysql_change_db. */ - if (new_db.str == NULL) - new_db.str= empty_c_string; + DBUG_ASSERT(new_db.str && new_db.length); if (thd->db) { diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 963457cc896..91b0c02d23b 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1240,10 +1240,10 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) { if (force_switch) { - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR)); - - /* Change db to NULL. */ + /* + This can only happen when we restore the old db in THD after + execution of a routine is complete. Change db to NULL. + */ mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server); From bd8b9746bfbb620b0f37d030169e2ae459aec4de Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 01:05:47 +0200 Subject: [PATCH 089/227] WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine Add more accessors to MySQL internals in mysql/plugin.h, for storage engine plugins. Add some accessors specific to the InnoDB storage engine, to allow InnoDB to be compiled as a plugin (without MYSQL_SERVER). InnoDB has additional requirements, due to its foreign key support, etc. include/m_string.h: Add structure tag to LEX_STRING definition, so that it can be referred to by forward declarations. Allow struct st_mysql_lex_string to be defined here, or in mysql/plugin.h. include/my_global.h: Define INNODB_COMPATIBILITY_HOOKS unconditionally; it brackets some definitions needed for the InnoDB storage engine plugin which do not belong in our general plugin interface. include/mysql/plugin.h: Additional accessors for MySQL internals: - Full definition of MYSQL_LEX_STRING (identical to LEX_STRING from m_string.h) - Full definition of MYSQL_XID (binary compatible with XID from handler.h) - mysql_tmpfile(), creates a temporary file in mysqld's tmpdir - thd_killed(), to check killed state of connection - thd_alloc() and similar allocation functions - thd_get_xid(), to get XID of connection's transaction - mysql_query_cache_invalidate4, to invalidate a table's query cache entries sql/handler.h: Use MYSQL_XIDDATASIZE definition from mysql/plugin.h, to avoid redundant definitions sql/log.cc: Add definitions for two InnoDB compatibility hooks: - mysql_bin_log_file(), to get log filename - mysql_bin_log_file_pos, to get position in file These are defined only if INNODB_COMPATIBILITY_HOOKS is defined; they are needed by the InnoDB plugin, but aren't part of the general plugin interface. They are declared in ha_innodb.h for InnoDB's use. sql/mysql_priv.h: Expose some server internals when INNODB_COMPATIBILITY_HOOKS is defined, so that InnoDB can be built as a plugin when MYSQL_SERVER is not defined. Move make_lex_string inside THD class. sql/sql_cache.cc: Add definiton of mysql_query_cache_invalidate4(), a part of the plugin API (mysql/plugin.h). sql/sql_class.cc: Add definitions for several accessor functions which form part of the plugin API (mysql/plugin.h): - mysql_tmpfile() - thd_alloc() and friends - thd_make_lex_string() - thd_get_xid() Add definitons for accessor functions which InnoDB requires, but which are not part of the plugin interface: - thd_charset() - thd_query() - thd_slave_thread() - thd_non_transactional_update() - thd_binlog_format() Move definition of make_lex_string() from sql_show.cc into THD class sql/sql_class.h: Remove LEX_STRING_make(), and move make_lex_string() from sql_show.cc inside THD class. sql/sql_parse.cc: Use thd->make_lex_string() instead of thd->LEX_STRING_make() sql/sql_show.cc: Move make_lex_string() inside THD class storage/innobase/handler/ha_innodb.cc: Call thd_make_lex_string() instead of make_lex_string(). --- include/m_string.h | 12 +-- include/my_global.h | 11 +++ include/mysql/plugin.h | 123 +++++++++++++++++++++++++ sql/handler.h | 10 +- sql/log.cc | 23 +++++ sql/mysql_priv.h | 54 +++++++++-- sql/sql_cache.cc | 12 +++ sql/sql_class.cc | 128 ++++++++++++++++++++++++++ sql/sql_class.h | 11 +-- sql/sql_parse.cc | 6 +- sql/sql_show.cc | 22 +---- storage/innobase/handler/ha_innodb.cc | 35 +++---- 12 files changed, 387 insertions(+), 60 deletions(-) diff --git a/include/m_string.h b/include/m_string.h index 715720df294..00fb4cb0656 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -246,17 +246,17 @@ extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...) /* LEX_STRING -- a pair of a C-string and its length. - - NOTE: this exactly form of declaration is required for some C-compilers - (for one, Sun C 5.7 2005/01/07). Unfortunately with such declaration - LEX_STRING can not be forward declared. */ -typedef struct +#ifndef _my_plugin_h +/* This definition must match the one given in mysql/plugin.h */ +struct st_mysql_lex_string { char *str; size_t length; -} LEX_STRING; +}; +#endif +typedef struct st_mysql_lex_string LEX_STRING; #define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1)) #define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1)) diff --git a/include/my_global.h b/include/my_global.h index 30fa2aba41b..91860f6e7a9 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -23,6 +23,17 @@ #define HAVE_EXTERNAL_CLIENT #endif +/* + InnoDB depends on some MySQL internals which other plugins should not + need. This is because of InnoDB's foreign key support, "safe" binlog + truncation, and other similar legacy features. + + We define accessors for these internals unconditionally, but do not + expose them in mysql/plugin.h. They are declared in ha_innodb.h for + InnoDB's use. +*/ +#define INNODB_COMPATIBILITY_HOOKS + #ifdef __CYGWIN__ /* We use a Unix API, so pretend it's not Windows */ #undef WIN diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h index dd540225deb..b87fcc60692 100644 --- a/include/mysql/plugin.h +++ b/include/mysql/plugin.h @@ -24,6 +24,32 @@ class Item; #define MYSQL_THD void* #endif +#ifndef _m_string_h +/* This definition must match the one given in m_string.h */ +struct st_mysql_lex_string +{ + char *str; + unsigned int length; +}; +#endif /* _m_string_h */ +typedef struct st_mysql_lex_string MYSQL_LEX_STRING; + +#define MYSQL_XIDDATASIZE 128 +/** + struct st_mysql_xid is binary compatible with the XID structure as + in the X/Open CAE Specification, Distributed Transaction Processing: + The XA Specification, X/Open Company Ltd., 1991. + http://www.opengroup.org/bookstore/catalog/c193.htm + + @see XID in sql/handler.h +*/ +struct st_mysql_xid { + long formatID; + long gtrid_length; + long bqual_length; + char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */ +}; +typedef struct st_mysql_xid MYSQL_XID; /************************************************************************* Plugin API. Common for all plugin types. @@ -658,6 +684,103 @@ char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, /* Increments the row counter, see THD::row_count */ void thd_inc_row_count(MYSQL_THD thd); +/** + Create a temporary file. + + @details + The temporary file is created in a location specified by the mysql + server configuration (--tmpdir option). The caller does not need to + delete the file, it will be deleted automatically. + + @param prefix prefix for temporary file name + @retval -1 error + @retval >= 0 a file handle that can be passed to dup or my_close +*/ +int mysql_tmpfile(const char *prefix); + +/** + Check the killed state of a connection + + @details + In MySQL support for the KILL statement is cooperative. The KILL + statement only sets a "killed" flag. This function returns the value + of that flag. A thread should check it often, especially inside + time-consuming loops, and gracefully abort the operation if it is + non-zero. + + @param thd user thread connection handle + @retval 0 the connection is active + @retval 1 the connection has been killed +*/ +int thd_killed(const MYSQL_THD thd); + +/** + Allocate memory in the connection's local memory pool + + @details + When properly used in place of @c my_malloc(), this can significantly + improve concurrency. Don't use this or related functions to allocate + large chunks of memory. Use for temporary storage only. The memory + will be freed automatically at the end of the statement; no explicit + code is required to prevent memory leaks. + + @see alloc_root() +*/ +void *thd_alloc(MYSQL_THD thd, unsigned int size); +/** + @see thd_alloc() +*/ +void *thd_calloc(MYSQL_THD thd, unsigned int size); +/** + @see thd_alloc() +*/ +char *thd_strdup(MYSQL_THD thd, const char *str); +/** + @see thd_alloc() +*/ +char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size); +/** + @see thd_alloc() +*/ +void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size); + +/** + Create a LEX_STRING in this connection's local memory pool + + @param thd user thread connection handle + @param lex_str pointer to LEX_STRING object to be initialized + @param str initializer to be copied into lex_str + @param length length of str, in bytes + @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object, + instead of using lex_str value + @return NULL on failure, or pointer to the LEX_STRING object + + @see thd_alloc() +*/ +MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); + +/** + Get the XID for this connection's transaction + + @param thd user thread connection handle + @param xid location where identifier is stored +*/ +void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid); + +/** + Invalidate the query cache for a given table. + + @param thd user thread connection handle + @param key databasename\0tablename\0 + @param key_length length of key in bytes, including the NUL bytes + @param using_trx flag: TRUE if using transactions, FALSE otherwise +*/ +void mysql_query_cache_invalidate4(MYSQL_THD thd, + const char *key, unsigned int key_length, + int using_trx); + #ifdef __cplusplus } #endif diff --git a/sql/handler.h b/sql/handler.h index 4095a2f4cb1..09de9a3873a 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -328,13 +328,21 @@ typedef ulonglong my_xid; // this line is the same as in log_event.h #define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN+sizeof(server_id)) #define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid)) -#define XIDDATASIZE 128 +#define XIDDATASIZE MYSQL_XIDDATASIZE #define MAXGTRIDSIZE 64 #define MAXBQUALSIZE 64 #define COMPATIBLE_DATA_YES 0 #define COMPATIBLE_DATA_NO 1 +/** + struct xid_t is binary compatible with the XID structure as + in the X/Open CAE Specification, Distributed Transaction Processing: + The XA Specification, X/Open Company Ltd., 1991. + http://www.opengroup.org/bookstore/catalog/c193.htm + + @see MYSQL_XID in mysql/plugin.h +*/ struct xid_t { long formatID; long gtrid_length; diff --git a/sql/log.cc b/sql/log.cc index 2821fb399a4..8ad290fdefc 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -5245,6 +5245,29 @@ err1: return 1; } + +#ifdef INNODB_COMPATIBILITY_HOOKS +/** + Get the file name of the MySQL binlog. + @return the name of the binlog file +*/ +extern "C" +const char* mysql_bin_log_file_name(void) +{ + return mysql_bin_log.get_log_fname(); +} +/** + Get the current position of the MySQL binlog. + @return byte offset from the beginning of the binlog +*/ +extern "C" +ulonglong mysql_bin_log_file_pos(void) +{ + return (ulonglong) mysql_bin_log.get_log_file()->pos_in_file; +} +#endif /* INNODB_COMPATIBILITY_HOOKS */ + + struct st_mysql_storage_engine binlog_storage_engine= { MYSQL_HANDLERTON_INTERFACE_VERSION }; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 98c06148313..d18dc9b90e9 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1182,7 +1182,11 @@ bool mysqld_show_open_tables(THD *thd,const char *wild); bool mysqld_show_logs(THD *thd); void append_identifier(THD *thd, String *packet, const char *name, uint length); +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS int get_quote_char_for_identifier(THD *thd, const char *name, uint length); +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild); int mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd); bool mysqld_show_create(THD *thd, TABLE_LIST *table_list); @@ -1211,9 +1215,6 @@ void reset_status_vars(); /* information schema */ extern LEX_STRING INFORMATION_SCHEMA_NAME; extern const LEX_STRING partition_keywords[]; -LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str, - const char* str, uint length, - bool allocate_lex_string); ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name); ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx); int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, @@ -1691,9 +1692,14 @@ extern int creating_table; // How many mysql_create_table() are running */ extern time_t server_start_time; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS extern uint mysql_data_home_len; extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH], - mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[], + mysql_real_data_home[]; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER +extern char *opt_mysql_tmpdir, mysql_charsets_dir[], def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; #define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list)) extern MY_TMPDIR mysql_tmpdir_list; @@ -1710,8 +1716,13 @@ extern Gt_creator gt_creator; extern Lt_creator lt_creator; extern Ge_creator ge_creator; extern Le_creator le_creator; -extern char language[FN_REFLEN], reg_ext[FN_EXTLEN]; +extern char language[FN_REFLEN]; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS +extern char reg_ext[FN_EXTLEN]; extern uint reg_ext_length; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN]; extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file; extern char log_error_file[FN_REFLEN], *opt_tc_log_file; @@ -1740,17 +1751,32 @@ extern ulong max_binlog_size, max_relay_log_size; extern ulong opt_binlog_rows_event_max_size; extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size; extern ulong back_log; -extern ulong specialflag, current_pid; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS +extern ulong specialflag; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER +extern ulong current_pid; extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter; extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size; extern ulong tc_log_page_waits; extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb; extern uint test_flags,select_errors,ha_open_options; extern uint protocol_version, mysqld_port, dropping_tables; -extern uint delay_key_write_options, lower_case_table_names; +extern uint delay_key_write_options; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS +extern uint lower_case_table_names; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern bool opt_endinfo, using_udf_functions; extern my_bool locked_in_memory; -extern bool opt_using_transactions, mysqld_embedded; +extern bool opt_using_transactions; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS +extern bool mysqld_embedded; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern bool using_update_log, opt_large_files, server_id_supplied; extern bool opt_update_log, opt_bin_log, opt_error_log; extern my_bool opt_log, opt_slow_log; @@ -1774,8 +1800,12 @@ extern uint opt_crash_binlog_innodb; extern char *shared_memory_base_name, *mysqld_unix_port; extern my_bool opt_enable_shared_memory; extern char *default_tz_name; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS extern my_bool opt_large_pages; extern uint opt_large_page_size; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern char *opt_logname, *opt_slow_logname; extern const char *log_output_str; @@ -1811,7 +1841,11 @@ extern MY_BITMAP temp_pool; extern String my_empty_string; extern const String my_null_string; extern SHOW_VAR status_vars[]; +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS extern struct system_variables global_system_variables; +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER extern struct system_variables max_system_variables; extern struct system_status_var global_status_var; extern struct rand_struct sql_rand; @@ -2009,10 +2043,14 @@ int wild_case_compare(CHARSET_INFO *cs, const char *str,const char *wildstr); char *fn_rext(char *name); /* Conversion functions */ +#endif /* MYSQL_SERVER */ +#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS uint strconvert(CHARSET_INFO *from_cs, const char *from, CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors); uint filename_to_tablename(const char *from, char *to, uint to_length); uint tablename_to_filename(const char *from, char *to, uint to_length); +#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */ +#ifdef MYSQL_SERVER uint build_table_filename(char *buff, size_t bufflen, const char *db, const char *table, const char *ext, uint flags); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 719c67aff6a..173ef4c02df 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -765,6 +765,18 @@ void query_cache_invalidate_by_MyISAM_filename(const char *filename) } +/* + The following function forms part of the C plugin API +*/ +extern "C" +void mysql_query_cache_invalidate4(THD *thd, + const char *key, unsigned key_length, + int using_trx) +{ + query_cache.invalidate(thd, key, (uint32) key_length, (my_bool) using_trx); +} + + /***************************************************************************** Query_cache methods *****************************************************************************/ diff --git a/sql/sql_class.cc b/sql/sql_class.cc index e279e23ab69..337bd4e6cc1 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -207,6 +207,31 @@ Open_tables_state::Open_tables_state(ulong version_arg) The following functions form part of the C plugin API */ +extern "C" int mysql_tmpfile(const char *prefix) +{ + char filename[FN_REFLEN]; + File fd = create_temp_file(filename, mysql_tmpdir, prefix, +#ifdef __WIN__ + O_BINARY | O_TRUNC | O_SEQUENTIAL | + O_SHORT_LIVED | +#endif /* __WIN__ */ + O_CREAT | O_EXCL | O_RDWR | O_TEMPORARY, + MYF(MY_WME)); + if (fd >= 0) { +#ifndef __WIN__ + /* + This can be removed once the following bug is fixed: + Bug #28903 create_temp_file() doesn't honor O_TEMPORARY option + (file not removed) (Unix) + */ + unlink(filename); +#endif /* !__WIN__ */ + } + + return fd; +} + + extern "C" int thd_in_lock_tables(const THD *thd) { @@ -488,6 +513,49 @@ void THD::pop_internal_handler() m_internal_handler= NULL; } +extern "C" +void *thd_alloc(MYSQL_THD thd, unsigned int size) +{ + return thd->alloc(size); +} + +extern "C" +void *thd_calloc(MYSQL_THD thd, unsigned int size) +{ + return thd->calloc(size); +} + +extern "C" +char *thd_strdup(MYSQL_THD thd, const char *str) +{ + return thd->strdup(str); +} + +extern "C" +char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size) +{ + return thd->strmake(str, size); +} + +extern "C" +LEX_STRING *thd_make_lex_string(THD *thd, LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string) +{ + return thd->make_lex_string(lex_str, str, size, + (bool) allocate_lex_string); +} + +extern "C" +void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size) +{ + return thd->memdup(str, size); +} + +void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid) +{ + *xid = *(MYSQL_XID *) &thd->transaction.xid_state.xid; +} /* Init common variables that has to be reset on start and on change_user @@ -856,6 +924,30 @@ void THD::cleanup_after_query() } +/** + Create a LEX_STRING in this connection + + @param lex_str pointer to LEX_STRING object to be initialized + @param str initializer to be copied into lex_str + @param length length of str, in bytes + @param allocate_lex_string if TRUE, allocate new LEX_STRING object, + instead of using lex_str value + @return NULL on failure, or pointer to the LEX_STRING object +*/ +LEX_STRING *THD::make_lex_string(LEX_STRING *lex_str, + const char* str, uint length, + bool allocate_lex_string) +{ + if (allocate_lex_string) + if (!(lex_str= (LEX_STRING *)alloc(sizeof(LEX_STRING)))) + return 0; + if (!(lex_str->str= strmake_root(mem_root, str, length))) + return 0; + lex_str->length= length; + return lex_str; +} + + /* Convert a string to another character set @@ -2441,7 +2533,43 @@ void THD::restore_backup_open_tables_state(Open_tables_state *backup) DBUG_VOID_RETURN; } +/** + Check the killed state of a user thread + @param thd user thread + @retval 0 the user thread is active + @retval 1 the user thread has been killed +*/ +extern "C" int thd_killed(const MYSQL_THD thd) +{ + return(thd->killed); +} +#ifdef INNODB_COMPATIBILITY_HOOKS +extern "C" struct charset_info_st *thd_charset(MYSQL_THD thd) +{ + return(thd->charset()); +} + +extern "C" char **thd_query(MYSQL_THD thd) +{ + return(&thd->query); +} + +extern "C" int thd_slave_thread(const MYSQL_THD thd) +{ + return(thd->slave_thread); +} + +extern "C" int thd_non_transactional_update(const MYSQL_THD thd) +{ + return(thd->no_trans_update.all); +} + +extern "C" int thd_binlog_format(const THD *thd) +{ + return (int) thd->variables.binlog_format; +} +#endif // INNODB_COMPATIBILITY_HOOKS */ /**************************************************************************** Handling of statement states in functions and triggers. diff --git a/sql/sql_class.h b/sql/sql_class.h index 6fa71b57997..a35cdbbec2a 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -490,13 +490,6 @@ public: { return strdup_root(mem_root,str); } inline char *strmake(const char *str, size_t size) { return strmake_root(mem_root,str,size); } - inline bool LEX_STRING_make(LEX_STRING *lex_str, const char *str, - size_t size) - { - return ((lex_str->str= - strmake_root(mem_root, str, (lex_str->length= size)))) == 0; - } - inline void *memdup(const void *str, size_t size) { return memdup_root(mem_root,str,size); } inline void *memdup_w_gap(const void *str, size_t size, uint gap) @@ -1594,6 +1587,10 @@ public: return alloc_root(&transaction.mem_root,size); } + LEX_STRING *make_lex_string(LEX_STRING *lex_str, + const char* str, uint length, + bool allocate_lex_string); + bool convert_string(LEX_STRING *to, CHARSET_INFO *to_cs, const char *from, uint from_length, CHARSET_INFO *from_cs); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index bd151dc2028..aa661b64598 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1025,8 +1025,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, HA_CREATE_INFO create_info; status_var_increment(thd->status_var.com_stat[SQLCOM_CREATE_DB]); - if (thd->LEX_STRING_make(&db, packet, packet_length -1) || - thd->LEX_STRING_make(&alias, db.str, db.length) || + if (thd->make_lex_string(&db, packet, packet_length - 1, FALSE) || + thd->make_lex_string(&alias, db.str, db.length, FALSE) || check_db_name(&db)) { my_error(ER_WRONG_DB_NAME, MYF(0), db.str ? db.str : "NULL"); @@ -1046,7 +1046,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, status_var_increment(thd->status_var.com_stat[SQLCOM_DROP_DB]); LEX_STRING db; - if (thd->LEX_STRING_make(&db, packet, packet_length - 1) || + if (thd->make_lex_string(&db, packet, packet_length - 1, FALSE) || check_db_name(&db)) { my_error(ER_WRONG_DB_NAME, MYF(0), db.str ? db.str : "NULL"); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index f66897df671..e74f09362e3 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2175,20 +2175,6 @@ void calc_sum_of_all_status(STATUS_VAR *to) } -LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str, - const char* str, uint length, - bool allocate_lex_string) -{ - MEM_ROOT *mem= thd->mem_root; - if (allocate_lex_string) - if (!(lex_str= (LEX_STRING *)thd->alloc(sizeof(LEX_STRING)))) - return 0; - lex_str->str= strmake_root(mem, str, length); - lex_str->length= length; - return lex_str; -} - - /* INFORMATION_SCHEMA name */ LEX_STRING INFORMATION_SCHEMA_NAME= { C_STRING_WITH_LEN("information_schema")}; @@ -5194,10 +5180,10 @@ int make_schema_select(THD *thd, SELECT_LEX *sel, We have to make non const db_name & table_name because of lower_case_table_names */ - make_lex_string(thd, &db, INFORMATION_SCHEMA_NAME.str, - INFORMATION_SCHEMA_NAME.length, 0); - make_lex_string(thd, &table, schema_table->table_name, - strlen(schema_table->table_name), 0); + thd->make_lex_string(&db, INFORMATION_SCHEMA_NAME.str, + INFORMATION_SCHEMA_NAME.length, 0); + thd->make_lex_string(&table, schema_table->table_name, + strlen(schema_table->table_name), 0); if (schema_table->old_format(thd, schema_table) || /* Handle old syntax */ !sel->add_table_to_list(thd, new Table_ident(thd, db, table, 0), 0, 0, TL_READ)) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 65c3086a086..e433298c96c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5909,8 +5909,8 @@ ha_innobase::get_foreign_key_list(THD *thd, List *f_key_list) while (tmp_buff[i] != '/') i++; tmp_buff+= i + 1; - f_key_info.forein_id= make_lex_string(thd, 0, tmp_buff, - (uint) strlen(tmp_buff), 1); + f_key_info.forein_id = thd_make_lex_string(thd, 0, + tmp_buff, (uint) strlen(tmp_buff), 1); tmp_buff= foreign->referenced_table_name; /* Database name */ @@ -5922,22 +5922,23 @@ ha_innobase::get_foreign_key_list(THD *thd, List *f_key_list) } db_name[i]= 0; ulen= filename_to_tablename(db_name, uname, sizeof(uname)); - f_key_info.referenced_db= make_lex_string(thd, 0, uname, ulen, 1); + f_key_info.referenced_db = thd_make_lex_string(thd, 0, + uname, ulen, 1); /* Table name */ tmp_buff+= i + 1; ulen= filename_to_tablename(tmp_buff, uname, sizeof(uname)); - f_key_info.referenced_table= make_lex_string(thd, 0, uname, - ulen, 1); + f_key_info.referenced_table = thd_make_lex_string(thd, 0, + uname, ulen, 1); for (i= 0;;) { tmp_buff= foreign->foreign_col_names[i]; - name= make_lex_string(thd, name, tmp_buff, - (uint) strlen(tmp_buff), 1); + name = thd_make_lex_string(thd, name, + tmp_buff, (uint) strlen(tmp_buff), 1); f_key_info.foreign_fields.push_back(name); tmp_buff= foreign->referenced_col_names[i]; - name= make_lex_string(thd, name, tmp_buff, - (uint) strlen(tmp_buff), 1); + name = thd_make_lex_string(thd, name, + tmp_buff, (uint) strlen(tmp_buff), 1); f_key_info.referenced_fields.push_back(name); if (++i >= foreign->n_fields) break; @@ -5964,8 +5965,8 @@ ha_innobase::get_foreign_key_list(THD *thd, List *f_key_list) length=8; tmp_buff= "RESTRICT"; } - f_key_info.delete_method= make_lex_string(thd, f_key_info.delete_method, - tmp_buff, length, 1); + f_key_info.delete_method = thd_make_lex_string( + thd, f_key_info.delete_method, tmp_buff, length, 1); if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE) @@ -5988,15 +5989,15 @@ ha_innobase::get_foreign_key_list(THD *thd, List *f_key_list) length=8; tmp_buff= "RESTRICT"; } - f_key_info.update_method= make_lex_string(thd, f_key_info.update_method, - tmp_buff, length, 1); + f_key_info.update_method = thd_make_lex_string( + thd, f_key_info.update_method, tmp_buff, length, 1); if (foreign->referenced_index && foreign->referenced_index->name) { - f_key_info.referenced_key_name= - make_lex_string(thd, f_key_info.referenced_key_name, - foreign->referenced_index->name, - strlen(foreign->referenced_index->name), 1); + f_key_info.referenced_key_name = thd_make_lex_string( + thd, f_key_info.referenced_key_name, + foreign->referenced_index->name, + strlen(foreign->referenced_index->name), 1); } FOREIGN_KEY_INFO *pf_key_info= ((FOREIGN_KEY_INFO *) From 5d88b654ede319aa3534833500f0963eba6f9f1a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jul 2007 21:12:07 -0700 Subject: [PATCH 090/227] Fixed bug #29392. This bug may manifest itself for select queries over a multi-table view that includes an ORDER BY clause in its definition. If the select list of the query contains references to the same view column with different aliases the names of the columns in the result output will be nevertheless the same, coinciding with one of the alias. The bug happened because the method Item_ref::get_tmp_table_item that was inherited by the class Item_direct_view_ref ignored the fact that the name of the view column reference must be inherited by the fields of the temporary table that was created in order to get the result rows sorted. mysql-test/r/view.result: Added a test case for bug #29392. mysql-test/t/view.test: Added a test case for bug #29392. sql/item.h: Fixed bug #29392. This bug may manifest itself for select queries over a multi-table view that includes an ORDER BY clause in its definition. If the select list of the query contains references to the same view column with different aliases the names of the columns in the result output will be nevertheless the same, coinciding with one of the alias. The bug happened because the method Item_ref::get_tmp_table_item that was inherited by the class Item_direct_view_ref ignored the fact that the name of the view column reference must be inherited by the fields of the temporary table that was created in order to get the result rows sorted. Fixed by providing a proper implementation of the get_tmp_table_item method for the Item_direct_view_ref class. --- mysql-test/r/view.result | 47 ++++++++++++++++++++++++++++++++++ mysql-test/t/view.test | 55 ++++++++++++++++++++++++++++++++++++++++ sql/item.h | 6 +++++ 3 files changed, 108 insertions(+) diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 9adb3f96142..c51a4c30960 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -3500,4 +3500,51 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where DROP VIEW v1; DROP TABLE t1; +CREATE TABLE t1 ( +person_id int NOT NULL PRIMARY KEY, +username varchar(40) default NULL, +status_flg char(1) NOT NULL default 'A' +); +CREATE TABLE t2 ( +person_role_id int NOT NULL auto_increment PRIMARY KEY, +role_id int NOT NULL, +person_id int NOT NULL, +INDEX idx_person_id (person_id), +INDEX idx_role_id (role_id) +); +CREATE TABLE t3 ( +role_id int NOT NULL auto_increment PRIMARY KEY, +role_name varchar(100) default NULL, +app_name varchar(40) NOT NULL, +INDEX idx_app_name(app_name) +); +CREATE VIEW v1 AS +SELECT profile.person_id AS person_id +FROM t1 profile, t2 userrole, t3 role +WHERE userrole.person_id = profile.person_id AND +role.role_id = userrole.role_id AND +profile.status_flg = 'A' + ORDER BY profile.person_id,role.app_name,role.role_name; +INSERT INTO t1 VALUES +(6,'Sw','A'), (-1136332546,'ols','e'), (0,' *\n','0'), +(-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0'); +INSERT INTO t2 VALUES +(1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10); +INSERT INTO t3 VALUES +(1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'), +(3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'), +(5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'), +(7,'SOC_USER','SOCCANS'),(8,'CAYIT_USER','CAYITCANS'), +(9,'RTOS_DCFSPOS_SUPERVISOR','RTOS'); +EXPLAIN SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE profile const PRIMARY PRIMARY 4 const 1 Using temporary; Using filesort +1 SIMPLE userrole ref idx_person_id,idx_role_id idx_person_id 4 const 2 +1 SIMPLE role eq_ref PRIMARY PRIMARY 4 test.userrole.role_id 1 +SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6; +a b +6 6 +6 6 +DROP VIEW v1; +DROP TABLE t1,t2,t3; End of 5.0 tests. diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index f670ac8a49d..c7f722a18a5 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -3348,4 +3348,59 @@ EXPLAIN SELECT a, SUM(b) FROM v1 WHERE a=1 GROUP BY a; DROP VIEW v1; DROP TABLE t1; +# +# Bug #29392: SELECT over a multi-table view with ORDER BY +# selecting the same view column with two different aliases +# + +CREATE TABLE t1 ( + person_id int NOT NULL PRIMARY KEY, + username varchar(40) default NULL, + status_flg char(1) NOT NULL default 'A' +); + +CREATE TABLE t2 ( + person_role_id int NOT NULL auto_increment PRIMARY KEY, + role_id int NOT NULL, + person_id int NOT NULL, + INDEX idx_person_id (person_id), + INDEX idx_role_id (role_id) +); + +CREATE TABLE t3 ( + role_id int NOT NULL auto_increment PRIMARY KEY, + role_name varchar(100) default NULL, + app_name varchar(40) NOT NULL, + INDEX idx_app_name(app_name) +); + +CREATE VIEW v1 AS +SELECT profile.person_id AS person_id + FROM t1 profile, t2 userrole, t3 role + WHERE userrole.person_id = profile.person_id AND + role.role_id = userrole.role_id AND + profile.status_flg = 'A' + ORDER BY profile.person_id,role.app_name,role.role_name; + +INSERT INTO t1 VALUES + (6,'Sw','A'), (-1136332546,'ols','e'), (0,' *\n','0'), + (-717462680,'ENTS Ta','0'), (-904346964,'ndard SQL\n','0'); + +INSERT INTO t2 VALUES + (1,3,6),(2,4,7),(3,5,8),(4,6,9),(5,1,6),(6,1,7),(7,1,8),(8,1,9),(9,1,10); + +INSERT INTO t3 VALUES + (1,'NUCANS_APP_USER','NUCANSAPP'),(2,'NUCANS_TRGAPP_USER','NUCANSAPP'), + (3,'IA_INTAKE_COORDINATOR','IACANS'),(4,'IA_SCREENER','IACANS'), + (5,'IA_SUPERVISOR','IACANS'),(6,'IA_READONLY','IACANS'), + (7,'SOC_USER','SOCCANS'),(8,'CAYIT_USER','CAYITCANS'), + (9,'RTOS_DCFSPOS_SUPERVISOR','RTOS'); + +EXPLAIN SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6; +SELECT t.person_id AS a, t.person_id AS b FROM v1 t WHERE t.person_id=6; + +DROP VIEW v1; +DROP TABLE t1,t2,t3; + --echo End of 5.0 tests. + diff --git a/sql/item.h b/sql/item.h index 3478095351a..a880f86f601 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1983,6 +1983,12 @@ public: bool fix_fields(THD *, Item **); bool eq(const Item *item, bool binary_cmp) const; + Item *get_tmp_table_item(THD *thd) + { + Item *item= Item_ref::get_tmp_table_item(thd); + item->name= name; + return item; + } virtual Ref_Type ref_type() { return VIEW_REF; } }; From b7bf9725852640bf843a5bd5fc83d6a0556406de Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 11:45:14 +0500 Subject: [PATCH 091/227] BUG#27564 - Valgrind: UDF does not cleanup correctly Dropping an user defined function may cause server crash in case this function is still in use by another thread. The problem was that our hash implementation didn't update hash link list properly when hash_update() was called. mysys/hash.c: The following requirement wasn't met by hash_update() function causing corruption of hash links list: After a record was unlinked from the old chain during update, it holds random position. By the chance this position is equal to position for the first element in the new chain. That means updated record is the only record in the new chain. --- mysys/hash.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mysys/hash.c b/mysys/hash.c index 75135a470c9..1ba80dc6fd3 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -572,6 +572,25 @@ my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length) previous->next=pos->next; /* unlink pos */ /* Move data to correct position */ + if (new_index == empty) + { + /* + At this point record is unlinked from the old chain, thus it holds + random position. By the chance this position is equal to position + for the first element in the new chain. That means updated record + is the only record in the new chain. + */ + if (empty != idx) + { + /* + Record was moved while unlinking it from the old chain. + Copy data to a new position. + */ + data[empty]= org_link; + } + data[empty].next= NO_RECORD; + DBUG_RETURN(0); + } pos=data+new_index; new_pos_index=hash_rec_mask(hash,pos,blength,records); if (new_index != new_pos_index) From 558aeb0f0bfd83726ffe84f5739c0317df48980c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 11:55:06 +0500 Subject: [PATCH 092/227] Fix for bug #29411: deleting from a csv table leads to the table corruption Problem: we don't adjust share->rows_recorded and local_saved_data_file_length deleting rows from a CSV table, so following table check may fail. Fix: properly adjust those values. mysql-test/r/csv.result: Fix for bug #29411: deleting from a csv table leads to the table corruption - test result. mysql-test/t/csv.test: Fix for bug #29411: deleting from a csv table leads to the table corruption - test case. storage/csv/ha_tina.cc: Fix for bug #29411: deleting from a csv table leads to the table corruption - decrement share->rows_recorded in the ha_tina::delete_row(). - set share->rows_recorded and local_saved_data_file_length to 0 in the ha_tina::delete_all_rows(). - adjust local_saved_data_file_length after cleaning up in the ha_tina::rnd_end(). --- mysql-test/r/csv.result | 18 ++++++++++++++++-- mysql-test/t/csv.test | 13 +++++++++++++ storage/csv/ha_tina.cc | 30 +++++++++++++++++++++++------- 3 files changed, 52 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index 5076220f74b..6335d890a95 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -4945,8 +4945,6 @@ SELECT * FROM bug13894; val 6 6 -5 -11 DROP TABLE bug13894; DROP TABLE IF EXISTS bug14672; CREATE TABLE bug14672 (c1 integer) engine = CSV; @@ -5291,4 +5289,20 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +create table t1(a int) engine=csv; +insert into t1 values (0), (1), (2); +delete from t1 limit 2; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +a +2 +delete from t1; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +a +drop table t1; End of 5.1 tests diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 6d24b38ee10..26051da24aa 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1698,4 +1698,17 @@ select * from t1; check table t1; drop table t1; +# +# Bug #29411: deleting from a csv table leads to the table corruption +# +create table t1(a int) engine=csv; +insert into t1 values (0), (1), (2); +delete from t1 limit 2; +check table t1; +select * from t1; +delete from t1; +check table t1; +select * from t1; +drop table t1; + --echo End of 5.1 tests diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 2ee96fd5d05..c6cbcbd422f 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -960,6 +960,11 @@ int ha_tina::delete_row(const uchar * buf) DBUG_RETURN(-1); stats.records--; + /* Update shared info */ + DBUG_ASSERT(share->rows_recorded); + pthread_mutex_lock(&share->mutex); + share->rows_recorded--; + pthread_mutex_unlock(&share->mutex); /* DELETE should never happen on the log table */ DBUG_ASSERT(!share->is_log_table); @@ -1146,6 +1151,7 @@ int ha_tina::rnd_end() if ((chain_ptr - chain) > 0) { + off_t temp_file_length= 0; tina_set *ptr= chain; /* @@ -1171,15 +1177,18 @@ int ha_tina::rnd_end() while ((file_buffer_start != -1)) // while not end of file { bool in_hole= get_write_pos(&write_end, ptr); + off_t write_length= write_end - write_begin; /* if there is something to write, write it */ - if ((write_end - write_begin) && - (my_write(update_temp_file, - (uchar*)(file_buff->ptr() + - (write_begin - file_buff->start())), - write_end - write_begin, MYF_RW))) - goto error; - + if (write_length) + { + if (my_write(update_temp_file, + (uchar*) (file_buff->ptr() + + (write_begin - file_buff->start())), + write_length, MYF_RW)) + goto error; + temp_file_length+= write_length; + } if (in_hole) { /* skip hole */ @@ -1232,6 +1241,8 @@ int ha_tina::rnd_end() Here we record this fact to the meta-file. */ (void)write_meta_file(share->meta_file, share->rows_recorded, FALSE); + + local_saved_data_file_length= temp_file_length; } DBUG_RETURN(0); @@ -1390,6 +1401,11 @@ int ha_tina::delete_all_rows() rc= my_chsize(share->tina_write_filedes, 0, 0, MYF(MY_WME)); stats.records=0; + /* Update shared info */ + pthread_mutex_lock(&share->mutex); + share->rows_recorded= 0; + pthread_mutex_unlock(&share->mutex); + local_saved_data_file_length= 0; DBUG_RETURN(rc); } From e8966deecc0eda77c5b94c6f0004cc2159dbd158 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 11:34:04 +0400 Subject: [PATCH 093/227] A fix and a test case for Bug#29050 Creation of a legal stored procedure fails if a database is not selected prior. The problem manifested itself when a user tried to create a routine that had non-fully-qualified identifiers in its bodies and there was no current database selected. This is a regression introduced by the fix for Bug 19022: The patch for Bug 19022 changes the code to always produce a warning if we can't resolve the current database in the parser. In this case this was not necessary, since even though the produced parsed tree was incorrect, we never re-use sphead that was obtained at first parsing of CREATE PROCEDURE. The sphead that is anyhow used is always obtained through db_load_routine, and there we change the current database to sphead->m_db before calling yyparse. The idea of the fix is to resolve the current database directly using lex->sphead->m_db member when parsing a stored routine body, when such is present. This patch removes the need to reset the current database when loading a trigger or routine definition into SP cache. The redundant code will be removed in 5.1. mysql-test/r/sp.result: Update test results (Bug#29050) mysql-test/r/trigger.result: Update results. mysql-test/t/sp.test: Add a test case for Bug#29050 mysql-test/t/trigger.test: Fix wrong behavior covered with tests. sql/sql_lex.cc: Implement st_lex::copy_db_to(). sql/sql_lex.h: Declare st_lex::copy_db_to(). sql/sql_parse.cc: Use st_lex::copy_db_to() in add_table_to_list, rather than THD::copy_db_to(). The former will use the database of the sphead, if we're parsing a stored routine, not the default database in THD. The default database is needed to initialize tables->db when the database part was not explicitly specified in the identifier. sql/sql_yacc.yy: Use st_lex::copy_db_to() in the parser, rather than THD::copy_db_to(). The former will use the database of the sphead, if we're parsing a stored routine, not the default database in THD. --- mysql-test/r/sp.result | 18 ++++++++++++++++++ mysql-test/r/trigger.result | 4 ++-- mysql-test/t/sp.test | 25 +++++++++++++++++++++++++ mysql-test/t/trigger.test | 4 ++-- sql/sql_lex.cc | 37 +++++++++++++++++++++++++++++++++++++ sql/sql_lex.h | 2 ++ sql/sql_parse.cc | 2 +- sql/sql_yacc.yy | 15 ++++++--------- 8 files changed, 93 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 5d7371b0991..7a4deb3ea5f 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6183,4 +6183,22 @@ call mysqltest_db1.sp_bug28551(); show warnings; Level Code Message drop database mysqltest_db1; +drop database if exists mysqltest_db1; +drop table if exists test.t1; +create database mysqltest_db1; +use mysqltest_db1; +drop database mysqltest_db1; +create table test.t1 (id int); +insert into test.t1 (id) values (1); +create procedure test.sp_bug29050() begin select * from t1; end// +show warnings; +Level Code Message +call test.sp_bug29050(); +id +1 +show warnings; +Level Code Message +use test; +drop procedure sp_bug29050; +drop table t1; End of 5.0 tests diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 5405a632aa4..290929d476d 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -351,7 +351,7 @@ create trigger trg1 before insert on mysqltest.t1 for each row set @a:= 1; ERROR HY000: Trigger in wrong schema use mysqltest; create trigger test.trg1 before insert on t1 for each row set @a:= 1; -ERROR HY000: Trigger in wrong schema +ERROR 42S02: Table 'test.t1' doesn't exist drop database mysqltest; use test; create table t1 (i int, j int default 10, k int not null, key (k)); @@ -842,7 +842,7 @@ drop table t1; create trigger t1_bi before insert on test.t1 for each row set @a:=0; ERROR 3D000: No database selected create trigger test.t1_bi before insert on t1 for each row set @a:=0; -ERROR 3D000: No database selected +ERROR 42S02: Table 'test.t1' doesn't exist drop trigger t1_bi; ERROR 3D000: No database selected create table t1 (id int); diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index cfc97fab777..54dc84ad19d 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -7142,5 +7142,30 @@ create procedure mysqltest_db1.sp_bug28551() begin end; call mysqltest_db1.sp_bug28551(); show warnings; drop database mysqltest_db1; +# +# Bug#29050 Creation of a legal stored procedure fails if a database is not +# selected prior +# +--disable_warnings +drop database if exists mysqltest_db1; +drop table if exists test.t1; +--enable_warnings +create database mysqltest_db1; +use mysqltest_db1; +# For the sake of its side effect +drop database mysqltest_db1; +# Now we have no current database selected. +create table test.t1 (id int); +insert into test.t1 (id) values (1); +delimiter //; +create procedure test.sp_bug29050() begin select * from t1; end// +delimiter ;// +show warnings; +call test.sp_bug29050(); +show warnings; +# Restore the old current database +use test; +drop procedure sp_bug29050; +drop table t1; --echo End of 5.0 tests diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 7158d02956e..0fa92f33de2 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -406,7 +406,7 @@ create table mysqltest.t1 (i int); --error ER_TRG_IN_WRONG_SCHEMA create trigger trg1 before insert on mysqltest.t1 for each row set @a:= 1; use mysqltest; ---error ER_TRG_IN_WRONG_SCHEMA +--error ER_NO_SUCH_TABLE create trigger test.trg1 before insert on t1 for each row set @a:= 1; drop database mysqltest; use test; @@ -1040,7 +1040,7 @@ drop table t1; connection addconwithoutdb; --error ER_NO_DB_ERROR create trigger t1_bi before insert on test.t1 for each row set @a:=0; ---error ER_NO_DB_ERROR +--error ER_NO_SUCH_TABLE create trigger test.t1_bi before insert on t1 for each row set @a:=0; --error ER_NO_DB_ERROR drop trigger t1_bi; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index cbfba3d4d80..aefa3d43b14 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1974,6 +1974,43 @@ uint8 st_lex::get_effective_with_check(st_table_list *view) } +/** + This method should be called only during parsing. + It is aware of compound statements (stored routine bodies) + and will initialize the destination with the default + database of the stored routine, rather than the default + database of the connection it is parsed in. + E.g. if one has no current database selected, or current database + set to 'bar' and then issues: + + CREATE PROCEDURE foo.p1() BEGIN SELECT * FROM t1 END// + + t1 is meant to refer to foo.t1, not to bar.t1. + + This method is needed to support this rule. + + @return TRUE in case of error (parsing should be aborted, FALSE in + case of success +*/ + +bool +st_lex::copy_db_to(char **p_db, uint *p_db_length) const +{ + if (sphead) + { + DBUG_ASSERT(sphead->m_db.str && sphead->m_db.length); + /* + It is safe to assign the string by-pointer, both sphead and + its statements reside in the same memory root. + */ + *p_db= sphead->m_db.str; + if (p_db_length) + *p_db_length= sphead->m_db.length; + return FALSE; + } + return thd->copy_db_to(p_db, p_db_length); +} + /* initialize limit counters diff --git a/sql/sql_lex.h b/sql/sql_lex.h index f8405ef14ca..3f55b3baae1 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1237,6 +1237,8 @@ typedef struct st_lex : public Query_tables_list context_stack.pop(); } + bool copy_db_to(char **p_db, uint *p_db_length) const; + Name_resolution_context *current_context() { return context_stack.head(); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b65ad705a36..124fcff9517 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6397,7 +6397,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, ptr->db= table->db.str; ptr->db_length= table->db.length; } - else if (thd->copy_db_to(&ptr->db, &ptr->db_length)) + else if (lex->copy_db_to(&ptr->db, &ptr->db_length)) DBUG_RETURN(0); ptr->alias= alias_str; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 6c146f77ed6..949f3ed4161 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1565,14 +1565,14 @@ sp_name: } | ident { - THD *thd= YYTHD; + LEX *lex= Lex; LEX_STRING db; if (check_routine_name($1)) { my_error(ER_SP_WRONG_NAME, MYF(0), $1.str); MYSQL_YYABORT; } - if (thd->copy_db_to(&db.str, &db.length)) + if (lex->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; $$= new sp_name(db, $1, false); if ($$) @@ -3624,10 +3624,9 @@ alter: opt_create_database_options { LEX *lex=Lex; - THD *thd= Lex->thd; lex->sql_command=SQLCOM_ALTER_DB; lex->name= $3; - if (lex->name == NULL && thd->copy_db_to(&lex->name, NULL)) + if (lex->name == NULL && lex->copy_db_to(&lex->name, NULL)) MYSQL_YYABORT; } | ALTER PROCEDURE sp_name @@ -3795,10 +3794,9 @@ alter_list_item: | RENAME opt_to table_ident { LEX *lex=Lex; - THD *thd= lex->thd; lex->select_lex.db=$3->db.str; if (lex->select_lex.db == NULL && - thd->copy_db_to(&lex->select_lex.db, NULL)) + lex->copy_db_to(&lex->select_lex.db, NULL)) { MYSQL_YYABORT; } @@ -5148,7 +5146,7 @@ simple_expr: { THD *thd= lex->thd; LEX_STRING db; - if (thd->copy_db_to(&db.str, &db.length)) + if (lex->copy_db_to(&db.str, &db.length)) MYSQL_YYABORT; sp_name *name= new sp_name(db, $1, false); if (name) @@ -9025,8 +9023,7 @@ grant_ident: '*' { LEX *lex= Lex; - THD *thd= lex->thd; - if (thd->copy_db_to(&lex->current_select->db, NULL)) + if (lex->copy_db_to(&lex->current_select->db, NULL)) MYSQL_YYABORT; if (lex->grant == GLOBAL_ACLS) lex->grant = DB_ACLS & ~GRANT_ACL; From e4ee2c5c08dc8d96f1519c1305416a4f17f1fcc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 12:48:11 +0500 Subject: [PATCH 094/227] BUG#27564 - Valgrind: UDF does not cleanup correctly Enabling rpl_udf test. mysql-test/t/disabled.def: Enabling rpl_udf test. --- mysql-test/t/disabled.def | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 32de2077e81..8a6a91fc169 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -51,6 +51,5 @@ ndb_partition_error2 : HF is not sure if the test can work as internded on all im_options_set : Bug#20294: Instance manager tests fail randomly im_options_unset : Bug#20294: Instance manager tests fail randomly mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage -rpl_udf : Bug#28993 rpl_udf test causes server crash and valgrind warning in pushbuild rpl_ndb_circular : Bug#29233 rpl_ndb_circular fails randomly ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild From 0d8f353b93f511b99e0f0ac79c3d48cd462186ff Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 13:09:56 +0500 Subject: [PATCH 095/227] Fix for bug #29420: crash with show and purge binlogs Problem: in case of failed 'show binlog events...' we don't inform that the log is not in use anymore. That may confuse following 'purge logs...' command as it takes into account logs in use. Fix: always notify that the log is not in use anymore. mysql-test/r/rpl_rotate_logs.result: Fix for bug #29420: crash with show and purge binlogs - test result. mysql-test/t/rpl_rotate_logs.test: Fix for bug #29420: crash with show and purge binlogs - test case. sql/sql_repl.cc: Fix for bug #29420: crash with show and purge binlogs - always zero thd->current_linfo at the end of the mysql_show_binlog_events(). --- mysql-test/r/rpl_rotate_logs.result | 8 ++++++++ mysql-test/t/rpl_rotate_logs.test | 14 +++++++++++++- sql/sql_repl.cc | 6 ++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index df42e76a0c8..8a5ae6c8983 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -95,3 +95,11 @@ count(*) 100 unlock tables; drop table if exists t1,t2,t3,t4; +End of 4.1 tests +show binlog events in 'non existing_binlog_file'; +ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log +purge master logs before now(); +show binlog events in ''; +ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log +purge master logs before now(); +End of 5.0 tests diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 69614b45693..0b7efb81f61 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -169,4 +169,16 @@ connection master; drop table if exists t1,t2,t3,t4; sync_slave_with_master; -# End of 4.1 tests +--echo End of 4.1 tests + +# +# Bug #29420: crash with show and purge binlogs +# +--error 1220 +show binlog events in 'non existing_binlog_file'; +purge master logs before now(); +--error 1220 +show binlog events in ''; +purge master logs before now(); + +--echo End of 5.0 tests diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 86ededd5587..9cc0ba7c29a 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1420,13 +1420,11 @@ err: } if (errmsg) - { my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0), "SHOW BINLOG EVENTS", errmsg); - DBUG_RETURN(TRUE); - } + else + send_eof(thd); - send_eof(thd); pthread_mutex_lock(&LOCK_thread_count); thd->current_linfo = 0; pthread_mutex_unlock(&LOCK_thread_count); From 26af0b96a8d7edb8987ff604f415b3814ee47ece Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 11:31:03 +0200 Subject: [PATCH 096/227] Bug#26827 - table->read_set is set incorrectly, causing update of a different column Post-pushbuild fix. bitmap_set_bit() is an inline function in DEBUG builds and a macro in non-DEBUG builds. The latter evaluates its 'bit' argument twice. So one must not use increment/decrement operators on this argument. Moved increment of pointer out of bitmap_set_bit() call. include/my_bitmap.h: Bug#26827 - table->read_set is set incorrectly, causing update of a different column Added a warning comment. sql/sql_partition.cc: Bug#26827 - table->read_set is set incorrectly, causing update of a different column Moved increment of pointer out of bitmap_set_bit() call. --- include/my_bitmap.h | 11 +++++++++++ sql/sql_partition.cc | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/my_bitmap.h b/include/my_bitmap.h index 488c41ffb22..0b12172946a 100644 --- a/include/my_bitmap.h +++ b/include/my_bitmap.h @@ -103,6 +103,17 @@ extern void bitmap_lock_invert(MY_BITMAP *map); &= ~ (1 << ((BIT) & 7))) #define _bitmap_is_set(MAP, BIT) (uint) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ & (1 << ((BIT) & 7))) +/* + WARNING! + + The below symbols are inline functions in DEBUG builds and macros in + non-DEBUG builds. The latter evaluate their 'bit' argument twice. + + NEVER use an increment/decrement operator with the 'bit' argument. + It would work with DEBUG builds, but fails later in production builds! + + FORBIDDEN: bitmap_set_bit($my_bitmap, (field++)->field_index); +*/ #ifndef DBUG_OFF static inline void bitmap_set_bit(MY_BITMAP *map,uint bit) diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index a44af968d9f..191859e0ed4 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -606,8 +606,8 @@ static bool create_full_part_field_array(THD *thd, TABLE *table, partitioning. */ if ((ptr= part_info->full_part_field_array)) - while (*ptr) - bitmap_set_bit(&part_info->full_part_field_set, (*ptr++)->field_index); + for (; *ptr; ptr++) + bitmap_set_bit(&part_info->full_part_field_set, (*ptr)->field_index); end: DBUG_RETURN(result); From 3bd52b0b7b4cddc973b74af64c097033cb75e149 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 15:17:06 +0500 Subject: [PATCH 097/227] BUG#29464 - load data infile into table with big5 chinese fulltext index hangs 100% cpu Fulltext parser may fall into infinite loop when it gets illegal multibyte sequence (or a sequence that doesn't have mapping to unicode). Affects 5.1 only. mysql-test/r/fulltext.result: A test case for BUG#29464. mysql-test/t/fulltext.test: A test case for BUG#29464. storage/myisam/ft_parser.c: ctype() may return negative value, which was stored in unsigned variable. Also ctype() may return negative length for correct multibyte sequence that doesn't have a mapping to unicode. These characters are skipped correctly with this patch. --- mysql-test/r/fulltext.result | 4 ++++ mysql-test/t/fulltext.test | 9 +++++++++ storage/myisam/ft_parser.c | 16 ++++++++++------ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index d8e3d53f7b1..ef8cf304743 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -476,3 +476,7 @@ ALTER TABLE t1 DISABLE KEYS; SELECT * FROM t1 WHERE MATCH(a) AGAINST('test'); ERROR HY000: Can't find FULLTEXT index matching the column list DROP TABLE t1; +CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci, +FULLTEXT(a)); +INSERT INTO t1 VALUES(0xA3C2); +DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 537ab5888bd..749e54d218a 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -399,4 +399,13 @@ ALTER TABLE t1 DISABLE KEYS; SELECT * FROM t1 WHERE MATCH(a) AGAINST('test'); DROP TABLE t1; +# +# BUG#29464 - load data infile into table with big5 chinese fulltext index +# hangs 100% cpu +# +CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci, +FULLTEXT(a)); +INSERT INTO t1 VALUES(0xA3C2); +DROP TABLE t1; + # End of 4.1 tests diff --git a/storage/myisam/ft_parser.c b/storage/myisam/ft_parser.c index ba858c37aee..befe2bab066 100644 --- a/storage/myisam/ft_parser.c +++ b/storage/myisam/ft_parser.c @@ -111,7 +111,8 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end, { uchar *doc=*start; int ctype; - uint mwc, length, mbl; + uint mwc, length; + int mbl; param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0); param->weight_adjust= param->wasign= 0; @@ -119,7 +120,7 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end, while (doc 0 ? mbl : 1)) + for (; doc < end; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1))) { mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end); if (true_word_char(ctype, *doc)) @@ -157,7 +158,8 @@ uchar ft_get_word(CHARSET_INFO *cs, uchar **start, uchar *end, } mwc=length=0; - for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1)) + for (word->pos= doc; doc < end; length++, + doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1))) { mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end); if (true_word_char(ctype, *doc)) @@ -200,13 +202,14 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, uchar **start, const uchar *end, FT_WORD *word, my_bool skip_stopwords) { uchar *doc= *start; - uint mwc, length, mbl; + uint mwc, length; + int mbl; int ctype; DBUG_ENTER("ft_simple_get_word"); do { - for (;; doc+= (mbl > 0 ? mbl : 1)) + for (;; doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1))) { if (doc >= end) DBUG_RETURN(0); @@ -216,7 +219,8 @@ uchar ft_simple_get_word(CHARSET_INFO *cs, uchar **start, const uchar *end, } mwc= length= 0; - for (word->pos= doc; doc < end; length++, doc+= (mbl > 0 ? mbl : 1)) + for (word->pos= doc; doc < end; length++, + doc+= (mbl > 0 ? mbl : (mbl < 0 ? -mbl : 1))) { mbl= cs->cset->ctype(cs, &ctype, (uchar*)doc, (uchar*)end); if (true_word_char(ctype, *doc)) From 32c6341ea8df1a5a42c0b5d514a1becf10c81be2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 15:34:12 +0500 Subject: [PATCH 098/227] Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored Problem: logging queries not using indexes we check a special flag which is set only at the server startup and is not changing with a corresponding server variable together. Fix: check the variable value instead of the flag. mysql-test/r/show_check.result: Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored - test result. mysql-test/t/show_check.test: Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored - test case. sql/mysqld.cc: Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored - SPECIAL_LOG_QUERIES_NOT_USING_INDEXES is not used anymore. sql/sql_parse.cc: Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored - check opt_log_queries_not_using_indexes instead of SPECIAL_LOG_QUERIES_NOT_USING_INDEXES flag. sql/unireg.h: Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored - SPECIAL_LOG_QUERIES_NOT_USING_INDEXES is not used anymore. --- mysql-test/r/show_check.result | 30 ++++++++++++++++++++++++++++++ mysql-test/t/show_check.test | 16 ++++++++++++++++ sql/mysqld.cc | 2 -- sql/sql_parse.cc | 2 +- sql/unireg.h | 2 +- 5 files changed, 48 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index e2450c98202..e4cdd4f183b 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1088,4 +1088,34 @@ DROP TABLE t1; DROP VIEW v1; DROP PROCEDURE p1; DROP FUNCTION f1; +flush status; +show variables like "log_queries_not_using_indexes"; +Variable_name Value +log_queries_not_using_indexes ON +select 1 from information_schema.tables limit 1; +1 +1 +show status like 'slow_queries'; +Variable_name Value +Slow_queries 1 +set global log_queries_not_using_indexes=OFF; +show variables like "log_queries_not_using_indexes"; +Variable_name Value +log_queries_not_using_indexes OFF +select 1 from information_schema.tables limit 1; +1 +1 +show status like 'slow_queries'; +Variable_name Value +Slow_queries 1 +set global log_queries_not_using_indexes=ON; +show variables like "log_queries_not_using_indexes"; +Variable_name Value +log_queries_not_using_indexes ON +select 1 from information_schema.tables limit 1; +1 +1 +show status like 'slow_queries'; +Variable_name Value +Slow_queries 2 End of 5.0 tests diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 1db40b0c17c..a58d81a414b 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -766,4 +766,20 @@ DROP VIEW v1; DROP PROCEDURE p1; DROP FUNCTION f1; +# +# Bug #28808: log_queries_not_using_indexes variable dynamic change is ignored +# +flush status; +show variables like "log_queries_not_using_indexes"; +select 1 from information_schema.tables limit 1; +show status like 'slow_queries'; +set global log_queries_not_using_indexes=OFF; +show variables like "log_queries_not_using_indexes"; +select 1 from information_schema.tables limit 1; +show status like 'slow_queries'; +set global log_queries_not_using_indexes=ON; +show variables like "log_queries_not_using_indexes"; +select 1 from information_schema.tables limit 1; +show status like 'slow_queries'; + --echo End of 5.0 tests diff --git a/sql/mysqld.cc b/sql/mysqld.cc index afeb3b82a01..61980fa1887 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7461,8 +7461,6 @@ static void get_options(int argc,char **argv) if (opt_short_log_format) opt_specialflag|= SPECIAL_SHORT_LOG_FORMAT; - if (opt_log_queries_not_using_indexes) - opt_specialflag|= SPECIAL_LOG_QUERIES_NOT_USING_INDEXES; if (init_global_datetime_format(MYSQL_TIMESTAMP_DATE, &global_system_variables.date_format) || diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b65ad705a36..c679135f858 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2207,7 +2207,7 @@ void log_slow_statement(THD *thd) thd->variables.long_query_time || (thd->server_status & (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) && - (specialflag & SPECIAL_LOG_QUERIES_NOT_USING_INDEXES) && + opt_log_queries_not_using_indexes && /* == SQLCOM_END unless this is a SHOW command */ thd->lex->orig_sql_command == SQLCOM_END) { diff --git a/sql/unireg.h b/sql/unireg.h index 0f7c1709c6c..81ca18c1d32 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -120,7 +120,7 @@ #define SPECIAL_NO_HOST_CACHE 512 /* Don't cache hosts */ #define SPECIAL_SHORT_LOG_FORMAT 1024 #define SPECIAL_SAFE_MODE 2048 -#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Log q not using indexes */ +#define SPECIAL_LOG_QUERIES_NOT_USING_INDEXES 4096 /* Obsolete */ /* Extern defines */ #define store_record(A,B) bmove_align((A)->B,(A)->record[0],(size_t) (A)->s->reclength) From 3cc57ba65a06e49e975fedf55cf12d2edf2ad646 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 12:51:51 +0100 Subject: [PATCH 099/227] make_binary_distribution.sh: This script incorrectly generates the mysql_install_db file, causing the problems detailed in bug#28585. The automake infrastructure correctly generates the script, so just copy it in place. scripts/make_binary_distribution.sh: This script incorrectly generates the mysql_install_db file, causing the problems detailed in bug#28585. The automake infrastructure correctly generates the script, so just copy it in place. --- scripts/make_binary_distribution.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 77f51c51c19..b0a4f9ec66e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -314,10 +314,7 @@ fi if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* copyfileto $BASE/bin scripts/* - $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ - ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ - @HOSTNAME@ \@pkgdatadir\@ ./support-files \ - < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db + copyfileto $BASE/scripts scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ \@sbindir\@ ./bin \@libexecdir\@ ./bin \ \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \ From 6139d34c92bf9c2e1a2fe19b41c7e19f5cbe2787 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 18:24:48 +0300 Subject: [PATCH 100/227] Bug #29166: AsText() needs to know the maximum number of characters a IEEE double precision value can occupy to make sure there's enough buffer space. The number was too small to hold all possible values and this caused buffer overruns. Fixed by correcting the calculation of the maximum digits in a string representation of an IEEE double precision value as printed by String::qs_append(double). mysql-test/r/gis.result: Bug #29166: test case mysql-test/t/gis.test: Bug #29166: test case sql/spatial.cc: Bug #29166: correct calculation of the maximum digits in a string representation of a double --- mysql-test/r/gis.result | 3 +++ mysql-test/t/gis.test | 20 ++++++++++++++++++++ sql/spatial.cc | 23 ++++++++++++++++++++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index d1f292cda0c..edf017f24d4 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -885,4 +885,7 @@ AsText(a) POINT(1 1) LINESTRING(0 0,1 1,2 2) drop table t1, t2; +SELECT 1; +1 +1 End of 5.0 tests diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 95ccc6272e2..79743a0b8f4 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -570,4 +570,24 @@ create table t2 as select f2 as a from t1 union select f3 from t1; desc t2; select AsText(a) from t2; drop table t1, t2; + +# +# Bug #29166: MYsql crash when query is run +# + +# The test query itself is not logged : too large output. +# The real test is the second query : see if the first hasn't crashed the +# server +--disable_query_log +--disable_result_log +SELECT AsText(GeometryFromText(CONCAT( + 'MULTIPOLYGON(((', + REPEAT ('-0.00000000001234567890123456789012 -0.123456789012345678,', 1000), + '-0.00000000001234567890123456789012 -0.123456789012345678', + ')))' +))) AS a; +--enable_result_log +--enable_query_log +SELECT 1; + --echo End of 5.0 tests diff --git a/sql/spatial.cc b/sql/spatial.cc index 939e7d2a3b4..69d0c15748a 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -17,7 +17,28 @@ #ifdef HAVE_SPATIAL -#define MAX_DIGITS_IN_DOUBLE 16 +/* + exponential notation : + 1 sign + 1 number before the decimal point + 1 decimal point + 14 number of significant digits (see String::qs_append(double)) + 1 'e' sign + 1 exponent sign + 3 exponent digits + == + 22 + + "f" notation : + 1 optional 0 + 1 sign + 14 number significant digits (see String::qs_append(double) ) + 1 decimal point + == + 17 +*/ + +#define MAX_DIGITS_IN_DOUBLE 22 /***************************** Gis_class_info *******************************/ From ea2ec3d96f3b615813e82a8ba691891ce44b52f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 19:20:14 +0200 Subject: [PATCH 101/227] Post-merge fixes. Fixed typos and comment styles in tests. mysql-test/r/rpl_partition.result: Post-merge fixes. Removed warnings after fixing --disable_warnings command. mysql-test/t/ctype_uca.test: Post-merge fixes. Fixed comment style. mysql-test/t/rpl_partition.test: Post-merge fixes. Fixed typo in --disable_warnings and --enable_warnings. mysql-test/t/subselect.test: Post-merge fixes. Fixed comment style. --- mysql-test/r/rpl_partition.result | 22 ---------------------- mysql-test/t/ctype_uca.test | 2 +- mysql-test/t/rpl_partition.test | 4 ++-- mysql-test/t/subselect.test | 2 +- 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/rpl_partition.result b/mysql-test/r/rpl_partition.result index cdd29919c48..79a95fd613b 100644 --- a/mysql-test/r/rpl_partition.result +++ b/mysql-test/r/rpl_partition.result @@ -10,31 +10,9 @@ select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format ROW @@session.binlog_format ROW DROP TABLE IF EXISTS t1, t2, t3; -Warnings: -Level Note -Code 1051 -Message Unknown table 't1' -Level Note -Code 1051 -Message Unknown table 't2' -Level Note -Code 1051 -Message Unknown table 't3' DROP PROCEDURE IF EXISTS p1; -Warnings: -Level Note -Code 1305 -Message PROCEDURE p1 does not exist DROP PROCEDURE IF EXISTS p2; -Warnings: -Level Note -Code 1305 -Message PROCEDURE p2 does not exist DROP PROCEDURE IF EXISTS p3; -Warnings: -Level Note -Code 1305 -Message PROCEDURE p3 does not exist CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT, dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, fkid MEDIUMINT, filler VARCHAR(255), diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 17632e7c8fc..695a21adbf5 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -530,7 +530,7 @@ create table t1 ( a varchar(255), key a(a) ) character set utf8 collate utf8_czech_ci; --- In Czech 'ch' is a single letter between 'h' and 'i' +# In Czech 'ch' is a single letter between 'h' and 'i' insert into t1 values ('b'),('c'),('d'),('e'),('f'),('g'),('h'),('ch'),('i'),('j'); select * from t1 where a like 'c%'; diff --git a/mysql-test/t/rpl_partition.test b/mysql-test/t/rpl_partition.test index 7f6e05db20e..ffd6d17ec6f 100644 --- a/mysql-test/t/rpl_partition.test +++ b/mysql-test/t/rpl_partition.test @@ -9,12 +9,12 @@ SET GLOBAL binlog_format = 'ROW'; SET SESSION binlog_format = 'ROW'; select @@global.binlog_format, @@session.binlog_format; ---disable-warnings +--disable_warnings DROP TABLE IF EXISTS t1, t2, t3; DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p2; DROP PROCEDURE IF EXISTS p3; ---enable-warnings +--enable_warnings eval CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT, dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB, diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 4c046dfd3c6..95514fd773e 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -2970,7 +2970,7 @@ DROP TABLE t1,t2; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1, 2), (1,3), (1,4), (2,1), (2,2); --- returns no rows, when it should +# returns no rows, when it should SELECT a1.a, COUNT(*) FROM t1 a1 WHERE a1.a = 1 AND EXISTS( SELECT a2.a FROM t1 a2 WHERE a2.a = a1.a) GROUP BY a1.a; From 725b49716b2bfb88361f37df2fd882578998b131 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Jul 2007 03:43:23 +0500 Subject: [PATCH 102/227] Fixed bug #29442. The SELECT INTO OUTFILE FIELDS ENCLOSED BY digit or minus sign, followed by the same LOAD DATA INFILE statement, used wrond encoding of non-string fields contained the enclosed character in their text representation. Example: SELECT 15, 9 INTO OUTFILE 'text' FIELDS ENCLOSED BY '5'; Old encoded result in the text file: 5155 595 ^ was decoded as the 1st enclosing character of the 2nd field; ^ was skipped as garbage; ^ ^ was decoded as a pair of englosing characters of the 1st field; ^ was decoded as traling space of the first field; ^^ was decoded as a doubled enclosed character. New encoded result in the text file: 51\55 595 ^ ^ pair of enclosing characters of the 1st field; ^^ escaped enclosed character. sql/sql_class.h: Fixed bug #29442. The NUMERIC_CHARS macro constant has been defined to enumerate all possible characters of a numeric value text representation. The select_export::is_unsafe_field_sep boolean flag has been added to apply the encoding algorithm to non-string values when it is necessary. sql/sql_class.cc: Fixed bug #29442. The select_export::send_data method has been modified to encode text representation of fields of all data types like string fields. mysql-test/t/loaddata.test: Updated test case for bug #29442. mysql-test/r/loaddata.result: Updated test case for bug #29442. --- mysql-test/r/loaddata.result | 14 ++++++++++++++ mysql-test/t/loaddata.test | 25 +++++++++++++++++++++++++ sql/sql_class.cc | 4 +++- sql/sql_class.h | 12 ++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result index 031aa5c700c..7fff2700779 100644 --- a/mysql-test/r/loaddata.result +++ b/mysql-test/r/loaddata.result @@ -238,3 +238,17 @@ f1 1 2 drop table t1,t2; +CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE); +INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100); +SELECT * FROM t1; +c1 c2 c3 c4 +10 1970-02-01 01:02:03 1.1e-100 1.1e+100 +SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1; +-10- -1970\-02\-01 01:02:03- -1.1e\-100- -1.1e+100- +EOF +TRUNCATE t1; +LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-'; +SELECT * FROM t1; +c1 c2 c3 c4 +10 1970-02-01 01:02:03 1.1e-100 1.1e+100 +DROP TABLE t1; diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index cdd3bb80b6e..260e760e7b3 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -213,4 +213,29 @@ select f1 from t1 where f2 <> '0000-00-00 00:00:00' order by f1; --exec rm $MYSQLTEST_VARDIR/tmp/t2 drop table t1,t2; +# +# Bug#29442: SELECT INTO OUTFILE FIELDS ENCLOSED BY digit, minus sign etc +# corrupts non-string fields containing this character. +# + +CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE); + +INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100); +SELECT * FROM t1; + +--exec rm -f $MYSQLTEST_VARDIR/tmp/t1 +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval SELECT * INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1; +--exec cat $MYSQLTEST_VARDIR/tmp/t1 +--exec echo EOF + +TRUNCATE t1; + +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-'; +SELECT * FROM t1; + +--exec rm $MYSQLTEST_VARDIR/tmp/t1 +DROP TABLE t1; + # End of 5.0 tests diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 117c20352ce..036ba217a9b 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1210,6 +1210,7 @@ select_export::prepare(List &list, SELECT_LEX_UNIT *u) field_term_length ? (*exchange->field_term)[0] : INT_MAX); escape_char= (exchange->escaped->length() ? (*exchange->escaped)[0] : -1); is_ambiguous_field_sep= test(strchr(ESCAPE_CHARS, field_sep_char)); + is_unsafe_field_sep= test(strchr(NUMERIC_CHARS, field_sep_char)); line_sep_char= (exchange->line_term->length() ? (*exchange->line_term)[0] : INT_MAX); if (!field_term_length) @@ -1284,7 +1285,8 @@ bool select_export::send_data(List &items) used_length=min(res->length(),item->max_length); else used_length=res->length(); - if (result_type == STRING_RESULT && escape_char != -1) + if ((result_type == STRING_RESULT || is_unsafe_field_sep) && + escape_char != -1) { char *pos, *start, *end; CHARSET_INFO *res_charset= res->charset(); diff --git a/sql/sql_class.h b/sql/sql_class.h index 23c499aea07..a5cbc21684f 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1929,6 +1929,12 @@ public: #define ESCAPE_CHARS "ntrb0ZN" // keep synchronous with READ_INFO::unescape +/* + List of all possible characters of a numeric value text representation. +*/ +#define NUMERIC_CHARS ".0123456789e+-" + + class select_export :public select_to_file { uint field_term_length; int field_sep_char,escape_char,line_sep_char; @@ -1938,6 +1944,12 @@ class select_export :public select_to_file { (see the READ_INFO::unescape method and the ESCAPE_CHARS constant value). */ bool is_ambiguous_field_sep; + /* + The is_unsafe_field_sep field is true if a value of the field_sep_char + field is one of the '0'..'9', '+', '-', '.' and 'e' characters + (see the NUMERIC_CHARS constant value). + */ + bool is_unsafe_field_sep; bool fixed_row_size; public: select_export(sql_exchange *ex) :select_to_file(ex) {} From ae23a601aed07617dc1b12bc2d1e320498750ff6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Jul 2007 16:58:56 +0800 Subject: [PATCH 103/227] update some description in t/disable.def for testcase rpl_ndb_innodb2ndb and rpl_ndb_myisam2ndb mysql-test/t/disabled.def: correct related bug, bug#29549 discovers more accurate reason --- mysql-test/t/disabled.def | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 90fd997e615..feb08c6f743 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -27,8 +27,8 @@ rpl_ndb_2myisam : BUG#19227 Seems to pass currently rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master -rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement -rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement +rpl_ndb_innodb2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue +rpl_ndb_myisam2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly synchronization : Bug#24529 Test 'synchronization' fails on Mac pushbuild; Also on Linux 64 bit. From 4e825803bf2ed3ca28214978a6203d67646c4439 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Jul 2007 12:39:03 +0200 Subject: [PATCH 104/227] Bug #29570 original error lost in write_event on slave - make sure error gets propagated to thd->net by calling print_error - also print the full error message --- sql/log_event.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 1241d0b02ed..6565278e6d3 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -6057,8 +6057,9 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) default: slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno, - "Error in %s event: row application failed", - get_type_str()); + "Error in %s event: row application failed. %s", + get_type_str(), + thd->net.last_error ? thd->net.last_error : ""); thd->query_error= 1; break; } @@ -6079,9 +6080,10 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli) { /* error has occured during the transaction */ slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno, "Error in %s event: error during transaction execution " - "on table %s.%s", + "on table %s.%s. %s", get_type_str(), table->s->db.str, - table->s->table_name.str); + table->s->table_name.str, + thd->net.last_error ? thd->net.last_error : ""); /* If one day we honour --skip-slave-errors in row-based replication, and @@ -6997,7 +6999,12 @@ replace_record(THD *thd, TABLE *table, } if ((keynum= table->file->get_dup_key(error)) < 0) { - /* We failed to retrieve the duplicate key */ + table->file->print_error(error, MYF(0)); + /* + We failed to retrieve the duplicate key + - either because the error was not "duplicate key" error + - or because the information which key is not available + */ DBUG_RETURN(error); } From 360a5ebc378f514f824d585545459ebfab6dc06f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Jul 2007 16:18:49 +0400 Subject: [PATCH 105/227] Remove typedef st_table_list TABLE_LIST and always use name 'TABLE_LIST'. The need arose when working on Bug 26141, where it became necessary to replace TABLE_LIST with its forward declaration in a few headers, and this involved a lot of s/TABLE_LIST/st_table_list/. Although other workarounds exist, this patch is in line with our general strategy of moving away from typedef-ed names. Sometime in future we might also rename TABLE_LIST to follow the coding style, but this is a huge change. sql/item.cc: st_table_list -> TABLE_LIST sql/item.h: st_table_list -> TABLE_LIST sql/mysql_priv.h: st_table_list -> TABLE_LIST sql/sql_base.cc: st_table_list -> TABLE_LIST sql/sql_lex.cc: st_table_list -> TABLE_LIST sql/sql_lex.h: st_table_list -> TABLE_LIST sql/sql_select.cc: st_table_list -> TABLE_LIST sql/sql_show.cc: st_table_list -> TABLE_LIST sql/sql_udf.h: Was not needed. sql/table.cc: st_table_list -> TABLE_LIST sql/table.h: st_table_list -> TABLE_LIST --- sql/item.cc | 2 +- sql/item.h | 2 +- sql/mysql_priv.h | 6 ++-- sql/sql_base.cc | 2 +- sql/sql_lex.cc | 2 +- sql/sql_lex.h | 2 +- sql/sql_select.cc | 4 +-- sql/sql_show.cc | 14 ++++---- sql/sql_udf.h | 1 - sql/table.cc | 92 +++++++++++++++++++++++------------------------ sql/table.h | 60 +++++++++++++++---------------- 11 files changed, 93 insertions(+), 94 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 52389eece10..2fc58eebe75 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5807,7 +5807,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) if (!arg->fixed) { bool res; - st_table_list *orig_next_table= context->last_name_resolution_table; + TABLE_LIST *orig_next_table= context->last_name_resolution_table; context->last_name_resolution_table= context->first_name_resolution_table; res= arg->fix_fields(thd, &arg); context->last_name_resolution_table= orig_next_table; diff --git a/sql/item.h b/sql/item.h index fdb85b131c1..58e3ec439b4 100644 --- a/sql/item.h +++ b/sql/item.h @@ -19,7 +19,7 @@ #endif class Protocol; -struct st_table_list; +struct TABLE_LIST; void item_init(void); /* Init item functions */ class Item_field; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 0aaa1744fe1..bbcf2ed8adf 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -455,9 +455,9 @@ void debug_sync_point(const char* lock_name, uint lock_timeout); #define SHOW_LOG_STATUS_FREE "FREE" #define SHOW_LOG_STATUS_INUSE "IN USE" -struct st_table_list; +struct TABLE_LIST; class String; -void view_store_options(THD *thd, st_table_list *table, String *buff); +void view_store_options(THD *thd, TABLE_LIST *table, String *buff); /* Options to add_table_to_list() */ #define TL_OPTION_UPDATING 1 @@ -1104,7 +1104,7 @@ bool close_thread_table(THD *thd, TABLE **table_ptr); void close_temporary_tables(THD *thd); void close_tables_for_reopen(THD *thd, TABLE_LIST **tables); TABLE_LIST *find_table_in_list(TABLE_LIST *table, - st_table_list *TABLE_LIST::*link, + TABLE_LIST *TABLE_LIST::*link, const char *db_name, const char *table_name); TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list, diff --git a/sql/sql_base.cc b/sql/sql_base.cc index ed006714143..bf1c6d7cb0d 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -848,7 +848,7 @@ void close_temporary_tables(THD *thd) */ TABLE_LIST *find_table_in_list(TABLE_LIST *table, - st_table_list *TABLE_LIST::*link, + TABLE_LIST *TABLE_LIST::*link, const char *db_name, const char *table_name) { diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index cbfba3d4d80..4084c67098e 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1965,7 +1965,7 @@ bool st_lex::need_correct_ident() VIEW_CHECK_CASCADED CHECK OPTION CASCADED */ -uint8 st_lex::get_effective_with_check(st_table_list *view) +uint8 st_lex::get_effective_with_check(TABLE_LIST *view) { if (view->select_lex->master_unit() == &unit && which_check_option_applicable()) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index f8405ef14ca..fbbb620fbd6 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1198,7 +1198,7 @@ typedef struct st_lex : public Query_tables_list bool can_not_use_merged(); bool only_view_structure(); bool need_correct_ident(); - uint8 get_effective_with_check(st_table_list *view); + uint8 get_effective_with_check(TABLE_LIST *view); /* Is this update command where 'WHITH CHECK OPTION' clause is important diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9d27ab4bb4e..6e0640d2cd4 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -15395,11 +15395,11 @@ static void print_join(THD *thd, String *str, List *tables) Print table as it should be in join list SYNOPSIS - st_table_list::print(); + TABLE_LIST::print(); str string where table should bbe printed */ -void st_table_list::print(THD *thd, String *str) +void TABLE_LIST::print(THD *thd, String *str) { if (nested_join) { diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 902b298e423..dd2c95842dc 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2429,7 +2429,7 @@ int fill_schema_shemata(THD *thd, TABLE_LIST *tables, COND *cond) } -static int get_schema_tables_record(THD *thd, struct st_table_list *tables, +static int get_schema_tables_record(THD *thd, TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name) @@ -2619,7 +2619,7 @@ static int get_schema_tables_record(THD *thd, struct st_table_list *tables, } -static int get_schema_column_record(THD *thd, struct st_table_list *tables, +static int get_schema_column_record(THD *thd, TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name) @@ -3061,7 +3061,7 @@ err: } -static int get_schema_stat_record(THD *thd, struct st_table_list *tables, +static int get_schema_stat_record(THD *thd, TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name) @@ -3151,7 +3151,7 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables, } -static int get_schema_views_record(THD *thd, struct st_table_list *tables, +static int get_schema_views_record(THD *thd, TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name) @@ -3263,7 +3263,7 @@ bool store_constraints(THD *thd, TABLE *table, const char *db, } -static int get_schema_constraints_record(THD *thd, struct st_table_list *tables, +static int get_schema_constraints_record(THD *thd, TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name) @@ -3359,7 +3359,7 @@ static bool store_trigger(THD *thd, TABLE *table, const char *db, } -static int get_schema_triggers_record(THD *thd, struct st_table_list *tables, +static int get_schema_triggers_record(THD *thd, TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name) @@ -3426,7 +3426,7 @@ void store_key_column_usage(TABLE *table, const char*db, const char *tname, static int get_schema_key_column_usage_record(THD *thd, - struct st_table_list *tables, + TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name) diff --git a/sql/sql_udf.h b/sql/sql_udf.h index 3cd9343610c..4b8b492698e 100644 --- a/sql/sql_udf.h +++ b/sql/sql_udf.h @@ -47,7 +47,6 @@ typedef struct st_udf_func } udf_func; class Item_result_field; -struct st_table_list; class udf_handler :public Sql_alloc { diff --git a/sql/table.cc b/sql/table.cc index 4e0f2b5d287..899d0ab2ed0 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1780,11 +1780,11 @@ void st_table::reset_item_list(List *item_list) const calculate md5 of query SYNOPSIS - st_table_list::calc_md5() + TABLE_LIST::calc_md5() buffer buffer for md5 writing */ -void st_table_list::calc_md5(char *buffer) +void TABLE_LIST::calc_md5(char *buffer) { my_MD5_CTX context; uchar digest[16]; @@ -1809,10 +1809,10 @@ void st_table_list::calc_md5(char *buffer) it (it is a kind of optimisation) SYNOPSIS - st_table_list::set_underlying_merge() + TABLE_LIST::set_underlying_merge() */ -void st_table_list::set_underlying_merge() +void TABLE_LIST::set_underlying_merge() { TABLE_LIST *tbl; @@ -1847,7 +1847,7 @@ void st_table_list::set_underlying_merge() setup fields of placeholder of merged VIEW SYNOPSIS - st_table_list::setup_underlying() + TABLE_LIST::setup_underlying() thd - thread handler DESCRIPTION @@ -1860,9 +1860,9 @@ void st_table_list::set_underlying_merge() TRUE - error */ -bool st_table_list::setup_underlying(THD *thd) +bool TABLE_LIST::setup_underlying(THD *thd) { - DBUG_ENTER("st_table_list::setup_underlying"); + DBUG_ENTER("TABLE_LIST::setup_underlying"); if (!field_translation && merge_underlying_list) { @@ -1925,7 +1925,7 @@ bool st_table_list::setup_underlying(THD *thd) Prepare where expression of view SYNOPSIS - st_table_list::prep_where() + TABLE_LIST::prep_where() thd - thread handler conds - condition of this JOIN no_where_clause - do not build WHERE or ON outer qwery do not need it @@ -1939,10 +1939,10 @@ bool st_table_list::setup_underlying(THD *thd) TRUE - error */ -bool st_table_list::prep_where(THD *thd, Item **conds, +bool TABLE_LIST::prep_where(THD *thd, Item **conds, bool no_where_clause) { - DBUG_ENTER("st_table_list::prep_where"); + DBUG_ENTER("TABLE_LIST::prep_where"); for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local) { @@ -2042,7 +2042,7 @@ merge_on_conds(THD *thd, TABLE_LIST *table, bool is_cascaded) Prepare check option expression of table SYNOPSIS - st_table_list::prep_check_option() + TABLE_LIST::prep_check_option() thd - thread handler check_opt_type - WITH CHECK OPTION type (VIEW_CHECK_NONE, VIEW_CHECK_LOCAL, VIEW_CHECK_CASCADED) @@ -2057,16 +2057,16 @@ merge_on_conds(THD *thd, TABLE_LIST *table, bool is_cascaded) This method builds check option condition to use it later on every call (usual execution or every SP/PS call). This method have to be called after WHERE preparation - (st_table_list::prep_where) + (TABLE_LIST::prep_where) RETURN FALSE - OK TRUE - error */ -bool st_table_list::prep_check_option(THD *thd, uint8 check_opt_type) +bool TABLE_LIST::prep_check_option(THD *thd, uint8 check_opt_type) { - DBUG_ENTER("st_table_list::prep_check_option"); + DBUG_ENTER("TABLE_LIST::prep_check_option"); bool is_cascaded= check_opt_type == VIEW_CHECK_CASCADED; for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local) @@ -2125,12 +2125,12 @@ bool st_table_list::prep_check_option(THD *thd, uint8 check_opt_type) Hide errors which show view underlying table information SYNOPSIS - st_table_list::hide_view_error() + TABLE_LIST::hide_view_error() thd thread handler */ -void st_table_list::hide_view_error(THD *thd) +void TABLE_LIST::hide_view_error(THD *thd) { /* Hide "Unknown column" or "Unknown function" error */ if (thd->net.last_errno == ER_BAD_FIELD_ERROR || @@ -2161,7 +2161,7 @@ void st_table_list::hide_view_error(THD *thd) table_to_find (TABLE) SYNOPSIS - st_table_list::find_underlying_table() + TABLE_LIST::find_underlying_table() table_to_find table to find RETURN @@ -2169,7 +2169,7 @@ void st_table_list::hide_view_error(THD *thd) found table reference */ -st_table_list *st_table_list::find_underlying_table(TABLE *table_to_find) +TABLE_LIST *TABLE_LIST::find_underlying_table(TABLE *table_to_find) { /* is this real table and table which we are looking for? */ if (table == table_to_find && merge_underlying_list == 0) @@ -2188,10 +2188,10 @@ st_table_list *st_table_list::find_underlying_table(TABLE *table_to_find) cleunup items belonged to view fields translation table SYNOPSIS - st_table_list::cleanup_items() + TABLE_LIST::cleanup_items() */ -void st_table_list::cleanup_items() +void TABLE_LIST::cleanup_items() { if (!field_translation) return; @@ -2207,7 +2207,7 @@ void st_table_list::cleanup_items() check CHECK OPTION condition SYNOPSIS - st_table_list::view_check_option() + TABLE_LIST::view_check_option() ignore_failure ignore check option fail RETURN @@ -2216,7 +2216,7 @@ void st_table_list::cleanup_items() VIEW_CHECK_SKIP FAILED, but continue */ -int st_table_list::view_check_option(THD *thd, bool ignore_failure) +int TABLE_LIST::view_check_option(THD *thd, bool ignore_failure) { if (check_option && check_option->val_int() == 0) { @@ -2241,7 +2241,7 @@ int st_table_list::view_check_option(THD *thd, bool ignore_failure) table belong to given mask SYNOPSIS - st_table_list::check_single_table() + TABLE_LIST::check_single_table() table_arg reference on variable where to store found table (should be 0 on call, to find table, or point to table for unique test) @@ -2253,9 +2253,9 @@ int st_table_list::view_check_option(THD *thd, bool ignore_failure) TRUE found several tables */ -bool st_table_list::check_single_table(st_table_list **table_arg, +bool TABLE_LIST::check_single_table(TABLE_LIST **table_arg, table_map map, - st_table_list *view_arg) + TABLE_LIST *view_arg) { for (TABLE_LIST *tbl= merge_underlying_list; tbl; tbl= tbl->next_local) { @@ -2288,7 +2288,7 @@ bool st_table_list::check_single_table(st_table_list **table_arg, TRUE - out of memory */ -bool st_table_list::set_insert_values(MEM_ROOT *mem_root) +bool TABLE_LIST::set_insert_values(MEM_ROOT *mem_root) { if (table) { @@ -2312,7 +2312,7 @@ bool st_table_list::set_insert_values(MEM_ROOT *mem_root) Test if this is a leaf with respect to name resolution. SYNOPSIS - st_table_list::is_leaf_for_name_resolution() + TABLE_LIST::is_leaf_for_name_resolution() DESCRIPTION A table reference is a leaf with respect to name resolution if @@ -2324,7 +2324,7 @@ bool st_table_list::set_insert_values(MEM_ROOT *mem_root) RETURN TRUE if a leaf, FALSE otherwise. */ -bool st_table_list::is_leaf_for_name_resolution() +bool TABLE_LIST::is_leaf_for_name_resolution() { return (view || is_natural_join || is_join_columns_complete || !nested_join); @@ -2336,7 +2336,7 @@ bool st_table_list::is_leaf_for_name_resolution() respect to name resolution. SYNOPSIS - st_table_list::first_leaf_for_name_resolution() + TABLE_LIST::first_leaf_for_name_resolution() DESCRIPTION Given that 'this' is a nested table reference, recursively walk @@ -2354,7 +2354,7 @@ bool st_table_list::is_leaf_for_name_resolution() else return 'this' */ -TABLE_LIST *st_table_list::first_leaf_for_name_resolution() +TABLE_LIST *TABLE_LIST::first_leaf_for_name_resolution() { TABLE_LIST *cur_table_ref; NESTED_JOIN *cur_nested_join; @@ -2394,7 +2394,7 @@ TABLE_LIST *st_table_list::first_leaf_for_name_resolution() respect to name resolution. SYNOPSIS - st_table_list::last_leaf_for_name_resolution() + TABLE_LIST::last_leaf_for_name_resolution() DESCRIPTION Given that 'this' is a nested table reference, recursively walk @@ -2412,7 +2412,7 @@ TABLE_LIST *st_table_list::first_leaf_for_name_resolution() - else - 'this' */ -TABLE_LIST *st_table_list::last_leaf_for_name_resolution() +TABLE_LIST *TABLE_LIST::last_leaf_for_name_resolution() { TABLE_LIST *cur_table_ref= this; NESTED_JOIN *cur_nested_join; @@ -2454,7 +2454,7 @@ TABLE_LIST *st_table_list::last_leaf_for_name_resolution() want_access Acess which we require */ -void st_table_list::register_want_access(ulong want_access) +void TABLE_LIST::register_want_access(ulong want_access) { /* Remove SHOW_VIEW_ACL, because it will be checked during making view */ want_access&= ~SHOW_VIEW_ACL; @@ -2473,7 +2473,7 @@ void st_table_list::register_want_access(ulong want_access) Load security context information for this view SYNOPSIS - st_table_list::prepare_view_securety_context() + TABLE_LIST::prepare_view_securety_context() thd [in] thread handler RETURN @@ -2482,9 +2482,9 @@ void st_table_list::register_want_access(ulong want_access) */ #ifndef NO_EMBEDDED_ACCESS_CHECKS -bool st_table_list::prepare_view_securety_context(THD *thd) +bool TABLE_LIST::prepare_view_securety_context(THD *thd) { - DBUG_ENTER("st_table_list::prepare_view_securety_context"); + DBUG_ENTER("TABLE_LIST::prepare_view_securety_context"); DBUG_PRINT("enter", ("table: %s", alias)); DBUG_ASSERT(!prelocking_placeholder && view); @@ -2533,17 +2533,17 @@ bool st_table_list::prepare_view_securety_context(THD *thd) Find security context of current view SYNOPSIS - st_table_list::find_view_security_context() + TABLE_LIST::find_view_security_context() thd [in] thread handler */ #ifndef NO_EMBEDDED_ACCESS_CHECKS -Security_context *st_table_list::find_view_security_context(THD *thd) +Security_context *TABLE_LIST::find_view_security_context(THD *thd) { Security_context *sctx; TABLE_LIST *upper_view= this; - DBUG_ENTER("st_table_list::find_view_security_context"); + DBUG_ENTER("TABLE_LIST::find_view_security_context"); DBUG_ASSERT(view); while (upper_view && !upper_view->view_suid) @@ -2572,7 +2572,7 @@ Security_context *st_table_list::find_view_security_context(THD *thd) Prepare security context and load underlying tables priveleges for view SYNOPSIS - st_table_list::prepare_security() + TABLE_LIST::prepare_security() thd [in] thread handler RETURN @@ -2580,11 +2580,11 @@ Security_context *st_table_list::find_view_security_context(THD *thd) TRUE Error */ -bool st_table_list::prepare_security(THD *thd) +bool TABLE_LIST::prepare_security(THD *thd) { List_iterator_fast tb(*view_tables); TABLE_LIST *tbl; - DBUG_ENTER("st_table_list::prepare_security"); + DBUG_ENTER("TABLE_LIST::prepare_security"); #ifndef NO_EMBEDDED_ACCESS_CHECKS Security_context *save_security_ctx= thd->security_ctx; @@ -3079,10 +3079,10 @@ Field_iterator_table_ref::get_natural_column_ref() Cleanup this table for re-execution. SYNOPSIS - st_table_list::reinit_before_use() + TABLE_LIST::reinit_before_use() */ -void st_table_list::reinit_before_use(THD *thd) +void TABLE_LIST::reinit_before_use(THD *thd) { /* Reset old pointers to TABLEs: they are not valid since the tables @@ -3109,7 +3109,7 @@ void st_table_list::reinit_before_use(THD *thd) Return subselect that contains the FROM list this table is taken from SYNOPSIS - st_table_list::containing_subselect() + TABLE_LIST::containing_subselect() RETURN Subselect item for the subquery that contains the FROM list @@ -3118,7 +3118,7 @@ void st_table_list::reinit_before_use(THD *thd) */ -Item_subselect *st_table_list::containing_subselect() +Item_subselect *TABLE_LIST::containing_subselect() { return (select_lex ? select_lex->master_unit()->item : 0); } diff --git a/sql/table.h b/sql/table.h index d4dc3e8c0b8..b29ef8c6566 100644 --- a/sql/table.h +++ b/sql/table.h @@ -237,7 +237,7 @@ struct st_table { /* Table's triggers, 0 if there are no of them */ Table_triggers_list *triggers; - struct st_table_list *pos_in_table_list;/* Element referring to this table */ + TABLE_LIST *pos_in_table_list;/* Element referring to this table */ ORDER *group; const char *alias; /* alias or table name */ uchar *null_flags; @@ -392,7 +392,7 @@ typedef struct st_field_info } ST_FIELD_INFO; -struct st_table_list; +struct TABLE_LIST; typedef class Item COND; typedef struct st_schema_table @@ -400,12 +400,12 @@ typedef struct st_schema_table const char* table_name; ST_FIELD_INFO *fields_info; /* Create information_schema table */ - TABLE *(*create_table) (THD *thd, struct st_table_list *table_list); + TABLE *(*create_table) (THD *thd, TABLE_LIST *table_list); /* Fill table with data */ - int (*fill_table) (THD *thd, struct st_table_list *tables, COND *cond); + int (*fill_table) (THD *thd, TABLE_LIST *tables, COND *cond); /* Handle fileds for old SHOW */ int (*old_format) (THD *thd, struct st_schema_table *schema_table); - int (*process_table) (THD *thd, struct st_table_list *tables, + int (*process_table) (THD *thd, TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name); int idx_field1, idx_field2; @@ -438,7 +438,7 @@ struct st_lex; class select_union; class TMP_TABLE_PARAM; -Item *create_view_field(THD *thd, st_table_list *view, Item **field_ref, +Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref, const char *name); struct Field_translator @@ -459,7 +459,7 @@ class Natural_join_column: public Sql_alloc public: Field_translator *view_field; /* Column reference of merge view. */ Field *table_field; /* Column reference of table or temp view. */ - st_table_list *table_ref; /* Original base table/view reference. */ + TABLE_LIST *table_ref; /* Original base table/view reference. */ /* True if a common join column of two NATURAL/USING join operands. Notice that when we have a hierarchy of nested NATURAL/USING joins, a column can @@ -469,8 +469,8 @@ public: */ bool is_common; public: - Natural_join_column(Field_translator *field_param, st_table_list *tab); - Natural_join_column(Field *field_param, st_table_list *tab); + Natural_join_column(Field_translator *field_param, TABLE_LIST *tab); + Natural_join_column(Field *field_param, TABLE_LIST *tab); const char *name(); Item *create_item(THD *thd); Field *field(); @@ -512,17 +512,17 @@ public: (TABLE_LIST::join_using_fields != NULL) */ -typedef struct st_table_list +struct TABLE_LIST { - st_table_list() {} /* Remove gcc warning */ + TABLE_LIST() {} /* Remove gcc warning */ /* List of tables local to a subquery (used by SQL_LIST). Considers views as leaves (unlike 'next_leaf' below). Created at parse time in st_select_lex::add_table_to_list() -> table_list.link_in_list(). */ - struct st_table_list *next_local; + TABLE_LIST *next_local; /* link in a global list of all queries tables */ - struct st_table_list *next_global, **prev_global; + TABLE_LIST *next_global, **prev_global; char *db, *alias, *table_name, *schema_table_name; char *option; /* Used by cache index */ Item *on_expr; /* Used with outer join */ @@ -542,7 +542,7 @@ typedef struct st_table_list 'this' represents a NATURAL or USING join operation. Thus after parsing 'this' is a NATURAL/USING join iff (natural_join != NULL). */ - struct st_table_list *natural_join; + TABLE_LIST *natural_join; /* True if 'this' represents a nested join that is a NATURAL JOIN. For one of the operands of 'this', the member 'natural_join' points @@ -566,7 +566,7 @@ typedef struct st_table_list base tables. All of these TABLE_LIST instances contain a materialized list of columns. The list is local to a subquery. */ - struct st_table_list *next_name_resolution_table; + TABLE_LIST *next_name_resolution_table; /* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */ List *use_index, *ignore_index; TABLE *table; /* opened table */ @@ -582,7 +582,7 @@ typedef struct st_table_list here it will be reference of first occurrence of t1 to second (as you can see this lists can't be merged) */ - st_table_list *correspondent_table; + TABLE_LIST *correspondent_table; st_select_lex_unit *derived; /* SELECT_LEX_UNIT of derived table */ ST_SCHEMA_TABLE *schema_table; /* Information_schema table */ st_select_lex *schema_select_lex; @@ -603,20 +603,20 @@ typedef struct st_table_list does not include the tables of subqueries used in the view. Is set only for merged views. */ - st_table_list *merge_underlying_list; + TABLE_LIST *merge_underlying_list; /* - 0 for base tables - in case of the view it is the list of all (not only underlying tables but also used in subquery ones) tables of the view. */ - List *view_tables; + List *view_tables; /* most upper view this table belongs to */ - st_table_list *belong_to_view; + TABLE_LIST *belong_to_view; /* The view directly referencing this table (non-zero only for merged underlying tables of a view). */ - st_table_list *referencing_view; + TABLE_LIST *referencing_view; /* Security context (non-zero only for tables which belong to view with SQL SECURITY DEFINER) @@ -633,7 +633,7 @@ typedef struct st_table_list leaves. Created in setup_tables() -> make_leaves_list(). */ bool allowed_show; - st_table_list *next_leaf; + TABLE_LIST *next_leaf; Item *where; /* VIEW WHERE clause condition */ Item *check_option; /* WITH CHECK OPTION condition */ LEX_STRING query; /* text of (CRETE/SELECT) statement */ @@ -673,8 +673,8 @@ typedef struct st_table_list table_map dep_tables; /* tables the table depends on */ table_map on_expr_dep_tables; /* tables on expression depends on */ struct st_nested_join *nested_join; /* if the element is a nested join */ - st_table_list *embedding; /* nested join containing the table */ - List *join_list;/* join list the table belongs to */ + TABLE_LIST *embedding; /* nested join containing the table */ + List *join_list;/* join list the table belongs to */ bool cacheable_table; /* stop PS caching */ /* used in multi-upd/views privilege check */ bool table_in_first_from_clause; @@ -714,15 +714,15 @@ typedef struct st_table_list !table; } void print(THD *thd, String *str); - bool check_single_table(st_table_list **table, table_map map, - st_table_list *view); + bool check_single_table(TABLE_LIST **table, table_map map, + TABLE_LIST *view); bool set_insert_values(MEM_ROOT *mem_root); void hide_view_error(THD *thd); - st_table_list *find_underlying_table(TABLE *table); - st_table_list *first_leaf_for_name_resolution(); - st_table_list *last_leaf_for_name_resolution(); + TABLE_LIST *find_underlying_table(TABLE *table); + TABLE_LIST *first_leaf_for_name_resolution(); + TABLE_LIST *last_leaf_for_name_resolution(); bool is_leaf_for_name_resolution(); - inline st_table_list *top_table() + inline TABLE_LIST *top_table() { return belong_to_view ? belong_to_view : this; } inline bool prepare_check_option(THD *thd) { @@ -759,7 +759,7 @@ private: Cleanup for re-execution in a prepared statement or a stored procedure. */ -} TABLE_LIST; +}; class Item; From a077186b7076fa61ab9a10be06cfc9fa3dbe5f34 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 6 Jul 2007 11:35:10 -0700 Subject: [PATCH 106/227] fix test for bug29299 --- mysql-test/r/fulltext2.result | 12 ------------ mysql-test/r/fulltext3.result | 13 +++++++++++++ mysql-test/t/fulltext2.test | 12 ------------ mysql-test/t/fulltext3.test | 24 ++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 mysql-test/r/fulltext3.result create mode 100644 mysql-test/t/fulltext3.test diff --git a/mysql-test/r/fulltext2.result b/mysql-test/r/fulltext2.result index f6bb4e4965a..f6a4b20bc22 100644 --- a/mysql-test/r/fulltext2.result +++ b/mysql-test/r/fulltext2.result @@ -241,15 +241,3 @@ select * from t1 where match a against('ab c' in boolean mode); a drop table t1; set names latin1; -CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); -SET NAMES utf8; -INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); -SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); -HEX(a) -BEF361616197C22061616161 -DELETE FROM t1 LIMIT 1; -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -SET NAMES latin1; -DROP TABLE t1; diff --git a/mysql-test/r/fulltext3.result b/mysql-test/r/fulltext3.result new file mode 100644 index 00000000000..019d5f472ed --- /dev/null +++ b/mysql-test/r/fulltext3.result @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); +SET NAMES utf8; +INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); +SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); +HEX(a) +BEF361616197C22061616161 +DELETE FROM t1 LIMIT 1; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SET NAMES latin1; +DROP TABLE t1; diff --git a/mysql-test/t/fulltext2.test b/mysql-test/t/fulltext2.test index 99209dc8543..fd97f795534 100644 --- a/mysql-test/t/fulltext2.test +++ b/mysql-test/t/fulltext2.test @@ -220,16 +220,4 @@ select * from t1 where match a against('ab c' in boolean mode); drop table t1; set names latin1; -# -# BUG#29299 - repeatable myisam fulltext index corruption -# -CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); -SET NAMES utf8; -INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); -SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); -DELETE FROM t1 LIMIT 1; -CHECK TABLE t1; -SET NAMES latin1; -DROP TABLE t1; - # End of 4.1 tests diff --git a/mysql-test/t/fulltext3.test b/mysql-test/t/fulltext3.test new file mode 100644 index 00000000000..a57fd48daaa --- /dev/null +++ b/mysql-test/t/fulltext3.test @@ -0,0 +1,24 @@ +--source include/have_gbk.inc +# +# test of new fulltext search features +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + + +# +# BUG#29299 - repeatable myisam fulltext index corruption +# +CREATE TABLE t1(a VARCHAR(255) CHARACTER SET gbk, FULLTEXT(a)); +SET NAMES utf8; +INSERT INTO t1 VALUES(0xF043616161),(0xBEF361616197C22061616161); +SELECT HEX(a) FROM t1 WHERE MATCH(a) AGAINST(0x97C22061616161 IN BOOLEAN MODE); +DELETE FROM t1 LIMIT 1; +CHECK TABLE t1; +SET NAMES latin1; +DROP TABLE t1; + +# End of 5.0 tests + From 87e1a302c3bbd0f956883321358da8d1dec0591e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Jul 2007 07:46:17 +0200 Subject: [PATCH 107/227] Bug #29543 GCov information not written in case of crash. For GCov builds, if the server crashes, the normal exit handler for writing coverage information is not executed due to the abnormal termination. Fix this by explicitly calling the __gcov_flush function in our crash handler. --- BUILD/compile-pentium-gcov | 5 +++-- sql/stacktrace.c | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/BUILD/compile-pentium-gcov b/BUILD/compile-pentium-gcov index 26475824570..0d561d5b147 100755 --- a/BUILD/compile-pentium-gcov +++ b/BUILD/compile-pentium-gcov @@ -13,8 +13,9 @@ export LDFLAGS="-fprofile-arcs -ftest-coverage" # The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the # code with profiling information used by gcov. -# the -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl. -extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM $debug_cflags $max_cflags -DMYSQL_SERVER_SUFFIX=-gcov" +# The -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl. +# The -DHAVE_gcov enables code to write out coverage info even when crashing. +extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM $debug_cflags $max_cflags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" extra_configs="$pentium_configs $debug_configs --disable-shared $static_link" diff --git a/sql/stacktrace.c b/sql/stacktrace.c index d8e9b7fd883..c947beafac3 100644 --- a/sql/stacktrace.c +++ b/sql/stacktrace.c @@ -241,6 +241,15 @@ void write_core(int sig) void write_core(int sig) { signal(sig, SIG_DFL); +#ifdef HAVE_gcov + /* + For GCOV build, crashing will prevent the writing of code coverage + information from this process, causing gcov output to be incomplete. + So we force the writing of coverage information here before terminating. + */ + extern void __gcov_flush(void); + __gcov_flush(); +#endif pthread_kill(pthread_self(), sig); #if defined(P_MYID) && !defined(SCO) /* On Solaris, the above kill is not enough */ From cbbd89059604636131cacb7528094050bba932aa Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Jul 2007 15:08:21 +0200 Subject: [PATCH 108/227] revert previous patch --- scripts/make_binary_distribution.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index b0a4f9ec66e..77f51c51c19 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -314,7 +314,10 @@ fi if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* copyfileto $BASE/bin scripts/* - copyfileto $BASE/scripts scripts/mysql_install_db + $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ + ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ + @HOSTNAME@ \@pkgdatadir\@ ./support-files \ + < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ \@sbindir\@ ./bin \@libexecdir\@ ./bin \ \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \ From fe00f78d809e3249e170bfce25fb4bc5030fdf71 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Jul 2007 09:28:35 -0700 Subject: [PATCH 109/227] disable federated_innodb test until bug29522 is fixed --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 827598d0585..cca73c38831 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -53,3 +53,4 @@ im_options_set : Bug#20294: Instance manager tests fail randomly im_options_unset : Bug#20294: Instance manager tests fail randomly mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild +federated_innodb : Bug#29522 failed assertion in binlog_close_connection() From 3756819e4bd548f4fd6ac8773697768435dbd129 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Jul 2007 10:33:02 -0700 Subject: [PATCH 110/227] Fixed bug #29415. The cast operation ignored the cases when the precision and/or the scale exceeded the limits, 65 and 30 respectively. No errors were reported in these cases. For some queries this may lead to an assertion abort. Fixed by throwing errors for such cases. mysql-test/r/type_newdecimal.result: Added a test case for bug #29415. mysql-test/t/type_newdecimal.test: Added a test case for bug #29415. --- mysql-test/r/type_newdecimal.result | 20 ++++++++++++++++++++ mysql-test/t/type_newdecimal.test | 23 +++++++++++++++++++++++ sql/item_create.cc | 12 ++++++++++++ 3 files changed, 55 insertions(+) diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 9e165721033..d858c3cbdd6 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1471,4 +1471,24 @@ drop table t1; SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; a b 0.9999999999999800000000000000 0.9999999999999800000000000000 +SELECT CAST(1 AS decimal(65,10)); +CAST(1 AS decimal(65,10)) +1.0000000000 +SELECT CAST(1 AS decimal(66,10)); +ERROR 42000: Too big precision 66 specified for column '1'. Maximum is 65. +SELECT CAST(1 AS decimal(65,30)); +CAST(1 AS decimal(65,30)) +1.000000000000000000000000000000 +SELECT CAST(1 AS decimal(65,31)); +ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30. +CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); +INSERT INTO t1 VALUES (3,30), (1,10), (2,10); +SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa; +aa SUM(b) +2.000000000000000000000000000000 10 +3.000000000000000000000000000000 10 +4.000000000000000000000000000000 30 +SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa; +ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30. +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index d2b808bd5e0..73142eb41c0 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1162,4 +1162,27 @@ drop table t1; # SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; + +# +# Bug #29415: CAST AS DECIMAL(P,S) with too big precision/scale +# + +SELECT CAST(1 AS decimal(65,10)); +--error ER_TOO_BIG_PRECISION +SELECT CAST(1 AS decimal(66,10)); + +SELECT CAST(1 AS decimal(65,30)); +--error ER_TOO_BIG_SCALE +SELECT CAST(1 AS decimal(65,31)); + +CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); +INSERT INTO t1 VALUES (3,30), (1,10), (2,10); +SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa; +--error ER_TOO_BIG_SCALE +SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa; + +DROP TABLE t1; + --echo End of 5.0 tests + + diff --git a/sql/item_create.cc b/sql/item_create.cc index 42cbdc8c280..50db1c37371 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -471,6 +471,18 @@ Item *create_func_cast(Item *a, Cast_target cast_type, my_error(ER_M_BIGGER_THAN_D, MYF(0), ""); return 0; } + if (len > DECIMAL_MAX_PRECISION) + { + my_error(ER_TOO_BIG_PRECISION, MYF(0), len, a->name, + DECIMAL_MAX_PRECISION); + return 0; + } + if (dec > DECIMAL_MAX_SCALE) + { + my_error(ER_TOO_BIG_SCALE, MYF(0), dec, a->name, + DECIMAL_MAX_SCALE); + return 0; + } res= new Item_decimal_typecast(a, len, dec); break; case ITEM_CAST_CHAR: From 0671e30ae6e4966d680c28b3d6dcc394f399831e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Jul 2007 12:31:55 -0700 Subject: [PATCH 111/227] Fixed bug #29417. An assertion abort could occur for some grouping queries that employed decimal user variables with assignments to them. The problem appeared the constructors of the class Field_new_decimal because the function my_decimal_length_to_precision did not guarantee returning decimal precision not greater than DECIMAL_MAX_PRECISION. mysql-test/r/type_newdecimal.result: Added a test case for bug #29417. mysql-test/t/type_newdecimal.test: Added a test case for bug #29417. sql/field.cc: Fixed bug #29417. An assertion abort could occur for some grouping queries that employed decimal user variables with assignments to them. The problem appeared the constructors of the class Field_new_decimal because the function my_decimal_length_to_precision did not guarantee returning decimal precision not greater than DECIMAL_MAX_PRECISION. Now if the precision returned by calls to my_decimal_length_to_precision in the constructors of the class Field_new_decimal is greater than DECIMAL_MAX_PRECISION the precision is set to this value. --- mysql-test/r/type_newdecimal.result | 8 ++++++++ mysql-test/t/type_newdecimal.test | 13 +++++++++++++ sql/field.cc | 2 ++ 3 files changed, 23 insertions(+) diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 9e165721033..c580568f3d4 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1471,4 +1471,12 @@ drop table t1; SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; a b 0.9999999999999800000000000000 0.9999999999999800000000000000 +CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); +INSERT INTO t1 VALUES (3,30), (1,10), (2,10); +SET @a= CAST(1 AS decimal); +SELECT 1 FROM t1 GROUP BY @b := @a, @b; +1 +1 +1 +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index d2b808bd5e0..da321cc9932 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1162,4 +1162,17 @@ drop table t1; # SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; + +# +# Bug #29417: assertion abort for a grouping query with decimal user variable +# + +CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); +INSERT INTO t1 VALUES (3,30), (1,10), (2,10); + +SET @a= CAST(1 AS decimal); +SELECT 1 FROM t1 GROUP BY @b := @a, @b; + +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/sql/field.cc b/sql/field.cc index f81b1c33fa7..2e227f0e67e 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2267,6 +2267,7 @@ Field_new_decimal::Field_new_decimal(char *ptr_arg, dec_arg, zero_arg, unsigned_arg) { precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg); + set_if_smaller(precision, DECIMAL_MAX_PRECISION); DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION) && (dec <= DECIMAL_MAX_SCALE)); bin_size= my_decimal_get_binary_size(precision, dec); @@ -2286,6 +2287,7 @@ Field_new_decimal::Field_new_decimal(uint32 len_arg, 0, unsigned_arg) { precision= my_decimal_length_to_precision(len_arg, dec_arg, unsigned_arg); + set_if_smaller(precision, DECIMAL_MAX_PRECISION); DBUG_ASSERT((precision <= DECIMAL_MAX_PRECISION) && (dec <= DECIMAL_MAX_SCALE)); bin_size= my_decimal_get_binary_size(precision, dec); From f81865470582520615afe3cc5d95cff66fd51ad8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 Jul 2007 20:03:00 -0700 Subject: [PATCH 112/227] Post-merge fix. --- mysql-test/r/type_newdecimal.result | 28 ++++++++++++++++++++++++++++ sql/item_create.cc | 12 ++++++++++++ 2 files changed, 40 insertions(+) diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index fc6955f11d2..24be10a7a29 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1481,6 +1481,34 @@ drop table t1; SELECT 1.000000000000 * 99.999999999998 / 100 a,1.000000000000 * (99.999999999998 / 100) b; a b 0.9999999999999800000000000000 0.9999999999999800000000000000 +SELECT CAST(1 AS decimal(65,10)); +CAST(1 AS decimal(65,10)) +1.0000000000 +SELECT CAST(1 AS decimal(66,10)); +ERROR 42000: Too big precision 66 specified for column '1'. Maximum is 65. +SELECT CAST(1 AS decimal(65,30)); +CAST(1 AS decimal(65,30)) +1.000000000000000000000000000000 +SELECT CAST(1 AS decimal(65,31)); +ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30. +CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); +INSERT INTO t1 VALUES (3,30), (1,10), (2,10); +SELECT a+CAST(1 AS decimal(65,30)) AS aa, SUM(b) FROM t1 GROUP BY aa; +aa SUM(b) +2.000000000000000000000000000000 10 +3.000000000000000000000000000000 10 +4.000000000000000000000000000000 30 +SELECT a+CAST(1 AS decimal(65,31)) AS aa, SUM(b) FROM t1 GROUP BY aa; +ERROR 42000: Too big scale 31 specified for column '1'. Maximum is 30. +DROP TABLE t1; +CREATE TABLE t1 (a int DEFAULT NULL, b int DEFAULT NULL); +INSERT INTO t1 VALUES (3,30), (1,10), (2,10); +SET @a= CAST(1 AS decimal); +SELECT 1 FROM t1 GROUP BY @b := @a, @b; +1 +1 +1 +DROP TABLE t1; End of 5.0 tests select cast(143.481 as decimal(4,1)); cast(143.481 as decimal(4,1)) diff --git a/sql/item_create.cc b/sql/item_create.cc index 20041b1176a..e20926c564f 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -5039,6 +5039,18 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type, my_error(ER_M_BIGGER_THAN_D, MYF(0), ""); return 0; } + if (len > DECIMAL_MAX_PRECISION) + { + my_error(ER_TOO_BIG_PRECISION, MYF(0), len, a->name, + DECIMAL_MAX_PRECISION); + return 0; + } + if (dec > DECIMAL_MAX_SCALE) + { + my_error(ER_TOO_BIG_SCALE, MYF(0), dec, a->name, + DECIMAL_MAX_SCALE); + return 0; + } res= new (thd->mem_root) Item_decimal_typecast(a, len, dec); break; } From a68a457be8f7ec13fa601e1e66be2b47f6e2aafa Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 8 Jul 2007 18:13:04 +0400 Subject: [PATCH 113/227] Bug#29310: An InnoDB table was updated when the data wasn't actually changed. When a table is being updated it has two set of fields - fields required for checks of conditions and fields to be updated. A storage engine is allowed not to retrieve columns marked for update. Due to this fact records can't be compared to see whether the data has been changed or not. This makes the server always update records independently of data change. Now when an auto-updatable timestamp field is present and server sees that a table handle isn't going to retrieve write-only fields then all of such fields are marked as to be read to force the handler to retrieve them. mysql-test/r/innodb_mysql.result: Added a test case for the bug#29310: An InnoDB table was updated when the data wasn't actually changed. mysql-test/include/mix1.inc: Added a test case for the bug#29310: An InnoDB table was updated when the data wasn't actually changed. sql/sql_update.cc: Bug#29310: An InnoDB table was updated when the data wasn't actually changed. Now the mysql_update function when an auto-updatable timestamp field is present marks write-only fields as to be read to force the table handler to retrieve them. sql/sql_insert.cc: Bug#29310: An InnoDB table was updated when the data wasn't actually changed. Now the write_record function can compare records when fileds to be written is a subset of the fields to be read while updating a record. --- mysql-test/include/mix1.inc | 24 ++++++++++++++++++++++++ mysql-test/r/innodb_mysql.result | 28 ++++++++++++++++++++++++++++ sql/sql_insert.cc | 3 ++- sql/sql_update.cc | 11 +++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index d8034e19898..03df7c33a00 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -948,5 +948,29 @@ unlock tables; select * from t1; drop tables t1; +# +# Bug#29310: An InnoDB table was updated when the data wasn't actually changed. +# +create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT + CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +insert into t1(f1) values(1); +--replace_column 1 # +select @a:=f2 from t1; +--sleep 5 +update t1 set f1=1; +--replace_column 1 # +select @b:=f2 from t1; +select if(@a=@b,"ok","wrong"); +--sleep 5 +insert into t1(f1) values (1) on duplicate key update f1="1"; +--replace_column 1 # +select @b:=f2 from t1; +select if(@a=@b,"ok","wrong"); +--sleep 5 +insert into t1(f1) select f1 from t1 on duplicate key update f1="1"; +--replace_column 1 # +select @b:=f2 from t1; +select if(@a=@b,"ok","wrong"); +drop table t1; --echo End of 5.1 tests diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index db912c650c3..93b78143de7 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -951,4 +951,32 @@ NULL 1 Two drop tables t1; +create table t1(f1 varchar(5) unique, f2 timestamp NOT NULL DEFAULT +CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP); +insert into t1(f1) values(1); +select @a:=f2 from t1; +@a:=f2 +# +update t1 set f1=1; +select @b:=f2 from t1; +@b:=f2 +# +select if(@a=@b,"ok","wrong"); +if(@a=@b,"ok","wrong") +ok +insert into t1(f1) values (1) on duplicate key update f1="1"; +select @b:=f2 from t1; +@b:=f2 +# +select if(@a=@b,"ok","wrong"); +if(@a=@b,"ok","wrong") +ok +insert into t1(f1) select f1 from t1 on duplicate key update f1="1"; +select @b:=f2 from t1; +@b:=f2 +# +select if(@a=@b,"ok","wrong"); +if(@a=@b,"ok","wrong") +ok +drop table t1; End of 5.1 tests diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index eeac5e7c4fe..7717d2c92c1 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1419,7 +1419,8 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) goto before_trg_err; table->file->restore_auto_increment(prev_insert_id); - if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) || + if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ && + !bitmap_is_subset(table->write_set, table->read_set)) || compare_record(table)) { if ((error=table->file->ha_update_row(table->record[1], diff --git a/sql/sql_update.cc b/sql/sql_update.cc index ef1f46bfdd2..6927835762b 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -231,6 +231,17 @@ int mysql_update(THD *thd, if (cond_value == Item::COND_FALSE) limit= 0; // Impossible WHERE } + + /* + If a timestamp field settable on UPDATE is present then to avoid wrong + update force the table handler to retrieve write-only fields to be able + to compare records and detect data change. + */ + if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ && + table->timestamp_field && + (table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_UPDATE || + table->timestamp_field_type == TIMESTAMP_AUTO_SET_ON_BOTH)) + bitmap_union(table->read_set, table->write_set); // Don't count on usage of 'only index' when calculating which key to use table->covering_keys.clear_all(); From bfa027e72e99c2cd27df3cf3869289ddc9bff5a3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jul 2007 01:23:33 +0400 Subject: [PATCH 114/227] Bug#29461: Sort order of the collation wasn't used when comparing characters with the space character. When the my_strnncollsp_simple function compares two strings and one is a prefix of another then this function compares characters in the rest of longer key with the space character to find whether the longer key is greater or less. But the sort order of the collation isn't used in this comparison. This may lead to a wrong comparison result, wrongly created index or wrong order of the result set of a query with the ORDER BY clause. Now the my_strnncollsp_simple function uses collation sort order to compare the characters in the rest of longer key with the space character. mysql-test/t/ctype_collate.test: Added a test case for the bug#29461: Sort order of the collation wasn't used when comparing characters with the space character. mysql-test/r/ctype_collate.result: Added a test case for the bug#29461: Sort order of the collation wasn't used when comparing characters with the space character. strings/ctype-simple.c: Bug#29461: Sort order of the collation wasn't used when comparing characters with the space character.Now the my_strnncollsp_simple function uses collation sort order to compare the characters in the rest of longer key with the space character. --- mysql-test/r/ctype_collate.result | 8 ++++++++ mysql-test/t/ctype_collate.test | 11 +++++++++++ strings/ctype-simple.c | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result index 52ee76d1948..5c9bb93103e 100644 --- a/mysql-test/r/ctype_collate.result +++ b/mysql-test/r/ctype_collate.result @@ -603,3 +603,11 @@ check table t1 extended; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a)); +insert into t1 set a=0x4c20; +insert into t1 set a=0x6c; +insert into t1 set a=0x4c98; +check table t1 extended; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test index 4bbae42559a..cfef8dfe81a 100644 --- a/mysql-test/t/ctype_collate.test +++ b/mysql-test/t/ctype_collate.test @@ -218,3 +218,14 @@ insert into t1 set f1=0x3F3F1E563F; insert into t1 set f1=0x3F3F; check table t1 extended; drop table t1; + +# +# Bug#29461: Sort order of the collation wasn't used when comparing characters +# with the space character. +# +create table t1 (a varchar(2) character set latin7 collate latin7_general_ci,key(a)); +insert into t1 set a=0x4c20; +insert into t1 set a=0x6c; +insert into t1 set a=0x4c98; +check table t1 extended; +drop table t1; diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index fca5607e152..8b1b0d6790d 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -179,7 +179,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length, } for (end= a + a_length-length; a < end ; a++) { - if (*a != ' ') + if (map[*a] != ' ') return (map[*a] < ' ') ? -swap : swap; } } From 49bc3c26689b40516b7bbdb93b5cf6b58367c3e5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jul 2007 10:39:49 +0500 Subject: [PATCH 115/227] after-merge fix. --- mysql-test/r/show_check.result | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 9ef10865cd7..3f8e48a0069 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1148,7 +1148,37 @@ DROP TABLE t1; DROP VIEW v1; DROP PROCEDURE p1; DROP FUNCTION f1; -End of 5.0 tests. +flush status; +show variables like "log_queries_not_using_indexes"; +Variable_name Value +log_queries_not_using_indexes ON +select 1 from information_schema.tables limit 1; +1 +1 +show status like 'slow_queries'; +Variable_name Value +Slow_queries 2 +set global log_queries_not_using_indexes=OFF; +show variables like "log_queries_not_using_indexes"; +Variable_name Value +log_queries_not_using_indexes OFF +select 1 from information_schema.tables limit 1; +1 +1 +show status like 'slow_queries'; +Variable_name Value +Slow_queries 2 +set global log_queries_not_using_indexes=ON; +show variables like "log_queries_not_using_indexes"; +Variable_name Value +log_queries_not_using_indexes ON +select 1 from information_schema.tables limit 1; +1 +1 +show status like 'slow_queries'; +Variable_name Value +Slow_queries 4 +End of 5.0 tests SHOW AUTHORS; create database mysqltest; show create database mysqltest; From 82ac789172d627739541284cd1f314d4fa514a3e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jul 2007 08:11:38 +0200 Subject: [PATCH 116/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB dollin' it up for Guilhem ;) -- test streamlined, better comments, faster code, add'l assert. mysql-test/r/binlog.result: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB streamlined test mysql-test/t/binlog.test: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB streamlined test sql/log.cc: Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB comment clarified --- mysql-test/r/binlog.result | 97 -------------------------------------- mysql-test/t/binlog.test | 61 ------------------------ sql/log.cc | 16 ++++--- 3 files changed, 9 insertions(+), 165 deletions(-) diff --git a/mysql-test/r/binlog.result b/mysql-test/r/binlog.result index aa5c6e88d65..0a199c87545 100644 --- a/mysql-test/r/binlog.result +++ b/mysql-test/r/binlog.result @@ -153,105 +153,8 @@ master-bin.000001 353 Query 1 441 use `test`; insert into t1 values (2) master-bin.000001 441 Query 1 529 use `test`; insert into t1 values (3) master-bin.000001 529 Xid 1 556 COMMIT /* XID */ master-bin.000001 556 Query 1 632 use `test`; drop table t1 -set autocommit= 1; -reset master; -create table t1(n int) engine=innodb; -insert into t1 values (1); -insert into t1 values (2); -insert into t1 values (3); -commit; -drop table t1; -show binlog events from 0; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 -master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=innodb -master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (1) -master-bin.000001 285 Xid 1 312 COMMIT /* XID */ -master-bin.000001 312 Query 1 400 use `test`; insert into t1 values (2) -master-bin.000001 400 Xid 1 427 COMMIT /* XID */ -master-bin.000001 427 Query 1 515 use `test`; insert into t1 values (3) -master-bin.000001 515 Xid 1 542 COMMIT /* XID */ -master-bin.000001 542 Query 1 618 use `test`; drop table t1 -reset master; -create table t1(n int) engine=myisam; -begin; -insert into t1 values (4); -insert into t1 values (5); -insert into t1 values (6); -commit; -drop table t1; -show binlog events from 0; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 -master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=myisam -master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (4) -master-bin.000001 285 Query 1 373 use `test`; insert into t1 values (5) -master-bin.000001 373 Query 1 461 use `test`; insert into t1 values (6) -master-bin.000001 461 Query 1 537 use `test`; drop table t1 -set autocommit= 1; -reset master; -create table t1(n int) engine=innodb; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 197 -insert into t1 values (1); -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 312 -insert into t1 values (2); -insert into t1 values (3); -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 542 -commit; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 542 -drop table t1; -show binlog events from 0; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 -master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=innodb -master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (1) -master-bin.000001 285 Xid 1 312 COMMIT /* XID */ -master-bin.000001 312 Query 1 400 use `test`; insert into t1 values (2) -master-bin.000001 400 Xid 1 427 COMMIT /* XID */ -master-bin.000001 427 Query 1 515 use `test`; insert into t1 values (3) -master-bin.000001 515 Xid 1 542 COMMIT /* XID */ -master-bin.000001 542 Query 1 618 use `test`; drop table t1 -set autocommit= 0; -reset master; -create table t1(n int) engine=myisam; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 197 -insert into t1 values (4); -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 285 -insert into t1 values (5); -insert into t1 values (6); -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 461 -commit; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 461 -drop table t1; -show binlog events from 0; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 -master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=myisam -master-bin.000001 197 Query 1 285 use `test`; insert into t1 values (4) -master-bin.000001 285 Query 1 373 use `test`; insert into t1 values (5) -master-bin.000001 373 Query 1 461 use `test`; insert into t1 values (6) -master-bin.000001 461 Query 1 537 use `test`; drop table t1 -set session autocommit = @ac; set @bcs = @@binlog_cache_size; -set @ac = @@autocommit; set global binlog_cache_size=4096; -set autocommit= 0; reset master; create table t1 (a int) engine=innodb; show binlog events from 0; diff --git a/mysql-test/t/binlog.test b/mysql-test/t/binlog.test index b9996a2b380..5d1399925c3 100644 --- a/mysql-test/t/binlog.test +++ b/mysql-test/t/binlog.test @@ -78,72 +78,11 @@ drop table t1; --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ show binlog events from 0; -set autocommit= 1; -reset master; -create table t1(n int) engine=innodb; -insert into t1 values (1); -insert into t1 values (2); -insert into t1 values (3); -commit; -drop table t1; ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ -show binlog events from 0; - -reset master; -create table t1(n int) engine=myisam; -begin; -insert into t1 values (4); -insert into t1 values (5); -insert into t1 values (6); -commit; -drop table t1; ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ -show binlog events from 0; - -# now show this also works for SHOW MASTER STATUS -# as this is what "mysqldump --master-data=1" uses. - -set autocommit= 1; -reset master; -create table t1(n int) engine=innodb; -show master status; -insert into t1 values (1); -show master status; -insert into t1 values (2); -insert into t1 values (3); -show master status; -commit; -show master status; -drop table t1; ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ -show binlog events from 0; - -set autocommit= 0; -reset master; -create table t1(n int) engine=myisam; -show master status; -insert into t1 values (4); -show master status; -insert into t1 values (5); -insert into t1 values (6); - -show master status; -commit; -show master status; -drop table t1; ---replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /Server ver: [^,]*,/Server version,/ -show binlog events from 0; - -set session autocommit = @ac; - # now show that nothing breaks if we need to read from the cache more # than once, resulting in split event-headers set @bcs = @@binlog_cache_size; -set @ac = @@autocommit; - set global binlog_cache_size=4096; -set autocommit= 0; reset master; create table t1 (a int) engine=innodb; diff --git a/sql/log.cc b/sql/log.cc index bcaf352f620..164dbd0d2d5 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1965,14 +1965,14 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) } /* - Adjust hdr_offs. Note that this doesn't mean it will necessarily - be valid in the next iteration; if the current event is very long, - it may take a couple of read-iterations (and subsequent fixings - of hdr_offs) for it to become valid again. - if we had a split header, hdr_offs was already fixed above. + Adjust hdr_offs. Note that it may still point beyond the segment + read in the next iteration; if the current event is very long, + it may take a couple of read-iterations (and subsequent adjustments + of hdr_offs) for it to point into the then-current segment. + If we have a split header (!carry), hdr_offs will be set at the + beginning of the next iteration, overwriting the value we set here: */ - if (carry == 0) - hdr_offs -= length; + hdr_offs -= length; } /* Write data to the binary log file */ @@ -1982,6 +1982,8 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) DBUG_EXECUTE_IF("half_binlogged_transaction", goto DBUG_skip_commit;); } while ((length=my_b_fill(cache))); + DBUG_ASSERT(carry == 0); + if (commit_event->write(&log_file)) goto err; #ifndef DBUG_OFF From ba6c552b9b1dbab71c49e5c17b25bb09fb4c048f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jul 2007 09:35:27 +0200 Subject: [PATCH 117/227] Bug #29570 - correct result files --- mysql-test/r/rpl_row_tabledefs_2myisam.result | 2 +- mysql-test/r/rpl_row_tabledefs_3innodb.result | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/rpl_row_tabledefs_2myisam.result b/mysql-test/r/rpl_row_tabledefs_2myisam.result index 4eca19ff098..e41f8be055b 100644 --- a/mysql-test/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/r/rpl_row_tabledefs_2myisam.result @@ -123,7 +123,7 @@ Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 1105 -Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef +Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Unknown error Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # diff --git a/mysql-test/r/rpl_row_tabledefs_3innodb.result b/mysql-test/r/rpl_row_tabledefs_3innodb.result index 687108e17e5..72c088d5a6b 100644 --- a/mysql-test/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/r/rpl_row_tabledefs_3innodb.result @@ -123,7 +123,7 @@ Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 1105 -Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef +Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Unknown error Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # From 407209c163564d5321e9cfab60d622c665ea51d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jul 2007 03:31:27 -0600 Subject: [PATCH 118/227] disabled.def: post-merge fix: re-enable rpl_udf test mysql-test/suite/rpl/t/disabled.def: post-merge fix: re-enable rpl_udf test --- mysql-test/suite/rpl/t/disabled.def | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 1c72d184739..fda40c30340 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -14,4 +14,3 @@ rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after C rpl_innodb_mixed_ddl : Bug #29363 rpl.rpl_innodb_mixed_* test failures rpl_innodb_mixed_dml : Bug #29363 rpl.rpl_innodb_mixed_* test failures rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case -rpl_udf : Bug#28993 rpl_udf test causes server crash and valgrind warning in pushbuild From 2ad26498cfc368cfed46323e05883ee736778ca6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jul 2007 17:41:24 +0300 Subject: [PATCH 119/227] Bug #29070: Error in spatial index 1. Threat MBR for a key as double[] and convert it only when about to store it on disk. 2. Remove the redundant function get_double(). myisam/sp_key.c: Bug #29070: 1. threat MBR for a key as double[] and convert it only when about to store it on disk. 2. remove the redundant function get_double() mysql-test/r/gis-rtree.result: Bug #29070: test case mysql-test/t/gis-rtree.test: Bug #29070: test case --- myisam/sp_key.c | 71 ++++++++++++++--------------------- mysql-test/r/gis-rtree.result | 13 +++++++ mysql-test/t/gis-rtree.test | 19 ++++++++++ 3 files changed, 61 insertions(+), 42 deletions(-) diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 34c96a219c7..e9728df4a14 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -31,11 +31,6 @@ static int sp_get_geometry_mbr(uchar *(*wkb), uchar *end, uint n_dims, double *mbr, int top); static int sp_mbr_from_wkb(uchar (*wkb), uint size, uint n_dims, double *mbr); -static void get_double(double *d, const byte *pos) -{ - float8get(*d, pos); -} - uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, const byte *record, my_off_t filepos) { @@ -62,48 +57,40 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++) { - uint length = keyseg->length; + uint length = keyseg->length, start= keyseg->start; + double val; + + DBUG_ASSERT(length == sizeof(double)); + DBUG_ASSERT(!(start % sizeof(double))); + DBUG_ASSERT(start < sizeof(mbr)); + DBUG_ASSERT(keyseg->type == HA_KEYTYPE_DOUBLE); - pos = ((byte*)mbr) + keyseg->start; + val= mbr[start / sizeof (double)]; +#ifdef HAVE_ISNAN + if (isnan(val)) + { + bzero(key, length); + key+= length; + len+= length; + continue; + } +#endif + if (keyseg->flag & HA_SWAP_KEY) { -#ifdef HAVE_ISNAN - if (keyseg->type == HA_KEYTYPE_FLOAT) - { - float nr; - float4get(nr, pos); - if (isnan(nr)) - { - /* Replace NAN with zero */ - bzero(key, length); - key+= length; - continue; - } - } - else if (keyseg->type == HA_KEYTYPE_DOUBLE) - { - double nr; - get_double(&nr, pos); - if (isnan(nr)) - { - bzero(key, length); - key+= length; - continue; - } - } -#endif - pos += length; - while (length--) - { + char buf[sizeof(double)]; + + float8store(buf, val); + pos= &buf[length]; + while (pos > buf) *key++ = *--pos; - } } else { - memcpy((byte*)key, pos, length); - key += keyseg->length; + float8store((byte *)key, val); + key += length; } - len += keyseg->length; + len+= length; } _mi_dpointer(info, key, filepos); return len; @@ -141,13 +128,13 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, { if ((*wkb) > end - 8) return -1; - get_double(&ord, (const byte*) *wkb); + float8get(ord, (const byte*) *wkb); (*wkb)+= 8; if (ord < *mbr) - float8store((char*) mbr, ord); + *mbr= ord; mbr++; if (ord > *mbr) - float8store((char*) mbr, ord); + *mbr= ord; mbr++; } return 0; diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index e4b52fc0392..8476ea9e838 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -1444,3 +1444,16 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize status OK DROP TABLE t1; +CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b)); +INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)')); +INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)')); +SELECT COUNT(*) FROM t1 WHERE +MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') ); +COUNT(*) +2 +SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE +MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') ); +COUNT(*) +2 +DROP TABLE t1; +End of 5.0 tests. diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 3368aea9741..74b12caca41 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -827,3 +827,22 @@ INSERT INTO t1 (b) SELECT b FROM t1; OPTIMIZE TABLE t1; DROP TABLE t1; + + +# +# Bug #29070: Error in spatial index +# + +CREATE TABLE t1 (a INT, b GEOMETRY NOT NULL, SPATIAL KEY b(b)); +INSERT INTO t1 VALUES (1, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)')); +INSERT INTO t1 VALUES (2, GEOMFROMTEXT('LINESTRING(1102218.456 1,2000000 2)')); + +# must return the same number as the next select +SELECT COUNT(*) FROM t1 WHERE + MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') ); +SELECT COUNT(*) FROM t1 IGNORE INDEX (b) WHERE + MBRINTERSECTS(b, GEOMFROMTEXT('LINESTRING(1 1,1102219 2)') ); + +DROP TABLE t1; + +--echo End of 5.0 tests. From 0fdcf49189b0acef2e03682310141aa9609c95ec Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jul 2007 13:18:27 -0600 Subject: [PATCH 120/227] rpl_misc_functions.result, rpl_misc_functions.test: Backport from 5.1 a fix to make this test deterministic mysql-test/r/rpl_misc_functions.result: Backport from 5.1 a fix to make this test deterministic mysql-test/t/rpl_misc_functions.test: Backport from 5.1 a fix to make this test deterministic --- mysql-test/r/rpl_misc_functions.result | 19 ++++++++++--------- mysql-test/t/rpl_misc_functions.test | 23 ++++++++++++----------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/mysql-test/r/rpl_misc_functions.result b/mysql-test/r/rpl_misc_functions.result index ca7403316b1..a8e5520ca8f 100644 --- a/mysql-test/r/rpl_misc_functions.result +++ b/mysql-test/r/rpl_misc_functions.result @@ -20,11 +20,12 @@ select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t id i r1 r2 p id i r1 r2 p drop table t1; DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (col_a double default NULL); +CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +col_a DOUBLE DEFAULT NULL); CREATE PROCEDURE test_replication_sp1() BEGIN -INSERT INTO t1 VALUES (rand()), (rand()); -INSERT INTO t1 VALUES (rand()); +INSERT INTO t1 (col_a) VALUES (rand()), (rand()); +INSERT INTO t1 (col_a) VALUES (rand()); END| CREATE PROCEDURE test_replication_sp2() BEGIN @@ -37,18 +38,18 @@ RETURN (rand() + rand()); END| CALL test_replication_sp1(); CALL test_replication_sp2(); -INSERT INTO t1 VALUES (test_replication_sf()); -INSERT INTO t1 VALUES (test_replication_sf()); -INSERT INTO t1 VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); select * from t1 into outfile "../tmp/t1_slave.txt"; create temporary table t1_slave select * from t1 where 1=0; load data infile '../tmp/t1_slave.txt' into table t1_slave; -select count(*) into @aux from t1, t1_slave -where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ; +select count(*) into @aux from t1 join t1_slave using (id) +where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ; SELECT @aux; @aux 12 +DROP TABLE t1, t1_slave; DROP PROCEDURE test_replication_sp1; DROP PROCEDURE test_replication_sp2; DROP FUNCTION test_replication_sf; -DROP TABLE t1, t1_slave; diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test index b87fff919b2..1c94471c975 100644 --- a/mysql-test/t/rpl_misc_functions.test +++ b/mysql-test/t/rpl_misc_functions.test @@ -43,15 +43,16 @@ drop table t1; DROP TABLE IF EXISTS t1; --enable_warnings -CREATE TABLE t1 (col_a double default NULL); +CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + col_a DOUBLE DEFAULT NULL); DELIMITER |; # Use a SP that calls rand() multiple times CREATE PROCEDURE test_replication_sp1() BEGIN - INSERT INTO t1 VALUES (rand()), (rand()); - INSERT INTO t1 VALUES (rand()); + INSERT INTO t1 (col_a) VALUES (rand()), (rand()); + INSERT INTO t1 (col_a) VALUES (rand()); END| # Use a SP that calls another SP to call rand() multiple times @@ -73,9 +74,9 @@ DELIMITER ;| # the master to those on the slave. CALL test_replication_sp1(); CALL test_replication_sp2(); -INSERT INTO t1 VALUES (test_replication_sf()); -INSERT INTO t1 VALUES (test_replication_sf()); -INSERT INTO t1 VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); +INSERT INTO t1 (col_a) VALUES (test_replication_sf()); --sync_slave_with_master @@ -90,24 +91,24 @@ load data infile '../tmp/t1_slave.txt' into table t1_slave; # Compare master and slave temp table, use subtraction # for floating point comparison of "double" -select count(*) into @aux from t1, t1_slave -where ABS(t1.col_a - t1_slave.col_a) < 0.0001 ; +select count(*) into @aux from t1 join t1_slave using (id) +where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ; SELECT @aux; if (`SELECT @aux <> 12 OR @aux IS NULL`) { --echo # ERROR: We expected to get count(*) = 12. - SELECT col_a FROM t1; - SELECT col_a FROM t1_slave; + SELECT id, col_a FROM t1; + SELECT id, col_a FROM t1_slave; --echo # abort exit; } # Cleanup connection master; +DROP TABLE t1, t1_slave; DROP PROCEDURE test_replication_sp1; DROP PROCEDURE test_replication_sp2; DROP FUNCTION test_replication_sf; -DROP TABLE t1, t1_slave; --sync_slave_with_master From fef75d10c41d20da016a73fee6730e35e438a245 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jul 2007 15:30:19 -0600 Subject: [PATCH 121/227] mysqld_safe.sh: Fix a few typos in comments (from Paul DuBois) scripts/mysqld_safe.sh: Fix a few typos in comments (from Paul DuBois) --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 357dd275d1f..987c714d3ff 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -14,7 +14,7 @@ KILL_MYSQLD=1; MYSQLD= niceness=0 -# Default on, unless --log-err is specified (and before options are parsed) +# Default on, unless --log-error is specified (and before options are parsed) syslog=2 user=@MYSQLD_USER@ pid_file= @@ -256,7 +256,7 @@ if [ -n "$err_log" -o $syslog -eq 0 ] then if [ -n "$err_log" ] then - # mysqld adds ".err" if there is no extension on the --log-err + # mysqld adds ".err" if there is no extension on the --log-error # argument; must match that here, or mysqld_safe will write to a # different log file than mysqld From d66bf1f78590a294e05509950df5a5d02b6a08ef Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Jul 2007 16:10:43 -0600 Subject: [PATCH 122/227] Bug #29634: mysqld_safe does not set err_log variable, error log file is not created Dont touch & chmod the err_log file if using syslog (mysqld_safe) scripts/mysqld_safe.sh: Dont touch & chmod the err_log file if using syslog --- scripts/mysqld_safe.sh | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 987c714d3ff..597bf38a518 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -289,6 +289,25 @@ then syslog=0 fi +USER_OPTION="" +if test -w / -o "$USER" = "root" +then + if test "$user" != "root" -o $SET_USER = 1 + then + USER_OPTION="--user=$user" + fi + # Change the err log to the right user, if it is in use + if [ $syslog -eq 0 ]; then + touch $err_log + chown $user $err_log + fi + if test -n "$open_files" + then + ulimit -n $open_files + append_arg_to_args "--open-files-limit=$open_files" + fi +fi + safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} # Make sure that directory for $safe_mysql_unix_port exists mysql_unix_port_dir=`dirname $safe_mysql_unix_port` @@ -387,22 +406,6 @@ else fi fi -USER_OPTION="" -if test -w / -o "$USER" = "root" -then - if test "$user" != "root" -o $SET_USER = 1 - then - USER_OPTION="--user=$user" - fi - # If we are root, change the err log to the right user. - touch $err_log; chown $user $err_log - if test -n "$open_files" - then - ulimit -n $open_files - append_arg_to_args "--open-files-limit=$open_files" - fi -fi - # Try to set the core file size (even if we aren't root) because many systems # don't specify a hard limit on core file size. if test -n "$core_file_size" From 20beacc9e188656a436facd5bd3661c9be58142f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jul 2007 09:00:15 +0200 Subject: [PATCH 123/227] Bug #29570 - correct result files --- mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result | 4 ++-- mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result index 4b0c59f97e7..1ccceb65317 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result @@ -123,7 +123,7 @@ Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 1364 -Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Unknown error +Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -141,7 +141,7 @@ Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error Last_SQL_Errno 1364 -Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef +Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (2); diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result index e94af83df3f..bec95c4370f 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result @@ -123,7 +123,7 @@ Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 1364 -Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Unknown error +Last_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -141,7 +141,7 @@ Master_SSL_Verify_Server_Cert No Last_IO_Errno 0 Last_IO_Error Last_SQL_Errno 1364 -Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef +Last_SQL_Error Error in Write_rows event: error during transaction execution on table test.t1_nodef. SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; INSERT INTO t9 VALUES (2); From 21474cd11e70511b7e82170d7f00d41f0c53e5fe Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jul 2007 10:43:12 +0300 Subject: [PATCH 124/227] Bug #29469: Client dies if a query is issued after hitting Ctrl + C The Ctrl-C handler in mysql closes the console while ReadConsole() waits for console input. But the main thread was detecting that ReadConsole() haven't read anything and was processing as if there're data in the buffer. Fixed to handle correctly this error condition. No test case added as the test relies on Ctrl-C sent to the client from its console. client/mysql.cc: Bug #29469: handle correctly console read error mysys/my_conio.c: Bug #29469: 1. handle correctly console read error 2. add boundry checks for console buffer. --- client/mysql.cc | 7 ++++++- mysys/my_conio.c | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 368fce30d67..277b56328a6 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1086,7 +1086,12 @@ static int read_and_execute(bool interactive) something else is still in console input buffer */ } while (tmpbuf.alloced_length() <= clen); - line= buffer.c_ptr(); + /* + An empty line is returned from my_cgets when there's error reading : + Ctrl-c for example + */ + if (line) + line= buffer.c_ptr(); #else /* OS2 */ buffer.length(0); /* _cgets() expects the buffer size - 3 as the first byte */ diff --git a/mysys/my_conio.c b/mysys/my_conio.c index 23b0c55e7a9..def15674f26 100644 --- a/mysys/my_conio.c +++ b/mysys/my_conio.c @@ -184,16 +184,19 @@ char* my_cgets(char *buffer, unsigned long clen, unsigned long* plen) } while (GetLastError() == ERROR_NOT_ENOUGH_MEMORY); + /* We go here on error reading the string (Ctrl-C for example) */ + if (!*plen) + result= NULL; /* purecov: inspected */ if (result != NULL) { - if (buffer[*plen - 2] == '\r') + if (*plen > 1 && buffer[*plen - 2] == '\r') { *plen= *plen - 2; } else { - if (buffer[*plen - 1] == '\r') + if (*plen > 0 && buffer[*plen - 1] == '\r') { char tmp[3]; int tmplen= sizeof(tmp); From 29ca25a675aafb46ad0decd19e7ab82ead72402b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jul 2007 13:09:07 +0500 Subject: [PATCH 125/227] Fix for bug #29652: csv.test failure: two changes conflict after merge Problem: we don't take into account the length of the data written to the temporary data file during update on a CSV table. Fix: properly calculate the data file length during update. mysql-test/r/csv.result: Fix for bug #29652: csv.test failure: two changes conflict after merge - test result adjusted. storage/csv/ha_tina.cc: Fix for bug #29652: csv.test failure: two changes conflict after merge - adjust local_saved_data_file_length in case of update as well. storage/csv/ha_tina.h: Fix for bug #29652: csv.test failure: two changes conflict after merge - adjust local_saved_data_file_length in case of update as well. --- mysql-test/r/csv.result | 2 ++ storage/csv/ha_tina.cc | 15 +++++++++++++-- storage/csv/ha_tina.h | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index 65677e75ceb..86ba5002af8 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -4945,6 +4945,8 @@ SELECT * FROM bug13894; val 6 6 +5 +11 DROP TABLE bug13894; DROP TABLE IF EXISTS bug14672; CREATE TABLE bug14672 (c1 integer) engine = CSV; diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 8b0359fdc21..07bd28f8e65 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -904,6 +904,7 @@ int ha_tina::open_update_temp_file_if_needed() 0, O_RDWR | O_TRUNC, MYF(MY_WME))) < 0) return 1; share->update_file_opened= TRUE; + temp_file_length= 0; } return 0; } @@ -928,6 +929,13 @@ int ha_tina::update_row(const uchar * old_data, uchar * new_data) size= encode_quote(new_data); + /* + During update we mark each updating record as deleted + (see the chain_append()) then write new one to the temporary data file. + At the end of the sequence in the rnd_end() we append all non-marked + records from the data file to the temporary data file then rename it. + The temp_file_length is used to calculate new data file length. + */ if (chain_append()) DBUG_RETURN(-1); @@ -937,6 +945,7 @@ int ha_tina::update_row(const uchar * old_data, uchar * new_data) if (my_write(update_temp_file, (uchar*)buffer.ptr(), size, MYF(MY_WME | MY_NABP))) DBUG_RETURN(-1); + temp_file_length+= size; /* UPDATE should never happen on the log tables */ DBUG_ASSERT(!share->is_log_table); @@ -1154,7 +1163,6 @@ int ha_tina::rnd_end() if ((chain_ptr - chain) > 0) { - off_t temp_file_length= 0; tina_set *ptr= chain; /* @@ -1244,7 +1252,10 @@ int ha_tina::rnd_end() Here we record this fact to the meta-file. */ (void)write_meta_file(share->meta_file, share->rows_recorded, FALSE); - + /* + Update local_saved_data_file_length with the real length of the + data file. + */ local_saved_data_file_length= temp_file_length; } diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 8d2c6855b84..2e43f1a2307 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -63,6 +63,7 @@ class ha_tina: public handler off_t current_position; /* Current position in the file during a file scan */ off_t next_position; /* Next position in the file scan */ off_t local_saved_data_file_length; /* save position for reads */ + off_t temp_file_length; uchar byte_buffer[IO_SIZE]; Transparent_file *file_buff; File data_file; /* File handler for readers */ From 3e99fbbb7f736c17e5d15a210f6726befba41330 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jul 2007 15:37:39 +0500 Subject: [PATCH 126/227] BUG#29445 - match ... against () never returns Part 1: Do not perform index search for a plus-word with truncation operator in case there are other plus-words in expression. Specifically this optimization was enforced for expression like "+word1 +word2*", but wasn't enforced for expression like "+word1 word2*". mysql-test/r/fulltext.result: A test case for BUG#29445. mysql-test/t/fulltext.test: A test case for BUG#29445. storage/myisam/ft_boolean_search.c: Do not perform index search for a plus-word with truncation operator in case there are other plus-words in expression. Specifically this optimization was enforced for expression like "+word1 +word2*", but wasn't enforced for expression like "+word1 word2*". --- mysql-test/r/fulltext.result | 6 ++++++ mysql-test/t/fulltext.test | 8 ++++++++ storage/myisam/ft_boolean_search.c | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index ef8cf304743..6f6760e31bc 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -480,3 +480,9 @@ CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci, FULLTEXT(a)); INSERT INTO t1 VALUES(0xA3C2); DROP TABLE t1; +CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a)); +INSERT INTO t1 VALUES('Offside'),('City Of God'); +SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE); +a +City Of God +DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 749e54d218a..4e0c65267c4 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -408,4 +408,12 @@ FULLTEXT(a)); INSERT INTO t1 VALUES(0xA3C2); DROP TABLE t1; +# +# BUG#29445 - match ... against () never returns +# +CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a)); +INSERT INTO t1 VALUES('Offside'),('City Of God'); +SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE); +DROP TABLE t1; + # End of 4.1 tests diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index f38561a76dd..ce93ba28da9 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -474,7 +474,8 @@ static void _ftb_init_index_search(FT_INFO *ftb) ftbe->up->flags|= FTB_FLAG_TRUNC, ftbe=ftbe->up) { if (ftbe->flags & FTB_FLAG_NO || /* 2 */ - ftbe->up->ythresh - ftbe->up->yweaks >1) /* 1 */ + ftbe->up->ythresh - ftbe->up->yweaks > + test(ftbe->flags & FTB_FLAG_YES)) /* 1 */ { FTB_EXPR *top_ftbe=ftbe->up; ftbw->docid[0]=HA_OFFSET_ERROR; From 32b5fb73233422429cd1ed9629c56367e4e922fa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jul 2007 05:37:43 -0600 Subject: [PATCH 127/227] Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. After applying the snapshots, ensure that code conforms to the final version of WL 3914. It is signficant that, after these changes, InnoDB does not define MYSQL_SERVER, and can be built as an independent storage engine plugin. Fixes: Bug#9709: InnoDB inconsistensy causes "Operating System Error 32/33" Bug#18828: If InnoDB runs out of undo slots, it returns misleading 'table is full' Bug#20090: InnoDB: Error: trying to declare trx to enter InnoDB Bug#20352: Make ibuf_contract_for_n_pages tunable Bug#21101: Wrong error on exceeding max row size for InnoDB table Bug#21293: Deadlock detection prefers to kill long running FOR UPDATE queries Bug#22819: SHOW INNODB STATUS crashes the server with an assertion failure under high load Bug#25078: Make the replication thread to ignore innodb_thread_concurrency Bug#25645: Assertion failure in file srv0srv.c Bug#28138: indexing column prefixes produces corruption in InnoDB BitKeeper/deleted/.del-Makefile.am~55504c43d99979e4: Delete: storage/innobase/buf/Makefile.am BitKeeper/deleted/.del-Makefile.am~79bb55303929b560: Delete: storage/innobase/dict/Makefile.am BitKeeper/deleted/.del-Makefile.am~7cd88e5f9a8d7ce8: Delete: storage/innobase/data/Makefile.am BitKeeper/deleted/.del-Makefile.am~e19a1fb29b1fe527: Delete: storage/innobase/btr/Makefile.am BitKeeper/deleted/.del-Makefile.am~4ae65b009d41d1d: Delete: storage/innobase/eval/Makefile.am BitKeeper/deleted/.del-Makefile.am~679131a02af3f6fb: Delete: storage/innobase/fsp/Makefile.am BitKeeper/deleted/.del-Makefile.am~6acac9ae30eabdb3: Delete: storage/innobase/dyn/Makefile.am BitKeeper/deleted/.del-Makefile.am~a5e6b4385717fcb7: Delete: storage/innobase/fil/Makefile.am BitKeeper/deleted/.del-Makefile.am~11d601934b49c19: Delete: storage/innobase/fut/Makefile.am BitKeeper/deleted/.del-Makefile.am~5aab37bf3b6c430: Delete: storage/innobase/ibuf/Makefile.am BitKeeper/deleted/.del-Makefile.am~af2d719bb6e66986: Delete: storage/innobase/handler/Makefile.am BitKeeper/deleted/.del-Makefile.am~f0dbbc7a78648e18: Delete: storage/innobase/ha/Makefile.am BitKeeper/deleted/.del-Makefile.am~41684e54a5b0d26a: Delete: storage/innobase/log/Makefile.am BitKeeper/deleted/.del-Makefile.am~edd95d7290ddeff3: Delete: storage/innobase/lock/Makefile.am BitKeeper/deleted/.del-Makefile.i: Delete: storage/innobase/include/Makefile.i BitKeeper/deleted/.del-Makefile.am~2a6ccdba41b591a3: Delete: storage/innobase/mach/Makefile.am BitKeeper/deleted/.del-Makefile.am~2bd35bda856342: Delete: storage/innobase/os/Makefile.am BitKeeper/deleted/.del-Makefile.am~8448688c5ab92132: Delete: storage/innobase/mem/Makefile.am BitKeeper/deleted/.del-Makefile.am~b5a7a8cfa711b6de: Delete: storage/innobase/mtr/Makefile.am BitKeeper/deleted/.del-Makefile.am~2cee8a309eb8eee2: Delete: storage/innobase/page/Makefile.am BitKeeper/deleted/.del-Makefile.am~3d0553f8aa9c456b: Delete: storage/innobase/read/Makefile.am BitKeeper/deleted/.del-Makefile.am~7b0c4abae6684f8c: Delete: storage/innobase/pars/Makefile.am BitKeeper/deleted/.del-Makefile.am~d0e0dd55cbd413f0: Delete: storage/innobase/que/Makefile.am BitKeeper/deleted/.del-Makefile.am~20a219ccf7825d65: Delete: storage/innobase/row/Makefile.am BitKeeper/deleted/.del-Makefile.am~37bdfb2973b2442b: Delete: storage/innobase/rem/Makefile.am BitKeeper/deleted/.del-Makefile.am~557098c4e5c01ee2: Delete: storage/innobase/thr/Makefile.am BitKeeper/deleted/.del-Makefile.am~fdfe12f48c2499af: Delete: storage/innobase/sync/Makefile.am BitKeeper/deleted/.del-Makefile.am~feb2280a52035d8d: Delete: storage/innobase/srv/Makefile.am BitKeeper/deleted/.del-Makefile.am~456d34c4816dbda4: Delete: storage/innobase/ut/Makefile.am BitKeeper/deleted/.del-Makefile.am~5ec2ef0d2c35e138: Delete: storage/innobase/usr/Makefile.am BitKeeper/deleted/.del-Makefile.am~d25c456e48393313: Delete: storage/innobase/trx/Makefile.am mysql-test/r/innodb.result: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1421: Fix the innodb test by shifting some of the contents of the .result file. Approved by: Marko Revision r1422: Fix for Bug#21101 - returns wrong error message when table column defs exceed the max row size. The fix returns a more appropriate error message. Add a test case to innodb.test and expected output to innodb.result. mysql-test/t/innodb.test: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1422: Fix for Bug#21101 - returns wrong error message when table column defs exceed the max row size. The fix returns a more appropriate error message. Add a test case to innodb.test and expected output to innodb.result. storage/innobase/btr/btr0btr.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1546: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug#28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. storage/innobase/data/data0data.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1490: Add #include . Apparently, this header is no longer included by the common headers. This may be related to WL#2936 (pluggable storage engines). storage/innobase/data/data0type.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1513: Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...]. This makes it possible to see which expression was false by looking at the error message. Approved by: Marko storage/innobase/dict/dict0crea.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1423: Fix for Bug#18828. Return DB_TOO_MANY_CONCURRENT_TRXS when we run out of UNDO slots in the rollback segment. This is a partial fix since the MySQL error code requested to properly report the error condition back to the client has not yet materialized. Currently we have #ifdef'd the error code translation in ha_innodb.cc. This will have to be changed as and when MySQl add the new requested code or an equivalent code that we can then use. Given the above, currently we will get the old behaviour, not the "fixed" and intended behaviour. storage/innobase/dict/dict0dict.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1490: Add #include . Apparently, this header is no longer included by the common headers. This may be related to WL#2936 (pluggable storage engines). Revision r1513: Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...]. This makes it possible to see which expression was false by looking at the error message. Approved by: Marko Revision r1528: Define an auxiliary macro UT_BITS_IN_BYTES() and use it where possible. Revision r1529: Revert r799, which was supposed to prevent similar cases as Bug#21638. In reality, the patch breaks the handling of prefix indexes of variable-length columns in ROW_FORMAT=COMPACT. Reverting the patch is only a partial fix of Bug#28138. Revision r1535: Document that DICT_MAX_INDEX_COL_LEN must not be changed. storage/innobase/fsp/fsp0fsp.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1513: Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...]. This makes it possible to see which expression was false by looking at the error message. Approved by: Marko Revision r1528: Define an auxiliary macro UT_BITS_IN_BYTES() and use it where possible. storage/innobase/ibuf/ibuf0ibuf.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1420: Output to the error log information about the limitations of UNIV_IBUF_DEBUG. innobase_start_or_create_for_mysql(): Note that crash recovery is broken when UNIV_IBUF_DEBUG is defined. ibuf_counts[]: Make this a two-dimensional array. No need to allocate anything from the heap. Eliminate ibuf_counts_inited, as the array will be zero-filled by the runtime environment. ibuf_count_check(): New function, to print out an explanation before assertion failure. Revision r1528: Define an auxiliary macro UT_BITS_IN_BYTES() and use it where possible. Revision r1546: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug#28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. storage/innobase/include/db0err.h: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1423: Fix for Bug#18828. Return DB_TOO_MANY_CONCURRENT_TRXS when we run out of UNDO slots in the rollback segment. This is a partial fix since the MySQL error code requested to properly report the error condition back to the client has not yet materialized. Currently we have #ifdef'd the error code translation in ha_innodb.cc. This will have to be changed as and when MySQl add the new requested code or an equivalent code that we can then use. Given the above, currently we will get the old behaviour, not the "fixed" and intended behaviour. storage/innobase/include/dict0dict.h: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1546: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug#28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. storage/innobase/include/dict0dict.ic: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1546: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug#28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. storage/innobase/include/dict0mem.h: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1535: Document that DICT_MAX_INDEX_COL_LEN must not be changed. Revision r1536: Change the comment to a more appropriate one. Discussed with Heikki on IM. Approved by: Heikki storage/innobase/include/ha_prototypes.h: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1482: Fix Bug#25078 by always letting the replication thread on the slave server to enter InnoDB. This can be made further customizable by the user if we introduce a new config parameter. This will wait until config parameters can be easily added. Approved by: Marko Revision r1501: Fix Bug#21293: Consider transactions that had edited non-transactional tables heavier than ones that had not. This helps killing the "right" transaction in case of a deadlock. Approved by: Heikki storage/innobase/include/os0file.h: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1431: Fix Bug#9709 by retrying (forever) if ERROR_SHARING_VIOLATION or ERROR_LOCK_VIOLATION is encountered during file operation. This is caused by backup software, so InnoDB should retry while the backup software is done with the file. Approved by: Heikki storage/innobase/include/rem0rec.ic: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1569: Fix some in:/out: comments. Approved by: Marko storage/innobase/include/row0mysql.h: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1422: Fix for Bug#21101 - returns wrong error message when table column defs exceed the max row size. The fix returns a more appropriate error message. Add a test case to innodb.test and expected output to innodb.result. storage/innobase/include/trx0trx.h: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1462: Fix typo in comment. Revision r1486: Improve the comment for trx_struct::undo_no. Suggested by: Heikki Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1497: Add the number of locks acquired by a transaction to its weight when choosing the lightest transaction to kill when a deadlock occurs. This fixes Bug#21293 partially. Approved by: Heikki Revision r1501: Fix Bug#21293: Consider transactions that had edited non-transactional tables heavier than ones that had not. This helps killing the "right" transaction in case of a deadlock. Approved by: Heikki storage/innobase/include/trx0undo.h: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1423: Fix for Bug#18828. Return DB_TOO_MANY_CONCURRENT_TRXS when we run out of UNDO slots in the rollback segment. This is a partial fix since the MySQL error code requested to properly report the error condition back to the client has not yet materialized. Currently we have #ifdef'd the error code translation in ha_innodb.cc. This will have to be changed as and when MySQl add the new requested code or an equivalent code that we can then use. Given the above, currently we will get the old behaviour, not the "fixed" and intended behaviour. storage/innobase/include/ut0ut.h: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1528: Define an auxiliary macro UT_BITS_IN_BYTES() and use it where possible. storage/innobase/lock/lock0lock.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1457: Fix Bug#22819, remove assertion. (http://bugs.mysql.com/bug.php?id=22819) Revision r1497: Add the number of locks acquired by a transaction to its weight when choosing the lightest transaction to kill when a deadlock occurs. This fixes Bug#21293 partially. Approved by: Heikki Revision r1513: Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...]. This makes it possible to see which expression was false by looking at the error message. Approved by: Marko storage/innobase/log/log0log.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1521: Forward port r1520 from branches/5.0 Patch to allow monitor threads to stop before proceeding with normal shutdown. Also have a separate time counter for tablespace monitor. reviewed by: Heikki Revision r1524: Undo bad space formatting introduced in earlier commit r1521 spotted by: Marko Revision r1533: logs_empty_and_mark_files_at_shutdown(): Remove trailing whitespace that was added in r1521. storage/innobase/os/os0file.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1431: Fix Bug#9709 by retrying (forever) if ERROR_SHARING_VIOLATION or ERROR_LOCK_VIOLATION is encountered during file operation. This is caused by backup software, so InnoDB should retry while the backup software is done with the file. Approved by: Heikki storage/innobase/rem/rem0rec.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1528: Define an auxiliary macro UT_BITS_IN_BYTES() and use it where possible. Revision r1531: rec_get_converted_size_new(): Simplify and move a debug assertion. Revision r1546: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug#28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. Revision r1555: rec_get_converted_size_new(): The total size of the infimum and supremum records in ROW_FORMAT=COMPACT is REC_N_NEW_EXTRA_BYTES + 8. The REC_N_NEW_EXTRA_BYTES was accidentally omitted in r1546. This function should never be called on those records, though. Revision r1569: Fix some in:/out: comments. Approved by: Marko storage/innobase/row/row0ins.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1485: Minor cleanup. row_ins_check_foreign_constraint(), row_ins_scan_sec_index_for_duplicate(): Make use of the predicates page_rec_is_infimum() and page_rec_is_supremum(). Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1513: Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...]. This makes it possible to see which expression was false by looking at the error message. Approved by: Marko storage/innobase/row/row0mysql.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1422: Fix for Bug#21101 - returns wrong error message when table column defs exceed the max row size. The fix returns a more appropriate error message. Add a test case to innodb.test and expected output to innodb.result. Revision r1423: Fix for Bug#18828. Return DB_TOO_MANY_CONCURRENT_TRXS when we run out of UNDO slots in the rollback segment. This is a partial fix since the MySQL error code requested to properly report the error condition back to the client has not yet materialized. Currently we have #ifdef'd the error code translation in ha_innodb.cc. This will have to be changed as and when MySQl add the new requested code or an equivalent code that we can then use. Given the above, currently we will get the old behaviour, not the "fixed" and intended behaviour. storage/innobase/row/row0row.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1513: Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...]. This makes it possible to see which expression was false by looking at the error message. Approved by: Marko Revision r1529: Revert r799, which was supposed to prevent similar cases as Bug#21638. In reality, the patch breaks the handling of prefix indexes of variable-length columns in ROW_FORMAT=COMPACT. Reverting the patch is only a partial fix of Bug#28138. storage/innobase/row/row0sel.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1452: Fix phantom reads (http://bugs.mysql.com/27197) following Heikki's patch in the bug followup. Approved by: Heikki Revision r1455: Reindent with tabs instead of spaces. Spotted by: Marko storage/innobase/srv/srv0srv.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1424: Bug#20352. Added variable srv_insert_buffer_batch_size. We want to make this variable settable. Since the pluggable engine interface currently doesn't provide a usable mechanism, we will add the latter functionality once it's available. Revision r1426: Fix code indentation from r1424. Revision r1459: Fix typo in the comment. Revision r1482: Fix Bug#25078 by always letting the replication thread on the slave server to enter InnoDB. This can be made further customizable by the user if we introduce a new config parameter. This will wait until config parameters can be easily added. Approved by: Marko Revision r1487: Fix typo in comment. Spotted by: Marko Revision r1521: Forward port r1520 from branches/5.0 Patch to allow monitor threads to stop before proceeding with normal shutdown. Also have a separate time counter for tablespace monitor. reviewed by: Heikki Revision r1532: srv_lock_timeout_and_monitor_thread(): Correct the indentation that was broken in r1521. Revision r1553: Fix Bug#20090 as suggested in the bug followup by Heikki. Approved by: Heikki storage/innobase/srv/srv0start.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1420: Output to the error log information about the limitations of UNIV_IBUF_DEBUG. innobase_start_or_create_for_mysql(): Note that crash recovery is broken when UNIV_IBUF_DEBUG is defined. ibuf_counts[]: Make this a two-dimensional array. No need to allocate anything from the heap. Eliminate ibuf_counts_inited, as the array will be zero-filled by the runtime environment. ibuf_count_check(): New function, to print out an explanation before assertion failure. storage/innobase/sync/sync0arr.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1513: Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...]. This makes it possible to see which expression was false by looking at the error message. Approved by: Marko storage/innobase/trx/trx0rec.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1423: Fix for Bug#18828. Return DB_TOO_MANY_CONCURRENT_TRXS when we run out of UNDO slots in the rollback segment. This is a partial fix since the MySQL error code requested to properly report the error condition back to the client has not yet materialized. Currently we have #ifdef'd the error code translation in ha_innodb.cc. This will have to be changed as and when MySQl add the new requested code or an equivalent code that we can then use. Given the above, currently we will get the old behaviour, not the "fixed" and intended behaviour. storage/innobase/trx/trx0trx.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1491: Fix typo in comment. Revision r1497: Add the number of locks acquired by a transaction to its weight when choosing the lightest transaction to kill when a deadlock occurs. This fixes Bug#21293 partially. Approved by: Heikki Revision r1501: Fix Bug#21293: Consider transactions that had edited non-transactional tables heavier than ones that had not. This helps killing the "right" transaction in case of a deadlock. Approved by: Heikki Revision r1522: trx0trx.c: Add missing #include "ha_prototypes.h". storage/innobase/trx/trx0undo.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1423: Fix for Bug#18828. Return DB_TOO_MANY_CONCURRENT_TRXS when we run out of UNDO slots in the rollback segment. This is a partial fix since the MySQL error code requested to properly report the error condition back to the client has not yet materialized. Currently we have #ifdef'd the error code translation in ha_innodb.cc. This will have to be changed as and when MySQl add the new requested code or an equivalent code that we can then use. Given the above, currently we will get the old behaviour, not the "fixed" and intended behaviour. storage/innobase/ut/ut0ut.c: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1490: Add #include . Apparently, this header is no longer included by the common headers. This may be related to WL#2936 (pluggable storage engines). mysql-test/r/innodb_trx_weight.result: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1498: Add a test about the behavior introduced in r1497. Revision r1501: Fix Bug#21293: Consider transactions that had edited non-transactional tables heavier than ones that had not. This helps killing the "right" transaction in case of a deadlock. Approved by: Heikki mysql-test/include/innodb_trx_weight.inc: Apply the following innodb-5.1-* snapshots: ss1489, ss1496, ss1550, ss1569. Revision r1501: Fix Bug#21293: Consider transactions that had edited non-transactional tables heavier than ones that had not. This helps killing the "right" transaction in case of a deadlock. Approved by: Heikki Revision r1556: mysql-test/innodb_trx_weight.inc: Add username root to the "connect" statement. The Unix user running mysql-test-run usually does not have any privileges on the MySQL test database. mysql-test/t/innodb_trx_weight.test: Fixes after merging InnoDB snapshots. Revision r1498: Add a test about the behavior introduced in r1497. Revision r1501: Fix Bug#21293: Consider transactions that had edited non-transactional tables heavier than ones that had not. This helps killing the "right" transaction in case of a deadlock. Approved by: Heikki sql/sql_class.cc: Fixes after merging InnoDB snapshots. storage/innobase/Makefile.am: Fixes after merging InnoDB snapshots. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. storage/innobase/handler/ha_innodb.cc: Fixes after merging InnoDB snapshots. Revision r1422: Fix for Bug#21101 - returns wrong error message when table column defs exceed the max row size. The fix returns a more appropriate error message. Add a test case to innodb.test and expected output to innodb.result. Revision r1423: Fix for Bug#18828. Return DB_TOO_MANY_CONCURRENT_TRXS when we run out of UNDO slots in the rollback segment. This is a partial fix since the MySQL error code requested to properly report the error condition back to the client has not yet materialized. Currently we have #ifdef'd the error code translation in ha_innodb.cc. This will have to be changed as and when MySQl add the new requested code or an equivalent code that we can then use. Given the above, currently we will get the old behaviour, not the "fixed" and intended behaviour. Revision r1425: Fixed a missing function decoration that slipped into r1422. Revision r1434: Fix typo. Revision r1442: Potential fix for Bug#25645: "Move innobase_release_stat_resources(trx) outside the 'if' in ha_innobase::external_lock(). That would add more safety that whatever MySQL does at a query end, there would be no risk of a hang on the btr search latch." Also call innobase_release_temporary_latches() in the beginning of ha_innobase::close(). Approved by: Heikki Revision r1453: Bugfix: only call innobase_release_temporary_latches() in case of current_thd is not NULL, otherwise we get NULL pointer dereferencing. Approved by: Heikki Revision r1474: Fix typo in comment: the exact prototype is in include/data0type.ic, not in data/data0type.ic Revision r1482: Fix Bug#25078 by always letting the replication thread on the slave server to enter InnoDB. This can be made further customizable by the user if we introduce a new config parameter. This will wait until config parameters can be easily added. Approved by: Marko Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. Revision r1489: thd_to_trx(), check_trx_exists(): Remove the handlerton parameter. It is a singleton object whose address is stored into innodb_hton_ptr. Revision r1492: Convert innobase_buffer_pool_size and innobase_log_file_size types from longlong to long long because MYSQL_SYSVAR_LONGLONG marco expects long long type. Also change ((ulint)innobase_buffer_pool_size) / 1024 to (ulint)(innobase_buffer_pool_size / 1024) and remove comment which is no longer true. Provided that innobase_buffer_pool_size is always 64bits these statements are equivalent if ulint is 64 bit (well it will screw up if innobase_buffer_pool_size is negative). And if ulint is 32 bit the later variant gives a little more chance that the value will fit. Approved by: Heikki Revision r1493: ha_innodb.cc: Remove the declarations of some global InnoDB variables whose name starts with srv_. These variables are declared in the header files that are covered by #include directives in ha_innodb.cc. Revision r1495: Introduce the function reset_template() for resetting some fields of row_prebuilt_t; currently prebuilt->read_just_key and prebuilt->keep_other_fields_on_keyread. Revision r1496: ha_innobase::extra(): Replace references to prebuilt->trx with thd_to_trx(ha_thd()), in order to avoid potential memory corruption. Revision r1501: Fix Bug#21293: Consider transactions that had edited non-transactional tables heavier than ones that had not. This helps killing the "right" transaction in case of a deadlock. Approved by: Heikki Revision r1513: Split ut_a(a && b [&& c...]); into separate ut_a(a); ut_a(b); [ut_a(c); ...]. This makes it possible to see which expression was false by looking at the error message. Approved by: Marko Revision r1527: Cleanup in ha_innodb.cc: thd_is_replication_slave_thread(), thd_has_edited_nontrans_tables(): Remove blank line between the function comment and the function definition. There should be exactly one line between the return type and the function comment, and this line should be one of '', 'static', 'UNIV_INLINE', and 'extern "C"'. Revision r1538: Do not return error in ha_innobase::info if srv_force_recovery >= 4. This is to allow for normal processing of the query by MySQL instead of generating an error. Reviewed by: Heikki Revision r1551: ha_innobase::innobase_read_and_init_auto_inc(): Remember and restore prebuilt->sql_stat_start. In an ALTER TABLE statement in the innodb_gis test, an ut_ad() assertion failed, because no IX lock had been acquired on the table, because prebuilt->sql_stat_start was inadvertently reset to FALSE, by this function. This function was called via ha_innobase::info() and mysql_prepare_alter_table(). storage/innobase/plug.in: Fixes after merging InnoDB snapshots. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. storage/innobase/handler/ha_innodb.h: Fixes after merging InnoDB snapshots. Revision r1488: Make InnoDB pluggable. That is, merge the modifications from MySQL WL#2936 and adapt some things. Note that ha_innodb.cc depends on mysql_tmpfile() being declared in . Until the function is declared there, you can uncomment the buggy definition of mysql_tmpfile in ha_innodb.cc. Remove storage/innobase/*/Makefile.am. The whole compilation is driven by storage/innobase/Makefile.am and storage/innobase/plug.in. plug.in: Declare InnoDB as a dynamic plugin. ha_innodb.h: Remove the declarations of many global variables. The variables are no longer directly referenced outside of storage/innobase. trx_t: Add the field trx->duplicates. trx_create(): Initialize the fields trx->active_trans and trx->duplicates. innobase_query_is_update(): Remove. Consult trx->duplicates instead. --- mysql-test/include/innodb_trx_weight.inc | 51 ++ mysql-test/r/innodb.result | 11 + mysql-test/r/innodb_trx_weight.result | 1 + mysql-test/t/innodb.test | 15 + mysql-test/t/innodb_trx_weight.test | 108 ++++ sql/sql_class.cc | 2 +- storage/innobase/Makefile.am | 232 ++++--- storage/innobase/btr/Makefile.am | 25 - storage/innobase/btr/btr0btr.c | 7 +- storage/innobase/buf/Makefile.am | 25 - storage/innobase/data/Makefile.am | 25 - storage/innobase/data/data0data.c | 2 + storage/innobase/data/data0type.c | 3 +- storage/innobase/dict/Makefile.am | 26 - storage/innobase/dict/dict0crea.c | 3 +- storage/innobase/dict/dict0dict.c | 19 +- storage/innobase/dyn/Makefile.am | 25 - storage/innobase/eval/Makefile.am | 25 - storage/innobase/fil/Makefile.am | 25 - storage/innobase/fsp/Makefile.am | 26 - storage/innobase/fsp/fsp0fsp.c | 11 +- storage/innobase/fut/Makefile.am | 25 - storage/innobase/ha/Makefile.am | 25 - storage/innobase/handler/Makefile.am | 28 - storage/innobase/handler/ha_innodb.cc | 785 ++++++++++++----------- storage/innobase/handler/ha_innodb.h | 63 +- storage/innobase/ibuf/Makefile.am | 25 - storage/innobase/ibuf/ibuf0ibuf.c | 86 ++- storage/innobase/include/Makefile.i | 10 - storage/innobase/include/db0err.h | 5 + storage/innobase/include/dict0dict.h | 11 + storage/innobase/include/dict0dict.ic | 24 + storage/innobase/include/dict0mem.h | 11 +- storage/innobase/include/ha_prototypes.h | 29 + storage/innobase/include/os0file.h | 3 +- storage/innobase/include/rem0rec.ic | 6 +- storage/innobase/include/row0mysql.h | 13 + storage/innobase/include/trx0trx.h | 36 +- storage/innobase/include/trx0undo.h | 13 +- storage/innobase/include/ut0ut.h | 5 + storage/innobase/lock/Makefile.am | 25 - storage/innobase/lock/lock0lock.c | 17 +- storage/innobase/log/Makefile.am | 25 - storage/innobase/log/log0log.c | 34 +- storage/innobase/mach/Makefile.am | 25 - storage/innobase/mem/Makefile.am | 27 - storage/innobase/mtr/Makefile.am | 25 - storage/innobase/os/Makefile.am | 25 - storage/innobase/os/os0file.c | 16 + storage/innobase/page/Makefile.am | 25 - storage/innobase/pars/Makefile.am | 27 - storage/innobase/plug.in | 33 +- storage/innobase/que/Makefile.am | 25 - storage/innobase/read/Makefile.am | 25 - storage/innobase/rem/Makefile.am | 25 - storage/innobase/rem/rem0rec.c | 40 +- storage/innobase/row/Makefile.am | 26 - storage/innobase/row/row0ins.c | 46 +- storage/innobase/row/row0mysql.c | 25 +- storage/innobase/row/row0row.c | 23 +- storage/innobase/row/row0sel.c | 26 + storage/innobase/srv/Makefile.am | 25 - storage/innobase/srv/srv0srv.c | 50 +- storage/innobase/srv/srv0start.c | 6 + storage/innobase/sync/Makefile.am | 25 - storage/innobase/sync/sync0arr.c | 4 +- storage/innobase/thr/Makefile.am | 25 - storage/innobase/trx/Makefile.am | 26 - storage/innobase/trx/trx0rec.c | 19 +- storage/innobase/trx/trx0trx.c | 60 +- storage/innobase/trx/trx0undo.c | 101 +-- storage/innobase/usr/Makefile.am | 25 - storage/innobase/ut/Makefile.am | 25 - storage/innobase/ut/ut0ut.c | 1 + 74 files changed, 1344 insertions(+), 1483 deletions(-) create mode 100644 mysql-test/include/innodb_trx_weight.inc create mode 100644 mysql-test/r/innodb_trx_weight.result create mode 100644 mysql-test/t/innodb_trx_weight.test delete mode 100644 storage/innobase/btr/Makefile.am delete mode 100644 storage/innobase/buf/Makefile.am delete mode 100644 storage/innobase/data/Makefile.am delete mode 100644 storage/innobase/dict/Makefile.am delete mode 100644 storage/innobase/dyn/Makefile.am delete mode 100644 storage/innobase/eval/Makefile.am delete mode 100644 storage/innobase/fil/Makefile.am delete mode 100644 storage/innobase/fsp/Makefile.am delete mode 100644 storage/innobase/fut/Makefile.am delete mode 100644 storage/innobase/ha/Makefile.am delete mode 100644 storage/innobase/handler/Makefile.am delete mode 100644 storage/innobase/ibuf/Makefile.am delete mode 100644 storage/innobase/include/Makefile.i delete mode 100644 storage/innobase/lock/Makefile.am delete mode 100644 storage/innobase/log/Makefile.am delete mode 100644 storage/innobase/mach/Makefile.am delete mode 100644 storage/innobase/mem/Makefile.am delete mode 100644 storage/innobase/mtr/Makefile.am delete mode 100644 storage/innobase/os/Makefile.am delete mode 100644 storage/innobase/page/Makefile.am delete mode 100644 storage/innobase/pars/Makefile.am delete mode 100644 storage/innobase/que/Makefile.am delete mode 100644 storage/innobase/read/Makefile.am delete mode 100644 storage/innobase/rem/Makefile.am delete mode 100644 storage/innobase/row/Makefile.am delete mode 100644 storage/innobase/srv/Makefile.am delete mode 100644 storage/innobase/sync/Makefile.am delete mode 100644 storage/innobase/thr/Makefile.am delete mode 100644 storage/innobase/trx/Makefile.am delete mode 100644 storage/innobase/usr/Makefile.am delete mode 100644 storage/innobase/ut/Makefile.am diff --git a/mysql-test/include/innodb_trx_weight.inc b/mysql-test/include/innodb_trx_weight.inc new file mode 100644 index 00000000000..56d3d47da36 --- /dev/null +++ b/mysql-test/include/innodb_trx_weight.inc @@ -0,0 +1,51 @@ +-- connect (con1,localhost,root,,) +-- connect (con2,localhost,root,,) + +-- connection con1 +SET autocommit=0; +SELECT * FROM t1 FOR UPDATE; +-- if ($con1_extra_sql_present) { + -- eval $con1_extra_sql +-- } + +-- connection con2 +SET autocommit=0; +SELECT * FROM t2 FOR UPDATE; +-- if ($con2_extra_sql_present) { + -- eval $con2_extra_sql +-- } + +-- if ($con1_should_be_rolledback) { + -- connection con1 + -- send + INSERT INTO t2 VALUES (0); + + -- connection con2 + INSERT INTO t1 VALUES (0); + ROLLBACK; + + -- connection con1 + -- error ER_LOCK_DEADLOCK + -- reap +-- } +# else +-- if (!$con1_should_be_rolledback) { + -- connection con2 + -- send + INSERT INTO t1 VALUES (0); + + -- connection con1 + INSERT INTO t2 VALUES (0); + ROLLBACK; + + -- connection con2 + -- error ER_LOCK_DEADLOCK + -- reap +-- } + +-- connection default + +DELETE FROM t5_nontrans; + +-- disconnect con1 +-- disconnect con2 diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index ad79a2a837a..9a96145ef06 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -3211,3 +3211,14 @@ t1 CREATE TABLE `t1` ( CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1 DROP TABLE t1,t2; +CREATE TABLE t1 ( +c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255), +c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255), +c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255), +c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255), +c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255), +c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255), +c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255), +c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) +) ENGINE = InnoDB; +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs diff --git a/mysql-test/r/innodb_trx_weight.result b/mysql-test/r/innodb_trx_weight.result new file mode 100644 index 00000000000..195775f74c8 --- /dev/null +++ b/mysql-test/r/innodb_trx_weight.result @@ -0,0 +1 @@ +SET storage_engine=InnoDB; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 321a1f4763a..96b2ffda7d6 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -2349,6 +2349,21 @@ SHOW CREATE TABLE t1; DROP TABLE t1,t2; +# +# Bug #21101 (Prints wrong error message if max row size is too large) +# +--error 1118 +CREATE TABLE t1 ( + c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255), + c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255), + c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255), + c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255), + c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255), + c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255), + c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255), + c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255) + ) ENGINE = InnoDB; + ####################################################################### # # # Please, DO NOT TOUCH this file as well as the innodb.result file. # diff --git a/mysql-test/t/innodb_trx_weight.test b/mysql-test/t/innodb_trx_weight.test new file mode 100644 index 00000000000..b72eaad345f --- /dev/null +++ b/mysql-test/t/innodb_trx_weight.test @@ -0,0 +1,108 @@ +# +# Ensure that the number of locks (SELECT FOR UPDATE for example) is +# added to the number of altered rows when choosing the smallest +# transaction to kill as a victim when a deadlock is detected. +# Also transactions what had edited non-transactional tables should +# be heavier than ones that had not. +# + +-- source include/have_innodb.inc + +SET storage_engine=InnoDB; + +# we do not really care about what gets printed, we are only +# interested in getting the deadlock resolved according to our +# expectations +-- disable_query_log +-- disable_result_log + +# we want to use "-- eval statement1; statement2" which does not work with +# prepared statements. Because this test should not behave differently with +# or without prepared statements we disable them so the test does not fail +# if someone runs ./mysql-test-run.pl --ps-protocol +-- disable_ps_protocol + +-- disable_warnings +DROP TABLE IF EXISTS t1, t2, t3, t4, t5_nontrans; +-- enable_warnings + +# we will create a simple deadlock with t1, t2 and two connections +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); + +# auxiliary table with a bulk of rows which will be locked by a +# transaction to increase its weight +CREATE TABLE t3 (a INT); + +# auxiliary empty table which will be inserted by a +# transaction to increase its weight +CREATE TABLE t4 (a INT); + +# auxiliary non-transactional table which will be edited by a +# transaction to tremendously increase its weight +CREATE TABLE t5_nontrans (a INT) ENGINE=MyISAM; + +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (1); +# insert a lot of rows in t3 +INSERT INTO t3 VALUES (1); +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; +INSERT INTO t3 SELECT * FROM t3; + +# test locking weight + +-- let $con1_extra_sql = +-- let $con1_extra_sql_present = 0 +-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 1 +-- source include/innodb_trx_weight.inc + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 1 +-- source include/innodb_trx_weight.inc + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1), (1), (1), (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 0 +-- source include/innodb_trx_weight.inc + +# test weight when non-transactional tables are edited + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = +-- let $con2_extra_sql_present = 0 +-- let $con1_should_be_rolledback = 0 +-- source include/innodb_trx_weight.inc + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1) +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 1 +-- source include/innodb_trx_weight.inc + +-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1) +-- let $con1_extra_sql = $con1_extra_sql; INSERT INTO t5_nontrans VALUES (1) +-- let $con1_extra_sql_present = 1 +-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1) +-- let $con2_extra_sql_present = 1 +-- let $con1_should_be_rolledback = 0 +-- source include/innodb_trx_weight.inc + +DROP TABLE t1, t2, t3, t4, t5_nontrans; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 4945b805578..a56ce6d02a4 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2570,7 +2570,7 @@ extern "C" int thd_non_transactional_update(const MYSQL_THD thd) return(thd->no_trans_update.all); } -extern "C" int thd_binlog_format(const THD *thd) +extern "C" int thd_binlog_format(const MYSQL_THD thd) { return (int) thd->variables.binlog_format; } diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am index 62c0f8e817c..0b23ae74f9e 100644 --- a/storage/innobase/Makefile.am +++ b/storage/innobase/Makefile.am @@ -25,102 +25,146 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \ -I$(top_srcdir)/sql \ -I$(srcdir) -AUTOMAKE_OPTIONS = foreign -TAR = gtar - -noinst_HEADERS = - -SUBDIRS = os ut btr buf data dict dyn eval fil fsp fut \ - ha ibuf lock log mach mem mtr page \ - handler \ - pars que read rem row srv sync thr trx usr - -EXTRA_DIST = include/btr0btr.h include/btr0btr.ic include/btr0cur.h include/btr0cur.ic \ - include/btr0pcur.h include/btr0pcur.ic include/btr0sea.h include/btr0sea.ic \ - include/btr0types.h \ - include/buf0buf.h include/buf0buf.ic include/buf0flu.h include/buf0flu.ic \ - include/buf0lru.h include/buf0lru.ic include/buf0rea.h include/buf0types.h \ - include/data0data.h include/data0data.ic include/data0type.h include/data0type.ic \ - include/data0types.h include/db0err.h \ - include/dict0boot.h include/dict0boot.ic include/dict0crea.h include/dict0crea.ic \ - include/dict0dict.h include/dict0dict.ic include/dict0load.h include/dict0load.ic \ - include/dict0mem.h include/dict0mem.ic include/dict0types.h \ - include/dyn0dyn.h include/dyn0dyn.ic \ - include/eval0eval.h include/eval0eval.ic include/eval0proc.h include/eval0proc.ic \ - include/fil0fil.h include/fsp0fsp.h include/fsp0fsp.ic \ - include/fut0fut.h include/fut0fut.ic include/fut0lst.h include/fut0lst.ic \ - include/ha0ha.h include/ha0ha.ic include/hash0hash.h include/hash0hash.ic \ - include/ibuf0ibuf.h include/ibuf0ibuf.ic include/ibuf0types.h \ - include/lock0lock.h include/lock0lock.ic include/lock0types.h \ - include/log0log.h include/log0log.ic include/log0recv.h include/log0recv.ic \ - include/mach0data.h include/mach0data.ic include/mem0dbg.h include/mem0dbg.ic \ - include/mem0mem.h include/mem0mem.ic include/mem0pool.h include/mem0pool.ic \ - include/mtr0log.h include/mtr0log.ic include/mtr0mtr.h include/mtr0mtr.ic \ - include/mtr0types.h include/os0file.h \ - include/os0proc.h include/os0proc.ic include/os0sync.h include/os0sync.ic \ - include/os0thread.h include/os0thread.ic \ - include/page0cur.h include/page0cur.ic include/page0page.h include/page0page.ic \ - include/page0types.h \ - include/pars0grm.h include/pars0opt.h include/pars0opt.ic \ - include/pars0pars.h include/pars0pars.ic include/pars0sym.h include/pars0sym.ic \ - include/pars0types.h \ - include/que0que.h include/que0que.ic include/que0types.h \ - include/read0read.h include/read0read.ic include/read0types.h \ - include/rem0cmp.h include/rem0cmp.ic include/rem0rec.h include/rem0rec.ic \ - include/rem0types.h \ - include/row0ins.h include/row0ins.ic include/row0mysql.h include/row0mysql.ic \ - include/row0purge.h include/row0purge.ic include/row0row.h include/row0row.ic \ - include/row0sel.h include/row0sel.ic include/row0types.h \ - include/row0uins.h include/row0uins.ic include/row0umod.h include/row0umod.ic \ - include/row0undo.h include/row0undo.ic include/row0upd.h include/row0upd.ic \ - include/row0vers.h include/row0vers.ic \ - include/srv0que.h include/srv0srv.h include/srv0srv.ic include/srv0start.h \ - include/sync0arr.h include/sync0arr.ic include/sync0rw.h include/sync0rw.ic \ - include/sync0sync.h include/sync0sync.ic include/sync0types.h \ - include/thr0loc.h include/thr0loc.ic \ - include/trx0purge.h include/trx0purge.ic include/trx0rec.h include/trx0rec.ic \ - include/trx0roll.h include/trx0roll.ic include/trx0rseg.h include/trx0rseg.ic \ - include/trx0sys.h include/trx0sys.ic include/trx0trx.h include/trx0trx.ic \ - include/trx0types.h include/trx0undo.h include/trx0undo.ic include/trx0xa.h \ - include/univ.i include/usr0sess.h include/usr0sess.ic include/usr0types.h \ - include/ut0byte.h include/ut0byte.ic include/ut0dbg.h include/ut0lst.h \ - include/ut0mem.h include/ut0mem.ic include/ut0rnd.h include/ut0rnd.ic \ - handler/ha_innodb.h \ - include/ut0sort.h include/ut0ut.h include/ut0ut.ic include/ut0vec.h include/ut0vec.ic include/ha_prototypes.h \ - include/ut0list.h include/ut0list.ic \ - include/ut0wqueue.h \ - pars/make_bison.sh pars/make_flex.sh \ - pars/pars0grm.y pars/pars0lex.l \ - CMakeLists.txt plug.in - -noinst_LIBRARIES = libinnobase.a -libinnobase_a_LIBADD = usr/libusr.a srv/libsrv.a dict/libdict.a \ - que/libque.a srv/libsrv.a ibuf/libibuf.a \ - row/librow.a pars/libpars.a btr/libbtr.a \ - trx/libtrx.a read/libread.a usr/libusr.a \ - buf/libbuf.a ibuf/libibuf.a eval/libeval.a \ - log/liblog.a fsp/libfsp.a fut/libfut.a \ - fil/libfil.a lock/liblock.a mtr/libmtr.a \ - page/libpage.a rem/librem.a thr/libthr.a \ - sync/libsync.a data/libdata.a mach/libmach.a \ - ha/libha.a dyn/libdyn.a mem/libmem.a \ - handler/libhandler.a \ - ut/libut.a os/libos.a ut/libut.a -libinnobase_a_SOURCES = +DEFS = @DEFS@ -libinnobase.a: $(libinnobase_a_LIBADD) - -rm -f $@ - if test "$(host_os)" = "netware" ; \ - then \ - $(libinnobase_a_AR) $@ $(libinnobase_a_LIBADD) ; \ - else \ - for arc in $(libinnobase_a_LIBADD); do \ - arpath=`echo $$arc|sed 's|[^/]*$$||'`; \ - $(AR) t $$arc|sed "s|^|$$arpath|"; \ - done | sort -u | xargs $(AR) cq $@ ; \ - $(RANLIB) $@ ; \ - fi +noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \ + include/btr0cur.h include/btr0cur.ic \ + include/btr0pcur.h include/btr0pcur.ic \ + include/btr0sea.h include/btr0sea.ic \ + include/btr0types.h include/buf0buf.h \ + include/buf0buf.ic include/buf0flu.h \ + include/buf0flu.ic include/buf0lru.h \ + include/buf0lru.ic include/buf0rea.h \ + include/buf0types.h include/data0data.h \ + include/data0data.ic include/data0type.h \ + include/data0type.ic include/data0types.h \ + include/db0err.h include/dict0boot.h \ + include/dict0boot.ic include/dict0crea.h \ + include/dict0crea.ic include/dict0dict.h \ + include/dict0dict.ic include/dict0load.h \ + include/dict0load.ic include/dict0mem.h \ + include/dict0mem.ic include/dict0types.h \ + include/dyn0dyn.h include/dyn0dyn.ic \ + include/eval0eval.h include/eval0eval.ic \ + include/eval0proc.h include/eval0proc.ic \ + include/fil0fil.h include/fsp0fsp.h \ + include/fsp0fsp.ic include/fut0fut.h \ + include/fut0fut.ic include/fut0lst.h \ + include/fut0lst.ic include/ha0ha.h \ + include/ha0ha.ic include/hash0hash.h \ + include/hash0hash.ic include/ibuf0ibuf.h \ + include/ibuf0ibuf.ic include/ibuf0types.h \ + include/lock0lock.h include/lock0lock.ic \ + include/lock0types.h include/log0log.h \ + include/log0log.ic include/log0recv.h \ + include/log0recv.ic include/mach0data.h \ + include/mach0data.ic include/mem0dbg.h \ + include/mem0dbg.ic mem/mem0dbg.c \ + include/mem0mem.h include/mem0mem.ic \ + include/mem0pool.h include/mem0pool.ic \ + include/mtr0log.h include/mtr0log.ic \ + include/mtr0mtr.h include/mtr0mtr.ic \ + include/mtr0types.h include/os0file.h \ + include/os0proc.h include/os0proc.ic \ + include/os0sync.h include/os0sync.ic \ + include/os0thread.h include/os0thread.ic \ + include/page0cur.h include/page0cur.ic \ + include/page0page.h include/page0page.ic \ + include/page0types.h include/pars0grm.h \ + include/pars0opt.h include/pars0opt.ic \ + include/pars0pars.h include/pars0pars.ic \ + include/pars0sym.h include/pars0sym.ic \ + include/pars0types.h include/que0que.h \ + include/que0que.ic include/que0types.h \ + include/read0read.h include/read0read.ic \ + include/read0types.h include/rem0cmp.h \ + include/rem0cmp.ic include/rem0rec.h \ + include/rem0rec.ic include/rem0types.h \ + include/row0ins.h include/row0ins.ic \ + include/row0mysql.h include/row0mysql.ic \ + include/row0purge.h include/row0purge.ic \ + include/row0row.h include/row0row.ic \ + include/row0sel.h include/row0sel.ic \ + include/row0types.h include/row0uins.h \ + include/row0uins.ic include/row0umod.h \ + include/row0umod.ic include/row0undo.h \ + include/row0undo.ic include/row0upd.h \ + include/row0upd.ic include/row0vers.h \ + include/row0vers.ic include/srv0que.h \ + include/srv0srv.h include/srv0srv.ic \ + include/srv0start.h include/sync0arr.h \ + include/sync0arr.ic include/sync0rw.h \ + include/sync0rw.ic include/sync0sync.h \ + include/sync0sync.ic include/sync0types.h \ + include/thr0loc.h include/thr0loc.ic \ + include/trx0purge.h include/trx0purge.ic \ + include/trx0rec.h include/trx0rec.ic \ + include/trx0roll.h include/trx0roll.ic \ + include/trx0rseg.h include/trx0rseg.ic \ + include/trx0sys.h include/trx0sys.ic \ + include/trx0trx.h include/trx0trx.ic \ + include/trx0types.h include/trx0undo.h \ + include/trx0undo.ic include/trx0xa.h \ + include/univ.i include/usr0sess.h \ + include/usr0sess.ic include/usr0types.h \ + include/ut0byte.h include/ut0byte.ic \ + include/ut0dbg.h include/ut0lst.h \ + include/ut0mem.h include/ut0mem.ic \ + include/ut0rnd.h include/ut0rnd.ic \ + include/ut0sort.h include/ut0ut.h \ + include/ut0ut.ic include/ut0vec.h \ + include/ut0vec.ic include/ut0list.h \ + include/ut0list.ic include/ut0wqueue.h \ + include/ha_prototypes.h handler/ha_innodb.h + +EXTRA_LIBRARIES = libinnobase.a +noinst_LIBRARIES = @plugin_innobase_static_target@ +libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \ + btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c \ + buf/buf0lru.c buf/buf0rea.c data/data0data.c \ + data/data0type.c dict/dict0boot.c \ + dict/dict0crea.c dict/dict0dict.c \ + dict/dict0load.c dict/dict0mem.c dyn/dyn0dyn.c \ + eval/eval0eval.c eval/eval0proc.c \ + fil/fil0fil.c fsp/fsp0fsp.c fut/fut0fut.c \ + fut/fut0lst.c ha/ha0ha.c ha/hash0hash.c \ + ibuf/ibuf0ibuf.c lock/lock0lock.c \ + log/log0log.c log/log0recv.c mach/mach0data.c \ + mem/mem0mem.c mem/mem0pool.c mtr/mtr0log.c \ + mtr/mtr0mtr.c os/os0file.c os/os0proc.c \ + os/os0sync.c os/os0thread.c page/page0cur.c \ + page/page0page.c pars/lexyy.c pars/pars0grm.c \ + pars/pars0opt.c pars/pars0pars.c \ + pars/pars0sym.c que/que0que.c read/read0read.c \ + rem/rem0cmp.c rem/rem0rec.c row/row0ins.c \ + row/row0mysql.c row/row0purge.c row/row0row.c \ + row/row0sel.c row/row0uins.c row/row0umod.c \ + row/row0undo.c row/row0upd.c row/row0vers.c \ + srv/srv0que.c srv/srv0srv.c srv/srv0start.c \ + sync/sync0arr.c sync/sync0rw.c \ + sync/sync0sync.c thr/thr0loc.c trx/trx0purge.c \ + trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c \ + trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c \ + usr/usr0sess.c ut/ut0byte.c ut/ut0dbg.c \ + ut/ut0list.c ut/ut0mem.c ut/ut0rnd.c \ + ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c \ + handler/ha_innodb.cc + +libinnobase_a_CXXFLAGS= $(AM_CFLAGS) +libinnobase_a_CFLAGS = $(AM_CFLAGS) + +EXTRA_LTLIBRARIES = ha_innodb.la +pkglib_LTLIBRARIES = @plugin_innobase_shared_target@ + +ha_innodb_la_LDFLAGS = -module -rpath $(MYSQLLIBdir) +ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +ha_innodb_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN +ha_innodb_la_SOURCES = $(libinnobase_a_SOURCES) + +EXTRA_DIST = CMakeLists.txt plug.in \ + pars/make_bison.sh pars/make_flex.sh \ + pars/pars0grm.y pars/pars0lex.l # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/storage/innobase/btr/Makefile.am b/storage/innobase/btr/Makefile.am deleted file mode 100644 index 6b09b289cdc..00000000000 --- a/storage/innobase/btr/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libbtr.a - -libbtr_a_SOURCES = btr0btr.c btr0cur.c btr0pcur.c btr0sea.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c index 50a349e78d6..6e8b43aeb8d 100644 --- a/storage/innobase/btr/btr0btr.c +++ b/storage/innobase/btr/btr0btr.c @@ -2606,8 +2606,11 @@ btr_index_rec_validate( rec_get_nth_field(rec, offsets, i, &len); - /* Note that prefix indexes are not fixed size even when - their type is CHAR. */ + /* Note that if fixed_size != 0, it equals the + length of a fixed-size column in the clustered index. + A prefix index of the column is of fixed, but different + length. When fixed_size == 0, prefix_len is the maximum + length of the prefix index column. */ if ((dict_index_get_nth_field(index, i)->prefix_len == 0 && len != UNIV_SQL_NULL && fixed_size diff --git a/storage/innobase/buf/Makefile.am b/storage/innobase/buf/Makefile.am deleted file mode 100644 index 946d5a2e5c2..00000000000 --- a/storage/innobase/buf/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libbuf.a - -libbuf_a_SOURCES = buf0buf.c buf0flu.c buf0lru.c buf0rea.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/data/Makefile.am b/storage/innobase/data/Makefile.am deleted file mode 100644 index 6f9407d40e5..00000000000 --- a/storage/innobase/data/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libdata.a - -libdata_a_SOURCES = data0data.c data0type.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/data/data0data.c b/storage/innobase/data/data0data.c index fc4494d991a..0f03de4ca9d 100644 --- a/storage/innobase/data/data0data.c +++ b/storage/innobase/data/data0data.c @@ -18,6 +18,8 @@ Created 5/30/1994 Heikki Tuuri #include "dict0dict.h" #include "btr0cur.h" +#include + #ifdef UNIV_DEBUG byte data_error; /* data pointers of tuple fields are initialized to point here for error checking */ diff --git a/storage/innobase/data/data0type.c b/storage/innobase/data/data0type.c index 77779d185cf..305000d7c0a 100644 --- a/storage/innobase/data/data0type.c +++ b/storage/innobase/data/data0type.c @@ -190,7 +190,8 @@ dtype_validate( dtype_t* type) /* in: type struct to validate */ { ut_a(type); - ut_a((type->mtype >= DATA_VARCHAR) && (type->mtype <= DATA_MYSQL)); + ut_a(type->mtype >= DATA_VARCHAR); + ut_a(type->mtype <= DATA_MYSQL); if (type->mtype == DATA_SYS) { ut_a((type->prtype & DATA_MYSQL_TYPE_MASK) < DATA_N_SYS_COLS); diff --git a/storage/innobase/dict/Makefile.am b/storage/innobase/dict/Makefile.am deleted file mode 100644 index 15cacca6f58..00000000000 --- a/storage/innobase/dict/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libdict.a - -libdict_a_SOURCES = dict0boot.c dict0crea.c dict0dict.c dict0load.c\ - dict0mem.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/dict/dict0crea.c b/storage/innobase/dict/dict0crea.c index e060d45768e..51146c3c24c 100644 --- a/storage/innobase/dict/dict0crea.c +++ b/storage/innobase/dict/dict0crea.c @@ -1195,7 +1195,8 @@ dict_create_or_check_foreign_constraint_tables(void) fprintf(stderr, "InnoDB: error %lu in creation\n", (ulong) error); - ut_a(error == DB_OUT_OF_FILE_SPACE); + ut_a(error == DB_OUT_OF_FILE_SPACE + || error == DB_TOO_MANY_CONCURRENT_TRXS); fprintf(stderr, "InnoDB: creation failed\n" diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c index f450d3553eb..e2a9535dc8b 100644 --- a/storage/innobase/dict/dict0dict.c +++ b/storage/innobase/dict/dict0dict.c @@ -30,6 +30,8 @@ Created 1/8/1996 Heikki Tuuri # include "m_ctype.h" /* my_isspace() */ #endif /* !UNIV_HOTBACKUP */ +#include + dict_sys_t* dict_sys = NULL; /* the dictionary system */ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve @@ -1529,6 +1531,12 @@ dict_index_add_col( if (field->fixed_len > DICT_MAX_INDEX_COL_LEN) { field->fixed_len = 0; } +#if DICT_MAX_INDEX_COL_LEN != 768 + /* The comparison limit above must be constant. If it were + changed, the disk format of some fixed-length columns would + change, which would be a disaster. */ +# error "DICT_MAX_INDEX_COL_LEN != 768" +#endif if (!(col->prtype & DATA_NOT_NULL)) { index->n_nullable++; @@ -1585,9 +1593,6 @@ dict_index_copy_types( ifield = dict_index_get_nth_field(index, i); dfield_type = dfield_get_type(dtuple_get_nth_field(tuple, i)); dict_col_copy_type(dict_field_get_col(ifield), dfield_type); - if (UNIV_UNLIKELY(ifield->prefix_len)) { - dfield_type->len = ifield->prefix_len; - } } } @@ -3361,7 +3366,8 @@ dict_create_foreign_constraints( ulint err; mem_heap_t* heap; - ut_a(trx && trx->mysql_thd); + ut_a(trx); + ut_a(trx->mysql_thd); str = dict_strip_comments(sql_string); heap = mem_heap_create(10000); @@ -3403,7 +3409,8 @@ dict_foreign_parse_drop_constraints( FILE* ef = dict_foreign_err_file; struct charset_info_st* cs; - ut_a(trx && trx->mysql_thd); + ut_a(trx); + ut_a(trx->mysql_thd); cs = innobase_get_charset(trx->mysql_thd); @@ -3712,7 +3719,7 @@ dict_index_calc_min_rec_len( } /* round the NULL flags up to full bytes */ - sum += (nullable + 7) / 8; + sum += UT_BITS_IN_BYTES(nullable); return(sum); } diff --git a/storage/innobase/dyn/Makefile.am b/storage/innobase/dyn/Makefile.am deleted file mode 100644 index 57d9a25e481..00000000000 --- a/storage/innobase/dyn/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libdyn.a - -libdyn_a_SOURCES = dyn0dyn.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/eval/Makefile.am b/storage/innobase/eval/Makefile.am deleted file mode 100644 index 6c2b05d8b7a..00000000000 --- a/storage/innobase/eval/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libeval.a - -libeval_a_SOURCES = eval0eval.c eval0proc.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/fil/Makefile.am b/storage/innobase/fil/Makefile.am deleted file mode 100644 index 0a85ceb5b86..00000000000 --- a/storage/innobase/fil/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libfil.a - -libfil_a_SOURCES = fil0fil.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/fsp/Makefile.am b/storage/innobase/fsp/Makefile.am deleted file mode 100644 index 7818cdafc1b..00000000000 --- a/storage/innobase/fsp/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -include ../include/Makefile.i - -noinst_LIBRARIES = libfsp.a - -libfsp_a_SOURCES = fsp0fsp.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c index b5662fd24a4..78fb55e4ef3 100644 --- a/storage/innobase/fsp/fsp0fsp.c +++ b/storage/innobase/fsp/fsp0fsp.c @@ -205,10 +205,9 @@ the extent are free and which contain old tuple version to clean. */ space */ #define XDES_FSEG 4 /* extent belongs to a segment */ -/* File extent data structure size in bytes. The "+ 7 ) / 8" part in the -definition rounds the number of bytes upward. */ +/* File extent data structure size in bytes. */ #define XDES_SIZE \ - (XDES_BITMAP + (FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE + 7) / 8) + (XDES_BITMAP + UT_BITS_IN_BYTES(FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE)) /* Offset of the descriptor array on a descriptor page */ #define XDES_ARR_OFFSET (FSP_HEADER_OFFSET + FSP_HEADER_SIZE) @@ -3649,7 +3648,11 @@ fsp_validate( n_full_frag_pages = FSP_EXTENT_SIZE * flst_get_len(header + FSP_FULL_FRAG, &mtr); - ut_a(free_limit <= size || (space != 0 && size < FSP_EXTENT_SIZE)); + if (UNIV_UNLIKELY(free_limit > size)) { + + ut_a(space != 0); + ut_a(size < FSP_EXTENT_SIZE); + } flst_validate(header + FSP_FREE, &mtr); flst_validate(header + FSP_FREE_FRAG, &mtr); diff --git a/storage/innobase/fut/Makefile.am b/storage/innobase/fut/Makefile.am deleted file mode 100644 index ffe9835a023..00000000000 --- a/storage/innobase/fut/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libfut.a - -libfut_a_SOURCES = fut0fut.c fut0lst.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/ha/Makefile.am b/storage/innobase/ha/Makefile.am deleted file mode 100644 index 696cad0b203..00000000000 --- a/storage/innobase/ha/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libha.a - -libha_a_SOURCES = ha0ha.c hash0hash.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/handler/Makefile.am b/storage/innobase/handler/Makefile.am deleted file mode 100644 index 0d34212bdd4..00000000000 --- a/storage/innobase/handler/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB -# & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -DEFS = -DMYSQL_SERVER @DEFS@ - -noinst_LIBRARIES = libhandler.a - -libhandler_a_SOURCES = ha_innodb.cc - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index c6319d977f7..b7d0c4417c3 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -15,11 +15,10 @@ /* This file defines the InnoDB handler: the interface between MySQL and InnoDB NOTE: You can only use noninlined InnoDB functions in this file, because we -have disables the InnoDB inlining in this file. */ +have disabled the InnoDB inlining in this file. */ /* TODO list for the InnoDB handler in 5.0: - - Remove the flag trx->active_trans and look at the InnoDB - trx struct state field + - Remove the flag trx->active_trans and look at trx->conc_state - fix savepoint functions to use savepoint storage area - Find out what kind of problems the OS X case-insensitivity causes to table and database names; should we 'normalize' the names like we do @@ -31,8 +30,7 @@ have disables the InnoDB inlining in this file. */ #endif #include - -#ifdef WITH_INNOBASE_STORAGE_ENGINE +#include #include #include @@ -40,15 +38,23 @@ have disables the InnoDB inlining in this file. */ #include #include #include "ha_innodb.h" +#include -pthread_mutex_t innobase_share_mutex, /* to protect innobase_open_files */ - prepare_commit_mutex; /* to force correct commit order in - binlog */ -ulong commit_threads= 0; -pthread_mutex_t commit_threads_m; -pthread_cond_t commit_cond; -pthread_mutex_t commit_cond_m; -bool innodb_inited= 0; +#ifndef MYSQL_SERVER +/* This is needed because of Bug #3596. Let us hope that pthread_mutex_t +is defined the same in both builds: the MySQL server and the InnoDB plugin. */ +extern pthread_mutex_t LOCK_thread_count; +#endif /* MYSQL_SERVER */ + +/** to protect innobase_open_files */ +static pthread_mutex_t innobase_share_mutex; +/** to force correct commit order in binlog */ +static pthread_mutex_t prepare_commit_mutex; +static ulong commit_threads = 0; +static pthread_mutex_t commit_threads_m; +static pthread_cond_t commit_cond; +static pthread_mutex_t commit_cond_m; +static bool innodb_inited = 0; /* This needs to exist until the query cache callback is removed @@ -92,55 +98,41 @@ extern "C" { #include "../storage/innobase/include/ha_prototypes.h" } - -/* The default values for the following, type long or longlong, start-up -parameters are declared in mysqld.cc: */ - -long innobase_mirrored_log_groups, innobase_log_files_in_group, +static long innobase_mirrored_log_groups, innobase_log_files_in_group, innobase_log_buffer_size, innobase_buffer_pool_awe_mem_mb, innobase_additional_mem_pool_size, innobase_file_io_threads, innobase_lock_wait_timeout, innobase_force_recovery, innobase_open_files; -long long innobase_buffer_pool_size, innobase_log_file_size; +static long long innobase_buffer_pool_size, innobase_log_file_size; /* The default values for the following char* start-up parameters are determined in innobase_init below: */ -char* innobase_data_home_dir = NULL; -char* innobase_data_file_path = NULL; -char* innobase_log_group_home_dir = NULL; -char* innobase_log_arch_dir = NULL;/* unused */ +static char* innobase_data_home_dir = NULL; +static char* innobase_data_file_path = NULL; +static char* innobase_log_group_home_dir = NULL; /* The following has a misleading name: starting from 4.0.5, this also affects Windows: */ -char* innobase_unix_file_flush_method = NULL; +static char* innobase_unix_file_flush_method = NULL; /* Below we have boolean-valued start-up parameters, and their default values */ -static -ulong innobase_fast_shutdown = 1; +static ulong innobase_fast_shutdown = 1; #ifdef UNIV_LOG_ARCHIVE -static -my_bool innobase_log_archive = FALSE;/* unused */ -#endif /* UNIG_LOG_ARCHIVE */ -static -my_bool innobase_use_doublewrite = TRUE; -static -my_bool innobase_use_checksums = TRUE; -static -my_bool innobase_file_per_table = FALSE; -static -my_bool innobase_locks_unsafe_for_binlog = FALSE; -static -my_bool innobase_rollback_on_timeout = FALSE; -static -my_bool innobase_create_status_file = FALSE; -static -my_bool innobase_stats_on_metadata = TRUE; +static my_bool innobase_log_archive = FALSE; +static char* innobase_log_arch_dir = NULL; +#endif /* UNIV_LOG_ARCHIVE */ +static my_bool innobase_use_doublewrite = TRUE; +static my_bool innobase_use_checksums = TRUE; +static my_bool innobase_file_per_table = FALSE; +static my_bool innobase_locks_unsafe_for_binlog = FALSE; +static my_bool innobase_rollback_on_timeout = FALSE; +static my_bool innobase_create_status_file = FALSE; +static my_bool innobase_stats_on_metadata = TRUE; -static -char* internal_innobase_data_file_path = NULL; +static char* internal_innobase_data_file_path = NULL; /* The following counter is used to convey information to InnoDB about server activity: in selects it is not sensible to call @@ -426,6 +418,22 @@ static SHOW_VAR innodb_status_variables[]= { /* General functions */ +/********************************************************************** +Returns true if the thread is the replication thread on the slave +server. Used in srv_conc_enter_innodb() to determine if the thread +should be allowed to enter InnoDB - the replication thread is treated +differently than other threads. Also used in +srv_conc_force_exit_innodb(). */ +extern "C" +ibool +thd_is_replication_slave_thread( +/*============================*/ + /* out: true if thd is the replication thread */ + void* thd) /* in: thread handle (THD*) */ +{ + return((ibool) thd_slave_thread((THD*) thd)); +} + /********************************************************************** Save some CPU by testing the value of srv_thread_concurrency in inline functions. */ @@ -482,14 +490,30 @@ innobase_release_stat_resources( } } +/********************************************************************** +Returns true if the transaction this thread is processing has edited +non-transactional tables. Used by the deadlock detector when deciding +which transaction to rollback in case of a deadlock - we try to avoid +rolling back transactions that have edited non-transactional tables. */ +extern "C" +ibool +thd_has_edited_nontrans_tables( +/*===========================*/ + /* out: true if non-transactional tables have + been edited */ + void* thd) /* in: thread handle (THD*) */ +{ + return((ibool) thd_non_transactional_update((THD*) thd)); +} + /************************************************************************ Obtain the InnoDB transaction of a MySQL thread. */ inline trx_t*& thd_to_trx( /*=======*/ - /* out: reference to transaction pointer */ - THD* thd) /* in: MySQL thread */ + /* out: reference to transaction pointer */ + THD* thd) /* in: MySQL thread */ { return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr)); } @@ -502,11 +526,14 @@ static int innobase_release_temporary_latches( /*===============================*/ - handlerton *hton, - THD *thd) + /* out: 0 */ + handlerton* hton, /* in: handlerton */ + THD* thd) /* in: MySQL thread */ { trx_t* trx; + DBUG_ASSERT(hton == innodb_hton_ptr); + if (!innodb_inited) { return 0; @@ -645,6 +672,20 @@ convert_error_code_to_mysql( } return(HA_ERR_LOCK_TABLE_FULL); + } else if (error == DB_TOO_MANY_CONCURRENT_TRXS) { + + /* Once MySQL add the appropriate code to errmsg.txt then + we can get rid of this #ifdef. NOTE: The code checked by + the #ifdef is the suggested name for the error condition + and the actual error code name could very well be different. + This will require some monitoring, ie. the status + of this request on our part.*/ +#ifdef ER_TOO_MANY_CONCURRENT_TRXS + return(ER_TOO_MANY_CONCURRENT_TRXS); +#else + return(HA_ERR_RECORD_FILE_FULL); +#endif + } else { return(-1); // Unknown error } @@ -693,19 +734,19 @@ innobase_mysql_print_thd( use the default max length */ { THD* thd; - char buffer[1024]; + char buffer[1024]; - thd = (THD*) input_thd; - fputs(thd_security_context(thd, buffer, sizeof(buffer), + thd = (THD*) input_thd; + fputs(thd_security_context(thd, buffer, sizeof(buffer), max_query_len), f); - putc('\n', f); + putc('\n', f); } /********************************************************************** Get the variable length bounds of the given character set. NOTE that the exact prototype of this function has to be in -/innobase/data/data0type.ic! */ +/innobase/include/data0type.ic! */ extern "C" void innobase_get_cset_width( @@ -744,7 +785,7 @@ innobase_convert_from_table_id( { uint errors; - strconvert(current_thd->charset(), from, + strconvert(thd_charset(current_thd), from, &my_charset_filename, to, (uint) len, &errors); } @@ -763,7 +804,7 @@ innobase_convert_from_id( { uint errors; - strconvert(current_thd->charset(), from, + strconvert(thd_charset(current_thd), from, system_charset_info, to, (uint) len, &errors); } @@ -826,7 +867,7 @@ innobase_get_charset( /* out: connection character set */ void* mysql_thd) /* in: MySQL thread handle */ { - return(((THD*) mysql_thd)->charset()); + return(thd_charset((THD*) mysql_thd)); } /************************************************************************* @@ -837,22 +878,9 @@ innobase_mysql_tmpfile(void) /*========================*/ /* out: temporary file descriptor, or < 0 on error */ { - char filename[FN_REFLEN]; int fd2 = -1; - File fd = create_temp_file(filename, mysql_tmpdir, "ib", -#ifdef __WIN__ - O_BINARY | O_TRUNC | O_SEQUENTIAL | - O_TEMPORARY | O_SHORT_LIVED | -#endif /* __WIN__ */ - O_CREAT | O_EXCL | O_RDWR, - MYF(MY_WME)); + File fd = mysql_tmpfile("ib"); if (fd >= 0) { -#ifndef __WIN__ - /* On Windows, open files cannot be removed, but files can be - created with the O_TEMPORARY flag to the same effect - ("delete on close"). */ - unlink(filename); -#endif /* !__WIN__ */ /* Copy the file descriptor, so that the additional resources allocated by create_temp_file() can be freed by invoking my_close(). @@ -867,7 +895,7 @@ innobase_mysql_tmpfile(void) my_errno=errno; my_error(EE_OUT_OF_FILERESOURCES, MYF(ME_BELL+ME_WAITTANG), - filename, my_errno); + "ib*", my_errno); } my_close(fd, MYF(MY_WME)); } @@ -903,7 +931,6 @@ trx_t* check_trx_exists( /*=============*/ /* out: InnoDB transaction handle */ - handlerton* hton, /* in: handlerton for innodb */ THD* thd) /* in: user thread handle */ { trx_t*& trx = thd_to_trx(thd); @@ -915,8 +942,7 @@ check_trx_exists( trx = trx_allocate_for_mysql(); trx->mysql_thd = thd; - trx->mysql_query_str = &(thd->query); - trx->active_trans = 0; + trx->mysql_query_str = thd_query(thd); /* Update the info whether we should skip XA steps that eat CPU time */ @@ -927,7 +953,7 @@ check_trx_exists( if (trx->magic_n != TRX_MAGIC_N) { mem_analyze_corruption(trx); - ut_a(0); + ut_error; } } @@ -958,7 +984,7 @@ ha_innobase::ha_innobase(handlerton *hton, TABLE_SHARE *table_arg) HA_CAN_SQL_HANDLER | HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | HA_PRIMARY_KEY_IN_READ_INDEX | - HA_BINLOG_ROW_CAPABLE | + HA_BINLOG_ROW_CAPABLE | HA_CAN_GEOMETRY | HA_PARTIAL_COLUMN_READ | HA_TABLE_SCAN_ON_INDEX), start_of_scan(0), @@ -978,7 +1004,7 @@ ha_innobase::update_thd( { trx_t* trx; - trx = check_trx_exists(ht, thd); + trx = check_trx_exists(thd); if (prebuilt->trx != trx) { @@ -1117,7 +1143,7 @@ innobase_query_caching_of_table_permitted( ut_a(full_name_len < 999); - trx = check_trx_exists(innodb_hton_ptr, thd); + trx = check_trx_exists(thd); if (trx->isolation_level == TRX_ISO_SERIALIZABLE) { /* In the SERIALIZABLE mode we add LOCK IN SHARE MODE to every @@ -1222,10 +1248,10 @@ innobase_invalidate_query_cache( /* Argument TRUE below means we are using transactions */ #ifdef HAVE_QUERY_CACHE - query_cache.invalidate((THD*)(trx->mysql_thd), - (const char*)full_name, - (uint32)full_name_len, - TRUE); + mysql_query_cache_invalidate4((THD*) trx->mysql_thd, + (const char*) full_name, + (uint32) full_name_len, + TRUE); #endif } @@ -1305,7 +1331,20 @@ trx_is_interrupted( /* out: TRUE if interrupted */ trx_t* trx) /* in: transaction */ { - return(trx && trx->mysql_thd && ((THD*) trx->mysql_thd)->killed); + return(trx && trx->mysql_thd && thd_killed((THD*) trx->mysql_thd)); +} + +/****************************************************************** +Resets some fields of a prebuilt struct. The template is used in fast +retrieval of just those column values MySQL needs in its processing. */ +static +void +reset_template( +/*===========*/ + row_prebuilt_t* prebuilt) /* in/out: prebuilt struct */ +{ + prebuilt->keep_other_fields_on_keyread = 0; + prebuilt->read_just_key = 0; } /********************************************************************* @@ -1343,7 +1382,7 @@ ha_innobase::init_table_handle_for_HANDLER(void) if (prebuilt->trx->active_trans == 0) { - innobase_register_trx_and_stmt(ht, ha_thd()); + innobase_register_trx_and_stmt(ht, user_thd); prebuilt->trx->active_trans = 1; } @@ -1366,19 +1405,18 @@ ha_innobase::init_table_handle_for_HANDLER(void) /* We want always to fetch all columns in the whole row? Or do we???? */ - prebuilt->read_just_key = FALSE; - prebuilt->used_in_HANDLER = TRUE; - - prebuilt->keep_other_fields_on_keyread = FALSE; + reset_template(prebuilt); } /************************************************************************* Opens an InnoDB database. */ static int -innobase_init(void *p) -/*===============*/ +innobase_init( +/*==========*/ + /* out: 0 on success, error code on failure */ + void *p) /* in: InnoDB handlerton */ { static char current_dir[3]; /* Set if using current lib */ int err; @@ -1387,9 +1425,9 @@ innobase_init(void *p) DBUG_ENTER("innobase_init"); handlerton *innobase_hton= (handlerton *)p; - innodb_hton_ptr= innobase_hton; + innodb_hton_ptr = innobase_hton; - innobase_hton->state= SHOW_OPTION_YES; + innobase_hton->state = SHOW_OPTION_YES; innobase_hton->db_type= DB_TYPE_INNODB; innobase_hton->savepoint_offset=sizeof(trx_named_savept_t); innobase_hton->close_connection=innobase_close_connection; @@ -1569,10 +1607,7 @@ innobase_init(void *p) changes the value so that it becomes the number of database pages. */ if (innobase_buffer_pool_awe_mem_mb == 0) { - /* Careful here: we first convert the signed long int to ulint - and only after that divide */ - - srv_pool_size = ((ulint) innobase_buffer_pool_size) / 1024; + srv_pool_size = (ulint)(innobase_buffer_pool_size / 1024); } else { srv_use_awe = TRUE; srv_pool_size = (ulint) @@ -1751,7 +1786,7 @@ innobase_start_trx_and_assign_read_view( /* Create a new trx struct for thd, if it does not yet have one */ - trx = check_trx_exists(hton, thd); + trx = check_trx_exists(thd); /* This is just to play safe: release a possible FIFO ticket and search latch. Since we will reserve the kernel mutex, we have to @@ -1796,7 +1831,7 @@ innobase_commit( DBUG_ENTER("innobase_commit"); DBUG_PRINT("trans", ("ending transaction")); - trx = check_trx_exists(hton, thd); + trx = check_trx_exists(thd); /* Update the info whether we should skip XA steps that eat CPU time */ trx->support_xa = THDVAR(thd, support_xa); @@ -1855,9 +1890,8 @@ retry: } } - trx->mysql_log_file_name = mysql_bin_log.get_log_fname(); - trx->mysql_log_offset = - (ib_longlong)mysql_bin_log.get_log_file()->pos_in_file; + trx->mysql_log_file_name = mysql_bin_log_file_name(); + trx->mysql_log_offset = (ib_longlong) mysql_bin_log_file_pos(); innobase_commit_low(trx); @@ -1987,7 +2021,6 @@ int innobase_commit_complete( /*=====================*/ /* out: 0 */ - handlerton *hton, /* in: Innodb handlerton */ THD* thd) /* in: user thread */ { trx_t* trx; @@ -2012,8 +2045,8 @@ innobase_commit_complete( /********************************************************************* Rolls back a transaction or the latest SQL statement. */ - -static int +static +int innobase_rollback( /*==============*/ /* out: 0 or error number */ @@ -2029,7 +2062,7 @@ innobase_rollback( DBUG_ENTER("innobase_rollback"); DBUG_PRINT("trans", ("aborting transaction")); - trx = check_trx_exists(hton, thd); + trx = check_trx_exists(thd); /* Update the info whether we should skip XA steps that eat CPU time */ trx->support_xa = THDVAR(thd, support_xa); @@ -2095,8 +2128,8 @@ innobase_rollback_trx( /********************************************************************* Rolls back a transaction to a savepoint. */ - -static int +static +int innobase_rollback_to_savepoint( /*===========================*/ /* out: 0 if success, HA_ERR_NO_SAVEPOINT if @@ -2113,7 +2146,7 @@ innobase_rollback_to_savepoint( DBUG_ENTER("innobase_rollback_to_savepoint"); - trx = check_trx_exists(hton, thd); + trx = check_trx_exists(thd); /* Release a possible FIFO ticket and search latch. Since we will reserve the kernel mutex, we have to release the search system latch @@ -2149,7 +2182,7 @@ innobase_release_savepoint( DBUG_ENTER("innobase_release_savepoint"); - trx = check_trx_exists(hton, thd); + trx = check_trx_exists(thd); /* TODO: use provided savepoint data area to store savepoint data */ @@ -2181,10 +2214,12 @@ innobase_savepoint( (unless we are in sub-statement), so SQL layer ensures that this method is never called in such situation. */ +#ifdef MYSQL_SERVER /* plugins cannot access thd->in_sub_stmt */ DBUG_ASSERT(thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) || thd->in_sub_stmt); +#endif /* MYSQL_SERVER */ - trx = check_trx_exists(hton, thd); + trx = check_trx_exists(thd); /* Release a possible FIFO ticket and search latch. Since we will reserve the kernel mutex, we have to release the search system latch @@ -2217,6 +2252,8 @@ innobase_close_connection( { trx_t* trx; + DBUG_ENTER("innobase_close_connection"); + DBUG_ASSERT(hton == innodb_hton_ptr); trx = thd_to_trx(thd); ut_a(trx); @@ -2243,7 +2280,7 @@ innobase_close_connection( thr_local_free(trx->mysql_thread_id); trx_free_for_mysql(trx); - return(0); + DBUG_RETURN(0); } @@ -2523,8 +2560,15 @@ ha_innobase::close(void) /*====================*/ /* out: 0 */ { + THD* thd; + DBUG_ENTER("ha_innobase::close"); + thd = current_thd; // avoid calling current_thd twice, it may be slow + if (thd != NULL) { + innobase_release_temporary_latches(ht, thd); + } + row_prebuilt_free(prebuilt); my_free(upd_buff, MYF(0)); @@ -3099,7 +3143,7 @@ static void build_template( /*===========*/ - row_prebuilt_t* prebuilt, /* in: prebuilt struct */ + row_prebuilt_t* prebuilt, /* in/out: prebuilt struct */ THD* thd, /* in: current user thread, used only if templ_type is ROW_MYSQL_REC_FIELDS */ @@ -3319,8 +3363,8 @@ ha_innobase::write_row( longlong auto_inc; longlong dummy; ibool auto_inc_used= FALSE; - THD *thd= ha_thd(); - trx_t* trx = thd_to_trx(thd); + ulint sql_command; + trx_t* trx = thd_to_trx(user_thd); DBUG_ENTER("ha_innobase::write_row"); @@ -3344,11 +3388,13 @@ ha_innobase::write_row( if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) table->timestamp_field->set_time(); - if ((thd_sql_command(thd) == SQLCOM_ALTER_TABLE - || thd_sql_command(thd) == SQLCOM_OPTIMIZE - || thd_sql_command(thd) == SQLCOM_CREATE_INDEX - || thd_sql_command(thd) == SQLCOM_DROP_INDEX) - && num_write_row >= 10000) { + sql_command = thd_sql_command(user_thd); + + if ((sql_command == SQLCOM_ALTER_TABLE + || sql_command == SQLCOM_OPTIMIZE + || sql_command == SQLCOM_CREATE_INDEX + || sql_command == SQLCOM_DROP_INDEX) + && num_write_row >= 10000) { /* ALTER TABLE is COMMITted at every 10000 copied rows. The IX table lock for the original table has to be re-issued. As this method will be called on a temporary table where the @@ -3490,30 +3536,32 @@ no_commit: /* This call will update the counter according to the value that was inserted in the table */ - dict_table_autoinc_update(prebuilt->table, auto_inc); - } - } + dict_table_autoinc_update(prebuilt->table, auto_inc); + } + } - /* A REPLACE command and LOAD DATA INFILE REPLACE handle a duplicate - key error themselves, and we must update the autoinc counter if we are - performing those statements. */ + /* A REPLACE command and LOAD DATA INFILE REPLACE handle a duplicate + key error themselves, and we must update the autoinc counter if we are + performing those statements. */ - if (error == DB_DUPLICATE_KEY && auto_inc_used - && (thd_sql_command(user_thd) == SQLCOM_REPLACE - || thd_sql_command(user_thd) == SQLCOM_REPLACE_SELECT - || (thd_sql_command(user_thd) == SQLCOM_INSERT - && prebuilt->trx->allow_duplicates - && !prebuilt->trx->replace_duplicates) - || (thd_sql_command(user_thd) == SQLCOM_LOAD - && prebuilt->trx->allow_duplicates - && prebuilt->trx->replace_duplicates))) { + if (error == DB_DUPLICATE_KEY && auto_inc_used + && (sql_command == SQLCOM_REPLACE + || sql_command == SQLCOM_REPLACE_SELECT + || (sql_command == SQLCOM_INSERT + && ((trx->duplicates + & (TRX_DUP_IGNORE | TRX_DUP_REPLACE)) + == TRX_DUP_IGNORE)) + || (sql_command == SQLCOM_LOAD + && ((trx->duplicates + & (TRX_DUP_IGNORE | TRX_DUP_REPLACE)) + == (TRX_DUP_IGNORE | TRX_DUP_REPLACE))))) { - auto_inc = table->next_number_field->val_int(); + auto_inc = table->next_number_field->val_int(); - if (auto_inc != 0) { - dict_table_autoinc_update(prebuilt->table, auto_inc); - } - } + if (auto_inc != 0) { + dict_table_autoinc_update(prebuilt->table, auto_inc); + } + } innodb_srv_conc_exit_innodb(prebuilt->trx); @@ -3694,7 +3742,7 @@ ha_innobase::update_row( { upd_t* uvect; int error = 0; - trx_t* trx = thd_to_trx(ha_thd()); + trx_t* trx = thd_to_trx(user_thd); DBUG_ENTER("ha_innobase::update_row"); @@ -3747,7 +3795,7 @@ ha_innobase::delete_row( const mysql_byte* record) /* in: a row in MySQL format */ { int error = 0; - trx_t* trx = thd_to_trx(ha_thd()); + trx_t* trx = thd_to_trx(user_thd); DBUG_ENTER("ha_innobase::delete_row"); @@ -3833,7 +3881,8 @@ ha_innobase::try_semi_consistent_read(bool yes) option is used or this session is using READ COMMITTED isolation level. */ - if (yes && (srv_locks_unsafe_for_binlog + if (yes + && (srv_locks_unsafe_for_binlog || prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED)) { prebuilt->row_read_type = ROW_READ_TRY_SEMI_CONSISTENT; } else { @@ -3991,7 +4040,7 @@ ha_innobase::index_read( DBUG_ENTER("index_read"); - ut_a(prebuilt->trx == thd_to_trx(ha_thd())); + ut_a(prebuilt->trx == thd_to_trx(user_thd)); ha_statistic_increment(&SSV::ha_read_key_count); @@ -4183,7 +4232,7 @@ ha_innobase::general_fetch( DBUG_ENTER("general_fetch"); - ut_a(prebuilt->trx == thd_to_trx(ha_thd())); + ut_a(prebuilt->trx == thd_to_trx(user_thd)); innodb_srv_conc_enter_innodb(prebuilt->trx); @@ -4481,6 +4530,25 @@ ha_innobase::position( } } +/********************************************************************* +If it's a DB_TOO_BIG_RECORD error then set a suitable message to +return to the client.*/ +static +void +innodb_check_for_record_too_big_error( +/*==================================*/ + dict_table_t* table, /* in: table to check */ + int error) /* in: error code to check */ +{ + if (error == (int)DB_TOO_BIG_RECORD) { + ulint max_row_size; + + max_row_size = page_get_free_space_of_empty_noninline(table); + + my_error(ER_TOO_BIG_ROWSIZE, MYF(0), max_row_size); + } +} + /********************************************************************* Creates a table definition to an InnoDB database. */ static @@ -4589,6 +4657,10 @@ create_table_def( error = row_create_table_for_mysql(table, trx); + /* We need access to the table and so we do the error checking + and set the error message here, before the error translation.*/ + innodb_check_for_record_too_big_error(table, error); + error = convert_error_code_to_mysql(error, NULL); DBUG_RETURN(error); @@ -4711,6 +4783,10 @@ create_index( sure we don't create too long indexes. */ error = row_create_index_for_mysql(index, trx, field_lengths); + /* We need access to the table and so we do the error checking + and set the error message here, before the error translation.*/ + innodb_check_for_record_too_big_error(index->table, error); + error = convert_error_code_to_mysql(error, NULL); my_free(field_lengths, MYF(0)); @@ -4738,6 +4814,10 @@ create_clustered_index_when_no_primary( (char*) "GEN_CLUST_INDEX", 0, DICT_CLUSTERED, 0); error = row_create_index_for_mysql(index, trx, NULL); + /* We need access to the table and so we do the error checking + and set the error message here, before the error translation.*/ + innodb_check_for_record_too_big_error(index->table, error); + error = convert_error_code_to_mysql(error, NULL); return(error); @@ -4779,7 +4859,7 @@ ha_innobase::create( uint i; char name2[FN_REFLEN]; char norm_name[FN_REFLEN]; - THD *thd= ha_thd(); + THD* thd = ha_thd(); ib_longlong auto_inc_value; ulint flags; @@ -4797,7 +4877,7 @@ ha_innobase::create( /* Get the transaction associated with the current thd, or create one if not yet created */ - parent_trx = check_trx_exists(ht, thd); + parent_trx = check_trx_exists(thd); /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads */ @@ -4807,7 +4887,7 @@ ha_innobase::create( trx = trx_allocate_for_mysql(); trx->mysql_thd = thd; - trx->mysql_query_str = &((*thd).query); + trx->mysql_query_str = thd_query(thd); if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { trx->check_foreigns = FALSE; @@ -4893,9 +4973,9 @@ ha_innobase::create( } } - if (thd->query != NULL) { + if (*trx->mysql_query_str) { error = row_table_add_foreign_constraints(trx, - thd->query, norm_name, + *trx->mysql_query_str, norm_name, create_info->options & HA_LEX_CREATE_TMP_TABLE); error = convert_error_code_to_mysql(error, NULL); @@ -4994,33 +5074,32 @@ ha_innobase::delete_all_rows(void) /* out: error number */ { int error; - THD* thd = ha_thd(); DBUG_ENTER("ha_innobase::delete_all_rows"); /* Get the transaction associated with the current thd, or create one if not yet created, and update prebuilt->trx */ - update_thd(thd); + update_thd(ha_thd()); - if (thd_sql_command(thd) == SQLCOM_TRUNCATE) { - /* Truncate the table in InnoDB */ - - error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx); - if (error == DB_ERROR) { - /* Cannot truncate; resort to ha_innobase::delete_row() */ - goto fallback; - } - - error = convert_error_code_to_mysql(error, NULL); - - DBUG_RETURN(error); + if (thd_sql_command(user_thd) != SQLCOM_TRUNCATE) { + fallback: + /* We only handle TRUNCATE TABLE t as a special case. + DELETE FROM t will have to use ha_innobase::delete_row(). */ + DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND); } -fallback: - /* We only handle TRUNCATE TABLE t as a special case. - DELETE FROM t will have to use ha_innobase::delete_row(). */ - DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND); + /* Truncate the table in InnoDB */ + + error = row_truncate_table_for_mysql(prebuilt->table, prebuilt->trx); + if (error == DB_ERROR) { + /* Cannot truncate; resort to ha_innobase::delete_row() */ + goto fallback; + } + + error = convert_error_code_to_mysql(error, NULL); + + DBUG_RETURN(error); } /********************************************************************* @@ -5040,7 +5119,7 @@ ha_innobase::delete_table( int error; trx_t* parent_trx; trx_t* trx; - THD *thd= ha_thd(); + THD *thd = ha_thd(); char norm_name[1000]; DBUG_ENTER("ha_innobase::delete_table"); @@ -5048,7 +5127,7 @@ ha_innobase::delete_table( /* Get the transaction associated with the current thd, or create one if not yet created */ - parent_trx = check_trx_exists(ht, thd); + parent_trx = check_trx_exists(thd); /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads */ @@ -5063,75 +5142,77 @@ ha_innobase::delete_table( trx = trx_allocate_for_mysql(); - trx->mysql_thd = ha_thd(); - trx->mysql_query_str = &(ha_thd()->query); + trx->mysql_thd = thd; + trx->mysql_query_str = thd_query(thd); - if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { - trx->check_foreigns = FALSE; - } + if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { + trx->check_foreigns = FALSE; + } - if (thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS)) { - trx->check_unique_secondary = FALSE; - } + if (thd_test_options(thd, OPTION_RELAXED_UNIQUE_CHECKS)) { + trx->check_unique_secondary = FALSE; + } - name_len = strlen(name); + name_len = strlen(name); - assert(name_len < 1000); + assert(name_len < 1000); - /* Strangely, MySQL passes the table name without the '.frm' - extension, in contrast to ::create */ + /* Strangely, MySQL passes the table name without the '.frm' + extension, in contrast to ::create */ - normalize_table_name(norm_name, name); + normalize_table_name(norm_name, name); - /* Drop the table in InnoDB */ + /* Drop the table in InnoDB */ - error = row_drop_table_for_mysql(norm_name, trx, - thd_sql_command(thd) == SQLCOM_DROP_DB); + error = row_drop_table_for_mysql(norm_name, trx, + thd_sql_command(thd) + == SQLCOM_DROP_DB); - /* Flush the log to reduce probability that the .frm files and - the InnoDB data dictionary get out-of-sync if the user runs - with innodb_flush_log_at_trx_commit = 0 */ + /* Flush the log to reduce probability that the .frm files and + the InnoDB data dictionary get out-of-sync if the user runs + with innodb_flush_log_at_trx_commit = 0 */ - log_buffer_flush_to_disk(); + log_buffer_flush_to_disk(); - /* Tell the InnoDB server that there might be work for - utility threads: */ + /* Tell the InnoDB server that there might be work for + utility threads: */ - srv_active_wake_master_thread(); + srv_active_wake_master_thread(); - innobase_commit_low(trx); + innobase_commit_low(trx); - trx_free_for_mysql(trx); + trx_free_for_mysql(trx); - error = convert_error_code_to_mysql(error, NULL); + error = convert_error_code_to_mysql(error, NULL); - DBUG_RETURN(error); + DBUG_RETURN(error); } /********************************************************************* - Removes all tables in the named database inside InnoDB. */ +Removes all tables in the named database inside InnoDB. */ static void innobase_drop_database( - /*===================*/ - /* out: error number */ - handlerton *hton, /* in: handlerton of Innodb */ - char* path) /* in: database path; inside InnoDB the name - of the last directory in the path is used as - the database name: for example, in 'mysql/data/test' - the database name is 'test' */ +/*===================*/ + /* out: error number */ + handlerton *hton, /* in: handlerton of Innodb */ + char* path) /* in: database path; inside InnoDB the name + of the last directory in the path is used as + the database name: for example, in 'mysql/data/test' + the database name is 'test' */ { - ulint len = 0; - trx_t* parent_trx; - trx_t* trx; - char* ptr; - int error; - char* namebuf; + ulint len = 0; + trx_t* parent_trx; + trx_t* trx; + char* ptr; + int error; + char* namebuf; + THD* thd = current_thd; - /* Get the transaction associated with the current thd, or create one - if not yet created */ + /* Get the transaction associated with the current thd, or create one + if not yet created */ - parent_trx = check_trx_exists(hton, current_thd); + parent_trx = check_trx_exists(thd); /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads */ @@ -5155,10 +5236,10 @@ innobase_drop_database( innobase_casedn_str(namebuf); #endif trx = trx_allocate_for_mysql(); - trx->mysql_thd = current_thd; - trx->mysql_query_str = &((*current_thd).query); + trx->mysql_thd = thd; + trx->mysql_query_str = thd_query(thd); - if (thd_test_options(current_thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { + if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { trx->check_foreigns = FALSE; } @@ -5204,13 +5285,14 @@ ha_innobase::rename_table( trx_t* trx; char norm_from[1000]; char norm_to[1000]; + THD* thd = ha_thd(); DBUG_ENTER("ha_innobase::rename_table"); /* Get the transaction associated with the current thd, or create one if not yet created */ - parent_trx = check_trx_exists(ht, ha_thd()); + parent_trx = check_trx_exists(thd); /* In case MySQL calls this in the middle of a SELECT query, release possible adaptive hash latch to avoid deadlocks of threads */ @@ -5224,10 +5306,10 @@ ha_innobase::rename_table( } trx = trx_allocate_for_mysql(); - trx->mysql_thd = ha_thd(); - trx->mysql_query_str = &((*ha_thd()).query); + trx->mysql_thd = thd; + trx->mysql_query_str = thd_query(thd); - if (thd_test_options(ha_thd(), OPTION_NO_FOREIGN_KEY_CHECKS)) { + if (thd_test_options(thd, OPTION_NO_FOREIGN_KEY_CHECKS)) { trx->check_foreigns = FALSE; } @@ -5489,7 +5571,12 @@ ha_innobase::info( if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { - DBUG_RETURN(HA_ERR_CRASHED); + /* We return success (0) instead of HA_ERR_CRASHED, + because we want MySQL to process this query and not + stop, like it would do if it received the error code + HA_ERR_CRASHED. */ + + DBUG_RETURN(0); } /* We do not know if MySQL can call this function before calling @@ -5509,15 +5596,14 @@ ha_innobase::info( if (flag & HA_STATUS_TIME) { if (srv_stats_on_metadata) { - /* In sql_show we call with this flag: update then statistics - so that they are up-to-date */ + /* In sql_show we call with this flag: update + then statistics so that they are up-to-date */ - prebuilt->trx->op_info = (char*)"updating table statistics"; + prebuilt->trx->op_info = "updating table statistics"; dict_update_statistics(ib_table); - prebuilt->trx->op_info = (char*) - "returning various info to MySQL"; + prebuilt->trx->op_info = "returning various info to MySQL"; } my_snprintf(path, sizeof(path), "%s/%s%s", @@ -5642,7 +5728,8 @@ ha_innobase::info( } if (flag & HA_STATUS_ERRKEY) { - ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N); + ut_a(prebuilt->trx); + ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N); errkey = (unsigned int) row_get_mysql_key_number_for_index( (dict_index_t*) trx_get_error_info(prebuilt->trx)); @@ -5726,8 +5813,10 @@ ha_innobase::check( { ulint ret; - ut_a(prebuilt->trx && prebuilt->trx->magic_n == TRX_MAGIC_N); - ut_a(prebuilt->trx == thd_to_trx(ha_thd())); + DBUG_ASSERT(thd == ha_thd()); + ut_a(prebuilt->trx); + ut_a(prebuilt->trx->magic_n == TRX_MAGIC_N); + ut_a(prebuilt->trx == thd_to_trx(thd)); if (prebuilt->mysql_template == NULL) { /* Build the template; we will use a dummy template @@ -6000,9 +6089,8 @@ ha_innobase::get_foreign_key_list(THD *thd, List *f_key_list) strlen(foreign->referenced_index->name), 1); } - FOREIGN_KEY_INFO *pf_key_info= ((FOREIGN_KEY_INFO *) - thd->memdup(&f_key_info, - sizeof(FOREIGN_KEY_INFO))); + FOREIGN_KEY_INFO *pf_key_info = (FOREIGN_KEY_INFO *) + thd_memdup(thd, &f_key_info, sizeof(FOREIGN_KEY_INFO)); f_key_list->push_back(pf_key_info); foreign = UT_LIST_GET_NEXT(foreign_list, foreign); } @@ -6094,8 +6182,7 @@ ha_innobase::extra( } break; case HA_EXTRA_RESET_STATE: - prebuilt->keep_other_fields_on_keyread = 0; - prebuilt->read_just_key = 0; + reset_template(prebuilt); break; case HA_EXTRA_NO_KEYREAD: prebuilt->read_just_key = 0; @@ -6106,18 +6193,25 @@ ha_innobase::extra( case HA_EXTRA_KEYREAD_PRESERVE_FIELDS: prebuilt->keep_other_fields_on_keyread = 1; break; + + /* IMPORTANT: prebuilt->trx can be obsolete in + this method, because it is not sure that MySQL + calls external_lock before this method with the + parameters below. We must not invoke update_thd() + either, because the calling threads may change. + CAREFUL HERE, OR MEMORY CORRUPTION MAY OCCUR! */ case HA_EXTRA_IGNORE_DUP_KEY: - prebuilt->trx->allow_duplicates= TRUE; + thd_to_trx(ha_thd())->duplicates |= TRX_DUP_IGNORE; break; case HA_EXTRA_WRITE_CAN_REPLACE: - prebuilt->trx->replace_duplicates= TRUE; + thd_to_trx(ha_thd())->duplicates |= TRX_DUP_REPLACE; break; case HA_EXTRA_WRITE_CANNOT_REPLACE: - prebuilt->trx->replace_duplicates= FALSE; + thd_to_trx(ha_thd())->duplicates &= ~TRX_DUP_REPLACE; break; case HA_EXTRA_NO_IGNORE_DUP_KEY: - prebuilt->trx->allow_duplicates= FALSE; - prebuilt->trx->replace_duplicates= FALSE; + thd_to_trx(ha_thd())->duplicates &= + ~(TRX_DUP_IGNORE | TRX_DUP_REPLACE); break; default:/* Do nothing */ ; @@ -6131,8 +6225,7 @@ int ha_innobase::reset() if (prebuilt->blob_heap) { row_mysql_prebuilt_free_blob_heap(prebuilt); } - prebuilt->keep_other_fields_on_keyread = 0; - prebuilt->read_just_key = 0; + reset_template(prebuilt); return 0; } @@ -6173,8 +6266,7 @@ ha_innobase::start_stmt( prebuilt->sql_stat_start = TRUE; prebuilt->hint_need_to_fetch_extra_cols = 0; - prebuilt->read_just_key = 0; - prebuilt->keep_other_fields_on_keyread = FALSE; + reset_template(prebuilt); if (!prebuilt->mysql_has_locked) { /* This handle is for a temporary table created inside @@ -6261,27 +6353,27 @@ ha_innobase::external_lock( update_thd(thd); - /* Statement based binlogging does not work in isolation level - READ UNCOMMITTED and READ COMMITTED since the necessary - locks cannot be taken. In this case, we print an - informative error message and return with an error. */ - if (lock_type == F_WRLCK) - { - ulong const binlog_format= thd->variables.binlog_format; - ulong const tx_isolation = thd_tx_isolation(current_thd); - if (tx_isolation <= ISO_READ_COMMITTED && - binlog_format == BINLOG_FORMAT_STMT) - { - char buf[256]; - my_snprintf(buf, sizeof(buf), - "Transaction level '%s' in" - " InnoDB is not safe for binlog mode '%s'", - tx_isolation_names[tx_isolation], - binlog_format_names[binlog_format]); - my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf); - DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE); - } - } + /* Statement based binlogging does not work in isolation level + READ UNCOMMITTED and READ COMMITTED since the necessary + locks cannot be taken. In this case, we print an + informative error message and return with an error. */ + if (lock_type == F_WRLCK) + { + ulong const binlog_format= thd_binlog_format(thd); + ulong const tx_isolation = thd_tx_isolation(current_thd); + if (tx_isolation <= ISO_READ_COMMITTED && + binlog_format == BINLOG_FORMAT_STMT) + { + char buf[256]; + my_snprintf(buf, sizeof(buf), + "Transaction level '%s' in" + " InnoDB is not safe for binlog mode '%s'", + tx_isolation_names[tx_isolation], + binlog_format_names[binlog_format]); + my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf); + DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE); + } + } trx = prebuilt->trx; @@ -6289,8 +6381,7 @@ ha_innobase::external_lock( prebuilt->sql_stat_start = TRUE; prebuilt->hint_need_to_fetch_extra_cols = 0; - prebuilt->read_just_key = 0; - prebuilt->keep_other_fields_on_keyread = FALSE; + reset_template(prebuilt); if (lock_type == F_WRLCK) { @@ -6348,17 +6439,17 @@ ha_innobase::external_lock( if (prebuilt->select_lock_type != LOCK_NONE) { - if (thd_in_lock_tables(thd) && - thd_sql_command(thd) == SQLCOM_LOCK_TABLES && - THDVAR(thd, table_locks) && - thd_test_options(thd, OPTION_NOT_AUTOCOMMIT)) { + if (thd_sql_command(thd) == SQLCOM_LOCK_TABLES + && THDVAR(thd, table_locks) + && thd_test_options(thd, OPTION_NOT_AUTOCOMMIT) + && thd_in_lock_tables(thd)) { ulint error = row_lock_table_for_mysql( prebuilt, NULL, 0); if (error != DB_SUCCESS) { error = convert_error_code_to_mysql( - (int) error, user_thd); + (int) error, thd); DBUG_RETURN((int) error); } } @@ -6374,6 +6465,12 @@ ha_innobase::external_lock( trx->n_mysql_tables_in_use--; prebuilt->mysql_has_locked = FALSE; + /* Release a possible FIFO ticket and search latch. Since we + may reserve the kernel mutex, we have to release the search + system latch first to obey the latching order. */ + + innobase_release_stat_resources(trx); + /* If the MySQL lock count drops to zero we know that the current SQL statement has ended */ @@ -6382,12 +6479,6 @@ ha_innobase::external_lock( trx->mysql_n_tables_locked = 0; prebuilt->used_in_HANDLER = FALSE; - /* Release a possible FIFO ticket and search latch. Since we - may reserve the kernel mutex, we have to release the search - system latch first to obey the latching order. */ - - innobase_release_stat_resources(trx); - if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) { if (trx->active_trans != 0) { innobase_commit(ht, thd, TRUE); @@ -6429,8 +6520,7 @@ ha_innobase::transactional_table_lock( update_thd(thd); - if (prebuilt->table->ibd_file_missing - && !thd_tablespace_op(ha_thd())) { + if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB error:\n" "MySQL is trying to use a table handle but the .ibd file for\n" @@ -6448,8 +6538,7 @@ ha_innobase::transactional_table_lock( prebuilt->sql_stat_start = TRUE; prebuilt->hint_need_to_fetch_extra_cols = 0; - prebuilt->read_just_key = 0; - prebuilt->keep_other_fields_on_keyread = FALSE; + reset_template(prebuilt); if (lock_type == F_WRLCK) { prebuilt->select_lock_type = LOCK_X; @@ -6475,13 +6564,13 @@ ha_innobase::transactional_table_lock( trx->active_trans = 1; } - if (thd_in_lock_tables(thd) && THDVAR(thd, table_locks)) { + if (THDVAR(thd, table_locks) && thd_in_lock_tables(thd)) { ulint error = DB_SUCCESS; error = row_lock_table_for_mysql(prebuilt, NULL, 0); if (error != DB_SUCCESS) { - error = convert_error_code_to_mysql((int) error, user_thd); + error = convert_error_code_to_mysql((int) error, thd); DBUG_RETURN((int) error); } @@ -6531,7 +6620,7 @@ innodb_show_status( DBUG_ENTER("innodb_show_status"); - trx = check_trx_exists(hton, thd); + trx = check_trx_exists(thd); innobase_release_stat_resources(trx); @@ -6809,7 +6898,7 @@ ha_innobase::store_lock( because we call update_thd() later, in ::external_lock()! Failure to understand this caused a serious memory corruption bug in 5.1.11. */ - trx = check_trx_exists(ht, thd); + trx = check_trx_exists(thd); /* NOTE: MySQL can call this function with lock 'type' TL_IGNORE! Be careful to ignore TL_IGNORE if we are going to do something with @@ -6819,9 +6908,9 @@ ha_innobase::store_lock( of the transaction. */ if (lock_type != TL_IGNORE - && trx->n_mysql_tables_in_use == 0) { + && trx->n_mysql_tables_in_use == 0) { trx->isolation_level = innobase_map_isolation_level( - (enum_tx_isolation)thd_tx_isolation(thd)); + (enum_tx_isolation) thd_tx_isolation(thd)); if (trx->isolation_level <= TRX_ISO_READ_COMMITTED && trx->global_read_view) { @@ -6843,12 +6932,12 @@ ha_innobase::store_lock( handle may belong to another thd that is running a query. Let us in that case skip any changes to the prebuilt struct. */ - } else if ((lock_type == TL_READ && in_lock_tables) || - (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables) || - lock_type == TL_READ_WITH_SHARED_LOCKS || - lock_type == TL_READ_NO_INSERT || - (sql_command != SQLCOM_SELECT - && lock_type != TL_IGNORE)) { + } else if ((lock_type == TL_READ && in_lock_tables) + || (lock_type == TL_READ_HIGH_PRIORITY && in_lock_tables) + || lock_type == TL_READ_WITH_SHARED_LOCKS + || lock_type == TL_READ_NO_INSERT + || (lock_type != TL_IGNORE + && sql_command != SQLCOM_SELECT)) { /* The OR cases above are in this order: 1) MySQL is doing LOCK TABLES ... READ LOCAL, or we @@ -6873,10 +6962,10 @@ ha_innobase::store_lock( isolation_level = trx->isolation_level; if ((srv_locks_unsafe_for_binlog - || isolation_level == TRX_ISO_READ_COMMITTED) - && isolation_level != TRX_ISO_SERIALIZABLE - && (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) - && (sql_command == SQLCOM_INSERT_SELECT + || isolation_level == TRX_ISO_READ_COMMITTED) + && isolation_level != TRX_ISO_SERIALIZABLE + && (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) + && (sql_command == SQLCOM_INSERT_SELECT || sql_command == SQLCOM_UPDATE || sql_command == SQLCOM_CREATE_TABLE)) { @@ -6947,24 +7036,25 @@ ha_innobase::store_lock( TRUE there). */ if ((lock_type >= TL_WRITE_CONCURRENT_INSERT - && lock_type <= TL_WRITE) - && !(in_lock_tables - && sql_command == SQLCOM_LOCK_TABLES) - && !thd_tablespace_op(thd) - && sql_command != SQLCOM_TRUNCATE - && sql_command != SQLCOM_OPTIMIZE + && lock_type <= TL_WRITE) + && !(in_lock_tables + && sql_command == SQLCOM_LOCK_TABLES) + && !thd_tablespace_op(thd) + && sql_command != SQLCOM_TRUNCATE + && sql_command != SQLCOM_OPTIMIZE #ifdef __WIN__ - /* For alter table on win32 for succesful operation - completion it is used TL_WRITE(=10) lock instead of - TL_WRITE_ALLOW_READ(=6), however here in innodb handler - TL_WRITE is lifted to TL_WRITE_ALLOW_WRITE, which causes - race condition when several clients do alter table - simultaneously (bug #17264). This fix avoids the problem. */ - && sql_command != SQLCOM_ALTER_TABLE + /* For alter table on win32 for successful + operation completion it is used TL_WRITE(=10) lock + instead of TL_WRITE_ALLOW_READ(=6), however here + in innodb handler TL_WRITE is lifted to + TL_WRITE_ALLOW_WRITE, which causes race condition + when several clients do alter table simultaneously + (bug #17264). This fix avoids the problem. */ + && sql_command != SQLCOM_ALTER_TABLE #endif - && sql_command != SQLCOM_CREATE_TABLE) { + && sql_command != SQLCOM_CREATE_TABLE) { lock_type = TL_WRITE_ALLOW_WRITE; } @@ -7009,11 +7099,16 @@ ha_innobase::innobase_read_and_init_auto_inc( longlong auto_inc; ulint old_select_lock_type; ibool trx_was_not_started = FALSE; + ibool stmt_start; int error; ut_a(prebuilt); ut_a(prebuilt->table); + /* Remember if we are in the beginning of an SQL statement. + This function must not change that flag. */ + stmt_start = prebuilt->sql_stat_start; + /* Prepare prebuilt->trx in the table handle */ update_thd(ha_thd()); @@ -7135,6 +7230,8 @@ func_exit_early: innobase_commit_low(prebuilt->trx); } + prebuilt->sql_stat_start = stmt_start; + return(error); } @@ -7206,7 +7303,7 @@ ha_innobase::reset_auto_increment(ulonglong value) bool ha_innobase::get_error_message(int error, String *buf) { - trx_t* trx = check_trx_exists(ht, ha_thd()); + trx_t* trx = check_trx_exists(ha_thd()); buf->copy(trx->detailed_error, strlen(trx->detailed_error), system_charset_info); @@ -7328,7 +7425,6 @@ ha_innobase::get_mysql_bin_log_pos() return(trx_sys_mysql_bin_log_pos); } -extern "C" { /********************************************************************** This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set. The function @@ -7337,7 +7433,7 @@ index field in bytes. NOTE: the prototype of this function is copied to data0type.c! If you change this function, you MUST change also data0type.c! */ - +extern "C" ulint innobase_get_at_most_n_mbchars( /*===========================*/ @@ -7402,39 +7498,6 @@ innobase_get_at_most_n_mbchars( return(char_length); } -} - -/********************************************************************** -This function returns true if - -1) SQL-query in the current thread -is either REPLACE or LOAD DATA INFILE REPLACE. - -2) SQL-query in the current thread -is INSERT ON DUPLICATE KEY UPDATE. - -NOTE that storage/innobase/row/row0ins.c must contain the -prototype for this function ! */ -extern "C" -ibool -innobase_query_is_update(void) -/*==========================*/ -{ - THD* thd = current_thd; - trx_t* trx; - - if (!thd) { - /* InnoDB's internal threads may run InnoDB stored procedures - that call this function. Then current_thd is not defined - (it is probably NULL). */ - - return(FALSE); - } - - trx = check_trx_exists(innodb_hton_ptr, thd); - - return(trx->allow_duplicates); -} /*********************************************************************** This function is used to prepare X/Open XA distributed transaction */ @@ -7450,7 +7513,7 @@ innobase_xa_prepare( FALSE - the current SQL statement ended */ { int error = 0; - trx_t* trx = check_trx_exists(hton, thd); + trx_t* trx = check_trx_exists(thd); if (thd_sql_command(thd) != SQLCOM_XA_PREPARE && (all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) @@ -7484,7 +7547,7 @@ innobase_xa_prepare( return(0); } - trx->xid=thd->transaction.xid_state.xid; + thd_get_xid(thd, (MYSQL_XID*) &trx->xid); /* Release a possible FIFO ticket and search latch. Since we will reserve the kernel mutex, we have to release the search system latch @@ -7611,8 +7674,7 @@ innobase_create_cursor_view( handlerton *hton, /* in: innobase hton */ THD* thd) /* in: user thread handle */ { - return(read_cursor_view_create_for_mysql( - check_trx_exists(hton, thd))); + return(read_cursor_view_create_for_mysql(check_trx_exists(thd))); } /*********************************************************************** @@ -7627,8 +7689,8 @@ innobase_close_cursor_view( THD* thd, /* in: user thread handle */ void* curview)/* in: Consistent read view to be closed */ { - read_cursor_view_close_for_mysql(check_trx_exists(hton, current_thd), - (cursor_view_t*) curview); + read_cursor_view_close_for_mysql(check_trx_exists(thd), + (cursor_view_t*) curview); } /*********************************************************************** @@ -7644,8 +7706,8 @@ innobase_set_cursor_view( THD* thd, /* in: user thread handle */ void* curview)/* in: Consistent cursor view to be set */ { - read_cursor_set_for_mysql(check_trx_exists(hton, current_thd), - (cursor_view_t*) curview); + read_cursor_set_for_mysql(check_trx_exists(thd), + (cursor_view_t*) curview); } @@ -7728,8 +7790,9 @@ static MYSQL_SYSVAR_BOOL(file_per_table, innobase_file_per_table, static MYSQL_SYSVAR_ULONG(flush_log_at_trx_commit, srv_flush_log_at_trx_commit, PLUGIN_VAR_OPCMDARG, - "Set to 0 (write and flush once per second), 1 (write and flush at each commit)" - " or 2 (write at commit, flush once per second).", + "Set to 0 (write and flush once per second)," + " 1 (write and flush at each commit)" + " or 2 (write at commit, flush once per second).", NULL, NULL, 1, 0, 2, 0); static MYSQL_SYSVAR_STR(flush_method, innobase_unix_file_flush_method, @@ -7741,11 +7804,11 @@ static MYSQL_SYSVAR_BOOL(locks_unsafe_for_binlog, innobase_locks_unsafe_for_binl "Force InnoDB to not use next-key locking, to use only row-level locking.", NULL, NULL, FALSE); +#ifdef UNIV_LOG_ARCHIVE static MYSQL_SYSVAR_STR(log_arch_dir, innobase_log_arch_dir, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "Where full logs should be archived.", NULL, NULL, NULL); -#ifdef UNIV_LOG_ARCHIVE static MYSQL_SYSVAR_BOOL(log_archive, innobase_log_archive, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY, "Set to 1 if you want to have logs archived.", NULL, NULL, FALSE); @@ -7883,8 +7946,8 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { MYSQL_SYSVAR(force_recovery), MYSQL_SYSVAR(locks_unsafe_for_binlog), MYSQL_SYSVAR(lock_wait_timeout), - MYSQL_SYSVAR(log_arch_dir), #ifdef UNIV_LOG_ARCHIVE + MYSQL_SYSVAR(log_arch_dir), MYSQL_SYSVAR(log_archive), #endif /* UNIV_LOG_ARCHIVE */ MYSQL_SYSVAR(log_buffer_size), @@ -7922,5 +7985,3 @@ mysql_declare_plugin(innobase) NULL /* reserved */ } mysql_declare_plugin_end; - -#endif diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index c727243bfd3..b10cccded18 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -190,27 +190,50 @@ class ha_innobase: public handler uint table_changes); }; -extern long innobase_mirrored_log_groups, innobase_log_files_in_group; -extern long long innobase_buffer_pool_size, innobase_log_file_size; -extern long innobase_log_buffer_size; -extern long innobase_additional_mem_pool_size; -extern long innobase_buffer_pool_awe_mem_mb; -extern long innobase_file_io_threads, innobase_lock_wait_timeout; -extern long innobase_force_recovery; -extern long innobase_open_files; -extern char *innobase_data_home_dir, *innobase_data_file_path; -extern char *innobase_log_group_home_dir, *innobase_log_arch_dir; -extern char *innobase_unix_file_flush_method; +/* Some accessor functions which the InnoDB plugin needs, but which +can not be added to mysql/plugin.h as part of the public interface; +the definitions are bracketed with #ifdef INNODB_COMPATIBILITY_HOOKS */ + +#ifndef INNODB_COMPATIBILITY_HOOKS +#error InnoDB needs MySQL to be built with #define INNODB_COMPATIBILITY_HOOKS +#endif + extern "C" { -extern ulong srv_max_buf_pool_modified_pct; -extern ulong srv_max_purge_lag; -extern ulong srv_auto_extend_increment; -extern ulong srv_n_spin_wait_rounds; -extern ulong srv_n_free_tickets_to_enter; -extern ulong srv_thread_sleep_delay; -extern ulong srv_thread_concurrency; -extern ulong srv_commit_concurrency; -extern ulong srv_flush_log_at_trx_commit; +struct charset_info_st *thd_charset(MYSQL_THD thd); +char **thd_query(MYSQL_THD thd); + +/** Get the file name of the MySQL binlog. + * @return the name of the binlog file + */ +const char* mysql_bin_log_file_name(void); + +/** Get the current position of the MySQL binlog. + * @return byte offset from the beginning of the binlog + */ +ulonglong mysql_bin_log_file_pos(void); + +/** + Check if a user thread is a replication slave thread + @param thd user thread + @retval 0 the user thread is not a replication slave thread + @retval 1 the user thread is a replication slave thread +*/ +int thd_slave_thread(const MYSQL_THD thd); + +/** + Check if a user thread is running a non-transactional update + @param thd user thread + @retval 0 the user thread is not running a non-transactional update + @retval 1 the user thread is running a non-transactional update +*/ +int thd_non_transactional_update(const MYSQL_THD thd); + +/** + Get the user thread's binary logging format + @param thd user thread + @return Value to be used as index into the binlog_format_names array +*/ +int thd_binlog_format(const MYSQL_THD thd); } /* diff --git a/storage/innobase/ibuf/Makefile.am b/storage/innobase/ibuf/Makefile.am deleted file mode 100644 index 42adda9a4ef..00000000000 --- a/storage/innobase/ibuf/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libibuf.a - -libibuf_a_SOURCES = ibuf0ibuf.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/ibuf/ibuf0ibuf.c b/storage/innobase/ibuf/ibuf0ibuf.c index 1cbb6003cfc..4e291924e0e 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.c +++ b/storage/innobase/ibuf/ibuf0ibuf.c @@ -150,9 +150,30 @@ ulint ibuf_flush_count = 0; #define IBUF_COUNT_N_PAGES 2000 /* Buffered entry counts for file pages, used in debugging */ -static ulint* ibuf_counts[IBUF_COUNT_N_SPACES]; +static ulint ibuf_counts[IBUF_COUNT_N_SPACES][IBUF_COUNT_N_PAGES]; -static ibool ibuf_counts_inited = FALSE; +/********************************************************************** +Checks that the indexes to ibuf_counts[][] are within limits. */ +UNIV_INLINE +void +ibuf_count_check( +/*=============*/ + ulint space_id, /* in: space identifier */ + ulint page_no) /* in: page number */ +{ + if (space_id < IBUF_COUNT_N_SPACES && page_no < IBUF_COUNT_N_PAGES) { + return; + } + + fprintf(stderr, + "InnoDB: UNIV_IBUF_DEBUG limits space_id and page_no\n" + "InnoDB: and breaks crash recovery.\n" + "InnoDB: space_id=%lu, should be 0<=space_id<%lu\n" + "InnoDB: page_no=%lu, should be 0<=page_no<%lu\n", + (ulint) space_id, (ulint) IBUF_COUNT_N_SPACES, + (ulint) page_no, (ulint) IBUF_COUNT_N_PAGES); + ut_error; +} #endif /* The start address for an insert buffer bitmap page bitmap */ @@ -328,15 +349,9 @@ ibuf_count_get( ulint space, /* in: space id */ ulint page_no)/* in: page number */ { - ut_ad(space < IBUF_COUNT_N_SPACES); - ut_ad(page_no < IBUF_COUNT_N_PAGES); + ibuf_count_check(space, page_no); - if (!ibuf_counts_inited) { - - return(0); - } - - return(*(ibuf_counts[space] + page_no)); + return(ibuf_counts[space][page_no]); } /********************************************************************** @@ -349,11 +364,10 @@ ibuf_count_set( ulint page_no,/* in: page number */ ulint val) /* in: value to set */ { - ut_a(space < IBUF_COUNT_N_SPACES); - ut_a(page_no < IBUF_COUNT_N_PAGES); + ibuf_count_check(space, page_no); ut_a(val < UNIV_PAGE_SIZE); - *(ibuf_counts[space] + page_no) = val; + ibuf_counts[space][page_no] = val; } #endif @@ -378,22 +392,6 @@ ibuf_init_at_db_start(void) ibuf->size = 0; -#ifdef UNIV_IBUF_DEBUG - { - ulint i, j; - - for (i = 0; i < IBUF_COUNT_N_SPACES; i++) { - - ibuf_counts[i] = mem_alloc(sizeof(ulint) - * IBUF_COUNT_N_PAGES); - for (j = 0; j < IBUF_COUNT_N_PAGES; j++) { - ibuf_count_set(i, j, 0); - } - } - - ibuf_counts_inited = TRUE; - } -#endif mutex_create(&ibuf_pessimistic_insert_mutex, SYNC_IBUF_PESS_INSERT_MUTEX); @@ -567,7 +565,8 @@ ibuf_bitmap_page_init( bit_offset = XDES_DESCRIBED_PER_PAGE * IBUF_BITS_PER_PAGE; - byte_offset = bit_offset / 8 + 1; /* better: (bit_offset + 7) / 8 */ + byte_offset = bit_offset / 8 + 1; + /* better: byte_offset = UT_BITS_IN_BYTES(bit_offset); */ fil_page_set_type(page, FIL_PAGE_IBUF_BITMAP); @@ -1441,6 +1440,9 @@ ibuf_entry_build( *buf2++ = 0; /* write the compact format indicator */ } for (i = 0; i < n_fields; i++) { + ulint fixed_len; + const dict_field_t* ifield; + /* We add 4 below because we have the 4 extra fields at the start of an ibuf record */ @@ -1448,10 +1450,30 @@ ibuf_entry_build( entry_field = dtuple_get_nth_field(entry, i); dfield_copy(field, entry_field); + ifield = dict_index_get_nth_field(index, i); + /* Prefix index columns of fixed-length columns are of + fixed length. However, in the function call below, + dfield_get_type(entry_field) contains the fixed length + of the column in the clustered index. Replace it with + the fixed length of the secondary index column. */ + fixed_len = ifield->fixed_len; + +#ifdef UNIV_DEBUG + if (fixed_len) { + /* dict_index_add_col() should guarantee these */ + ut_ad(fixed_len <= (ulint) entry_field->type.len); + if (ifield->prefix_len) { + ut_ad(ifield->prefix_len == fixed_len); + } else { + ut_ad(fixed_len + == (ulint) entry_field->type.len); + } + } +#endif /* UNIV_DEBUG */ + dtype_new_store_for_order_and_null_size( buf2 + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE, - dfield_get_type(entry_field), - dict_index_get_nth_field(index, i)->prefix_len); + dfield_get_type(entry_field), fixed_len); } /* Store the type info in buf2 to field 3 of tuple */ diff --git a/storage/innobase/include/Makefile.i b/storage/innobase/include/Makefile.i deleted file mode 100644 index db436c702ff..00000000000 --- a/storage/innobase/include/Makefile.i +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile included in Makefile.am in every subdirectory - -INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \ - -I$(top_srcdir)/regex \ - -I$(top_srcdir)/storage/innobase/include \ - -I$(top_srcdir)/sql \ - -I$(srcdir) - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/include/db0err.h b/storage/innobase/include/db0err.h index 843c70af577..0aa1b87e470 100644 --- a/storage/innobase/include/db0err.h +++ b/storage/innobase/include/db0err.h @@ -62,6 +62,11 @@ Created 5/24/1996 Heikki Tuuri lead to a duplicate key in some table */ +#define DB_TOO_MANY_CONCURRENT_TRXS 47 /* when InnoDB runs out of the + preconfigured undo slots, this can + only happen when there are too many + concurrent transactions */ + /* The following are partial failure codes */ #define DB_FAIL 1000 #define DB_OVERFLOW 1001 diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h index 836a6290498..eb31043ecc3 100644 --- a/storage/innobase/include/dict0dict.h +++ b/storage/innobase/include/dict0dict.h @@ -92,6 +92,17 @@ dict_col_copy_type_noninline( /*=========================*/ const dict_col_t* col, /* in: column */ dtype_t* type); /* out: data type */ +#ifdef UNIV_DEBUG +/************************************************************************* +Assert that a column and a data type match. */ +UNIV_INLINE +ibool +dict_col_type_assert_equal( +/*=======================*/ + /* out: TRUE */ + const dict_col_t* col, /* in: column */ + const dtype_t* type); /* in: data type */ +#endif /* UNIV_DEBUG */ /*************************************************************************** Returns the minimum size of the column. */ UNIV_INLINE diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index 4a9afd2f3f5..7d38cbcd1fa 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -30,6 +30,30 @@ dict_col_copy_type( type->mbmaxlen = col->mbmaxlen; } +#ifdef UNIV_DEBUG +/************************************************************************* +Assert that a column and a data type match. */ +UNIV_INLINE +ibool +dict_col_type_assert_equal( +/*=======================*/ + /* out: TRUE */ + const dict_col_t* col, /* in: column */ + const dtype_t* type) /* in: data type */ +{ + ut_ad(col); + ut_ad(type); + + ut_ad(col->mtype == type->mtype); + ut_ad(col->prtype == type->prtype); + ut_ad(col->len == type->len); + ut_ad(col->mbminlen == type->mbminlen); + ut_ad(col->mbmaxlen == type->mbmaxlen); + + return(TRUE); +} +#endif /* UNIV_DEBUG */ + /*************************************************************************** Returns the minimum size of the column. */ UNIV_INLINE diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index a23f89954a4..647035c2fff 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -158,10 +158,13 @@ struct dict_col_struct{ of an index */ }; -/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the max index column -length + 1. Starting from 4.1.6, we set it to < 3 * 256, so that one can -create a column prefix index on 255 characters of a TEXT field also in the -UTF-8 charset. In that charset, a character may take at most 3 bytes. */ +/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the maximum +indexed column length (or indexed prefix length). It is set to 3*256, +so that one can create a column prefix index on 256 characters of a +TEXT or VARCHAR column also in the UTF-8 charset. In that charset, +a character may take at most 3 bytes. +This constant MUST NOT BE CHANGED, or the compatibility of InnoDB data +files would be at risk! */ #define DICT_MAX_INDEX_COL_LEN 768 diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index 2d27034fdfe..7fb50988941 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -1,6 +1,9 @@ #ifndef HA_INNODB_PROTOTYPES_H #define HA_INNODB_PROTOTYPES_H +#include "univ.i" /* ulint, uint */ +#include "m_ctype.h" /* CHARSET_INFO */ + /* Prototypes for global functions in ha_innodb.cc that are called by InnoDB's C-code. */ @@ -19,4 +22,30 @@ innobase_convert_string( CHARSET_INFO* from_cs, uint* errors); +/********************************************************************** +Returns true if the thread is the replication thread on the slave +server. Used in srv_conc_enter_innodb() to determine if the thread +should be allowed to enter InnoDB - the replication thread is treated +differently than other threads. Also used in +srv_conc_force_exit_innodb(). */ + +ibool +thd_is_replication_slave_thread( +/*============================*/ + /* out: true if thd is the replication thread */ + void* thd); /* in: thread handle (THD*) */ + +/********************************************************************** +Returns true if the transaction this thread is processing has edited +non-transactional tables. Used by the deadlock detector when deciding +which transaction to rollback in case of a deadlock - we try to avoid +rolling back transactions that have edited non-transactional tables. */ + +ibool +thd_has_edited_nontrans_tables( +/*===========================*/ + /* out: true if non-transactional tables have + been edited */ + void* thd); /* in: thread handle (THD*) */ + #endif diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 5ffcdf7e58c..9eb44d3f4a8 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -94,7 +94,8 @@ log. */ #define OS_FILE_PATH_ERROR 74 #define OS_FILE_AIO_RESOURCES_RESERVED 75 /* wait for OS aio resources to become available again */ -#define OS_FILE_ERROR_NOT_SPECIFIED 76 +#define OS_FILE_SHARING_VIOLATION 76 +#define OS_FILE_ERROR_NOT_SPECIFIED 77 /* Types for aio operations */ #define OS_FILE_READ 10 diff --git a/storage/innobase/include/rem0rec.ic b/storage/innobase/include/rem0rec.ic index 90a35af74dc..95aa65fabba 100644 --- a/storage/innobase/include/rem0rec.ic +++ b/storage/innobase/include/rem0rec.ic @@ -795,7 +795,8 @@ UNIV_INLINE void rec_offs_set_n_alloc( /*=================*/ - ulint* offsets, /* in: array for rec_get_offsets() */ + ulint* offsets, /* out: array for rec_get_offsets(), + must be allocated */ ulint n_alloc) /* in: number of elements */ { ut_ad(offsets); @@ -1282,7 +1283,8 @@ UNIV_INLINE void rec_offs_set_n_fields( /*==================*/ - ulint* offsets, /* in: array returned by rec_get_offsets() */ + ulint* offsets, /* in/out: array returned by + rec_get_offsets() */ ulint n_fields) /* in: number of fields */ { ut_ad(offsets); diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 1448efe94fe..bda3494073f 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -460,6 +460,19 @@ row_check_table_for_mysql( /* out: DB_ERROR or DB_SUCCESS */ row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL handle */ +/************************************************************************* +Get the min of the maximum possible row sizes. */ + +ulint +page_get_free_space_of_empty_noninline( +/*===================================*/ + /* out: The (approx) maximum size + of a row, this is a conservative + estimate, since the size can be + slightly larger depending upon + the ROW_FORMAT setting.*/ + dict_table_t* table); /* in: table for which max record + size required.*/ /* A struct describing a place for an individual column in the MySQL row format which is presented to the table handler in ha_innobase. diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index e75c200cc3a..eeda2a7a52c 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -371,6 +371,18 @@ trx_is_interrupted( #define trx_is_interrupted(trx) FALSE #endif /* !UNIV_HOTBACKUP */ +/*********************************************************************** +Compares the "weight" (or size) of two transactions. The weight of one +transaction is estimated as the number of altered rows + the number of +locked rows. Transactions that have edited non-transactional tables are +considered heavier than ones that have not. */ + +int +trx_weight_cmp( +/*===========*/ + /* out: <0, 0 or >0; similar to strcmp(3) */ + trx_t* a, /* in: the first transaction to be compared */ + trx_t* b); /* in: the second transaction to be compared */ /* Signal to a transaction */ struct trx_sig_struct{ @@ -453,7 +465,8 @@ struct trx_struct{ dulint table_id; /* table id if the preceding field is TRUE */ /*------------------------------*/ - int active_trans; /* 1 - if a transaction in MySQL + unsigned duplicates:2; /* TRX_DUP_IGNORE | TRX_DUP_REPLACE */ + unsigned active_trans:2; /* 1 - if a transaction in MySQL is active. 2 - if prepare_commit_mutex was taken */ void* mysql_thd; /* MySQL thread handle corresponding @@ -610,7 +623,7 @@ struct trx_struct{ NULL */ ibool was_chosen_as_deadlock_victim; /* when the transaction decides to wait - for a lock, this it sets this to FALSE; + for a lock, it sets this to FALSE; if another transaction chooses this transaction as a victim in deadlock resolution, it sets this to TRUE */ @@ -651,7 +664,12 @@ struct trx_struct{ cannot be any activity in the undo logs! */ dulint undo_no; /* next undo log record number to - assign */ + assign; since the undo log is + private for a transaction, this + is a simple ascending sequence + with no gaps; thus it represents + the number of modified/inserted + rows in a transaction */ trx_savept_t last_sql_stat_start; /* undo_no when the last sql statement was started: in case of an error, trx @@ -681,19 +699,19 @@ struct trx_struct{ single operation of a transaction, e.g., a parallel query */ -/* Transaction concurrency states */ +/* Transaction concurrency states (trx->conc_state) */ #define TRX_NOT_STARTED 1 #define TRX_ACTIVE 2 #define TRX_COMMITTED_IN_MEMORY 3 #define TRX_PREPARED 4 /* Support for 2PC/XA */ -/* Transaction execution states when trx state is TRX_ACTIVE */ +/* Transaction execution states when trx->conc_state == TRX_ACTIVE */ #define TRX_QUE_RUNNING 1 /* transaction is running */ #define TRX_QUE_LOCK_WAIT 2 /* transaction is waiting for a lock */ #define TRX_QUE_ROLLING_BACK 3 /* transaction is rolling back */ #define TRX_QUE_COMMITTING 4 /* transaction is committing */ -/* Transaction isolation levels */ +/* Transaction isolation levels (trx->isolation_level) */ #define TRX_ISO_READ_UNCOMMITTED 1 /* dirty read: non-locking SELECTs are performed so that we do not look at a possible @@ -728,6 +746,12 @@ struct trx_struct{ converted to LOCK IN SHARE MODE reads */ +/* Treatment of duplicate values (trx->duplicates; for example, in inserts). +Multiple flags can be combined with bitwise OR. */ +#define TRX_DUP_IGNORE 1 /* duplicate rows are to be updated */ +#define TRX_DUP_REPLACE 2 /* duplicate rows are to be replaced */ + + /* Types of a trx signal */ #define TRX_SIG_NO_SIGNAL 100 #define TRX_SIG_TOTAL_ROLLBACK 1 diff --git a/storage/innobase/include/trx0undo.h b/storage/innobase/include/trx0undo.h index 87849ab42c3..f53c6b01be4 100644 --- a/storage/innobase/include/trx0undo.h +++ b/storage/innobase/include/trx0undo.h @@ -222,13 +222,16 @@ trx_undo_lists_init( Assigns an undo log for a transaction. A new undo log is created or a cached undo log reused. */ -trx_undo_t* +ulint trx_undo_assign_undo( /*=================*/ - /* out: the undo log, NULL if did not succeed: out of - space */ - trx_t* trx, /* in: transaction */ - ulint type); /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */ + /* out: DB_SUCCESS if undo log assign + * successful, possible error codes are: + * ER_TOO_MANY_CONCURRENT_TRXS + * DB_OUT_OF_FILE_SPAC + * DB_OUT_OF_MEMORY */ + trx_t* trx, /* in: transaction */ + ulint type); /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */ /********************************************************************** Sets the state of the undo log segment at a transaction finish. */ diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 8bfc1edd323..825c10d5f11 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -121,6 +121,11 @@ ut_2_power_up( /* out: first power of 2 which is >= n */ ulint n) /* in: number != 0 */ __attribute__((const)); + +/* Determine how many bytes (groups of 8 bits) are needed to +store the given number of bits. */ +#define UT_BITS_IN_BYTES(b) (((b) + 7) / 8) + /**************************************************************** Sort function for ulint arrays. */ diff --git a/storage/innobase/lock/Makefile.am b/storage/innobase/lock/Makefile.am deleted file mode 100644 index 4c6caa49853..00000000000 --- a/storage/innobase/lock/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = liblock.a - -liblock_a_SOURCES = lock0lock.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index 93a43d9a30f..6f5390145b5 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -3174,7 +3174,8 @@ lock_deadlock_occurs( ulint ret; ulint cost = 0; - ut_ad(trx && lock); + ut_ad(trx); + ut_ad(lock); ut_ad(mutex_own(&kernel_mutex)); retry: /* We check that adding this trx to the waits-for graph @@ -3246,7 +3247,9 @@ lock_deadlock_recursive( trx_t* lock_trx; ulint ret; - ut_a(trx && start && wait_lock); + ut_a(trx); + ut_a(start); + ut_a(wait_lock); ut_ad(mutex_own(&kernel_mutex)); if (trx->deadlock_mark == 1) { @@ -3357,8 +3360,8 @@ lock_deadlock_recursive( return(LOCK_VICTIM_IS_START); } - if (ut_dulint_cmp(wait_lock->trx->undo_no, - start->undo_no) >= 0) { + if (trx_weight_cmp(wait_lock->trx, + start) >= 0) { /* Our recursion starting point transaction is 'smaller', let us choose 'start' as the victim and roll @@ -4423,12 +4426,9 @@ lock_table_queue_validate( dict_table_t* table) /* in: table */ { lock_t* lock; - ibool is_waiting; ut_ad(mutex_own(&kernel_mutex)); - is_waiting = FALSE; - lock = UT_LIST_GET_FIRST(table->locks); while (lock) { @@ -4438,13 +4438,10 @@ lock_table_queue_validate( if (!lock_get_wait(lock)) { - ut_a(!is_waiting); - ut_a(!lock_table_other_has_incompatible( lock->trx, 0, table, lock_get_mode(lock))); } else { - is_waiting = TRUE; ut_a(lock_table_has_to_wait_in_queue(lock)); } diff --git a/storage/innobase/log/Makefile.am b/storage/innobase/log/Makefile.am deleted file mode 100644 index a40572a64da..00000000000 --- a/storage/innobase/log/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = liblog.a - -liblog_a_SOURCES = log0log.c log0recv.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c index e9dedf6aac4..b10c348b24d 100644 --- a/storage/innobase/log/log0log.c +++ b/storage/innobase/log/log0log.c @@ -3039,10 +3039,22 @@ loop: mutex_enter(&kernel_mutex); - /* Check that there are no longer transactions. We need this wait - even for the 'very fast' shutdown, because the InnoDB layer may have - committed or prepared transactions and we don't want to lose - them. */ + /* We need the monitor threads to stop before we proceed with a + normal shutdown. In case of very fast shutdown, however, we can + proceed without waiting for monitor threads. */ + + if (srv_fast_shutdown < 2 + && (srv_error_monitor_active + || srv_lock_timeout_and_monitor_active)) { + + mutex_exit(&kernel_mutex); + + goto loop; + } + + /* Check that there are no longer transactions. We need this wait even + for the 'very fast' shutdown, because the InnoDB layer may have + committed or prepared transactions and we don't want to lose them. */ if (trx_n_mysql_transactions > 0 || UT_LIST_GET_LEN(trx_sys->trx_list) > 0) { @@ -3163,22 +3175,8 @@ loop: goto loop; } - /* The lock timeout thread should now have exited */ - - if (srv_lock_timeout_and_monitor_active) { - - goto loop; - } - - /* We now let also the InnoDB error monitor thread to exit */ - srv_shutdown_state = SRV_SHUTDOWN_LAST_PHASE; - if (srv_error_monitor_active) { - - goto loop; - } - /* Make some checks that the server really is quiet */ ut_a(srv_n_threads_active[SRV_MASTER] == 0); ut_a(buf_all_freed()); diff --git a/storage/innobase/mach/Makefile.am b/storage/innobase/mach/Makefile.am deleted file mode 100644 index 1a59cb3e4d7..00000000000 --- a/storage/innobase/mach/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libmach.a - -libmach_a_SOURCES = mach0data.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/mem/Makefile.am b/storage/innobase/mem/Makefile.am deleted file mode 100644 index 598dbb96124..00000000000 --- a/storage/innobase/mem/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libmem.a - -libmem_a_SOURCES = mem0mem.c mem0pool.c - -EXTRA_DIST = mem0dbg.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/mtr/Makefile.am b/storage/innobase/mtr/Makefile.am deleted file mode 100644 index 80eb7c907be..00000000000 --- a/storage/innobase/mtr/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libmtr.a - -libmtr_a_SOURCES = mtr0mtr.c mtr0log.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/os/Makefile.am b/storage/innobase/os/Makefile.am deleted file mode 100644 index d5c45eba54e..00000000000 --- a/storage/innobase/os/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libos.a - -libos_a_SOURCES = os0proc.c os0sync.c os0thread.c os0file.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c index c18ba047d4e..f496e1127ce 100644 --- a/storage/innobase/os/os0file.c +++ b/storage/innobase/os/os0file.c @@ -250,6 +250,15 @@ os_file_get_last_error( "InnoDB: the directory. It may also be" " you have created a subdirectory\n" "InnoDB: of the same name as a data file.\n"); + } else if (err == ERROR_SHARING_VIOLATION + || err == ERROR_LOCK_VIOLATION) { + fprintf(stderr, + "InnoDB: The error means that another program" + " is using InnoDB's files.\n" + "InnoDB: This might be a backup or antivirus" + " software or another instance\n" + "InnoDB: of MySQL." + " Please close it to get rid of this error.\n"); } else { fprintf(stderr, "InnoDB: Some operating system error numbers" @@ -268,6 +277,9 @@ os_file_get_last_error( return(OS_FILE_DISK_FULL); } else if (err == ERROR_FILE_EXISTS) { return(OS_FILE_ALREADY_EXISTS); + } else if (err == ERROR_SHARING_VIOLATION + || err == ERROR_LOCK_VIOLATION) { + return(OS_FILE_SHARING_VIOLATION); } else { return(100 + err); } @@ -388,6 +400,10 @@ os_file_handle_error_cond_exit( || err == OS_FILE_PATH_ERROR) { return(FALSE); + } else if (err == OS_FILE_SHARING_VIOLATION) { + + os_thread_sleep(10000000); /* 10 sec */ + return(TRUE); } else { if (name) { fprintf(stderr, "InnoDB: File name %s\n", name); diff --git a/storage/innobase/page/Makefile.am b/storage/innobase/page/Makefile.am deleted file mode 100644 index 1a5b202a2c9..00000000000 --- a/storage/innobase/page/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libpage.a - -libpage_a_SOURCES = page0page.c page0cur.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/pars/Makefile.am b/storage/innobase/pars/Makefile.am deleted file mode 100644 index b10796c3d5e..00000000000 --- a/storage/innobase/pars/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libpars.a - -noinst_HEADERS = pars0grm.h - -libpars_a_SOURCES = pars0grm.c lexyy.c pars0opt.c pars0pars.c pars0sym.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/plug.in b/storage/innobase/plug.in index 59634523399..6e26a7d3376 100644 --- a/storage/innobase/plug.in +++ b/storage/innobase/plug.in @@ -2,6 +2,7 @@ MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine], [Transactional Tables using InnoDB], [max,max-no-ndb]) MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase]) MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a]) +MYSQL_PLUGIN_DYNAMIC(innobase, [ha_innodb.la]) MYSQL_PLUGIN_ACTIONS(innobase, [ AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"]) AC_SUBST(innodb_system_libs) @@ -38,37 +39,5 @@ MYSQL_PLUGIN_ACTIONS(innobase, [ openbsd*) CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; esac - AC_CONFIG_FILES( - storage/innobase/ut/Makefile - storage/innobase/btr/Makefile - storage/innobase/buf/Makefile - storage/innobase/data/Makefile - storage/innobase/dict/Makefile - storage/innobase/dyn/Makefile - storage/innobase/eval/Makefile - storage/innobase/fil/Makefile - storage/innobase/fsp/Makefile - storage/innobase/fut/Makefile - storage/innobase/ha/Makefile - storage/innobase/ibuf/Makefile - storage/innobase/lock/Makefile - storage/innobase/log/Makefile - storage/innobase/mach/Makefile - storage/innobase/mem/Makefile - storage/innobase/mtr/Makefile - storage/innobase/os/Makefile - storage/innobase/page/Makefile - storage/innobase/pars/Makefile - storage/innobase/que/Makefile - storage/innobase/read/Makefile - storage/innobase/rem/Makefile - storage/innobase/row/Makefile - storage/innobase/srv/Makefile - storage/innobase/sync/Makefile - storage/innobase/thr/Makefile - storage/innobase/trx/Makefile - storage/innobase/handler/Makefile - storage/innobase/usr/Makefile) ]) -MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(innobase, [handler/ha_innodb.cc]) diff --git a/storage/innobase/que/Makefile.am b/storage/innobase/que/Makefile.am deleted file mode 100644 index 73f3fb07af4..00000000000 --- a/storage/innobase/que/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libque.a - -libque_a_SOURCES = que0que.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/read/Makefile.am b/storage/innobase/read/Makefile.am deleted file mode 100644 index 1e56a9716c3..00000000000 --- a/storage/innobase/read/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libread.a - -libread_a_SOURCES = read0read.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/rem/Makefile.am b/storage/innobase/rem/Makefile.am deleted file mode 100644 index 1026172b815..00000000000 --- a/storage/innobase/rem/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = librem.a - -librem_a_SOURCES = rem0rec.c rem0cmp.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/rem/rem0rec.c b/storage/innobase/rem/rem0rec.c index 549b5ee8b28..3bc73eca9ea 100644 --- a/storage/innobase/rem/rem0rec.c +++ b/storage/innobase/rem/rem0rec.c @@ -153,7 +153,6 @@ static void rec_init_offsets( /*=============*/ - /* out: the offsets */ rec_t* rec, /* in: physical record */ dict_index_t* index, /* in: record descriptor */ ulint* offsets)/* in/out: array of offsets; @@ -189,7 +188,7 @@ rec_init_offsets( } nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1); - lens = nulls - (index->n_nullable + 7) / 8; + lens = nulls - UT_BITS_IN_BYTES(index->n_nullable); offs = 0; null_mask = 1; @@ -304,7 +303,7 @@ rec_get_offsets_func( /* out: the new offsets */ rec_t* rec, /* in: physical record */ dict_index_t* index, /* in: record descriptor */ - ulint* offsets,/* in: array consisting of offsets[0] + ulint* offsets,/* in/out: array consisting of offsets[0] allocated elements, or an array from rec_get_offsets(), or NULL */ ulint n_fields,/* in: maximum number of initialized fields @@ -440,7 +439,7 @@ rec_get_converted_size_new( dtuple_t* dtuple) /* in: data tuple */ { ulint size = REC_N_NEW_EXTRA_BYTES - + (index->n_nullable + 7) / 8; + + UT_BITS_IN_BYTES(index->n_nullable); ulint i; ulint n_fields; ut_ad(index && dtuple); @@ -459,10 +458,10 @@ rec_get_converted_size_new( break; case REC_STATUS_INFIMUM: case REC_STATUS_SUPREMUM: - /* infimum or supremum record, 8 bytes */ - return(size + 8); /* no extra data needed */ + /* infimum or supremum record, 8 data bytes */ + return(REC_N_NEW_EXTRA_BYTES + 8); default: - ut_a(0); + ut_error; return(ULINT_UNDEFINED); } @@ -476,21 +475,31 @@ rec_get_converted_size_new( len = dtuple_get_nth_field(dtuple, i)->len; col = dict_field_get_col(field); - ut_ad(len != UNIV_SQL_NULL || !(col->prtype & DATA_NOT_NULL)); + ut_ad(dict_col_type_assert_equal( + col, dfield_get_type(dtuple_get_nth_field( + dtuple, i)))); if (len == UNIV_SQL_NULL) { /* No length is stored for NULL fields. */ + ut_ad(!(col->prtype & DATA_NOT_NULL)); continue; } ut_ad(len <= col->len || col->mtype == DATA_BLOB); - ut_ad(!field->fixed_len || len == field->fixed_len); if (field->fixed_len) { + ut_ad(len == field->fixed_len); + /* dict_index_add_col() should guarantee this */ + ut_ad(!field->prefix_len + || field->fixed_len == field->prefix_len); } else if (len < 128 || (col->len < 256 && col->mtype != DATA_BLOB)) { size++; } else { + /* For variable-length columns, we look up the + maximum length from the column itself. If this + is a prefix index column shorter than 256 bytes, + this will waste one byte. */ size += 2; } size += len; @@ -586,7 +595,7 @@ rec_set_nth_field_extern_bit_new( we do not write to log about the change */ { byte* nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1); - byte* lens = nulls - (index->n_nullable + 7) / 8; + byte* lens = nulls - UT_BITS_IN_BYTES(index->n_nullable); ulint i; ulint n_fields; ulint null_mask = 1; @@ -875,7 +884,7 @@ rec_convert_dtuple_to_rec_new( /* Calculate the offset of the origin in the physical record. We must loop over all fields to do this. */ - rec += (index->n_nullable + 7) / 8; + rec += UT_BITS_IN_BYTES(index->n_nullable); for (i = 0; i < n_fields; i++) { if (UNIV_UNLIKELY(i == n_node_ptr_field)) { @@ -892,6 +901,11 @@ rec_convert_dtuple_to_rec_new( len = dfield_get_len(field); fixed_len = dict_index_get_nth_field(index, i)->fixed_len; + ut_ad(dict_col_type_assert_equal( + dict_field_get_col(dict_index_get_nth_field( + index, i)), + dfield_get_type(field))); + if (!(dtype_get_prtype(type) & DATA_NOT_NULL)) { if (len == UNIV_SQL_NULL) continue; @@ -915,7 +929,7 @@ rec_convert_dtuple_to_rec_new( init: end = rec; nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1); - lens = nulls - (index->n_nullable + 7) / 8; + lens = nulls - UT_BITS_IN_BYTES(index->n_nullable); /* clear the SQL-null flags */ memset (lens + 1, 0, nulls - lens); @@ -1172,7 +1186,7 @@ rec_copy_prefix_to_buf( } nulls = rec - (REC_N_NEW_EXTRA_BYTES + 1); - lens = nulls - (index->n_nullable + 7) / 8; + lens = nulls - UT_BITS_IN_BYTES(index->n_nullable); UNIV_PREFETCH_R(lens); prefix_len = 0; null_mask = 1; diff --git a/storage/innobase/row/Makefile.am b/storage/innobase/row/Makefile.am deleted file mode 100644 index 6c1f960055d..00000000000 --- a/storage/innobase/row/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = librow.a - -librow_a_SOURCES = row0ins.c row0mysql.c row0purge.c row0row.c row0sel.c\ - row0uins.c row0umod.c row0undo.c row0upd.c row0vers.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c index 1fba0abcdaf..ad14b927170 100644 --- a/storage/innobase/row/row0ins.c +++ b/storage/innobase/row/row0ins.c @@ -51,21 +51,6 @@ innobase_invalidate_query_cache( ulint full_name_len); /* in: full name length where also the null chars count */ -/********************************************************************** -This function returns true if - -1) SQL-query in the current thread -is either REPLACE or LOAD DATA INFILE REPLACE. - -2) SQL-query in the current thread -is INSERT ON DUPLICATE KEY UPDATE. - -NOTE that /mysql/innobase/row/row0ins.c must contain the -prototype for this function ! */ - -ibool -innobase_query_is_update(void); - /************************************************************************* Creates an insert node struct. */ @@ -448,7 +433,11 @@ row_ins_cascade_calc_update_vec( ulint i; ulint j; - ut_a(node && foreign && cascade && table && index); + ut_a(node); + ut_a(foreign); + ut_a(cascade); + ut_a(table); + ut_a(index); /* Calculate the appropriate update vector which will set the fields in the child index record to the same value (possibly padded with @@ -791,7 +780,10 @@ row_ins_foreign_check_on_constraint( trx_t* trx; mem_heap_t* tmp_heap = NULL; - ut_a(thr && foreign && pcur && mtr); + ut_a(thr); + ut_a(foreign); + ut_a(pcur); + ut_a(mtr); trx = thr_get_trx(thr); @@ -1308,7 +1300,8 @@ run_again: goto exit_func; } - ut_a(check_table && check_index); + ut_a(check_table); + ut_a(check_index); if (check_table != table) { /* We already have a LOCK_IX on table, but not necessarily @@ -1336,11 +1329,9 @@ run_again: /* Scan index records and check if there is a matching record */ for (;;) { - page_t* page; rec = btr_pcur_get_rec(&pcur); - page = buf_frame_align(rec); - if (rec == page_get_infimum_rec(page)) { + if (page_rec_is_infimum(rec)) { goto next_rec; } @@ -1348,7 +1339,7 @@ run_again: offsets = rec_get_offsets(rec, check_index, offsets, ULINT_UNDEFINED, &heap); - if (rec == page_get_supremum_rec(page)) { + if (page_rec_is_supremum(rec)) { err = row_ins_set_shared_rec_lock( LOCK_ORDINARY, rec, check_index, offsets, thr); @@ -1654,6 +1645,7 @@ row_ins_scan_sec_index_for_duplicate( btr_pcur_t pcur; ulint err = DB_SUCCESS; ibool moved; + unsigned allow_duplicates; mtr_t mtr; mem_heap_t* heap = NULL; ulint offsets_[REC_OFFS_NORMAL_SIZE]; @@ -1684,12 +1676,14 @@ row_ins_scan_sec_index_for_duplicate( btr_pcur_open(index, entry, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); + allow_duplicates = thr_get_trx(thr)->duplicates & TRX_DUP_IGNORE; + /* Scan index records and check if there is a duplicate */ for (;;) { rec = btr_pcur_get_rec(&pcur); - if (rec == page_get_infimum_rec(buf_frame_align(rec))) { + if (page_rec_is_infimum(rec)) { goto next_rec; } @@ -1697,7 +1691,7 @@ row_ins_scan_sec_index_for_duplicate( offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap); - if (innobase_query_is_update()) { + if (allow_duplicates) { /* If the SQL-query will update or replace duplicate key we will take X-lock for @@ -1826,7 +1820,7 @@ row_ins_duplicate_error_in_clust( sure that in roll-forward we get the same duplicate errors as in original execution */ - if (innobase_query_is_update()) { + if (trx->duplicates & TRX_DUP_IGNORE) { /* If the SQL-query will update or replace duplicate key we will take X-lock for @@ -1864,7 +1858,7 @@ row_ins_duplicate_error_in_clust( offsets = rec_get_offsets(rec, cursor->index, offsets, ULINT_UNDEFINED, &heap); - if (innobase_query_is_update()) { + if (trx->duplicates & TRX_DUP_IGNORE) { /* If the SQL-query will update or replace duplicate key we will take X-lock for diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 7c9427db0d2..9f88fd8040b 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -476,7 +476,8 @@ handle_new_error: /* MySQL will roll back the latest SQL statement */ } else if (err == DB_ROW_IS_REFERENCED || err == DB_NO_REFERENCED_ROW - || err == DB_CANNOT_ADD_CONSTRAINT) { + || err == DB_CANNOT_ADD_CONSTRAINT + || err == DB_TOO_MANY_CONCURRENT_TRXS) { if (savept) { /* Roll back the latest, possibly incomplete insertion or update */ @@ -4058,3 +4059,25 @@ row_check_table_for_mysql( return(ret); } + +/************************************************************************* +Get the maximum row size. */ + +ulint +page_get_free_space_of_empty_noninline( +/*===================================*/ + /* out: The (approx) maximum size + of a row, this is a conservative + estimate, since the size can be + slightly larger depending upon + the ROW_FORMAT setting.*/ + dict_table_t* table) /* in: table for which max record + size is required.*/ +{ + ibool compact; + + compact = dict_table_is_comp(table); + + return(page_get_free_space_of_empty(compact) / 2); +} + diff --git a/storage/innobase/row/row0row.c b/storage/innobase/row/row0row.c index efa129d6211..08e50817db9 100644 --- a/storage/innobase/row/row0row.c +++ b/storage/innobase/row/row0row.c @@ -142,20 +142,15 @@ row_build_index_entry( dfield_copy(dfield, dfield2); /* If a column prefix index, take only the prefix */ - if (ind_field->prefix_len) { - if (dfield_get_len(dfield2) != UNIV_SQL_NULL) { + if (ind_field->prefix_len > 0 + && dfield_get_len(dfield2) != UNIV_SQL_NULL) { - storage_len = dtype_get_at_most_n_mbchars( - col->prtype, - col->mbminlen, col->mbmaxlen, - ind_field->prefix_len, - dfield_get_len(dfield2), - dfield2->data); + storage_len = dtype_get_at_most_n_mbchars( + col->prtype, col->mbminlen, col->mbmaxlen, + ind_field->prefix_len, + dfield_get_len(dfield2), dfield2->data); - dfield_set_len(dfield, storage_len); - } - - dfield_get_type(dfield)->len = ind_field->prefix_len; + dfield_set_len(dfield, storage_len); } } @@ -478,7 +473,9 @@ row_build_row_ref_in_tuple( ulint* offsets = offsets_; *offsets_ = (sizeof offsets_) / sizeof *offsets_; - ut_a(ref && index && rec); + ut_a(ref); + ut_a(index); + ut_a(rec); if (UNIV_UNLIKELY(!index->table)) { fputs("InnoDB: table ", stderr); diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index a3199055b54..e70b3b8671f 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -3619,6 +3619,32 @@ shortcut_fails_too_big_rec: pcur, 0, &mtr); pcur->trx_if_known = trx; + + rec = btr_pcur_get_rec(pcur); + + if (!moves_up + && !page_rec_is_supremum(rec) + && set_also_gap_locks + && !(srv_locks_unsafe_for_binlog + || trx->isolation_level == TRX_ISO_READ_COMMITTED) + && prebuilt->select_lock_type != LOCK_NONE) { + + /* Try to place a gap lock on the next index record + to prevent phantoms in ORDER BY ... DESC queries */ + + offsets = rec_get_offsets(page_rec_get_next(rec), + index, offsets, + ULINT_UNDEFINED, &heap); + err = sel_set_rec_lock(page_rec_get_next(rec), + index, offsets, + prebuilt->select_lock_type, + LOCK_GAP, thr); + + if (err != DB_SUCCESS) { + + goto lock_wait_or_error; + } + } } else { if (mode == PAGE_CUR_G) { btr_pcur_open_at_index_side( diff --git a/storage/innobase/srv/Makefile.am b/storage/innobase/srv/Makefile.am deleted file mode 100644 index e0b5b911b04..00000000000 --- a/storage/innobase/srv/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libsrv.a - -libsrv_a_SOURCES = srv0srv.c srv0que.c srv0start.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index 72e8fe751d0..8f8c9386f41 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -47,6 +47,7 @@ Created 10/8/1995 Heikki Tuuri #include "dict0boot.h" #include "srv0start.h" #include "row0mysql.h" +#include "ha_prototypes.h" /* This is set to TRUE if the MySQL user has set it in MySQL; currently affects only FOREIGN KEY definition parsing */ @@ -180,6 +181,16 @@ dulint srv_archive_recovery_limit_lsn; ulint srv_lock_wait_timeout = 1024 * 1024 * 1024; +/* This parameter is used to throttle the number of insert buffers that are +merged in a batch. By increasing this parameter on a faster disk you can +possibly reduce the number of I/O operations performed to complete the +merge operation. The value of this parameter is used as is by the +background loop when the system is idle (low load), on a busy system +the parameter is scaled down by a factor of 4, this is to avoid putting +a heavier load on the I/O sub system. */ + +ulong srv_insert_buffer_batch_size = 20; + char* srv_file_flush_method_str = NULL; ulint srv_unix_file_flush_method = SRV_UNIX_FDATASYNC; ulint srv_win_file_flush_method = SRV_WIN_IO_UNBUFFERED; @@ -977,6 +988,17 @@ srv_conc_enter_innodb( srv_conc_slot_t* slot = NULL; ulint i; + if (trx->mysql_thd != NULL + && thd_is_replication_slave_thread(trx->mysql_thd)) { + + /* TODO Do something more interesting (based on a config + parameter). Some users what to give the replication + thread very low priority, see http://bugs.mysql.com/25078 + This can be done by introducing + innodb_replication_delay(ms) config parameter */ + return; + } + /* If trx has 'free tickets' to enter the engine left, then use one such ticket */ @@ -1017,7 +1039,7 @@ retry: if (!has_slept && !trx->has_search_latch && NULL == UT_LIST_GET_FIRST(trx->trx_locks)) { - has_slept = TRUE; /* We let is sleep only once to avoid + has_slept = TRUE; /* We let it sleep only once to avoid starvation */ srv_conc_n_waiting_threads++; @@ -1130,7 +1152,7 @@ srv_conc_force_enter_innodb( srv_conc_n_threads++; trx->declared_to_be_inside_innodb = TRUE; - trx->n_tickets_to_enter_innodb = 0; + trx->n_tickets_to_enter_innodb = 1; os_fast_mutex_unlock(&srv_conc_mutex); } @@ -1152,6 +1174,12 @@ srv_conc_force_exit_innodb( return; } + if (trx->mysql_thd != NULL + && thd_is_replication_slave_thread(trx->mysql_thd)) { + + return; + } + if (trx->declared_to_be_inside_innodb == FALSE) { return; @@ -1853,6 +1881,7 @@ srv_lock_timeout_and_monitor_thread( double time_elapsed; time_t current_time; time_t last_table_monitor_time; + time_t last_tablespace_monitor_time; time_t last_monitor_time; ibool some_waits; double wait_time; @@ -1865,6 +1894,7 @@ srv_lock_timeout_and_monitor_thread( UT_NOT_USED(arg); srv_last_monitor_time = time(NULL); last_table_monitor_time = time(NULL); + last_tablespace_monitor_time = time(NULL); last_monitor_time = time(NULL); loop: srv_lock_timeout_and_monitor_active = TRUE; @@ -1901,9 +1931,9 @@ loop: } if (srv_print_innodb_tablespace_monitor - && difftime(current_time, last_table_monitor_time) > 60) { - - last_table_monitor_time = time(NULL); + && difftime(current_time, + last_tablespace_monitor_time) > 60) { + last_tablespace_monitor_time = time(NULL); fputs("========================" "========================\n", @@ -2100,7 +2130,7 @@ loop: os_thread_sleep(2000000); - if (srv_shutdown_state < SRV_SHUTDOWN_LAST_PHASE) { + if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) { goto loop; } @@ -2270,7 +2300,8 @@ loop: + buf_pool->n_pages_written; if (n_pend_ios < 3 && (n_ios - n_ios_old < 5)) { srv_main_thread_op_info = "doing insert buffer merge"; - ibuf_contract_for_n_pages(TRUE, 5); + ibuf_contract_for_n_pages( + TRUE, srv_insert_buffer_batch_size / 4); srv_main_thread_op_info = "flushing log"; @@ -2331,7 +2362,7 @@ loop: even if the server were active */ srv_main_thread_op_info = "doing insert buffer merge"; - ibuf_contract_for_n_pages(TRUE, 5); + ibuf_contract_for_n_pages(TRUE, srv_insert_buffer_batch_size / 4); srv_main_thread_op_info = "flushing log"; log_buffer_flush_to_disk(); @@ -2469,7 +2500,8 @@ background_loop: if (srv_fast_shutdown && srv_shutdown_state > 0) { n_bytes_merged = 0; } else { - n_bytes_merged = ibuf_contract_for_n_pages(TRUE, 20); + n_bytes_merged = ibuf_contract_for_n_pages( + TRUE, srv_insert_buffer_batch_size); } srv_main_thread_op_info = "reserving kernel mutex"; diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c index 25f6f05e878..dac84e1410d 100644 --- a/storage/innobase/srv/srv0start.c +++ b/storage/innobase/srv/srv0start.c @@ -1025,6 +1025,12 @@ innobase_start_or_create_for_mysql(void) "InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!\n"); #endif +#ifdef UNIV_IBUF_DEBUG + fprintf(stderr, + "InnoDB: !!!!!!!! UNIV_IBUF_DEBUG switched on !!!!!!!!!\n" + "InnoDB: Crash recovery will fail with UNIV_IBUF_DEBUG\n"); +#endif + #ifdef UNIV_SYNC_DEBUG fprintf(stderr, "InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!\n"); diff --git a/storage/innobase/sync/Makefile.am b/storage/innobase/sync/Makefile.am deleted file mode 100644 index 7cf274b64e8..00000000000 --- a/storage/innobase/sync/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003-2004 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libsync.a - -libsync_a_SOURCES = sync0arr.c sync0rw.c sync0sync.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/sync/sync0arr.c b/storage/innobase/sync/sync0arr.c index e45cd48a6b4..82b08a890e0 100644 --- a/storage/innobase/sync/sync0arr.c +++ b/storage/innobase/sync/sync0arr.c @@ -670,7 +670,9 @@ sync_array_detect_deadlock( ibool ret; rw_lock_debug_t*debug; - ut_a(arr && start && cell); + ut_a(arr); + ut_a(start); + ut_a(cell); ut_ad(cell->wait_object); ut_ad(os_thread_get_curr_id() == start->thread); ut_ad(depth < 100); diff --git a/storage/innobase/thr/Makefile.am b/storage/innobase/thr/Makefile.am deleted file mode 100644 index febcdf3e1a3..00000000000 --- a/storage/innobase/thr/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libthr.a - -libthr_a_SOURCES = thr0loc.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/trx/Makefile.am b/storage/innobase/trx/Makefile.am deleted file mode 100644 index f9722454ef5..00000000000 --- a/storage/innobase/trx/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libtrx.a - -libtrx_a_SOURCES = trx0purge.c trx0rec.c trx0roll.c trx0rseg.c\ - trx0sys.c trx0trx.c trx0undo.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/trx/trx0rec.c b/storage/innobase/trx/trx0rec.c index 69e858fe71d..50f8b011463 100644 --- a/storage/innobase/trx/trx0rec.c +++ b/storage/innobase/trx/trx0rec.c @@ -1024,6 +1024,7 @@ trx_undo_report_row_operation( ibool is_insert; trx_rseg_t* rseg; mtr_t mtr; + ulint err = DB_SUCCESS; mem_heap_t* heap = NULL; ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; @@ -1035,7 +1036,7 @@ trx_undo_report_row_operation( *roll_ptr = ut_dulint_zero; - return(DB_SUCCESS); + return(err); } ut_ad(thr); @@ -1053,7 +1054,7 @@ trx_undo_report_row_operation( if (trx->insert_undo == NULL) { - trx_undo_assign_undo(trx, TRX_UNDO_INSERT); + err = trx_undo_assign_undo(trx, TRX_UNDO_INSERT); } undo = trx->insert_undo; @@ -1063,7 +1064,7 @@ trx_undo_report_row_operation( if (trx->update_undo == NULL) { - trx_undo_assign_undo(trx, TRX_UNDO_UPDATE); + err = trx_undo_assign_undo(trx, TRX_UNDO_UPDATE); } @@ -1071,11 +1072,11 @@ trx_undo_report_row_operation( is_insert = FALSE; } - if (undo == NULL) { - /* Did not succeed: out of space */ + if (err != DB_SUCCESS) { + /* Did not succeed: return the error encountered */ mutex_exit(&(trx->undo_mutex)); - return(DB_OUT_OF_FILE_SPACE); + return(err); } page_no = undo->last_page_no; @@ -1107,7 +1108,9 @@ trx_undo_report_row_operation( if (offset == 0) { /* The record did not fit on the page. We erase the end segment of the undo log page and write a log - record of it to to ensure deterministic contents. */ + record of it: this is to ensure that in the debug + version the replicate page constructed using the log + records stays identical to the original page */ trx_undo_erase_page_end(undo_page, &mtr); } @@ -1163,7 +1166,7 @@ trx_undo_report_row_operation( if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); } - return(DB_SUCCESS); + return(err); } /*============== BUILDING PREVIOUS VERSION OF A RECORD ===============*/ diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index cdea3e9c477..2d5ce0e1c61 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -25,6 +25,7 @@ Created 3/26/1996 Heikki Tuuri #include "btr0sea.h" #include "os0proc.h" #include "trx0xa.h" +#include "ha_prototypes.h" /* Copy of the prototype for innobase_mysql_print_thd: this copy MUST be equal to the one in mysql/sql/ha_innodb.cc ! */ @@ -130,6 +131,8 @@ trx_create( trx->mysql_thd = NULL; trx->mysql_query_str = NULL; + trx->active_trans = 0; + trx->duplicates = 0; trx->n_mysql_tables_in_use = 0; trx->mysql_n_tables_locked = 0; @@ -1771,6 +1774,61 @@ trx_print( } } +/*********************************************************************** +Compares the "weight" (or size) of two transactions. The weight of one +transaction is estimated as the number of altered rows + the number of +locked rows. Transactions that have edited non-transactional tables are +considered heavier than ones that have not. */ + +int +trx_weight_cmp( +/*===========*/ + /* out: <0, 0 or >0; similar to strcmp(3) */ + trx_t* a, /* in: the first transaction to be compared */ + trx_t* b) /* in: the second transaction to be compared */ +{ + ibool a_notrans_edit; + ibool b_notrans_edit; + + /* If mysql_thd is NULL for a transaction we assume that it has + not edited non-transactional tables. */ + + a_notrans_edit = a->mysql_thd != NULL + && thd_has_edited_nontrans_tables(a->mysql_thd); + + b_notrans_edit = b->mysql_thd != NULL + && thd_has_edited_nontrans_tables(b->mysql_thd); + + if (a_notrans_edit && !b_notrans_edit) { + + return(1); + } + + if (!a_notrans_edit && b_notrans_edit) { + + return(-1); + } + + /* Either both had edited non-transactional tables or both had + not, we fall back to comparing the number of altered/locked + rows. */ + +#if 0 + fprintf(stderr, + "%s TRX_WEIGHT(a): %lld+%lu, TRX_WEIGHT(b): %lld+%lu\n", + __func__, + ut_conv_dulint_to_longlong(a->undo_no), + UT_LIST_GET_LEN(a->trx_locks), + ut_conv_dulint_to_longlong(b->undo_no), + UT_LIST_GET_LEN(b->trx_locks)); +#endif + +#define TRX_WEIGHT(t) \ + ut_dulint_add((t)->undo_no, UT_LIST_GET_LEN((t)->trx_locks)) + + return(ut_dulint_cmp(TRX_WEIGHT(a), TRX_WEIGHT(b))); +} + /******************************************************************** Prepares a transaction. */ @@ -1889,7 +1947,7 @@ Does the transaction prepare for MySQL. */ ulint trx_prepare_for_mysql( -/*====-=============*/ +/*==================*/ /* out: 0 or error number */ trx_t* trx) /* in: trx handle */ { diff --git a/storage/innobase/trx/trx0undo.c b/storage/innobase/trx/trx0undo.c index 831e337f513..64e5ad3c9a8 100644 --- a/storage/innobase/trx/trx0undo.c +++ b/storage/innobase/trx/trx0undo.c @@ -373,26 +373,31 @@ trx_undo_page_init( /******************************************************************* Creates a new undo log segment in file. */ static -page_t* +ulint trx_undo_seg_create( /*================*/ - /* out: segment header page x-latched, NULL - if no space left */ + /* out: DB_SUCCESS if page creation OK + possible error codes are: + DB_TOO_MANY_CONCURRENT_TRXS + DB_OUT_OF_FILE_SPACE */ trx_rseg_t* rseg __attribute__((unused)),/* in: rollback segment */ trx_rsegf_t* rseg_hdr,/* in: rollback segment header, page x-latched */ ulint type, /* in: type of the segment: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */ ulint* id, /* out: slot index within rseg header */ + page_t** undo_page, + /* out: segment header page x-latched, NULL + if there was an error */ mtr_t* mtr) /* in: mtr */ { ulint slot_no; ulint space; - page_t* undo_page; trx_upagef_t* page_hdr; trx_usegf_t* seg_hdr; ulint n_reserved; ibool success; + ulint err = DB_SUCCESS; ut_ad(mtr && id && rseg_hdr); ut_ad(mutex_own(&(rseg->mutex))); @@ -410,7 +415,7 @@ trx_undo_seg_create( "InnoDB: many active transactions" " running concurrently?\n"); - return(NULL); + return(DB_TOO_MANY_CONCURRENT_TRXS); } space = buf_frame_get_space_id(rseg_hdr); @@ -419,30 +424,30 @@ trx_undo_seg_create( mtr); if (!success) { - return(NULL); + return(DB_OUT_OF_FILE_SPACE); } /* Allocate a new file segment for the undo log */ - undo_page = fseg_create_general(space, 0, + *undo_page = fseg_create_general(space, 0, TRX_UNDO_SEG_HDR + TRX_UNDO_FSEG_HEADER, TRUE, mtr); fil_space_release_free_extents(space, n_reserved); - if (undo_page == NULL) { + if (*undo_page == NULL) { /* No space left */ - return(NULL); + return(DB_OUT_OF_FILE_SPACE); } #ifdef UNIV_SYNC_DEBUG - buf_page_dbg_add_level(undo_page, SYNC_TRX_UNDO_PAGE); + buf_page_dbg_add_level(*undo_page, SYNC_TRX_UNDO_PAGE); #endif /* UNIV_SYNC_DEBUG */ - page_hdr = undo_page + TRX_UNDO_PAGE_HDR; - seg_hdr = undo_page + TRX_UNDO_SEG_HDR; + page_hdr = *undo_page + TRX_UNDO_PAGE_HDR; + seg_hdr = *undo_page + TRX_UNDO_SEG_HDR; - trx_undo_page_init(undo_page, type, mtr); + trx_undo_page_init(*undo_page, type, mtr); mlog_write_ulint(page_hdr + TRX_UNDO_PAGE_FREE, TRX_UNDO_SEG_HDR + TRX_UNDO_SEG_HDR_SIZE, @@ -456,10 +461,11 @@ trx_undo_seg_create( page_hdr + TRX_UNDO_PAGE_NODE, mtr); trx_rsegf_set_nth_undo(rseg_hdr, slot_no, - buf_frame_get_page_no(undo_page), mtr); + buf_frame_get_page_no(*undo_page), mtr); + *id = slot_no; - return(undo_page); + return(err); } /************************************************************************** @@ -1387,6 +1393,11 @@ trx_undo_mem_create( undo = mem_alloc(sizeof(trx_undo_t)); + if (undo == NULL) { + + return NULL; + } + undo->id = id; undo->type = type; undo->state = TRX_UNDO_ACTIVE; @@ -1464,11 +1475,15 @@ trx_undo_mem_free( /************************************************************************** Creates a new undo log. */ static -trx_undo_t* +ulint trx_undo_create( /*============*/ - /* out: undo log object, NULL if did not - succeed: out of space */ + /* out: DB_SUCCESS if successful in creating + the new undo lob object, possible error + codes are: + DB_TOO_MANY_CONCURRENT_TRXS + DB_OUT_OF_FILE_SPACE + DB_OUT_OF_MEMORY*/ trx_t* trx, /* in: transaction */ trx_rseg_t* rseg, /* in: rollback segment memory copy */ ulint type, /* in: type of the log: TRX_UNDO_INSERT or @@ -1476,34 +1491,37 @@ trx_undo_create( dulint trx_id, /* in: id of the trx for which the undo log is created */ XID* xid, /* in: X/Open transaction identification*/ + trx_undo_t** undo, /* out: the new undo log object, undefined + * if did not succeed */ mtr_t* mtr) /* in: mtr */ { trx_rsegf_t* rseg_header; ulint page_no; ulint offset; ulint id; - trx_undo_t* undo; page_t* undo_page; + ulint err; ut_ad(mutex_own(&(rseg->mutex))); if (rseg->curr_size == rseg->max_size) { - return(NULL); + return(DB_OUT_OF_FILE_SPACE); } rseg->curr_size++; rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr); - undo_page = trx_undo_seg_create(rseg, rseg_header, type, &id, mtr); + err = trx_undo_seg_create(rseg, rseg_header, type, &id, + &undo_page, mtr); - if (undo_page == NULL) { + if (err != DB_SUCCESS) { /* Did not succeed */ rseg->curr_size--; - return(NULL); + return(err); } page_no = buf_frame_get_page_no(undo_page); @@ -1515,9 +1533,14 @@ trx_undo_create( undo_page + offset, mtr); } - undo = trx_undo_mem_create(rseg, id, type, trx_id, xid, + *undo = trx_undo_mem_create(rseg, id, type, trx_id, xid, page_no, offset); - return(undo); + if (*undo == NULL) { + + err = DB_OUT_OF_MEMORY; + } + + return(err); } /*================ UNDO LOG ASSIGNMENT AND CLEANUP =====================*/ @@ -1634,17 +1657,20 @@ trx_undo_mark_as_dict_operation( Assigns an undo log for a transaction. A new undo log is created or a cached undo log reused. */ -trx_undo_t* +ulint trx_undo_assign_undo( /*=================*/ - /* out: the undo log, NULL if did not succeed: out of - space */ - trx_t* trx, /* in: transaction */ - ulint type) /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */ + /* out: DB_SUCCESS if undo log assign + successful, possible error codes are: + DD_TOO_MANY_CONCURRENT_TRXS + DB_OUT_OF_FILE_SPACE DB_OUT_OF_MEMORY*/ + trx_t* trx, /* in: transaction */ + ulint type) /* in: TRX_UNDO_INSERT or TRX_UNDO_UPDATE */ { trx_rseg_t* rseg; trx_undo_t* undo; mtr_t mtr; + ulint err = DB_SUCCESS; ut_ad(trx); ut_ad(trx->rseg); @@ -1662,15 +1688,11 @@ trx_undo_assign_undo( undo = trx_undo_reuse_cached(trx, rseg, type, trx->id, &trx->xid, &mtr); if (undo == NULL) { - undo = trx_undo_create(trx, rseg, type, trx->id, &trx->xid, - &mtr); - if (undo == NULL) { - /* Did not succeed */ + err = trx_undo_create(trx, rseg, type, trx->id, &trx->xid, + &undo, &mtr); + if (err != DB_SUCCESS) { - mutex_exit(&(rseg->mutex)); - mtr_commit(&mtr); - - return(NULL); + goto func_exit; } } @@ -1688,10 +1710,11 @@ trx_undo_assign_undo( trx_undo_mark_as_dict_operation(trx, undo, &mtr); } +func_exit: mutex_exit(&(rseg->mutex)); mtr_commit(&mtr); - return(undo); + return err; } /********************************************************************** diff --git a/storage/innobase/usr/Makefile.am b/storage/innobase/usr/Makefile.am deleted file mode 100644 index ea485022f71..00000000000 --- a/storage/innobase/usr/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libusr.a - -libusr_a_SOURCES = usr0sess.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/ut/Makefile.am b/storage/innobase/ut/Makefile.am deleted file mode 100644 index d79184759c1..00000000000 --- a/storage/innobase/ut/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (C) 2001, 2003 MySQL AB & Innobase Oy -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include ../include/Makefile.i - -noinst_LIBRARIES = libut.a - -libut_a_SOURCES = ut0byte.c ut0dbg.c ut0mem.c ut0rnd.c ut0ut.c ut0vec.c ut0list.c ut0wqueue.c - -EXTRA_PROGRAMS = - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/storage/innobase/ut/ut0ut.c b/storage/innobase/ut/ut0ut.c index bc6778f4c2f..389063ad821 100644 --- a/storage/innobase/ut/ut0ut.c +++ b/storage/innobase/ut/ut0ut.c @@ -14,6 +14,7 @@ Created 5/11/1994 Heikki Tuuri #include #include +#include #include "ut0sort.h" #include "trx0trx.h" From 9016198aa2e7f9d58408a08c13861450764bcaaa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jul 2007 08:16:51 -0600 Subject: [PATCH 128/227] NULL MERGE UP to 5.1. Apply innodb-5.0-* snapshots: ss1489 and ss1547. Fixes: Bug#9709: InnoDB inconsistensy causes "Operating System Error 32/33" Bug#22819: SHOW INNODB STATUS crashes the server with an assertion failure under high load Bug#25645: Assertion failure in file srv0srv.c Bug#27294: insert into ... select ... causes crash with innodb_locks_unsafe_for_binlog=1 Bug#28138: indexing column prefixes produces corruption in InnoDB innobase/btr/btr0btr.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1547: branches/5.0: Merge r1546 from trunk: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug #28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. innobase/buf/buf0buf.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1502: branches/5.0: Add debug code for Bug 26081. This change has some debug assertions that have been promoted to normal assertions. These will need to be undone once we've nailed this bug. innobase/buf/buf0lru.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1502: branches/5.0: Add debug code for Bug 26081. This change has some debug assertions that have been promoted to normal assertions. These will need to be undone once we've nailed this bug. innobase/ibuf/ibuf0ibuf.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1547: branches/5.0: Merge r1546 from trunk: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug #28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. innobase/include/buf0buf.ic: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1502: branches/5.0: Add debug code for Bug 26081. This change has some debug assertions that have been promoted to normal assertions. These will need to be undone once we've nailed this bug. innobase/include/buf0lru.h: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1502: branches/5.0: Add debug code for Bug 26081. This change has some debug assertions that have been promoted to normal assertions. These will need to be undone once we've nailed this bug. innobase/include/dict0dict.h: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1547: branches/5.0: Merge r1546 from trunk: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug #28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. innobase/include/dict0dict.ic: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1547: branches/5.0: Merge r1546 from trunk: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug #28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. innobase/include/dict0mem.h: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1537: branches/5.0: merge r1536 and partially r1535 Change the comment to a more appropriate one. Discussed with Heikki on IM. Document that DICT_MAX_INDEX_COL_LEN should not be changed. innobase/include/os0file.h: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1417: branches/5.0: Fix Bug#9709 by retrying (forever) if ERROR_SHARING_VIOLATION or ERROR_LOCK_VIOLATION is encountered during file operation. This is caused by backup software, so InnoDB should retry while the backup software is done with the file. Approved by: Heikki innobase/include/trx0trx.h: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1463: branches/5.0: merge r1462 from trunk: Fix typo in comment. innobase/lock/lock0lock.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1458: branches/5.0: Fix Bug#22819, remove assertion. (http://bugs.mysql.com/bug.php?id=22819) innobase/log/log0log.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1520: Patch to allow monitor threads to stop before proceeding with normal shutdown. Also have a separate time counter for tablespace monitor. reviewed by: Heikki Revision r1525: backport of r1524 Log: Undo bad space formatting introduced in earlier commit r1521 spotted by: Marko innobase/mtr/mtr0mtr.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1502: branches/5.0: Add debug code for Bug 26081. This change has some debug assertions that have been promoted to normal assertions. These will need to be undone once we've nailed this bug. innobase/os/os0file.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1417: branches/5.0: Fix Bug#9709 by retrying (forever) if ERROR_SHARING_VIOLATION or ERROR_LOCK_VIOLATION is encountered during file operation. This is caused by backup software, so InnoDB should retry while the backup software is done with the file. Approved by: Heikki innobase/rem/rem0rec.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1547: branches/5.0: Merge r1546 from trunk: When buffering an insert to a prefix index of a variable-length column, do not incorrectly mark the column as fixed-length. (Bug #28138) ibuf_entry_build(): Instead of prefix_len, pass fixed_len to dtype_new_store_for_order_and_null_size(). Add debug assertions. btr_index_rec_validate(): Correct a comment about prefix indexes. rec_get_converted_size_new(), rec_convert_dtuple_to_rec_new(): Add debug assertions and comments. dict_col_type_assert_equal(): New debug function. innobase/row/row0sel.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1456: branches/5.0: merge r1452 from trunk: Fix phantom reads (http://bugs.mysql.com/27197) following Heikki's patch in the bug followup. innobase/srv/srv0srv.c: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1460: branches/5.0: Merge r1459 from trunk: Fix typo in the comment. Revision r1520: Patch to allow monitor threads to stop before proceeding with normal shutdown. Also have a separate time counter for tablespace monitor. reviewed by: Heikki sql/ha_innodb.cc: Apply innodb-5.0-* snapshots: ss1489 and ss1547. Revision r1436: branches/5.0: Fix Bug#27294 by using trx returned by check_trx_exists() instead of prebuilt->trx. This has been fixed in 5.1 in r782. Approved by: Heikki Revision r1443: branches/5.0: merge r1442 from trunk: Potential fix for Bug#25645: "Move innobase_release_stat_resources(trx) outside the 'if' in ha_innobase::external_lock(). That would add more safety that whatever MySQL does at a query end, there would be no risk of a hang on the btr search latch." Also call innobase_release_temporary_latches() in the beginning of ha_innobase::close(). Approved by: Heikki Revision r1454: branches/5.0: merge r1453 from trunk: Bugfix: only call innobase_release_temporary_latches() in case of current_thd is not NULL, otherwise we get NULL pointer dereferencing. Revision r1504: branches/5.0: Apply patch for Bug 27650 from MySQL. Revision r1539: Backport of r1538 from 5.1 Do not return error in ha_innobase::info if srv_force_recovery >= 4. This is to allow for normal processing of the query by MySQL instead of generating an error. Reviewed by: Heikki --- innobase/btr/btr0btr.c | 7 ++- innobase/buf/buf0buf.c | 108 +++++++++++++++++++++++++++++++--- innobase/buf/buf0lru.c | 2 - innobase/ibuf/ibuf0ibuf.c | 30 ++++++++-- innobase/include/buf0buf.ic | 21 +++++-- innobase/include/buf0lru.h | 2 - innobase/include/dict0dict.h | 11 ++++ innobase/include/dict0dict.ic | 24 ++++++++ innobase/include/dict0mem.h | 11 ++-- innobase/include/os0file.h | 3 +- innobase/include/trx0trx.h | 2 +- innobase/lock/lock0lock.c | 6 -- innobase/log/log0log.c | 33 +++++------ innobase/mtr/mtr0mtr.c | 13 +++- innobase/os/os0file.c | 17 +++++- innobase/rem/rem0rec.c | 24 ++++++-- innobase/row/row0sel.c | 25 ++++++++ innobase/srv/srv0srv.c | 10 ++-- sql/ha_innodb.cc | 39 ++++++++---- 19 files changed, 315 insertions(+), 73 deletions(-) diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index 07bc04feae6..a339405372d 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -2542,8 +2542,11 @@ btr_index_rec_validate( rec_get_nth_field(rec, offsets, i, &len); - /* Note that prefix indexes are not fixed size even when - their type is CHAR. */ + /* Note that if fixed_size != 0, it equals the + length of a fixed-size column in the clustered index. + A prefix index of the column is of fixed, but different + length. When fixed_size == 0, prefix_len is the maximum + length of the prefix index column. */ if ((dict_index_get_nth_field(index, i)->prefix_len == 0 && len != UNIV_SQL_NULL && fixed_size diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index f24f1744363..9df48495355 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -1220,7 +1220,8 @@ loop: ut_ad(buf_validate()); } #endif - ut_ad(block->buf_fix_count > 0); + /* This debug code has been upgraded to narrow down Bug# 26081 */ + ut_a(block->buf_fix_count > 0); ut_ad(block->state == BUF_BLOCK_FILE_PAGE); if (mode == BUF_GET_NOWAIT) { @@ -1238,6 +1239,13 @@ loop: if (!success) { mutex_enter(&block->mutex); + /* This debug code has been added to narrow + down Bug# 26081 */ + if (UNIV_UNLIKELY(block->buf_fix_count == 0)) { + buf_print_diagnostic(mtr, block); + ut_error; + } + block->buf_fix_count--; mutex_exit(&block->mutex); @@ -1362,7 +1370,14 @@ buf_page_optimistic_get_func( if (UNIV_UNLIKELY(!success)) { mutex_enter(&block->mutex); - + + /* This debug code has been added to narrow + down Bug# 26081 */ + if (UNIV_UNLIKELY(block->buf_fix_count == 0)) { + buf_print_diagnostic(mtr, block); + ut_error; + } + block->buf_fix_count--; mutex_exit(&block->mutex); @@ -1384,7 +1399,14 @@ buf_page_optimistic_get_func( } mutex_enter(&block->mutex); - + + /* This debug code has been added to narrow + down Bug# 26081 */ + if (UNIV_UNLIKELY(block->buf_fix_count == 0)) { + buf_print_diagnostic(mtr, block); + ut_error; + } + block->buf_fix_count--; mutex_exit(&block->mutex); @@ -1404,7 +1426,10 @@ buf_page_optimistic_get_func( ut_ad(buf_validate()); } #endif - ut_ad(block->buf_fix_count > 0); + /* This debug code has been upgraded from ut_ad() to narrow + down Bug# 26081 */ + ut_a(block->buf_fix_count > 0); + ut_ad(block->state == BUF_BLOCK_FILE_PAGE); #ifdef UNIV_DEBUG_FILE_ACCESSES @@ -1493,7 +1518,14 @@ buf_page_get_known_nowait( if (!success) { mutex_enter(&block->mutex); - + + /* This debug code has been added to narrow + down Bug# 26081 */ + if (UNIV_UNLIKELY(block->buf_fix_count == 0)) { + buf_print_diagnostic(mtr, block); + ut_error; + } + block->buf_fix_count--; mutex_exit(&block->mutex); @@ -1514,7 +1546,8 @@ buf_page_get_known_nowait( ut_ad(buf_validate()); } #endif - ut_ad(block->buf_fix_count > 0); + /* This debug code has been upgraded to narrow down Bug# 26081 */ + ut_a(block->buf_fix_count > 0); ut_ad(block->state == BUF_BLOCK_FILE_PAGE); #ifdef UNIV_DEBUG_FILE_ACCESSES ut_a(block->file_page_was_freed == FALSE); @@ -2027,7 +2060,6 @@ buf_pool_invalidate(void) mutex_exit(&(buf_pool->mutex)); } -#ifdef UNIV_DEBUG /************************************************************************* Validates the buffer buf_pool data structure. */ @@ -2227,7 +2259,6 @@ buf_print(void) ut_a(buf_validate()); } -#endif /* UNIV_DEBUG */ /************************************************************************* Returns the number of latched pages in the buffer pool. */ @@ -2483,3 +2514,64 @@ buf_get_free_list_len(void) return(len); } + +/************************************************************************* +Print the block fields. */ + +void +buf_block_print( +/*============*/ + const buf_block_t* block) /* in: block to print */ +{ + fprintf(stderr, + "BLOCK fields\nmagic_n: 0x%lx\n" + "state: %lu frame: 0x%lx space:offset: 0x%lx:0x%lx\n" + "hash value: 0x%lx check_index_page_at_flush: %ld\n" + "newest_modification %lu:%lu oldest_modification %lu:%lu\n" + "flush_type: %lu in_free_list: %ld in_LRU_list: %ld\n" + "LRU_position: %ld freed_page_clock: %lu old: %ld\n" + "accessed: %ld buf_fix_count: %lu io_fix: %ld " + "modify_clock: %lu:%lu\n" + "n_hash_helps: %lu n_fields: %ld n_bytes: %lu side: %lu\n" + "is_hashed: %lu n_pointers: %lu curr_n_fields: %lu\n" + "curr_n_bytes: %lu curr_side: %lu index name: %s\n" + "file_page_was_freed: %lu\n", + block->magic_n, block->state, (ulint) block->frame, + block->space, block->offset, block->lock_hash_val, + block->check_index_page_at_flush, + ut_dulint_get_high(block->newest_modification), + ut_dulint_get_low(block->newest_modification), + ut_dulint_get_high(block->oldest_modification), + ut_dulint_get_low(block->oldest_modification), + block->flush_type, block->in_free_list, block->in_LRU_list, + block->LRU_position, block->freed_page_clock, + block->old, block->accessed, block->buf_fix_count, + block->io_fix, + ut_dulint_get_high(block->modify_clock), + ut_dulint_get_low(block->modify_clock), + block->n_hash_helps, block->n_fields, block->n_bytes, + block->side, block->is_hashed, block->n_pointers, + block->curr_n_fields, block->curr_n_bytes, + block->curr_side, block->index->name, + block->file_page_was_freed); +} + +/************************************************************************ +Print some diagnostics related to the buffer pool.*/ + +void +buf_print_diagnostic( +/*=================*/ + mtr_t* mtr, /* in: mtr to print */ + const buf_block_t* block) /* in: block to print */ +{ + fprintf(stderr, "=== MTR ===\n"); + mtr_print(mtr); + buf_LRU_print(); + buf_print(); + buf_LRU_validate(); + buf_print_io(stderr); + fprintf(stderr, "=== BLOCK ===\n"); + buf_block_print(block); +} + diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c index dfee2add045..0f632f0752a 100644 --- a/innobase/buf/buf0lru.c +++ b/innobase/buf/buf0lru.c @@ -945,7 +945,6 @@ buf_LRU_block_free_hashed_page( buf_LRU_block_free_non_file_page(block); } -#ifdef UNIV_DEBUG /************************************************************************** Validates the LRU list. */ @@ -1076,4 +1075,3 @@ buf_LRU_print(void) mutex_exit(&(buf_pool->mutex)); } -#endif /* UNIV_DEBUG */ diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index eb10a88d1d1..031add1c9ba 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -1436,6 +1436,9 @@ ibuf_entry_build( *buf2++ = 0; /* write the compact format indicator */ } for (i = 0; i < n_fields; i++) { + ulint fixed_len; + const dict_field_t* ifield; + /* We add 4 below because we have the 4 extra fields at the start of an ibuf record */ @@ -1443,11 +1446,30 @@ ibuf_entry_build( entry_field = dtuple_get_nth_field(entry, i); dfield_copy(field, entry_field); + ifield = dict_index_get_nth_field(index, i); + /* Prefix index columns of fixed-length columns are of + fixed length. However, in the function call below, + dfield_get_type(entry_field) contains the fixed length + of the column in the clustered index. Replace it with + the fixed length of the secondary index column. */ + fixed_len = ifield->fixed_len; + +#ifdef UNIV_DEBUG + if (fixed_len) { + /* dict_index_add_col() should guarantee these */ + ut_ad(fixed_len <= (ulint) entry_field->type.len); + if (ifield->prefix_len) { + ut_ad(ifield->prefix_len == fixed_len); + } else { + ut_ad(fixed_len + == (ulint) entry_field->type.len); + } + } +#endif /* UNIV_DEBUG */ + dtype_new_store_for_order_and_null_size( - buf2 + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE, - dfield_get_type(entry_field), - dict_index_get_nth_field(index, i) - ->prefix_len); + buf2 + i * DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE, + dfield_get_type(entry_field), fixed_len); } /* Store the type info in buf2 to field 3 of tuple */ diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic index ddc91b8d66c..844d3fbd6d1 100644 --- a/innobase/include/buf0buf.ic +++ b/innobase/include/buf0buf.ic @@ -11,6 +11,15 @@ Created 11/5/1995 Heikki Tuuri #include "buf0rea.h" #include "mtr0mtr.h" +/************************************************************************* +Print the mtr and block fields. */ + +void +buf_print_diagnostic( +/*=================*/ + mtr_t* mtr, /* in: mtr to print */ + const buf_block_t* block); /* in: block to print */ + #ifdef UNIV_DEBUG extern ulint buf_dbg_counter; /* This is used to insert validation operations in execution in the @@ -618,12 +627,9 @@ buf_page_release( RW_NO_LATCH */ mtr_t* mtr) /* in: mtr */ { - ulint buf_fix_count; - ut_ad(block); ut_a(block->state == BUF_BLOCK_FILE_PAGE); - ut_a(block->buf_fix_count > 0); if (rw_latch == RW_X_LATCH && mtr->modifications) { mutex_enter(&buf_pool->mutex); @@ -633,11 +639,16 @@ buf_page_release( mutex_enter(&block->mutex); + /* This debug code has been added to narrow down Bug# 26081 */ + if (UNIV_UNLIKELY(block->buf_fix_count == 0)) { + buf_print_diagnostic(mtr, block); + ut_error; + } + #ifdef UNIV_SYNC_DEBUG rw_lock_s_unlock(&(block->debug_latch)); #endif - buf_fix_count = block->buf_fix_count; - block->buf_fix_count = buf_fix_count - 1; + --block->buf_fix_count; mutex_exit(&block->mutex); diff --git a/innobase/include/buf0lru.h b/innobase/include/buf0lru.h index 790bf65c698..e0f511cf7b8 100644 --- a/innobase/include/buf0lru.h +++ b/innobase/include/buf0lru.h @@ -122,7 +122,6 @@ void buf_LRU_make_block_old( /*===================*/ buf_block_t* block); /* in: control block */ -#ifdef UNIV_DEBUG /************************************************************************** Validates the LRU list. */ @@ -135,7 +134,6 @@ Prints the LRU list. */ void buf_LRU_print(void); /*===============*/ -#endif /* UNIV_DEBUG */ #ifndef UNIV_NONINL #include "buf0lru.ic" diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index 642037494b5..7fd9be1ebd6 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -84,6 +84,17 @@ dtype_t* dict_col_get_type( /*==============*/ dict_col_t* col); +#ifdef UNIV_DEBUG +/************************************************************************* +Assert that a column and a data type match. */ +UNIV_INLINE +ibool +dict_col_type_assert_equal( +/*=======================*/ + /* out: TRUE */ + const dict_col_t* col, /* in: column */ + const dtype_t* type); /* in: data type */ +#endif /* UNIV_DEBUG */ /************************************************************************* Gets the column number. */ UNIV_INLINE diff --git a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic index 861da5d057a..cbd7285e20f 100644 --- a/innobase/include/dict0dict.ic +++ b/innobase/include/dict0dict.ic @@ -23,6 +23,30 @@ dict_col_get_type( return(&col->type); } +#ifdef UNIV_DEBUG +/************************************************************************* +Assert that a column and a data type match. */ +UNIV_INLINE +ibool +dict_col_type_assert_equal( +/*=======================*/ + /* out: TRUE */ + const dict_col_t* col, /* in: column */ + const dtype_t* type) /* in: data type */ +{ + ut_ad(col); + ut_ad(type); + + ut_ad(col->type.mtype == type->mtype); + ut_ad(col->type.prtype == type->prtype); + ut_ad(col->type.len == type->len); + ut_ad(col->type.mbminlen == type->mbminlen); + ut_ad(col->type.mbmaxlen == type->mbmaxlen); + + return(TRUE); +} +#endif /* UNIV_DEBUG */ + /************************************************************************* Gets the column number. */ UNIV_INLINE diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h index 3c10e82342b..7d8dc404290 100644 --- a/innobase/include/dict0mem.h +++ b/innobase/include/dict0mem.h @@ -159,10 +159,13 @@ struct dict_col_struct{ in some of the functions below */ }; -/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the max index column -length + 1. Starting from 4.1.6, we set it to < 3 * 256, so that one can -create a column prefix index on 255 characters of a TEXT field also in the -UTF-8 charset. In that charset, a character may take at most 3 bytes. */ +/* DICT_MAX_INDEX_COL_LEN is measured in bytes and is the maximum +indexed column length (or indexed prefix length). It is set to 3*256, +so that one can create a column prefix index on 256 characters of a +TEXT or VARCHAR column also in the UTF-8 charset. In that charset, +a character may take at most 3 bytes. +This constant MUST NOT BE CHANGED, or the compatibility of InnoDB data +files would be at risk! */ #define DICT_MAX_INDEX_COL_LEN 768 diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h index d5bc5a2b115..49460dbaf19 100644 --- a/innobase/include/os0file.h +++ b/innobase/include/os0file.h @@ -94,7 +94,8 @@ log. */ #define OS_FILE_PATH_ERROR 74 #define OS_FILE_AIO_RESOURCES_RESERVED 75 /* wait for OS aio resources to become available again */ -#define OS_FILE_ERROR_NOT_SPECIFIED 76 +#define OS_FILE_SHARING_VIOLATION 76 +#define OS_FILE_ERROR_NOT_SPECIFIED 77 /* Types for aio operations */ #define OS_FILE_READ 10 diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 0dc82893ad1..cf9d1788ad8 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -604,7 +604,7 @@ struct trx_struct{ NULL */ ibool was_chosen_as_deadlock_victim; /* when the transaction decides to wait - for a lock, this it sets this to FALSE; + for a lock, it sets this to FALSE; if another transaction chooses this transaction as a victim in deadlock resolution, it sets this to TRUE */ diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 77dfca5fdf4..e0f3f58f737 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -4438,14 +4438,11 @@ lock_table_queue_validate( dict_table_t* table) /* in: table */ { lock_t* lock; - ibool is_waiting; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); #endif /* UNIV_SYNC_DEBUG */ - is_waiting = FALSE; - lock = UT_LIST_GET_FIRST(table->locks); while (lock) { @@ -4455,12 +4452,9 @@ lock_table_queue_validate( if (!lock_get_wait(lock)) { - ut_a(!is_waiting); - ut_a(!lock_table_other_has_incompatible(lock->trx, 0, table, lock_get_mode(lock))); } else { - is_waiting = TRUE; ut_a(lock_table_has_to_wait_in_queue(lock)); } diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c index 2d3bff522e2..26c0ce60c69 100644 --- a/innobase/log/log0log.c +++ b/innobase/log/log0log.c @@ -3061,9 +3061,22 @@ loop: mutex_enter(&kernel_mutex); - /* Check that there are no longer transactions. We need this wait even - for the 'very fast' shutdown, because the InnoDB layer may have - committed or prepared transactions and we don't want to lose them. */ + /* We need the monitor threads to stop before we proceed with a + normal shutdown. In case of very fast shutdown, however, we can + proceed without waiting for monitor threads. */ + + if (srv_fast_shutdown < 2 + && (srv_error_monitor_active + || srv_lock_timeout_and_monitor_active)) { + + mutex_exit(&kernel_mutex); + + goto loop; + } + + /* Check that there are no longer transactions. We need this wait even + for the 'very fast' shutdown, because the InnoDB layer may have + committed or prepared transactions and we don't want to lose them. */ if (trx_n_mysql_transactions > 0 || UT_LIST_GET_LEN(trx_sys->trx_list) > 0) { @@ -3184,22 +3197,8 @@ loop: goto loop; } - /* The lock timeout thread should now have exited */ - - if (srv_lock_timeout_and_monitor_active) { - - goto loop; - } - - /* We now let also the InnoDB error monitor thread to exit */ - srv_shutdown_state = SRV_SHUTDOWN_LAST_PHASE; - if (srv_error_monitor_active) { - - goto loop; - } - /* Make some checks that the server really is quiet */ ut_a(srv_n_threads_active[SRV_MASTER] == 0); ut_a(buf_all_freed()); diff --git a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c index da045be1f62..143db0ce0dd 100644 --- a/innobase/mtr/mtr0mtr.c +++ b/innobase/mtr/mtr0mtr.c @@ -326,7 +326,16 @@ mtr_print( mtr_t* mtr) /* in: mtr */ { fprintf(stderr, - "Mini-transaction handle: memo size %lu bytes log size %lu bytes\n", + "Mini-transaction handle: memo size %lu bytes log " + "size %lu bytes\n" + "state: %lu modifications: %lu n_lock_recs %lu\n" + "log_mode: %lu start_lsn: %lu:%lu end_lsn: %lu:%lu\n", (ulong) dyn_array_get_data_size(&(mtr->memo)), - (ulong) dyn_array_get_data_size(&(mtr->log))); + (ulong) dyn_array_get_data_size(&(mtr->log)), + mtr->state, (ulint) mtr->modifications, + mtr->n_log_recs, mtr->log_mode, + ut_dulint_get_high(mtr->start_lsn), + ut_dulint_get_low(mtr->start_lsn), + ut_dulint_get_high(mtr->end_lsn), + ut_dulint_get_low(mtr->end_lsn)); } diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 7133b28ecb2..3030b20a685 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -243,7 +243,13 @@ os_file_get_last_error( fprintf(stderr, "InnoDB: The error means mysqld does not have the access rights to\n" "InnoDB: the directory. It may also be you have created a subdirectory\n" - "InnoDB: of the same name as a data file.\n"); + "InnoDB: of the same name as a data file.\n"); + } else if (err == ERROR_SHARING_VIOLATION + || err == ERROR_LOCK_VIOLATION) { + fprintf(stderr, + "InnoDB: The error means that another program is using InnoDB's files.\n" + "InnoDB: This might be a backup or antivirus software or another instance\n" + "InnoDB: of MySQL. Please close it to get rid of this error.\n"); } else { fprintf(stderr, "InnoDB: Some operating system error numbers are described at\n" @@ -260,6 +266,9 @@ os_file_get_last_error( return(OS_FILE_DISK_FULL); } else if (err == ERROR_FILE_EXISTS) { return(OS_FILE_ALREADY_EXISTS); + } else if (err == ERROR_SHARING_VIOLATION + || err == ERROR_LOCK_VIOLATION) { + return(OS_FILE_SHARING_VIOLATION); } else { return(100 + err); } @@ -369,6 +378,12 @@ os_file_handle_error_cond_exit( || err == OS_FILE_PATH_ERROR) { return(FALSE); + + } else if (err == OS_FILE_SHARING_VIOLATION) { + + os_thread_sleep(10000000); /* 10 sec */ + return(TRUE); + } else { if (name) { fprintf(stderr, "InnoDB: File name %s\n", name); diff --git a/innobase/rem/rem0rec.c b/innobase/rem/rem0rec.c index 9480c978755..65da8352dc7 100644 --- a/innobase/rem/rem0rec.c +++ b/innobase/rem/rem0rec.c @@ -462,7 +462,7 @@ rec_get_converted_size_new( case REC_STATUS_INFIMUM: case REC_STATUS_SUPREMUM: /* infimum or supremum record, 8 bytes */ - return(size + 8); /* no extra data needed */ + return(8); /* no extra data needed */ default: ut_a(0); return(ULINT_UNDEFINED); @@ -473,23 +473,34 @@ rec_get_converted_size_new( ulint len = dtuple_get_nth_field(dtuple, i)->len; field = dict_index_get_nth_field(index, i); type = dict_col_get_type(dict_field_get_col(field)); - ut_ad(len != UNIV_SQL_NULL || - !(dtype_get_prtype(type) & DATA_NOT_NULL)); + + ut_ad(dict_col_type_assert_equal( + dict_field_get_col(field), + dfield_get_type(dtuple_get_nth_field( + dtuple, i)))); if (len == UNIV_SQL_NULL) { /* No length is stored for NULL fields. */ + ut_ad(!(dtype_get_prtype(type) & DATA_NOT_NULL)); continue; } ut_ad(len <= dtype_get_len(type) || dtype_get_mtype(type) == DATA_BLOB); - ut_ad(!field->fixed_len || len == field->fixed_len); if (field->fixed_len) { + ut_ad(len == field->fixed_len); + /* dict_index_add_col() should guarantee this */ + ut_ad(!field->prefix_len + || field->fixed_len == field->prefix_len); } else if (len < 128 || (dtype_get_len(type) < 256 && dtype_get_mtype(type) != DATA_BLOB)) { size++; } else { + /* For variable-length columns, we look up the + maximum length from the column itself. If this + is a prefix index column shorter than 256 bytes, + this will waste one byte. */ size += 2; } size += len; @@ -885,6 +896,11 @@ rec_convert_dtuple_to_rec_new( len = dfield_get_len(field); fixed_len = dict_index_get_nth_field(index, i)->fixed_len; + ut_ad(dict_col_type_assert_equal( + dict_field_get_col(dict_index_get_nth_field( + index, i)), + dfield_get_type(field))); + if (!(dtype_get_prtype(type) & DATA_NOT_NULL)) { if (len == UNIV_SQL_NULL) continue; diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index f8a65e6ff82..c956492900d 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -3451,6 +3451,31 @@ shortcut_fails_too_big_rec: pcur, 0, &mtr); pcur->trx_if_known = trx; + + rec = btr_pcur_get_rec(pcur); + + if (!moves_up + && !page_rec_is_supremum(rec) + && set_also_gap_locks + && !srv_locks_unsafe_for_binlog + && prebuilt->select_lock_type != LOCK_NONE) { + + /* Try to place a gap lock on the next index record + to prevent phantoms in ORDER BY ... DESC queries */ + + offsets = rec_get_offsets(page_rec_get_next(rec), + index, offsets, + ULINT_UNDEFINED, &heap); + err = sel_set_rec_lock(page_rec_get_next(rec), + index, offsets, + prebuilt->select_lock_type, + LOCK_GAP, thr); + + if (err != DB_SUCCESS) { + + goto lock_wait_or_error; + } + } } else { if (mode == PAGE_CUR_G) { btr_pcur_open_at_index_side(TRUE, index, diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 96c0f05111b..e4ce29f445c 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1037,7 +1037,7 @@ retry: if (!has_slept && !trx->has_search_latch && NULL == UT_LIST_GET_FIRST(trx->trx_locks)) { - has_slept = TRUE; /* We let is sleep only once to avoid + has_slept = TRUE; /* We let it sleep only once to avoid starvation */ srv_conc_n_waiting_threads++; @@ -1858,6 +1858,7 @@ srv_lock_timeout_and_monitor_thread( double time_elapsed; time_t current_time; time_t last_table_monitor_time; + time_t last_tablespace_monitor_time; time_t last_monitor_time; ibool some_waits; double wait_time; @@ -1870,6 +1871,7 @@ srv_lock_timeout_and_monitor_thread( UT_NOT_USED(arg); srv_last_monitor_time = time(NULL); last_table_monitor_time = time(NULL); + last_tablespace_monitor_time = time(NULL); last_monitor_time = time(NULL); loop: srv_lock_timeout_and_monitor_active = TRUE; @@ -1905,9 +1907,9 @@ loop: } if (srv_print_innodb_tablespace_monitor - && difftime(current_time, last_table_monitor_time) > 60) { + && difftime(current_time, last_tablespace_monitor_time) > 60) { - last_table_monitor_time = time(NULL); + last_tablespace_monitor_time = time(NULL); fputs("================================================\n", stderr); @@ -2103,7 +2105,7 @@ loop: os_thread_sleep(2000000); - if (srv_shutdown_state < SRV_SHUTDOWN_LAST_PHASE) { + if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) { goto loop; } diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index a3676bd7e1b..b03dc9bb986 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -15,7 +15,7 @@ /* This file defines the InnoDB handler: the interface between MySQL and InnoDB NOTE: You can only use noninlined InnoDB functions in this file, because we -have disables the InnoDB inlining in this file. */ +have disabled the InnoDB inlining in this file. */ /* TODO list for the InnoDB handler in 5.0: - Remove the flag trx->active_trans and look at the InnoDB @@ -2313,8 +2313,15 @@ ha_innobase::close(void) /*====================*/ /* out: 0 */ { + THD* thd; + DBUG_ENTER("ha_innobase::close"); + thd = current_thd; // avoid calling current_thd twice, it may be slow + if (thd != NULL) { + innobase_release_temporary_latches(thd); + } + row_prebuilt_free((row_prebuilt_t*) innobase_prebuilt); my_free((gptr) upd_buff, MYF(0)); @@ -5305,7 +5312,12 @@ ha_innobase::info( if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE) { - DBUG_RETURN(HA_ERR_CRASHED); + /* We return success (0) instead of HA_ERR_CRASHED, + because we want MySQL to process this query and not + stop, like it would do if it received the error code + HA_ERR_CRASHED. */ + + DBUG_RETURN(0); } /* We do not know if MySQL can call this function before calling @@ -6150,6 +6162,12 @@ ha_innobase::external_lock( trx->n_mysql_tables_in_use--; prebuilt->mysql_has_locked = FALSE; + /* Release a possible FIFO ticket and search latch. Since we + may reserve the kernel mutex, we have to release the search + system latch first to obey the latching order. */ + + innobase_release_stat_resources(trx); + /* If the MySQL lock count drops to zero we know that the current SQL statement has ended */ @@ -6158,12 +6176,6 @@ ha_innobase::external_lock( trx->mysql_n_tables_locked = 0; prebuilt->used_in_HANDLER = FALSE; - /* Release a possible FIFO ticket and search latch. Since we - may reserve the kernel mutex, we have to release the search - system latch first to obey the latching order. */ - - innobase_release_stat_resources(trx); - if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { if (trx->active_trans != 0) { innobase_commit(thd, TRUE); @@ -6593,8 +6605,15 @@ ha_innobase::store_lock( TL_IGNORE */ { row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; + trx_t* trx; - /* NOTE: MySQL can call this function with lock 'type' TL_IGNORE! + /* Note that trx in this function is NOT necessarily prebuilt->trx + because we call update_thd() later, in ::external_lock()! Failure to + understand this caused a serious memory corruption bug in 5.1.11. */ + + trx = check_trx_exists(thd); + + /* NOTE: MySQL can call this function with lock 'type' TL_IGNORE! Be careful to ignore TL_IGNORE if we are going to do something with only 'real' locks! */ @@ -6624,7 +6643,7 @@ ha_innobase::store_lock( used. */ if (srv_locks_unsafe_for_binlog && - prebuilt->trx->isolation_level != TRX_ISO_SERIALIZABLE && + trx->isolation_level != TRX_ISO_SERIALIZABLE && (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) && (thd->lex->sql_command == SQLCOM_INSERT_SELECT || thd->lex->sql_command == SQLCOM_UPDATE || From 523d4ddbd41d84dd8acbe956ae3a6a75b65c220a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jul 2007 18:31:50 +0200 Subject: [PATCH 129/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB streamlining the test --- .../suite/binlog/r/binlog_stm_binlog.result | 826 +++++++++--------- 1 file changed, 413 insertions(+), 413 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index c02c8f7ef8d..80908e6b450 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -157,425 +157,425 @@ commit; drop table t1; show binlog events from 0; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 -master-bin.000001 98 Query 1 197 use `test`; create table t1(n int) engine=innodb -master-bin.000001 197 Query 1 265 use `test`; BEGIN -master-bin.000001 265 Query 1 353 use `test`; insert into t1 values (1) -master-bin.000001 353 Query 1 441 use `test`; insert into t1 values (2) -master-bin.000001 441 Query 1 529 use `test`; insert into t1 values (3) -master-bin.000001 529 Xid 1 556 COMMIT /* XID */ -master-bin.000001 556 Query 1 632 use `test`; drop table t1 +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb +master-bin.000001 205 Query 1 273 use `test`; BEGIN +master-bin.000001 273 Query 1 361 use `test`; insert into t1 values (1) +master-bin.000001 361 Query 1 449 use `test`; insert into t1 values (2) +master-bin.000001 449 Query 1 537 use `test`; insert into t1 values (3) +master-bin.000001 537 Xid 1 564 COMMIT /* XID */ +master-bin.000001 564 Query 1 640 use `test`; drop table t1 set @bcs = @@binlog_cache_size; set global binlog_cache_size=4096; reset master; create table t1 (a int) engine=innodb; show binlog events from 0; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 98 Server version, Binlog ver: 4 -master-bin.000001 98 Query 1 198 use `test`; create table t1 (a int) engine=innodb -master-bin.000001 198 Query 1 266 use `test`; BEGIN -master-bin.000001 266 Query 1 357 use `test`; insert into t1 values( 400 ) -master-bin.000001 357 Query 1 448 use `test`; insert into t1 values( 399 ) -master-bin.000001 448 Query 1 539 use `test`; insert into t1 values( 398 ) -master-bin.000001 539 Query 1 630 use `test`; insert into t1 values( 397 ) -master-bin.000001 630 Query 1 721 use `test`; insert into t1 values( 396 ) -master-bin.000001 721 Query 1 812 use `test`; insert into t1 values( 395 ) -master-bin.000001 812 Query 1 903 use `test`; insert into t1 values( 394 ) -master-bin.000001 903 Query 1 994 use `test`; insert into t1 values( 393 ) -master-bin.000001 994 Query 1 1085 use `test`; insert into t1 values( 392 ) -master-bin.000001 1085 Query 1 1176 use `test`; insert into t1 values( 391 ) -master-bin.000001 1176 Query 1 1267 use `test`; insert into t1 values( 390 ) -master-bin.000001 1267 Query 1 1358 use `test`; insert into t1 values( 389 ) -master-bin.000001 1358 Query 1 1449 use `test`; insert into t1 values( 388 ) -master-bin.000001 1449 Query 1 1540 use `test`; insert into t1 values( 387 ) -master-bin.000001 1540 Query 1 1631 use `test`; insert into t1 values( 386 ) -master-bin.000001 1631 Query 1 1722 use `test`; insert into t1 values( 385 ) -master-bin.000001 1722 Query 1 1813 use `test`; insert into t1 values( 384 ) -master-bin.000001 1813 Query 1 1904 use `test`; insert into t1 values( 383 ) -master-bin.000001 1904 Query 1 1995 use `test`; insert into t1 values( 382 ) -master-bin.000001 1995 Query 1 2086 use `test`; insert into t1 values( 381 ) -master-bin.000001 2086 Query 1 2177 use `test`; insert into t1 values( 380 ) -master-bin.000001 2177 Query 1 2268 use `test`; insert into t1 values( 379 ) -master-bin.000001 2268 Query 1 2359 use `test`; insert into t1 values( 378 ) -master-bin.000001 2359 Query 1 2450 use `test`; insert into t1 values( 377 ) -master-bin.000001 2450 Query 1 2541 use `test`; insert into t1 values( 376 ) -master-bin.000001 2541 Query 1 2632 use `test`; insert into t1 values( 375 ) -master-bin.000001 2632 Query 1 2723 use `test`; insert into t1 values( 374 ) -master-bin.000001 2723 Query 1 2814 use `test`; insert into t1 values( 373 ) -master-bin.000001 2814 Query 1 2905 use `test`; insert into t1 values( 372 ) -master-bin.000001 2905 Query 1 2996 use `test`; insert into t1 values( 371 ) -master-bin.000001 2996 Query 1 3087 use `test`; insert into t1 values( 370 ) -master-bin.000001 3087 Query 1 3178 use `test`; insert into t1 values( 369 ) -master-bin.000001 3178 Query 1 3269 use `test`; insert into t1 values( 368 ) -master-bin.000001 3269 Query 1 3360 use `test`; insert into t1 values( 367 ) -master-bin.000001 3360 Query 1 3451 use `test`; insert into t1 values( 366 ) -master-bin.000001 3451 Query 1 3542 use `test`; insert into t1 values( 365 ) -master-bin.000001 3542 Query 1 3633 use `test`; insert into t1 values( 364 ) -master-bin.000001 3633 Query 1 3724 use `test`; insert into t1 values( 363 ) -master-bin.000001 3724 Query 1 3815 use `test`; insert into t1 values( 362 ) -master-bin.000001 3815 Query 1 3906 use `test`; insert into t1 values( 361 ) -master-bin.000001 3906 Query 1 3997 use `test`; insert into t1 values( 360 ) -master-bin.000001 3997 Query 1 4088 use `test`; insert into t1 values( 359 ) -master-bin.000001 4088 Query 1 4179 use `test`; insert into t1 values( 358 ) -master-bin.000001 4179 Query 1 4270 use `test`; insert into t1 values( 357 ) -master-bin.000001 4270 Query 1 4361 use `test`; insert into t1 values( 356 ) -master-bin.000001 4361 Query 1 4452 use `test`; insert into t1 values( 355 ) -master-bin.000001 4452 Query 1 4543 use `test`; insert into t1 values( 354 ) -master-bin.000001 4543 Query 1 4634 use `test`; insert into t1 values( 353 ) -master-bin.000001 4634 Query 1 4725 use `test`; insert into t1 values( 352 ) -master-bin.000001 4725 Query 1 4816 use `test`; insert into t1 values( 351 ) -master-bin.000001 4816 Query 1 4907 use `test`; insert into t1 values( 350 ) -master-bin.000001 4907 Query 1 4998 use `test`; insert into t1 values( 349 ) -master-bin.000001 4998 Query 1 5089 use `test`; insert into t1 values( 348 ) -master-bin.000001 5089 Query 1 5180 use `test`; insert into t1 values( 347 ) -master-bin.000001 5180 Query 1 5271 use `test`; insert into t1 values( 346 ) -master-bin.000001 5271 Query 1 5362 use `test`; insert into t1 values( 345 ) -master-bin.000001 5362 Query 1 5453 use `test`; insert into t1 values( 344 ) -master-bin.000001 5453 Query 1 5544 use `test`; insert into t1 values( 343 ) -master-bin.000001 5544 Query 1 5635 use `test`; insert into t1 values( 342 ) -master-bin.000001 5635 Query 1 5726 use `test`; insert into t1 values( 341 ) -master-bin.000001 5726 Query 1 5817 use `test`; insert into t1 values( 340 ) -master-bin.000001 5817 Query 1 5908 use `test`; insert into t1 values( 339 ) -master-bin.000001 5908 Query 1 5999 use `test`; insert into t1 values( 338 ) -master-bin.000001 5999 Query 1 6090 use `test`; insert into t1 values( 337 ) -master-bin.000001 6090 Query 1 6181 use `test`; insert into t1 values( 336 ) -master-bin.000001 6181 Query 1 6272 use `test`; insert into t1 values( 335 ) -master-bin.000001 6272 Query 1 6363 use `test`; insert into t1 values( 334 ) -master-bin.000001 6363 Query 1 6454 use `test`; insert into t1 values( 333 ) -master-bin.000001 6454 Query 1 6545 use `test`; insert into t1 values( 332 ) -master-bin.000001 6545 Query 1 6636 use `test`; insert into t1 values( 331 ) -master-bin.000001 6636 Query 1 6727 use `test`; insert into t1 values( 330 ) -master-bin.000001 6727 Query 1 6818 use `test`; insert into t1 values( 329 ) -master-bin.000001 6818 Query 1 6909 use `test`; insert into t1 values( 328 ) -master-bin.000001 6909 Query 1 7000 use `test`; insert into t1 values( 327 ) -master-bin.000001 7000 Query 1 7091 use `test`; insert into t1 values( 326 ) -master-bin.000001 7091 Query 1 7182 use `test`; insert into t1 values( 325 ) -master-bin.000001 7182 Query 1 7273 use `test`; insert into t1 values( 324 ) -master-bin.000001 7273 Query 1 7364 use `test`; insert into t1 values( 323 ) -master-bin.000001 7364 Query 1 7455 use `test`; insert into t1 values( 322 ) -master-bin.000001 7455 Query 1 7546 use `test`; insert into t1 values( 321 ) -master-bin.000001 7546 Query 1 7637 use `test`; insert into t1 values( 320 ) -master-bin.000001 7637 Query 1 7728 use `test`; insert into t1 values( 319 ) -master-bin.000001 7728 Query 1 7819 use `test`; insert into t1 values( 318 ) -master-bin.000001 7819 Query 1 7910 use `test`; insert into t1 values( 317 ) -master-bin.000001 7910 Query 1 8001 use `test`; insert into t1 values( 316 ) -master-bin.000001 8001 Query 1 8092 use `test`; insert into t1 values( 315 ) -master-bin.000001 8092 Query 1 8183 use `test`; insert into t1 values( 314 ) -master-bin.000001 8183 Query 1 8274 use `test`; insert into t1 values( 313 ) -master-bin.000001 8274 Query 1 8365 use `test`; insert into t1 values( 312 ) -master-bin.000001 8365 Query 1 8456 use `test`; insert into t1 values( 311 ) -master-bin.000001 8456 Query 1 8547 use `test`; insert into t1 values( 310 ) -master-bin.000001 8547 Query 1 8638 use `test`; insert into t1 values( 309 ) -master-bin.000001 8638 Query 1 8729 use `test`; insert into t1 values( 308 ) -master-bin.000001 8729 Query 1 8820 use `test`; insert into t1 values( 307 ) -master-bin.000001 8820 Query 1 8911 use `test`; insert into t1 values( 306 ) -master-bin.000001 8911 Query 1 9002 use `test`; insert into t1 values( 305 ) -master-bin.000001 9002 Query 1 9093 use `test`; insert into t1 values( 304 ) -master-bin.000001 9093 Query 1 9184 use `test`; insert into t1 values( 303 ) -master-bin.000001 9184 Query 1 9275 use `test`; insert into t1 values( 302 ) -master-bin.000001 9275 Query 1 9366 use `test`; insert into t1 values( 301 ) -master-bin.000001 9366 Query 1 9457 use `test`; insert into t1 values( 300 ) -master-bin.000001 9457 Query 1 9548 use `test`; insert into t1 values( 299 ) -master-bin.000001 9548 Query 1 9639 use `test`; insert into t1 values( 298 ) -master-bin.000001 9639 Query 1 9730 use `test`; insert into t1 values( 297 ) -master-bin.000001 9730 Query 1 9821 use `test`; insert into t1 values( 296 ) -master-bin.000001 9821 Query 1 9912 use `test`; insert into t1 values( 295 ) -master-bin.000001 9912 Query 1 10003 use `test`; insert into t1 values( 294 ) -master-bin.000001 10003 Query 1 10094 use `test`; insert into t1 values( 293 ) -master-bin.000001 10094 Query 1 10185 use `test`; insert into t1 values( 292 ) -master-bin.000001 10185 Query 1 10276 use `test`; insert into t1 values( 291 ) -master-bin.000001 10276 Query 1 10367 use `test`; insert into t1 values( 290 ) -master-bin.000001 10367 Query 1 10458 use `test`; insert into t1 values( 289 ) -master-bin.000001 10458 Query 1 10549 use `test`; insert into t1 values( 288 ) -master-bin.000001 10549 Query 1 10640 use `test`; insert into t1 values( 287 ) -master-bin.000001 10640 Query 1 10731 use `test`; insert into t1 values( 286 ) -master-bin.000001 10731 Query 1 10822 use `test`; insert into t1 values( 285 ) -master-bin.000001 10822 Query 1 10913 use `test`; insert into t1 values( 284 ) -master-bin.000001 10913 Query 1 11004 use `test`; insert into t1 values( 283 ) -master-bin.000001 11004 Query 1 11095 use `test`; insert into t1 values( 282 ) -master-bin.000001 11095 Query 1 11186 use `test`; insert into t1 values( 281 ) -master-bin.000001 11186 Query 1 11277 use `test`; insert into t1 values( 280 ) -master-bin.000001 11277 Query 1 11368 use `test`; insert into t1 values( 279 ) -master-bin.000001 11368 Query 1 11459 use `test`; insert into t1 values( 278 ) -master-bin.000001 11459 Query 1 11550 use `test`; insert into t1 values( 277 ) -master-bin.000001 11550 Query 1 11641 use `test`; insert into t1 values( 276 ) -master-bin.000001 11641 Query 1 11732 use `test`; insert into t1 values( 275 ) -master-bin.000001 11732 Query 1 11823 use `test`; insert into t1 values( 274 ) -master-bin.000001 11823 Query 1 11914 use `test`; insert into t1 values( 273 ) -master-bin.000001 11914 Query 1 12005 use `test`; insert into t1 values( 272 ) -master-bin.000001 12005 Query 1 12096 use `test`; insert into t1 values( 271 ) -master-bin.000001 12096 Query 1 12187 use `test`; insert into t1 values( 270 ) -master-bin.000001 12187 Query 1 12278 use `test`; insert into t1 values( 269 ) -master-bin.000001 12278 Query 1 12369 use `test`; insert into t1 values( 268 ) -master-bin.000001 12369 Query 1 12460 use `test`; insert into t1 values( 267 ) -master-bin.000001 12460 Query 1 12551 use `test`; insert into t1 values( 266 ) -master-bin.000001 12551 Query 1 12642 use `test`; insert into t1 values( 265 ) -master-bin.000001 12642 Query 1 12733 use `test`; insert into t1 values( 264 ) -master-bin.000001 12733 Query 1 12824 use `test`; insert into t1 values( 263 ) -master-bin.000001 12824 Query 1 12915 use `test`; insert into t1 values( 262 ) -master-bin.000001 12915 Query 1 13006 use `test`; insert into t1 values( 261 ) -master-bin.000001 13006 Query 1 13097 use `test`; insert into t1 values( 260 ) -master-bin.000001 13097 Query 1 13188 use `test`; insert into t1 values( 259 ) -master-bin.000001 13188 Query 1 13279 use `test`; insert into t1 values( 258 ) -master-bin.000001 13279 Query 1 13370 use `test`; insert into t1 values( 257 ) -master-bin.000001 13370 Query 1 13461 use `test`; insert into t1 values( 256 ) -master-bin.000001 13461 Query 1 13552 use `test`; insert into t1 values( 255 ) -master-bin.000001 13552 Query 1 13643 use `test`; insert into t1 values( 254 ) -master-bin.000001 13643 Query 1 13734 use `test`; insert into t1 values( 253 ) -master-bin.000001 13734 Query 1 13825 use `test`; insert into t1 values( 252 ) -master-bin.000001 13825 Query 1 13916 use `test`; insert into t1 values( 251 ) -master-bin.000001 13916 Query 1 14007 use `test`; insert into t1 values( 250 ) -master-bin.000001 14007 Query 1 14098 use `test`; insert into t1 values( 249 ) -master-bin.000001 14098 Query 1 14189 use `test`; insert into t1 values( 248 ) -master-bin.000001 14189 Query 1 14280 use `test`; insert into t1 values( 247 ) -master-bin.000001 14280 Query 1 14371 use `test`; insert into t1 values( 246 ) -master-bin.000001 14371 Query 1 14462 use `test`; insert into t1 values( 245 ) -master-bin.000001 14462 Query 1 14553 use `test`; insert into t1 values( 244 ) -master-bin.000001 14553 Query 1 14644 use `test`; insert into t1 values( 243 ) -master-bin.000001 14644 Query 1 14735 use `test`; insert into t1 values( 242 ) -master-bin.000001 14735 Query 1 14826 use `test`; insert into t1 values( 241 ) -master-bin.000001 14826 Query 1 14917 use `test`; insert into t1 values( 240 ) -master-bin.000001 14917 Query 1 15008 use `test`; insert into t1 values( 239 ) -master-bin.000001 15008 Query 1 15099 use `test`; insert into t1 values( 238 ) -master-bin.000001 15099 Query 1 15190 use `test`; insert into t1 values( 237 ) -master-bin.000001 15190 Query 1 15281 use `test`; insert into t1 values( 236 ) -master-bin.000001 15281 Query 1 15372 use `test`; insert into t1 values( 235 ) -master-bin.000001 15372 Query 1 15463 use `test`; insert into t1 values( 234 ) -master-bin.000001 15463 Query 1 15554 use `test`; insert into t1 values( 233 ) -master-bin.000001 15554 Query 1 15645 use `test`; insert into t1 values( 232 ) -master-bin.000001 15645 Query 1 15736 use `test`; insert into t1 values( 231 ) -master-bin.000001 15736 Query 1 15827 use `test`; insert into t1 values( 230 ) -master-bin.000001 15827 Query 1 15918 use `test`; insert into t1 values( 229 ) -master-bin.000001 15918 Query 1 16009 use `test`; insert into t1 values( 228 ) -master-bin.000001 16009 Query 1 16100 use `test`; insert into t1 values( 227 ) -master-bin.000001 16100 Query 1 16191 use `test`; insert into t1 values( 226 ) -master-bin.000001 16191 Query 1 16282 use `test`; insert into t1 values( 225 ) -master-bin.000001 16282 Query 1 16373 use `test`; insert into t1 values( 224 ) -master-bin.000001 16373 Query 1 16464 use `test`; insert into t1 values( 223 ) -master-bin.000001 16464 Query 1 16555 use `test`; insert into t1 values( 222 ) -master-bin.000001 16555 Query 1 16646 use `test`; insert into t1 values( 221 ) -master-bin.000001 16646 Query 1 16737 use `test`; insert into t1 values( 220 ) -master-bin.000001 16737 Query 1 16828 use `test`; insert into t1 values( 219 ) -master-bin.000001 16828 Query 1 16919 use `test`; insert into t1 values( 218 ) -master-bin.000001 16919 Query 1 17010 use `test`; insert into t1 values( 217 ) -master-bin.000001 17010 Query 1 17101 use `test`; insert into t1 values( 216 ) -master-bin.000001 17101 Query 1 17192 use `test`; insert into t1 values( 215 ) -master-bin.000001 17192 Query 1 17283 use `test`; insert into t1 values( 214 ) -master-bin.000001 17283 Query 1 17374 use `test`; insert into t1 values( 213 ) -master-bin.000001 17374 Query 1 17465 use `test`; insert into t1 values( 212 ) -master-bin.000001 17465 Query 1 17556 use `test`; insert into t1 values( 211 ) -master-bin.000001 17556 Query 1 17647 use `test`; insert into t1 values( 210 ) -master-bin.000001 17647 Query 1 17738 use `test`; insert into t1 values( 209 ) -master-bin.000001 17738 Query 1 17829 use `test`; insert into t1 values( 208 ) -master-bin.000001 17829 Query 1 17920 use `test`; insert into t1 values( 207 ) -master-bin.000001 17920 Query 1 18011 use `test`; insert into t1 values( 206 ) -master-bin.000001 18011 Query 1 18102 use `test`; insert into t1 values( 205 ) -master-bin.000001 18102 Query 1 18193 use `test`; insert into t1 values( 204 ) -master-bin.000001 18193 Query 1 18284 use `test`; insert into t1 values( 203 ) -master-bin.000001 18284 Query 1 18375 use `test`; insert into t1 values( 202 ) -master-bin.000001 18375 Query 1 18466 use `test`; insert into t1 values( 201 ) -master-bin.000001 18466 Query 1 18557 use `test`; insert into t1 values( 200 ) -master-bin.000001 18557 Query 1 18648 use `test`; insert into t1 values( 199 ) -master-bin.000001 18648 Query 1 18739 use `test`; insert into t1 values( 198 ) -master-bin.000001 18739 Query 1 18830 use `test`; insert into t1 values( 197 ) -master-bin.000001 18830 Query 1 18921 use `test`; insert into t1 values( 196 ) -master-bin.000001 18921 Query 1 19012 use `test`; insert into t1 values( 195 ) -master-bin.000001 19012 Query 1 19103 use `test`; insert into t1 values( 194 ) -master-bin.000001 19103 Query 1 19194 use `test`; insert into t1 values( 193 ) -master-bin.000001 19194 Query 1 19285 use `test`; insert into t1 values( 192 ) -master-bin.000001 19285 Query 1 19376 use `test`; insert into t1 values( 191 ) -master-bin.000001 19376 Query 1 19467 use `test`; insert into t1 values( 190 ) -master-bin.000001 19467 Query 1 19558 use `test`; insert into t1 values( 189 ) -master-bin.000001 19558 Query 1 19649 use `test`; insert into t1 values( 188 ) -master-bin.000001 19649 Query 1 19740 use `test`; insert into t1 values( 187 ) -master-bin.000001 19740 Query 1 19831 use `test`; insert into t1 values( 186 ) -master-bin.000001 19831 Query 1 19922 use `test`; insert into t1 values( 185 ) -master-bin.000001 19922 Query 1 20013 use `test`; insert into t1 values( 184 ) -master-bin.000001 20013 Query 1 20104 use `test`; insert into t1 values( 183 ) -master-bin.000001 20104 Query 1 20195 use `test`; insert into t1 values( 182 ) -master-bin.000001 20195 Query 1 20286 use `test`; insert into t1 values( 181 ) -master-bin.000001 20286 Query 1 20377 use `test`; insert into t1 values( 180 ) -master-bin.000001 20377 Query 1 20468 use `test`; insert into t1 values( 179 ) -master-bin.000001 20468 Query 1 20559 use `test`; insert into t1 values( 178 ) -master-bin.000001 20559 Query 1 20650 use `test`; insert into t1 values( 177 ) -master-bin.000001 20650 Query 1 20741 use `test`; insert into t1 values( 176 ) -master-bin.000001 20741 Query 1 20832 use `test`; insert into t1 values( 175 ) -master-bin.000001 20832 Query 1 20923 use `test`; insert into t1 values( 174 ) -master-bin.000001 20923 Query 1 21014 use `test`; insert into t1 values( 173 ) -master-bin.000001 21014 Query 1 21105 use `test`; insert into t1 values( 172 ) -master-bin.000001 21105 Query 1 21196 use `test`; insert into t1 values( 171 ) -master-bin.000001 21196 Query 1 21287 use `test`; insert into t1 values( 170 ) -master-bin.000001 21287 Query 1 21378 use `test`; insert into t1 values( 169 ) -master-bin.000001 21378 Query 1 21469 use `test`; insert into t1 values( 168 ) -master-bin.000001 21469 Query 1 21560 use `test`; insert into t1 values( 167 ) -master-bin.000001 21560 Query 1 21651 use `test`; insert into t1 values( 166 ) -master-bin.000001 21651 Query 1 21742 use `test`; insert into t1 values( 165 ) -master-bin.000001 21742 Query 1 21833 use `test`; insert into t1 values( 164 ) -master-bin.000001 21833 Query 1 21924 use `test`; insert into t1 values( 163 ) -master-bin.000001 21924 Query 1 22015 use `test`; insert into t1 values( 162 ) -master-bin.000001 22015 Query 1 22106 use `test`; insert into t1 values( 161 ) -master-bin.000001 22106 Query 1 22197 use `test`; insert into t1 values( 160 ) -master-bin.000001 22197 Query 1 22288 use `test`; insert into t1 values( 159 ) -master-bin.000001 22288 Query 1 22379 use `test`; insert into t1 values( 158 ) -master-bin.000001 22379 Query 1 22470 use `test`; insert into t1 values( 157 ) -master-bin.000001 22470 Query 1 22561 use `test`; insert into t1 values( 156 ) -master-bin.000001 22561 Query 1 22652 use `test`; insert into t1 values( 155 ) -master-bin.000001 22652 Query 1 22743 use `test`; insert into t1 values( 154 ) -master-bin.000001 22743 Query 1 22834 use `test`; insert into t1 values( 153 ) -master-bin.000001 22834 Query 1 22925 use `test`; insert into t1 values( 152 ) -master-bin.000001 22925 Query 1 23016 use `test`; insert into t1 values( 151 ) -master-bin.000001 23016 Query 1 23107 use `test`; insert into t1 values( 150 ) -master-bin.000001 23107 Query 1 23198 use `test`; insert into t1 values( 149 ) -master-bin.000001 23198 Query 1 23289 use `test`; insert into t1 values( 148 ) -master-bin.000001 23289 Query 1 23380 use `test`; insert into t1 values( 147 ) -master-bin.000001 23380 Query 1 23471 use `test`; insert into t1 values( 146 ) -master-bin.000001 23471 Query 1 23562 use `test`; insert into t1 values( 145 ) -master-bin.000001 23562 Query 1 23653 use `test`; insert into t1 values( 144 ) -master-bin.000001 23653 Query 1 23744 use `test`; insert into t1 values( 143 ) -master-bin.000001 23744 Query 1 23835 use `test`; insert into t1 values( 142 ) -master-bin.000001 23835 Query 1 23926 use `test`; insert into t1 values( 141 ) -master-bin.000001 23926 Query 1 24017 use `test`; insert into t1 values( 140 ) -master-bin.000001 24017 Query 1 24108 use `test`; insert into t1 values( 139 ) -master-bin.000001 24108 Query 1 24199 use `test`; insert into t1 values( 138 ) -master-bin.000001 24199 Query 1 24290 use `test`; insert into t1 values( 137 ) -master-bin.000001 24290 Query 1 24381 use `test`; insert into t1 values( 136 ) -master-bin.000001 24381 Query 1 24472 use `test`; insert into t1 values( 135 ) -master-bin.000001 24472 Query 1 24563 use `test`; insert into t1 values( 134 ) -master-bin.000001 24563 Query 1 24654 use `test`; insert into t1 values( 133 ) -master-bin.000001 24654 Query 1 24745 use `test`; insert into t1 values( 132 ) -master-bin.000001 24745 Query 1 24836 use `test`; insert into t1 values( 131 ) -master-bin.000001 24836 Query 1 24927 use `test`; insert into t1 values( 130 ) -master-bin.000001 24927 Query 1 25018 use `test`; insert into t1 values( 129 ) -master-bin.000001 25018 Query 1 25109 use `test`; insert into t1 values( 128 ) -master-bin.000001 25109 Query 1 25200 use `test`; insert into t1 values( 127 ) -master-bin.000001 25200 Query 1 25291 use `test`; insert into t1 values( 126 ) -master-bin.000001 25291 Query 1 25382 use `test`; insert into t1 values( 125 ) -master-bin.000001 25382 Query 1 25473 use `test`; insert into t1 values( 124 ) -master-bin.000001 25473 Query 1 25564 use `test`; insert into t1 values( 123 ) -master-bin.000001 25564 Query 1 25655 use `test`; insert into t1 values( 122 ) -master-bin.000001 25655 Query 1 25746 use `test`; insert into t1 values( 121 ) -master-bin.000001 25746 Query 1 25837 use `test`; insert into t1 values( 120 ) -master-bin.000001 25837 Query 1 25928 use `test`; insert into t1 values( 119 ) -master-bin.000001 25928 Query 1 26019 use `test`; insert into t1 values( 118 ) -master-bin.000001 26019 Query 1 26110 use `test`; insert into t1 values( 117 ) -master-bin.000001 26110 Query 1 26201 use `test`; insert into t1 values( 116 ) -master-bin.000001 26201 Query 1 26292 use `test`; insert into t1 values( 115 ) -master-bin.000001 26292 Query 1 26383 use `test`; insert into t1 values( 114 ) -master-bin.000001 26383 Query 1 26474 use `test`; insert into t1 values( 113 ) -master-bin.000001 26474 Query 1 26565 use `test`; insert into t1 values( 112 ) -master-bin.000001 26565 Query 1 26656 use `test`; insert into t1 values( 111 ) -master-bin.000001 26656 Query 1 26747 use `test`; insert into t1 values( 110 ) -master-bin.000001 26747 Query 1 26838 use `test`; insert into t1 values( 109 ) -master-bin.000001 26838 Query 1 26929 use `test`; insert into t1 values( 108 ) -master-bin.000001 26929 Query 1 27020 use `test`; insert into t1 values( 107 ) -master-bin.000001 27020 Query 1 27111 use `test`; insert into t1 values( 106 ) -master-bin.000001 27111 Query 1 27202 use `test`; insert into t1 values( 105 ) -master-bin.000001 27202 Query 1 27293 use `test`; insert into t1 values( 104 ) -master-bin.000001 27293 Query 1 27384 use `test`; insert into t1 values( 103 ) -master-bin.000001 27384 Query 1 27475 use `test`; insert into t1 values( 102 ) -master-bin.000001 27475 Query 1 27566 use `test`; insert into t1 values( 101 ) -master-bin.000001 27566 Query 1 27657 use `test`; insert into t1 values( 100 ) -master-bin.000001 27657 Query 1 27747 use `test`; insert into t1 values( 99 ) -master-bin.000001 27747 Query 1 27837 use `test`; insert into t1 values( 98 ) -master-bin.000001 27837 Query 1 27927 use `test`; insert into t1 values( 97 ) -master-bin.000001 27927 Query 1 28017 use `test`; insert into t1 values( 96 ) -master-bin.000001 28017 Query 1 28107 use `test`; insert into t1 values( 95 ) -master-bin.000001 28107 Query 1 28197 use `test`; insert into t1 values( 94 ) -master-bin.000001 28197 Query 1 28287 use `test`; insert into t1 values( 93 ) -master-bin.000001 28287 Query 1 28377 use `test`; insert into t1 values( 92 ) -master-bin.000001 28377 Query 1 28467 use `test`; insert into t1 values( 91 ) -master-bin.000001 28467 Query 1 28557 use `test`; insert into t1 values( 90 ) -master-bin.000001 28557 Query 1 28647 use `test`; insert into t1 values( 89 ) -master-bin.000001 28647 Query 1 28737 use `test`; insert into t1 values( 88 ) -master-bin.000001 28737 Query 1 28827 use `test`; insert into t1 values( 87 ) -master-bin.000001 28827 Query 1 28917 use `test`; insert into t1 values( 86 ) -master-bin.000001 28917 Query 1 29007 use `test`; insert into t1 values( 85 ) -master-bin.000001 29007 Query 1 29097 use `test`; insert into t1 values( 84 ) -master-bin.000001 29097 Query 1 29187 use `test`; insert into t1 values( 83 ) -master-bin.000001 29187 Query 1 29277 use `test`; insert into t1 values( 82 ) -master-bin.000001 29277 Query 1 29367 use `test`; insert into t1 values( 81 ) -master-bin.000001 29367 Query 1 29457 use `test`; insert into t1 values( 80 ) -master-bin.000001 29457 Query 1 29547 use `test`; insert into t1 values( 79 ) -master-bin.000001 29547 Query 1 29637 use `test`; insert into t1 values( 78 ) -master-bin.000001 29637 Query 1 29727 use `test`; insert into t1 values( 77 ) -master-bin.000001 29727 Query 1 29817 use `test`; insert into t1 values( 76 ) -master-bin.000001 29817 Query 1 29907 use `test`; insert into t1 values( 75 ) -master-bin.000001 29907 Query 1 29997 use `test`; insert into t1 values( 74 ) -master-bin.000001 29997 Query 1 30087 use `test`; insert into t1 values( 73 ) -master-bin.000001 30087 Query 1 30177 use `test`; insert into t1 values( 72 ) -master-bin.000001 30177 Query 1 30267 use `test`; insert into t1 values( 71 ) -master-bin.000001 30267 Query 1 30357 use `test`; insert into t1 values( 70 ) -master-bin.000001 30357 Query 1 30447 use `test`; insert into t1 values( 69 ) -master-bin.000001 30447 Query 1 30537 use `test`; insert into t1 values( 68 ) -master-bin.000001 30537 Query 1 30627 use `test`; insert into t1 values( 67 ) -master-bin.000001 30627 Query 1 30717 use `test`; insert into t1 values( 66 ) -master-bin.000001 30717 Query 1 30807 use `test`; insert into t1 values( 65 ) -master-bin.000001 30807 Query 1 30897 use `test`; insert into t1 values( 64 ) -master-bin.000001 30897 Query 1 30987 use `test`; insert into t1 values( 63 ) -master-bin.000001 30987 Query 1 31077 use `test`; insert into t1 values( 62 ) -master-bin.000001 31077 Query 1 31167 use `test`; insert into t1 values( 61 ) -master-bin.000001 31167 Query 1 31257 use `test`; insert into t1 values( 60 ) -master-bin.000001 31257 Query 1 31347 use `test`; insert into t1 values( 59 ) -master-bin.000001 31347 Query 1 31437 use `test`; insert into t1 values( 58 ) -master-bin.000001 31437 Query 1 31527 use `test`; insert into t1 values( 57 ) -master-bin.000001 31527 Query 1 31617 use `test`; insert into t1 values( 56 ) -master-bin.000001 31617 Query 1 31707 use `test`; insert into t1 values( 55 ) -master-bin.000001 31707 Query 1 31797 use `test`; insert into t1 values( 54 ) -master-bin.000001 31797 Query 1 31887 use `test`; insert into t1 values( 53 ) -master-bin.000001 31887 Query 1 31977 use `test`; insert into t1 values( 52 ) -master-bin.000001 31977 Query 1 32067 use `test`; insert into t1 values( 51 ) -master-bin.000001 32067 Query 1 32157 use `test`; insert into t1 values( 50 ) -master-bin.000001 32157 Query 1 32247 use `test`; insert into t1 values( 49 ) -master-bin.000001 32247 Query 1 32337 use `test`; insert into t1 values( 48 ) -master-bin.000001 32337 Query 1 32427 use `test`; insert into t1 values( 47 ) -master-bin.000001 32427 Query 1 32517 use `test`; insert into t1 values( 46 ) -master-bin.000001 32517 Query 1 32607 use `test`; insert into t1 values( 45 ) -master-bin.000001 32607 Query 1 32697 use `test`; insert into t1 values( 44 ) -master-bin.000001 32697 Query 1 32787 use `test`; insert into t1 values( 43 ) -master-bin.000001 32787 Query 1 32877 use `test`; insert into t1 values( 42 ) -master-bin.000001 32877 Query 1 32967 use `test`; insert into t1 values( 41 ) -master-bin.000001 32967 Query 1 33057 use `test`; insert into t1 values( 40 ) -master-bin.000001 33057 Query 1 33147 use `test`; insert into t1 values( 39 ) -master-bin.000001 33147 Query 1 33237 use `test`; insert into t1 values( 38 ) -master-bin.000001 33237 Query 1 33327 use `test`; insert into t1 values( 37 ) -master-bin.000001 33327 Query 1 33417 use `test`; insert into t1 values( 36 ) -master-bin.000001 33417 Query 1 33507 use `test`; insert into t1 values( 35 ) -master-bin.000001 33507 Query 1 33597 use `test`; insert into t1 values( 34 ) -master-bin.000001 33597 Query 1 33687 use `test`; insert into t1 values( 33 ) -master-bin.000001 33687 Query 1 33777 use `test`; insert into t1 values( 32 ) -master-bin.000001 33777 Query 1 33867 use `test`; insert into t1 values( 31 ) -master-bin.000001 33867 Query 1 33957 use `test`; insert into t1 values( 30 ) -master-bin.000001 33957 Query 1 34047 use `test`; insert into t1 values( 29 ) -master-bin.000001 34047 Query 1 34137 use `test`; insert into t1 values( 28 ) -master-bin.000001 34137 Query 1 34227 use `test`; insert into t1 values( 27 ) -master-bin.000001 34227 Query 1 34317 use `test`; insert into t1 values( 26 ) -master-bin.000001 34317 Query 1 34407 use `test`; insert into t1 values( 25 ) -master-bin.000001 34407 Query 1 34497 use `test`; insert into t1 values( 24 ) -master-bin.000001 34497 Query 1 34587 use `test`; insert into t1 values( 23 ) -master-bin.000001 34587 Query 1 34677 use `test`; insert into t1 values( 22 ) -master-bin.000001 34677 Query 1 34767 use `test`; insert into t1 values( 21 ) -master-bin.000001 34767 Query 1 34857 use `test`; insert into t1 values( 20 ) -master-bin.000001 34857 Query 1 34947 use `test`; insert into t1 values( 19 ) -master-bin.000001 34947 Query 1 35037 use `test`; insert into t1 values( 18 ) -master-bin.000001 35037 Query 1 35127 use `test`; insert into t1 values( 17 ) -master-bin.000001 35127 Query 1 35217 use `test`; insert into t1 values( 16 ) -master-bin.000001 35217 Query 1 35307 use `test`; insert into t1 values( 15 ) -master-bin.000001 35307 Query 1 35397 use `test`; insert into t1 values( 14 ) -master-bin.000001 35397 Query 1 35487 use `test`; insert into t1 values( 13 ) -master-bin.000001 35487 Query 1 35577 use `test`; insert into t1 values( 12 ) -master-bin.000001 35577 Query 1 35667 use `test`; insert into t1 values( 11 ) -master-bin.000001 35667 Query 1 35757 use `test`; insert into t1 values( 10 ) -master-bin.000001 35757 Query 1 35846 use `test`; insert into t1 values( 9 ) -master-bin.000001 35846 Query 1 35935 use `test`; insert into t1 values( 8 ) -master-bin.000001 35935 Query 1 36024 use `test`; insert into t1 values( 7 ) -master-bin.000001 36024 Query 1 36113 use `test`; insert into t1 values( 6 ) -master-bin.000001 36113 Query 1 36202 use `test`; insert into t1 values( 5 ) -master-bin.000001 36202 Query 1 36291 use `test`; insert into t1 values( 4 ) -master-bin.000001 36291 Query 1 36380 use `test`; insert into t1 values( 3 ) -master-bin.000001 36380 Query 1 36469 use `test`; insert into t1 values( 2 ) -master-bin.000001 36469 Query 1 36558 use `test`; insert into t1 values( 1 ) -master-bin.000001 36558 Xid 1 36585 COMMIT /* XID */ -master-bin.000001 36585 Rotate 1 36629 master-bin.000002;pos=4 +master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 +master-bin.000001 106 Query 1 206 use `test`; create table t1 (a int) engine=innodb +master-bin.000001 206 Query 1 274 use `test`; BEGIN +master-bin.000001 274 Query 1 365 use `test`; insert into t1 values( 400 ) +master-bin.000001 365 Query 1 456 use `test`; insert into t1 values( 399 ) +master-bin.000001 456 Query 1 547 use `test`; insert into t1 values( 398 ) +master-bin.000001 547 Query 1 638 use `test`; insert into t1 values( 397 ) +master-bin.000001 638 Query 1 729 use `test`; insert into t1 values( 396 ) +master-bin.000001 729 Query 1 820 use `test`; insert into t1 values( 395 ) +master-bin.000001 820 Query 1 911 use `test`; insert into t1 values( 394 ) +master-bin.000001 911 Query 1 1002 use `test`; insert into t1 values( 393 ) +master-bin.000001 1002 Query 1 1093 use `test`; insert into t1 values( 392 ) +master-bin.000001 1093 Query 1 1184 use `test`; insert into t1 values( 391 ) +master-bin.000001 1184 Query 1 1275 use `test`; insert into t1 values( 390 ) +master-bin.000001 1275 Query 1 1366 use `test`; insert into t1 values( 389 ) +master-bin.000001 1366 Query 1 1457 use `test`; insert into t1 values( 388 ) +master-bin.000001 1457 Query 1 1548 use `test`; insert into t1 values( 387 ) +master-bin.000001 1548 Query 1 1639 use `test`; insert into t1 values( 386 ) +master-bin.000001 1639 Query 1 1730 use `test`; insert into t1 values( 385 ) +master-bin.000001 1730 Query 1 1821 use `test`; insert into t1 values( 384 ) +master-bin.000001 1821 Query 1 1912 use `test`; insert into t1 values( 383 ) +master-bin.000001 1912 Query 1 2003 use `test`; insert into t1 values( 382 ) +master-bin.000001 2003 Query 1 2094 use `test`; insert into t1 values( 381 ) +master-bin.000001 2094 Query 1 2185 use `test`; insert into t1 values( 380 ) +master-bin.000001 2185 Query 1 2276 use `test`; insert into t1 values( 379 ) +master-bin.000001 2276 Query 1 2367 use `test`; insert into t1 values( 378 ) +master-bin.000001 2367 Query 1 2458 use `test`; insert into t1 values( 377 ) +master-bin.000001 2458 Query 1 2549 use `test`; insert into t1 values( 376 ) +master-bin.000001 2549 Query 1 2640 use `test`; insert into t1 values( 375 ) +master-bin.000001 2640 Query 1 2731 use `test`; insert into t1 values( 374 ) +master-bin.000001 2731 Query 1 2822 use `test`; insert into t1 values( 373 ) +master-bin.000001 2822 Query 1 2913 use `test`; insert into t1 values( 372 ) +master-bin.000001 2913 Query 1 3004 use `test`; insert into t1 values( 371 ) +master-bin.000001 3004 Query 1 3095 use `test`; insert into t1 values( 370 ) +master-bin.000001 3095 Query 1 3186 use `test`; insert into t1 values( 369 ) +master-bin.000001 3186 Query 1 3277 use `test`; insert into t1 values( 368 ) +master-bin.000001 3277 Query 1 3368 use `test`; insert into t1 values( 367 ) +master-bin.000001 3368 Query 1 3459 use `test`; insert into t1 values( 366 ) +master-bin.000001 3459 Query 1 3550 use `test`; insert into t1 values( 365 ) +master-bin.000001 3550 Query 1 3641 use `test`; insert into t1 values( 364 ) +master-bin.000001 3641 Query 1 3732 use `test`; insert into t1 values( 363 ) +master-bin.000001 3732 Query 1 3823 use `test`; insert into t1 values( 362 ) +master-bin.000001 3823 Query 1 3914 use `test`; insert into t1 values( 361 ) +master-bin.000001 3914 Query 1 4005 use `test`; insert into t1 values( 360 ) +master-bin.000001 4005 Query 1 4096 use `test`; insert into t1 values( 359 ) +master-bin.000001 4096 Query 1 4187 use `test`; insert into t1 values( 358 ) +master-bin.000001 4187 Query 1 4278 use `test`; insert into t1 values( 357 ) +master-bin.000001 4278 Query 1 4369 use `test`; insert into t1 values( 356 ) +master-bin.000001 4369 Query 1 4460 use `test`; insert into t1 values( 355 ) +master-bin.000001 4460 Query 1 4551 use `test`; insert into t1 values( 354 ) +master-bin.000001 4551 Query 1 4642 use `test`; insert into t1 values( 353 ) +master-bin.000001 4642 Query 1 4733 use `test`; insert into t1 values( 352 ) +master-bin.000001 4733 Query 1 4824 use `test`; insert into t1 values( 351 ) +master-bin.000001 4824 Query 1 4915 use `test`; insert into t1 values( 350 ) +master-bin.000001 4915 Query 1 5006 use `test`; insert into t1 values( 349 ) +master-bin.000001 5006 Query 1 5097 use `test`; insert into t1 values( 348 ) +master-bin.000001 5097 Query 1 5188 use `test`; insert into t1 values( 347 ) +master-bin.000001 5188 Query 1 5279 use `test`; insert into t1 values( 346 ) +master-bin.000001 5279 Query 1 5370 use `test`; insert into t1 values( 345 ) +master-bin.000001 5370 Query 1 5461 use `test`; insert into t1 values( 344 ) +master-bin.000001 5461 Query 1 5552 use `test`; insert into t1 values( 343 ) +master-bin.000001 5552 Query 1 5643 use `test`; insert into t1 values( 342 ) +master-bin.000001 5643 Query 1 5734 use `test`; insert into t1 values( 341 ) +master-bin.000001 5734 Query 1 5825 use `test`; insert into t1 values( 340 ) +master-bin.000001 5825 Query 1 5916 use `test`; insert into t1 values( 339 ) +master-bin.000001 5916 Query 1 6007 use `test`; insert into t1 values( 338 ) +master-bin.000001 6007 Query 1 6098 use `test`; insert into t1 values( 337 ) +master-bin.000001 6098 Query 1 6189 use `test`; insert into t1 values( 336 ) +master-bin.000001 6189 Query 1 6280 use `test`; insert into t1 values( 335 ) +master-bin.000001 6280 Query 1 6371 use `test`; insert into t1 values( 334 ) +master-bin.000001 6371 Query 1 6462 use `test`; insert into t1 values( 333 ) +master-bin.000001 6462 Query 1 6553 use `test`; insert into t1 values( 332 ) +master-bin.000001 6553 Query 1 6644 use `test`; insert into t1 values( 331 ) +master-bin.000001 6644 Query 1 6735 use `test`; insert into t1 values( 330 ) +master-bin.000001 6735 Query 1 6826 use `test`; insert into t1 values( 329 ) +master-bin.000001 6826 Query 1 6917 use `test`; insert into t1 values( 328 ) +master-bin.000001 6917 Query 1 7008 use `test`; insert into t1 values( 327 ) +master-bin.000001 7008 Query 1 7099 use `test`; insert into t1 values( 326 ) +master-bin.000001 7099 Query 1 7190 use `test`; insert into t1 values( 325 ) +master-bin.000001 7190 Query 1 7281 use `test`; insert into t1 values( 324 ) +master-bin.000001 7281 Query 1 7372 use `test`; insert into t1 values( 323 ) +master-bin.000001 7372 Query 1 7463 use `test`; insert into t1 values( 322 ) +master-bin.000001 7463 Query 1 7554 use `test`; insert into t1 values( 321 ) +master-bin.000001 7554 Query 1 7645 use `test`; insert into t1 values( 320 ) +master-bin.000001 7645 Query 1 7736 use `test`; insert into t1 values( 319 ) +master-bin.000001 7736 Query 1 7827 use `test`; insert into t1 values( 318 ) +master-bin.000001 7827 Query 1 7918 use `test`; insert into t1 values( 317 ) +master-bin.000001 7918 Query 1 8009 use `test`; insert into t1 values( 316 ) +master-bin.000001 8009 Query 1 8100 use `test`; insert into t1 values( 315 ) +master-bin.000001 8100 Query 1 8191 use `test`; insert into t1 values( 314 ) +master-bin.000001 8191 Query 1 8282 use `test`; insert into t1 values( 313 ) +master-bin.000001 8282 Query 1 8373 use `test`; insert into t1 values( 312 ) +master-bin.000001 8373 Query 1 8464 use `test`; insert into t1 values( 311 ) +master-bin.000001 8464 Query 1 8555 use `test`; insert into t1 values( 310 ) +master-bin.000001 8555 Query 1 8646 use `test`; insert into t1 values( 309 ) +master-bin.000001 8646 Query 1 8737 use `test`; insert into t1 values( 308 ) +master-bin.000001 8737 Query 1 8828 use `test`; insert into t1 values( 307 ) +master-bin.000001 8828 Query 1 8919 use `test`; insert into t1 values( 306 ) +master-bin.000001 8919 Query 1 9010 use `test`; insert into t1 values( 305 ) +master-bin.000001 9010 Query 1 9101 use `test`; insert into t1 values( 304 ) +master-bin.000001 9101 Query 1 9192 use `test`; insert into t1 values( 303 ) +master-bin.000001 9192 Query 1 9283 use `test`; insert into t1 values( 302 ) +master-bin.000001 9283 Query 1 9374 use `test`; insert into t1 values( 301 ) +master-bin.000001 9374 Query 1 9465 use `test`; insert into t1 values( 300 ) +master-bin.000001 9465 Query 1 9556 use `test`; insert into t1 values( 299 ) +master-bin.000001 9556 Query 1 9647 use `test`; insert into t1 values( 298 ) +master-bin.000001 9647 Query 1 9738 use `test`; insert into t1 values( 297 ) +master-bin.000001 9738 Query 1 9829 use `test`; insert into t1 values( 296 ) +master-bin.000001 9829 Query 1 9920 use `test`; insert into t1 values( 295 ) +master-bin.000001 9920 Query 1 10011 use `test`; insert into t1 values( 294 ) +master-bin.000001 10011 Query 1 10102 use `test`; insert into t1 values( 293 ) +master-bin.000001 10102 Query 1 10193 use `test`; insert into t1 values( 292 ) +master-bin.000001 10193 Query 1 10284 use `test`; insert into t1 values( 291 ) +master-bin.000001 10284 Query 1 10375 use `test`; insert into t1 values( 290 ) +master-bin.000001 10375 Query 1 10466 use `test`; insert into t1 values( 289 ) +master-bin.000001 10466 Query 1 10557 use `test`; insert into t1 values( 288 ) +master-bin.000001 10557 Query 1 10648 use `test`; insert into t1 values( 287 ) +master-bin.000001 10648 Query 1 10739 use `test`; insert into t1 values( 286 ) +master-bin.000001 10739 Query 1 10830 use `test`; insert into t1 values( 285 ) +master-bin.000001 10830 Query 1 10921 use `test`; insert into t1 values( 284 ) +master-bin.000001 10921 Query 1 11012 use `test`; insert into t1 values( 283 ) +master-bin.000001 11012 Query 1 11103 use `test`; insert into t1 values( 282 ) +master-bin.000001 11103 Query 1 11194 use `test`; insert into t1 values( 281 ) +master-bin.000001 11194 Query 1 11285 use `test`; insert into t1 values( 280 ) +master-bin.000001 11285 Query 1 11376 use `test`; insert into t1 values( 279 ) +master-bin.000001 11376 Query 1 11467 use `test`; insert into t1 values( 278 ) +master-bin.000001 11467 Query 1 11558 use `test`; insert into t1 values( 277 ) +master-bin.000001 11558 Query 1 11649 use `test`; insert into t1 values( 276 ) +master-bin.000001 11649 Query 1 11740 use `test`; insert into t1 values( 275 ) +master-bin.000001 11740 Query 1 11831 use `test`; insert into t1 values( 274 ) +master-bin.000001 11831 Query 1 11922 use `test`; insert into t1 values( 273 ) +master-bin.000001 11922 Query 1 12013 use `test`; insert into t1 values( 272 ) +master-bin.000001 12013 Query 1 12104 use `test`; insert into t1 values( 271 ) +master-bin.000001 12104 Query 1 12195 use `test`; insert into t1 values( 270 ) +master-bin.000001 12195 Query 1 12286 use `test`; insert into t1 values( 269 ) +master-bin.000001 12286 Query 1 12377 use `test`; insert into t1 values( 268 ) +master-bin.000001 12377 Query 1 12468 use `test`; insert into t1 values( 267 ) +master-bin.000001 12468 Query 1 12559 use `test`; insert into t1 values( 266 ) +master-bin.000001 12559 Query 1 12650 use `test`; insert into t1 values( 265 ) +master-bin.000001 12650 Query 1 12741 use `test`; insert into t1 values( 264 ) +master-bin.000001 12741 Query 1 12832 use `test`; insert into t1 values( 263 ) +master-bin.000001 12832 Query 1 12923 use `test`; insert into t1 values( 262 ) +master-bin.000001 12923 Query 1 13014 use `test`; insert into t1 values( 261 ) +master-bin.000001 13014 Query 1 13105 use `test`; insert into t1 values( 260 ) +master-bin.000001 13105 Query 1 13196 use `test`; insert into t1 values( 259 ) +master-bin.000001 13196 Query 1 13287 use `test`; insert into t1 values( 258 ) +master-bin.000001 13287 Query 1 13378 use `test`; insert into t1 values( 257 ) +master-bin.000001 13378 Query 1 13469 use `test`; insert into t1 values( 256 ) +master-bin.000001 13469 Query 1 13560 use `test`; insert into t1 values( 255 ) +master-bin.000001 13560 Query 1 13651 use `test`; insert into t1 values( 254 ) +master-bin.000001 13651 Query 1 13742 use `test`; insert into t1 values( 253 ) +master-bin.000001 13742 Query 1 13833 use `test`; insert into t1 values( 252 ) +master-bin.000001 13833 Query 1 13924 use `test`; insert into t1 values( 251 ) +master-bin.000001 13924 Query 1 14015 use `test`; insert into t1 values( 250 ) +master-bin.000001 14015 Query 1 14106 use `test`; insert into t1 values( 249 ) +master-bin.000001 14106 Query 1 14197 use `test`; insert into t1 values( 248 ) +master-bin.000001 14197 Query 1 14288 use `test`; insert into t1 values( 247 ) +master-bin.000001 14288 Query 1 14379 use `test`; insert into t1 values( 246 ) +master-bin.000001 14379 Query 1 14470 use `test`; insert into t1 values( 245 ) +master-bin.000001 14470 Query 1 14561 use `test`; insert into t1 values( 244 ) +master-bin.000001 14561 Query 1 14652 use `test`; insert into t1 values( 243 ) +master-bin.000001 14652 Query 1 14743 use `test`; insert into t1 values( 242 ) +master-bin.000001 14743 Query 1 14834 use `test`; insert into t1 values( 241 ) +master-bin.000001 14834 Query 1 14925 use `test`; insert into t1 values( 240 ) +master-bin.000001 14925 Query 1 15016 use `test`; insert into t1 values( 239 ) +master-bin.000001 15016 Query 1 15107 use `test`; insert into t1 values( 238 ) +master-bin.000001 15107 Query 1 15198 use `test`; insert into t1 values( 237 ) +master-bin.000001 15198 Query 1 15289 use `test`; insert into t1 values( 236 ) +master-bin.000001 15289 Query 1 15380 use `test`; insert into t1 values( 235 ) +master-bin.000001 15380 Query 1 15471 use `test`; insert into t1 values( 234 ) +master-bin.000001 15471 Query 1 15562 use `test`; insert into t1 values( 233 ) +master-bin.000001 15562 Query 1 15653 use `test`; insert into t1 values( 232 ) +master-bin.000001 15653 Query 1 15744 use `test`; insert into t1 values( 231 ) +master-bin.000001 15744 Query 1 15835 use `test`; insert into t1 values( 230 ) +master-bin.000001 15835 Query 1 15926 use `test`; insert into t1 values( 229 ) +master-bin.000001 15926 Query 1 16017 use `test`; insert into t1 values( 228 ) +master-bin.000001 16017 Query 1 16108 use `test`; insert into t1 values( 227 ) +master-bin.000001 16108 Query 1 16199 use `test`; insert into t1 values( 226 ) +master-bin.000001 16199 Query 1 16290 use `test`; insert into t1 values( 225 ) +master-bin.000001 16290 Query 1 16381 use `test`; insert into t1 values( 224 ) +master-bin.000001 16381 Query 1 16472 use `test`; insert into t1 values( 223 ) +master-bin.000001 16472 Query 1 16563 use `test`; insert into t1 values( 222 ) +master-bin.000001 16563 Query 1 16654 use `test`; insert into t1 values( 221 ) +master-bin.000001 16654 Query 1 16745 use `test`; insert into t1 values( 220 ) +master-bin.000001 16745 Query 1 16836 use `test`; insert into t1 values( 219 ) +master-bin.000001 16836 Query 1 16927 use `test`; insert into t1 values( 218 ) +master-bin.000001 16927 Query 1 17018 use `test`; insert into t1 values( 217 ) +master-bin.000001 17018 Query 1 17109 use `test`; insert into t1 values( 216 ) +master-bin.000001 17109 Query 1 17200 use `test`; insert into t1 values( 215 ) +master-bin.000001 17200 Query 1 17291 use `test`; insert into t1 values( 214 ) +master-bin.000001 17291 Query 1 17382 use `test`; insert into t1 values( 213 ) +master-bin.000001 17382 Query 1 17473 use `test`; insert into t1 values( 212 ) +master-bin.000001 17473 Query 1 17564 use `test`; insert into t1 values( 211 ) +master-bin.000001 17564 Query 1 17655 use `test`; insert into t1 values( 210 ) +master-bin.000001 17655 Query 1 17746 use `test`; insert into t1 values( 209 ) +master-bin.000001 17746 Query 1 17837 use `test`; insert into t1 values( 208 ) +master-bin.000001 17837 Query 1 17928 use `test`; insert into t1 values( 207 ) +master-bin.000001 17928 Query 1 18019 use `test`; insert into t1 values( 206 ) +master-bin.000001 18019 Query 1 18110 use `test`; insert into t1 values( 205 ) +master-bin.000001 18110 Query 1 18201 use `test`; insert into t1 values( 204 ) +master-bin.000001 18201 Query 1 18292 use `test`; insert into t1 values( 203 ) +master-bin.000001 18292 Query 1 18383 use `test`; insert into t1 values( 202 ) +master-bin.000001 18383 Query 1 18474 use `test`; insert into t1 values( 201 ) +master-bin.000001 18474 Query 1 18565 use `test`; insert into t1 values( 200 ) +master-bin.000001 18565 Query 1 18656 use `test`; insert into t1 values( 199 ) +master-bin.000001 18656 Query 1 18747 use `test`; insert into t1 values( 198 ) +master-bin.000001 18747 Query 1 18838 use `test`; insert into t1 values( 197 ) +master-bin.000001 18838 Query 1 18929 use `test`; insert into t1 values( 196 ) +master-bin.000001 18929 Query 1 19020 use `test`; insert into t1 values( 195 ) +master-bin.000001 19020 Query 1 19111 use `test`; insert into t1 values( 194 ) +master-bin.000001 19111 Query 1 19202 use `test`; insert into t1 values( 193 ) +master-bin.000001 19202 Query 1 19293 use `test`; insert into t1 values( 192 ) +master-bin.000001 19293 Query 1 19384 use `test`; insert into t1 values( 191 ) +master-bin.000001 19384 Query 1 19475 use `test`; insert into t1 values( 190 ) +master-bin.000001 19475 Query 1 19566 use `test`; insert into t1 values( 189 ) +master-bin.000001 19566 Query 1 19657 use `test`; insert into t1 values( 188 ) +master-bin.000001 19657 Query 1 19748 use `test`; insert into t1 values( 187 ) +master-bin.000001 19748 Query 1 19839 use `test`; insert into t1 values( 186 ) +master-bin.000001 19839 Query 1 19930 use `test`; insert into t1 values( 185 ) +master-bin.000001 19930 Query 1 20021 use `test`; insert into t1 values( 184 ) +master-bin.000001 20021 Query 1 20112 use `test`; insert into t1 values( 183 ) +master-bin.000001 20112 Query 1 20203 use `test`; insert into t1 values( 182 ) +master-bin.000001 20203 Query 1 20294 use `test`; insert into t1 values( 181 ) +master-bin.000001 20294 Query 1 20385 use `test`; insert into t1 values( 180 ) +master-bin.000001 20385 Query 1 20476 use `test`; insert into t1 values( 179 ) +master-bin.000001 20476 Query 1 20567 use `test`; insert into t1 values( 178 ) +master-bin.000001 20567 Query 1 20658 use `test`; insert into t1 values( 177 ) +master-bin.000001 20658 Query 1 20749 use `test`; insert into t1 values( 176 ) +master-bin.000001 20749 Query 1 20840 use `test`; insert into t1 values( 175 ) +master-bin.000001 20840 Query 1 20931 use `test`; insert into t1 values( 174 ) +master-bin.000001 20931 Query 1 21022 use `test`; insert into t1 values( 173 ) +master-bin.000001 21022 Query 1 21113 use `test`; insert into t1 values( 172 ) +master-bin.000001 21113 Query 1 21204 use `test`; insert into t1 values( 171 ) +master-bin.000001 21204 Query 1 21295 use `test`; insert into t1 values( 170 ) +master-bin.000001 21295 Query 1 21386 use `test`; insert into t1 values( 169 ) +master-bin.000001 21386 Query 1 21477 use `test`; insert into t1 values( 168 ) +master-bin.000001 21477 Query 1 21568 use `test`; insert into t1 values( 167 ) +master-bin.000001 21568 Query 1 21659 use `test`; insert into t1 values( 166 ) +master-bin.000001 21659 Query 1 21750 use `test`; insert into t1 values( 165 ) +master-bin.000001 21750 Query 1 21841 use `test`; insert into t1 values( 164 ) +master-bin.000001 21841 Query 1 21932 use `test`; insert into t1 values( 163 ) +master-bin.000001 21932 Query 1 22023 use `test`; insert into t1 values( 162 ) +master-bin.000001 22023 Query 1 22114 use `test`; insert into t1 values( 161 ) +master-bin.000001 22114 Query 1 22205 use `test`; insert into t1 values( 160 ) +master-bin.000001 22205 Query 1 22296 use `test`; insert into t1 values( 159 ) +master-bin.000001 22296 Query 1 22387 use `test`; insert into t1 values( 158 ) +master-bin.000001 22387 Query 1 22478 use `test`; insert into t1 values( 157 ) +master-bin.000001 22478 Query 1 22569 use `test`; insert into t1 values( 156 ) +master-bin.000001 22569 Query 1 22660 use `test`; insert into t1 values( 155 ) +master-bin.000001 22660 Query 1 22751 use `test`; insert into t1 values( 154 ) +master-bin.000001 22751 Query 1 22842 use `test`; insert into t1 values( 153 ) +master-bin.000001 22842 Query 1 22933 use `test`; insert into t1 values( 152 ) +master-bin.000001 22933 Query 1 23024 use `test`; insert into t1 values( 151 ) +master-bin.000001 23024 Query 1 23115 use `test`; insert into t1 values( 150 ) +master-bin.000001 23115 Query 1 23206 use `test`; insert into t1 values( 149 ) +master-bin.000001 23206 Query 1 23297 use `test`; insert into t1 values( 148 ) +master-bin.000001 23297 Query 1 23388 use `test`; insert into t1 values( 147 ) +master-bin.000001 23388 Query 1 23479 use `test`; insert into t1 values( 146 ) +master-bin.000001 23479 Query 1 23570 use `test`; insert into t1 values( 145 ) +master-bin.000001 23570 Query 1 23661 use `test`; insert into t1 values( 144 ) +master-bin.000001 23661 Query 1 23752 use `test`; insert into t1 values( 143 ) +master-bin.000001 23752 Query 1 23843 use `test`; insert into t1 values( 142 ) +master-bin.000001 23843 Query 1 23934 use `test`; insert into t1 values( 141 ) +master-bin.000001 23934 Query 1 24025 use `test`; insert into t1 values( 140 ) +master-bin.000001 24025 Query 1 24116 use `test`; insert into t1 values( 139 ) +master-bin.000001 24116 Query 1 24207 use `test`; insert into t1 values( 138 ) +master-bin.000001 24207 Query 1 24298 use `test`; insert into t1 values( 137 ) +master-bin.000001 24298 Query 1 24389 use `test`; insert into t1 values( 136 ) +master-bin.000001 24389 Query 1 24480 use `test`; insert into t1 values( 135 ) +master-bin.000001 24480 Query 1 24571 use `test`; insert into t1 values( 134 ) +master-bin.000001 24571 Query 1 24662 use `test`; insert into t1 values( 133 ) +master-bin.000001 24662 Query 1 24753 use `test`; insert into t1 values( 132 ) +master-bin.000001 24753 Query 1 24844 use `test`; insert into t1 values( 131 ) +master-bin.000001 24844 Query 1 24935 use `test`; insert into t1 values( 130 ) +master-bin.000001 24935 Query 1 25026 use `test`; insert into t1 values( 129 ) +master-bin.000001 25026 Query 1 25117 use `test`; insert into t1 values( 128 ) +master-bin.000001 25117 Query 1 25208 use `test`; insert into t1 values( 127 ) +master-bin.000001 25208 Query 1 25299 use `test`; insert into t1 values( 126 ) +master-bin.000001 25299 Query 1 25390 use `test`; insert into t1 values( 125 ) +master-bin.000001 25390 Query 1 25481 use `test`; insert into t1 values( 124 ) +master-bin.000001 25481 Query 1 25572 use `test`; insert into t1 values( 123 ) +master-bin.000001 25572 Query 1 25663 use `test`; insert into t1 values( 122 ) +master-bin.000001 25663 Query 1 25754 use `test`; insert into t1 values( 121 ) +master-bin.000001 25754 Query 1 25845 use `test`; insert into t1 values( 120 ) +master-bin.000001 25845 Query 1 25936 use `test`; insert into t1 values( 119 ) +master-bin.000001 25936 Query 1 26027 use `test`; insert into t1 values( 118 ) +master-bin.000001 26027 Query 1 26118 use `test`; insert into t1 values( 117 ) +master-bin.000001 26118 Query 1 26209 use `test`; insert into t1 values( 116 ) +master-bin.000001 26209 Query 1 26300 use `test`; insert into t1 values( 115 ) +master-bin.000001 26300 Query 1 26391 use `test`; insert into t1 values( 114 ) +master-bin.000001 26391 Query 1 26482 use `test`; insert into t1 values( 113 ) +master-bin.000001 26482 Query 1 26573 use `test`; insert into t1 values( 112 ) +master-bin.000001 26573 Query 1 26664 use `test`; insert into t1 values( 111 ) +master-bin.000001 26664 Query 1 26755 use `test`; insert into t1 values( 110 ) +master-bin.000001 26755 Query 1 26846 use `test`; insert into t1 values( 109 ) +master-bin.000001 26846 Query 1 26937 use `test`; insert into t1 values( 108 ) +master-bin.000001 26937 Query 1 27028 use `test`; insert into t1 values( 107 ) +master-bin.000001 27028 Query 1 27119 use `test`; insert into t1 values( 106 ) +master-bin.000001 27119 Query 1 27210 use `test`; insert into t1 values( 105 ) +master-bin.000001 27210 Query 1 27301 use `test`; insert into t1 values( 104 ) +master-bin.000001 27301 Query 1 27392 use `test`; insert into t1 values( 103 ) +master-bin.000001 27392 Query 1 27483 use `test`; insert into t1 values( 102 ) +master-bin.000001 27483 Query 1 27574 use `test`; insert into t1 values( 101 ) +master-bin.000001 27574 Query 1 27665 use `test`; insert into t1 values( 100 ) +master-bin.000001 27665 Query 1 27755 use `test`; insert into t1 values( 99 ) +master-bin.000001 27755 Query 1 27845 use `test`; insert into t1 values( 98 ) +master-bin.000001 27845 Query 1 27935 use `test`; insert into t1 values( 97 ) +master-bin.000001 27935 Query 1 28025 use `test`; insert into t1 values( 96 ) +master-bin.000001 28025 Query 1 28115 use `test`; insert into t1 values( 95 ) +master-bin.000001 28115 Query 1 28205 use `test`; insert into t1 values( 94 ) +master-bin.000001 28205 Query 1 28295 use `test`; insert into t1 values( 93 ) +master-bin.000001 28295 Query 1 28385 use `test`; insert into t1 values( 92 ) +master-bin.000001 28385 Query 1 28475 use `test`; insert into t1 values( 91 ) +master-bin.000001 28475 Query 1 28565 use `test`; insert into t1 values( 90 ) +master-bin.000001 28565 Query 1 28655 use `test`; insert into t1 values( 89 ) +master-bin.000001 28655 Query 1 28745 use `test`; insert into t1 values( 88 ) +master-bin.000001 28745 Query 1 28835 use `test`; insert into t1 values( 87 ) +master-bin.000001 28835 Query 1 28925 use `test`; insert into t1 values( 86 ) +master-bin.000001 28925 Query 1 29015 use `test`; insert into t1 values( 85 ) +master-bin.000001 29015 Query 1 29105 use `test`; insert into t1 values( 84 ) +master-bin.000001 29105 Query 1 29195 use `test`; insert into t1 values( 83 ) +master-bin.000001 29195 Query 1 29285 use `test`; insert into t1 values( 82 ) +master-bin.000001 29285 Query 1 29375 use `test`; insert into t1 values( 81 ) +master-bin.000001 29375 Query 1 29465 use `test`; insert into t1 values( 80 ) +master-bin.000001 29465 Query 1 29555 use `test`; insert into t1 values( 79 ) +master-bin.000001 29555 Query 1 29645 use `test`; insert into t1 values( 78 ) +master-bin.000001 29645 Query 1 29735 use `test`; insert into t1 values( 77 ) +master-bin.000001 29735 Query 1 29825 use `test`; insert into t1 values( 76 ) +master-bin.000001 29825 Query 1 29915 use `test`; insert into t1 values( 75 ) +master-bin.000001 29915 Query 1 30005 use `test`; insert into t1 values( 74 ) +master-bin.000001 30005 Query 1 30095 use `test`; insert into t1 values( 73 ) +master-bin.000001 30095 Query 1 30185 use `test`; insert into t1 values( 72 ) +master-bin.000001 30185 Query 1 30275 use `test`; insert into t1 values( 71 ) +master-bin.000001 30275 Query 1 30365 use `test`; insert into t1 values( 70 ) +master-bin.000001 30365 Query 1 30455 use `test`; insert into t1 values( 69 ) +master-bin.000001 30455 Query 1 30545 use `test`; insert into t1 values( 68 ) +master-bin.000001 30545 Query 1 30635 use `test`; insert into t1 values( 67 ) +master-bin.000001 30635 Query 1 30725 use `test`; insert into t1 values( 66 ) +master-bin.000001 30725 Query 1 30815 use `test`; insert into t1 values( 65 ) +master-bin.000001 30815 Query 1 30905 use `test`; insert into t1 values( 64 ) +master-bin.000001 30905 Query 1 30995 use `test`; insert into t1 values( 63 ) +master-bin.000001 30995 Query 1 31085 use `test`; insert into t1 values( 62 ) +master-bin.000001 31085 Query 1 31175 use `test`; insert into t1 values( 61 ) +master-bin.000001 31175 Query 1 31265 use `test`; insert into t1 values( 60 ) +master-bin.000001 31265 Query 1 31355 use `test`; insert into t1 values( 59 ) +master-bin.000001 31355 Query 1 31445 use `test`; insert into t1 values( 58 ) +master-bin.000001 31445 Query 1 31535 use `test`; insert into t1 values( 57 ) +master-bin.000001 31535 Query 1 31625 use `test`; insert into t1 values( 56 ) +master-bin.000001 31625 Query 1 31715 use `test`; insert into t1 values( 55 ) +master-bin.000001 31715 Query 1 31805 use `test`; insert into t1 values( 54 ) +master-bin.000001 31805 Query 1 31895 use `test`; insert into t1 values( 53 ) +master-bin.000001 31895 Query 1 31985 use `test`; insert into t1 values( 52 ) +master-bin.000001 31985 Query 1 32075 use `test`; insert into t1 values( 51 ) +master-bin.000001 32075 Query 1 32165 use `test`; insert into t1 values( 50 ) +master-bin.000001 32165 Query 1 32255 use `test`; insert into t1 values( 49 ) +master-bin.000001 32255 Query 1 32345 use `test`; insert into t1 values( 48 ) +master-bin.000001 32345 Query 1 32435 use `test`; insert into t1 values( 47 ) +master-bin.000001 32435 Query 1 32525 use `test`; insert into t1 values( 46 ) +master-bin.000001 32525 Query 1 32615 use `test`; insert into t1 values( 45 ) +master-bin.000001 32615 Query 1 32705 use `test`; insert into t1 values( 44 ) +master-bin.000001 32705 Query 1 32795 use `test`; insert into t1 values( 43 ) +master-bin.000001 32795 Query 1 32885 use `test`; insert into t1 values( 42 ) +master-bin.000001 32885 Query 1 32975 use `test`; insert into t1 values( 41 ) +master-bin.000001 32975 Query 1 33065 use `test`; insert into t1 values( 40 ) +master-bin.000001 33065 Query 1 33155 use `test`; insert into t1 values( 39 ) +master-bin.000001 33155 Query 1 33245 use `test`; insert into t1 values( 38 ) +master-bin.000001 33245 Query 1 33335 use `test`; insert into t1 values( 37 ) +master-bin.000001 33335 Query 1 33425 use `test`; insert into t1 values( 36 ) +master-bin.000001 33425 Query 1 33515 use `test`; insert into t1 values( 35 ) +master-bin.000001 33515 Query 1 33605 use `test`; insert into t1 values( 34 ) +master-bin.000001 33605 Query 1 33695 use `test`; insert into t1 values( 33 ) +master-bin.000001 33695 Query 1 33785 use `test`; insert into t1 values( 32 ) +master-bin.000001 33785 Query 1 33875 use `test`; insert into t1 values( 31 ) +master-bin.000001 33875 Query 1 33965 use `test`; insert into t1 values( 30 ) +master-bin.000001 33965 Query 1 34055 use `test`; insert into t1 values( 29 ) +master-bin.000001 34055 Query 1 34145 use `test`; insert into t1 values( 28 ) +master-bin.000001 34145 Query 1 34235 use `test`; insert into t1 values( 27 ) +master-bin.000001 34235 Query 1 34325 use `test`; insert into t1 values( 26 ) +master-bin.000001 34325 Query 1 34415 use `test`; insert into t1 values( 25 ) +master-bin.000001 34415 Query 1 34505 use `test`; insert into t1 values( 24 ) +master-bin.000001 34505 Query 1 34595 use `test`; insert into t1 values( 23 ) +master-bin.000001 34595 Query 1 34685 use `test`; insert into t1 values( 22 ) +master-bin.000001 34685 Query 1 34775 use `test`; insert into t1 values( 21 ) +master-bin.000001 34775 Query 1 34865 use `test`; insert into t1 values( 20 ) +master-bin.000001 34865 Query 1 34955 use `test`; insert into t1 values( 19 ) +master-bin.000001 34955 Query 1 35045 use `test`; insert into t1 values( 18 ) +master-bin.000001 35045 Query 1 35135 use `test`; insert into t1 values( 17 ) +master-bin.000001 35135 Query 1 35225 use `test`; insert into t1 values( 16 ) +master-bin.000001 35225 Query 1 35315 use `test`; insert into t1 values( 15 ) +master-bin.000001 35315 Query 1 35405 use `test`; insert into t1 values( 14 ) +master-bin.000001 35405 Query 1 35495 use `test`; insert into t1 values( 13 ) +master-bin.000001 35495 Query 1 35585 use `test`; insert into t1 values( 12 ) +master-bin.000001 35585 Query 1 35675 use `test`; insert into t1 values( 11 ) +master-bin.000001 35675 Query 1 35765 use `test`; insert into t1 values( 10 ) +master-bin.000001 35765 Query 1 35854 use `test`; insert into t1 values( 9 ) +master-bin.000001 35854 Query 1 35943 use `test`; insert into t1 values( 8 ) +master-bin.000001 35943 Query 1 36032 use `test`; insert into t1 values( 7 ) +master-bin.000001 36032 Query 1 36121 use `test`; insert into t1 values( 6 ) +master-bin.000001 36121 Query 1 36210 use `test`; insert into t1 values( 5 ) +master-bin.000001 36210 Query 1 36299 use `test`; insert into t1 values( 4 ) +master-bin.000001 36299 Query 1 36388 use `test`; insert into t1 values( 3 ) +master-bin.000001 36388 Query 1 36477 use `test`; insert into t1 values( 2 ) +master-bin.000001 36477 Query 1 36566 use `test`; insert into t1 values( 1 ) +master-bin.000001 36566 Xid 1 36593 COMMIT /* XID */ +master-bin.000001 36593 Rotate 1 36637 master-bin.000002;pos=4 drop table t1; set global binlog_cache_size=@bcs; set session autocommit = @ac; From b7af4c5b25e8ae6768a35b5ddf296d41642f6785 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 04:33:19 +0200 Subject: [PATCH 130/227] Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB Streamlining test for RBR --- .../suite/binlog/r/binlog_row_binlog.result | 109 ------------------ 1 file changed, 109 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index 37fe49e79dc..1d1656889f4 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -258,117 +258,8 @@ master-bin.000001 419 Table_map 1 458 table_id: # (test.t1) master-bin.000001 458 Write_rows 1 492 table_id: # flags: STMT_END_F master-bin.000001 492 Xid 1 519 COMMIT /* XID */ master-bin.000001 519 Query 1 595 use `test`; drop table t1 -set autocommit= 1; -reset master; -create table t1(n int) engine=innodb; -insert into t1 values (1); -insert into t1 values (2); -insert into t1 values (3); -commit; -drop table t1; -show binlog events from 0; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb -master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) -master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F -master-bin.000001 278 Xid 1 305 COMMIT /* XID */ -master-bin.000001 305 Table_map 1 344 table_id: # (test.t1) -master-bin.000001 344 Write_rows 1 378 table_id: # flags: STMT_END_F -master-bin.000001 378 Xid 1 405 COMMIT /* XID */ -master-bin.000001 405 Table_map 1 444 table_id: # (test.t1) -master-bin.000001 444 Write_rows 1 478 table_id: # flags: STMT_END_F -master-bin.000001 478 Xid 1 505 COMMIT /* XID */ -master-bin.000001 505 Query 1 581 use `test`; drop table t1 -reset master; -create table t1(n int) engine=myisam; -begin; -insert into t1 values (4); -insert into t1 values (5); -insert into t1 values (6); -commit; -drop table t1; -show binlog events from 0; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=myisam -master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) -master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F -master-bin.000001 278 Table_map 1 317 table_id: # (test.t1) -master-bin.000001 317 Write_rows 1 351 table_id: # flags: STMT_END_F -master-bin.000001 351 Table_map 1 390 table_id: # (test.t1) -master-bin.000001 390 Write_rows 1 424 table_id: # flags: STMT_END_F -master-bin.000001 424 Query 1 500 use `test`; drop table t1 -set autocommit= 1; -reset master; -create table t1(n int) engine=innodb; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 205 -insert into t1 values (1); -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 305 -insert into t1 values (2); -insert into t1 values (3); -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 505 -commit; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 505 -drop table t1; -show binlog events from 0; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=innodb -master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) -master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F -master-bin.000001 278 Xid 1 305 COMMIT /* XID */ -master-bin.000001 305 Table_map 1 344 table_id: # (test.t1) -master-bin.000001 344 Write_rows 1 378 table_id: # flags: STMT_END_F -master-bin.000001 378 Xid 1 405 COMMIT /* XID */ -master-bin.000001 405 Table_map 1 444 table_id: # (test.t1) -master-bin.000001 444 Write_rows 1 478 table_id: # flags: STMT_END_F -master-bin.000001 478 Xid 1 505 COMMIT /* XID */ -master-bin.000001 505 Query 1 581 use `test`; drop table t1 -set autocommit= 0; -reset master; -create table t1(n int) engine=myisam; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 205 -insert into t1 values (4); -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 278 -insert into t1 values (5); -insert into t1 values (6); -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 424 -commit; -show master status; -File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 424 -drop table t1; -show binlog events from 0; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4 -master-bin.000001 106 Query 1 205 use `test`; create table t1(n int) engine=myisam -master-bin.000001 205 Table_map 1 244 table_id: # (test.t1) -master-bin.000001 244 Write_rows 1 278 table_id: # flags: STMT_END_F -master-bin.000001 278 Table_map 1 317 table_id: # (test.t1) -master-bin.000001 317 Write_rows 1 351 table_id: # flags: STMT_END_F -master-bin.000001 351 Table_map 1 390 table_id: # (test.t1) -master-bin.000001 390 Write_rows 1 424 table_id: # flags: STMT_END_F -master-bin.000001 424 Query 1 500 use `test`; drop table t1 -set session autocommit = @ac; set @bcs = @@binlog_cache_size; -set @ac = @@autocommit; set global binlog_cache_size=4096; -set autocommit= 0; reset master; create table t1 (a int) engine=innodb; show binlog events from 0; From 1abab6c7c7461bac95afd424e80b9a953fdf897b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 10:49:54 +0300 Subject: [PATCH 131/227] Bug #29325: By default MyISAM overwrites .MYD and .MYI files no DATA DIRECTORY option is used. This can lead to two tables using the same .MYD and .MYI files (that can't be dropped). To prevent CREATE TABLE from overwriting a file a new option is introduced : keep_files_on_create When this is on the CREATE TABLE throws an error if either the .MYD or .MYI exists for a MyISAM table. The option is off by default (resulting in compatible behavior). include/my_base.h: Bug #29325: introduce keep_files_on_create myisam/mi_create.c: Bug #29325: introduce keep_files_on_create mysql-test/r/create.result: Bug #29325: test case mysql-test/t/create.test: Bug #29325: test case sql/ha_myisam.cc: Bug #29325: introduce keep_files_on_create sql/set_var.cc: Bug #29325: introduce keep_files_on_create sql/sql_class.h: Bug #29325: introduce keep_files_on_create sql/sql_table.cc: Bug #29325: introduce keep_files_on_create sql/unireg.cc: Bug #29325: introduce keep_files_on_create --- include/my_base.h | 1 + myisam/mi_create.c | 6 ++++-- mysql-test/r/create.result | 17 +++++++++++++++++ mysql-test/t/create.test | 31 +++++++++++++++++++++++++++++++ sql/ha_myisam.cc | 2 ++ sql/set_var.cc | 6 ++++++ sql/sql_class.h | 1 + sql/sql_table.cc | 2 ++ sql/unireg.cc | 2 ++ 9 files changed, 66 insertions(+), 2 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index d07a4de8e6a..d8732808cee 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -279,6 +279,7 @@ enum ha_base_keytype { #define HA_PACK_RECORD 2 /* Request packed record format */ #define HA_CREATE_TMP_TABLE 4 #define HA_CREATE_CHECKSUM 8 +#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */ #define HA_CREATE_DELAY_KEY_WRITE 64 /* diff --git a/myisam/mi_create.c b/myisam/mi_create.c index ea1d8c7b83e..dd8a5b0d525 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -586,7 +586,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, 32 : 0)); linkname_ptr=0; /* Replace the current file */ - create_flag=MY_DELETE_OLD; + if (!(flags & HA_CREATE_KEEP_FILES)) + create_flag=MY_DELETE_OLD; } /* @@ -647,7 +648,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, { fn_format(filename,name,"",MI_NAME_DEXT,4); linkname_ptr=0; - create_flag=MY_DELETE_OLD; + if (!(flags & HA_CREATE_KEEP_FILES)) + create_flag=MY_DELETE_OLD; } if ((dfile= my_create_with_symlink(linkname_ptr, filename, 0, create_mode, diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index e692dbf3938..16bc534ba92 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1503,4 +1503,21 @@ t1 CREATE TABLE `t1` ( `c17` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +CREATE DATABASE db1; +CREATE DATABASE db2; +USE db2; +INSERT INTO db2.t1 VALUES (1); +SELECT * FROM db2.t1; +b +1 +RESET QUERY CACHE; +USE db1; +SET SESSION keep_files_on_create = TRUE; +CREATE TABLE t1 (a INT) ENGINE MYISAM; +ERROR HY000: Can't create/write to file './db1/t1.MYD' (Errcode: 17) +SET SESSION keep_files_on_create = DEFAULT; +DROP TABLE db2.t1; +DROP DATABASE db1; +DROP DATABASE db2; +USE test; End of 5.0 tests diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 99f3fea416a..610a208ebf0 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1118,5 +1118,36 @@ show create table t1; drop table t1; +# +# Bug #29325: create table overwrites .MYD file of other table (datadir) +# + +CREATE DATABASE db1; +CREATE DATABASE db2; + +USE db2; +--disable_query_log +eval CREATE TABLE t1 (b INT) ENGINE MYISAM +DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/'; +--enable_query_log + +INSERT INTO db2.t1 VALUES (1); +SELECT * FROM db2.t1; +RESET QUERY CACHE; + +USE db1; + +#no warning from create table +SET SESSION keep_files_on_create = TRUE; +--disable_abort_on_error +CREATE TABLE t1 (a INT) ENGINE MYISAM; +--enable_abort_on_error +SET SESSION keep_files_on_create = DEFAULT; + +DROP TABLE db2.t1; +DROP DATABASE db1; +DROP DATABASE db2; +USE test; + --echo End of 5.0 tests diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 5e953092436..4efa19bad78 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1809,6 +1809,8 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE) create_flags|= HA_CREATE_TMP_TABLE; + if (ha_create_info->options & HA_CREATE_KEEP_FILES) + create_flags|= HA_CREATE_KEEP_FILES; if (options & HA_OPTION_PACK_RECORD) create_flags|= HA_PACK_RECORD; if (options & HA_OPTION_CHECKSUM) diff --git a/sql/set_var.cc b/sql/set_var.cc index 09cdc34f803..b30aa008366 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -592,6 +592,10 @@ sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE)); /* Global read-only variable containing hostname */ sys_var_const_str sys_hostname("hostname", glob_hostname); +sys_var_thd_bool sys_keep_files_on_create("keep_files_on_create", + &SV::keep_files_on_create); + + /* @@ -637,6 +641,7 @@ sys_var *sys_variables[]= &sys_delayed_insert_limit, &sys_delayed_insert_timeout, &sys_delayed_queue_size, + &sys_keep_files_on_create, &sys_error_count, &sys_expire_logs_days, &sys_flush, @@ -849,6 +854,7 @@ struct show_var_st init_vars[]= { {sys_delayed_insert_timeout.name, (char*) &sys_delayed_insert_timeout, SHOW_SYS}, {sys_delayed_queue_size.name,(char*) &sys_delayed_queue_size, SHOW_SYS}, {sys_div_precincrement.name,(char*) &sys_div_precincrement,SHOW_SYS}, + {sys_keep_files_on_create.name,(char*) &sys_keep_files_on_create, SHOW_SYS}, {sys_engine_condition_pushdown.name, (char*) &sys_engine_condition_pushdown, SHOW_SYS}, {sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS}, diff --git a/sql/sql_class.h b/sql/sql_class.h index a5cbc21684f..112538cbe95 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -566,6 +566,7 @@ struct system_variables my_bool new_mode; my_bool query_cache_wlock_invalidate; my_bool engine_condition_pushdown; + my_bool keep_files_on_create; #ifdef HAVE_INNOBASE_DB my_bool innodb_table_locks; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 87f23097a66..e02595836ca 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2841,6 +2841,8 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST *src_table, and temporary tables). */ *fn_ext(dst_path)= 0; + if (thd->variables.keep_files_on_create) + create_info->options|= HA_CREATE_KEEP_FILES; err= ha_create_table(dst_path, create_info, 1); if (create_info->options & HA_LEX_CREATE_TMP_TABLE) diff --git a/sql/unireg.cc b/sql/unireg.cc index c01e6a0f00c..d8e63bb78e1 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -285,6 +285,8 @@ int rea_create_table(THD *thd, my_string file_name, if (mysql_create_frm(thd, file_name, db, table, create_info, create_fields, keys, key_info, NULL)) DBUG_RETURN(1); + if (thd->variables.keep_files_on_create) + create_info->options|= HA_CREATE_KEEP_FILES; if (!create_info->frm_only && ha_create_table(file_name,create_info,0)) { my_delete(file_name,MYF(0)); From 3881f2a24dd531077d99b9a646c437d98e05c994 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 12:37:47 +0300 Subject: [PATCH 132/227] fixed uninitialized variable introduced by the fix for bug 29325 --- myisam/mi_create.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/myisam/mi_create.c b/myisam/mi_create.c index dd8a5b0d525..75863ed976f 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -586,8 +586,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, 32 : 0)); linkname_ptr=0; /* Replace the current file */ - if (!(flags & HA_CREATE_KEEP_FILES)) - create_flag=MY_DELETE_OLD; + create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD; } /* @@ -648,8 +647,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, { fn_format(filename,name,"",MI_NAME_DEXT,4); linkname_ptr=0; - if (!(flags & HA_CREATE_KEEP_FILES)) - create_flag=MY_DELETE_OLD; + create_flag=(flags & HA_CREATE_KEEP_FILES) ? 0 : MY_DELETE_OLD; } if ((dfile= my_create_with_symlink(linkname_ptr, filename, 0, create_mode, From 6a1fda7aba66cb75170397ec67a3e807151f3b27 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 13:09:39 +0300 Subject: [PATCH 133/227] porting 29070 to 5.1-opt --- storage/myisam/sp_key.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/myisam/sp_key.c b/storage/myisam/sp_key.c index 21965fad6b3..3748a38ff81 100644 --- a/storage/myisam/sp_key.c +++ b/storage/myisam/sp_key.c @@ -78,7 +78,7 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, if (keyseg->flag & HA_SWAP_KEY) { - char buf[sizeof(double)]; + uchar buf[sizeof(double)]; float8store(buf, val); pos= &buf[length]; @@ -87,7 +87,7 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, } else { - float8store((byte *)key, val); + float8store((uchar *)key, val); key += length; } len+= length; @@ -128,7 +128,7 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims, { if ((*wkb) > end - 8) return -1; - float8get(ord, (const byte*) *wkb); + float8get(ord, (const uchar*) *wkb); (*wkb)+= 8; if (ord < *mbr) *mbr= ord; From 70dc2448411dadd984e08e98aaa1e07889c40643 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 15:16:54 +0400 Subject: [PATCH 134/227] BUG#29610: crash in func_group on 64bit platform: - make merge_buffers():sort_length have type size_t as this type is expected by, e.g. ptr_compare_1, which will receive pointer to sort_length as comparison parameter. sql/filesort.cc: BUG#29610: crash in func_group on 64bit platform: - make sort_length have type size_t as this type is expected by, e.g. ptr_compare_1, which will receive pointer to sort_length as comparison parameter. --- sql/filesort.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/filesort.cc b/sql/filesort.cc index e547940797b..b6a5d844eac 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1120,7 +1120,8 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file, int flag) { int error; - uint rec_length,sort_length,res_length,offset; + uint rec_length,res_length,offset; + size_t sort_length; ulong maxcount; ha_rows max_rows,org_max_rows; my_off_t to_start_filepos; From 49bb7e206b2b04f36f461b59ce7e86d692c7b654 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 14:36:44 +0200 Subject: [PATCH 135/227] fix ndb_version.h so that it is usable and make some functions public to handle ndb version --- storage/ndb/include/ndb_version.h.in | 57 ++++++++++++------- storage/ndb/include/util/version.h | 23 +++----- storage/ndb/src/common/util/version.c | 23 +++++--- .../kernel/blocks/dbdict/printSchemaFile.cpp | 2 +- storage/ndb/src/kernel/blocks/diskpage.cpp | 2 +- .../ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 2 +- storage/ndb/src/kernel/blocks/restore.cpp | 2 +- storage/ndb/src/kernel/vm/SimulatedBlock.hpp | 2 +- storage/ndb/src/mgmsrv/Services.cpp | 2 +- storage/ndb/src/ndbapi/ClusterMgr.cpp | 2 +- storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp | 2 +- storage/ndb/tools/restore/restore_main.cpp | 6 +- 12 files changed, 70 insertions(+), 55 deletions(-) diff --git a/storage/ndb/include/ndb_version.h.in b/storage/ndb/include/ndb_version.h.in index 9e1edeecd1e..5405ad4d7aa 100644 --- a/storage/ndb/include/ndb_version.h.in +++ b/storage/ndb/include/ndb_version.h.in @@ -16,8 +16,7 @@ #ifndef NDB_VERSION_H #define NDB_VERSION_H -#include -#include +#include /* NDB build version */ #define NDB_VERSION_BUILD @NDB_VERSION_BUILD@ @@ -32,19 +31,35 @@ #define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@" -#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) +#define NDB_MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) -#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) +#define NDB_VERSION_D NDB_MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) #define NDB_VERSION_STRING_BUF_SZ 100 #ifdef __cplusplus -extern "C" -#else -extern +extern "C" { #endif -char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ]; -#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS, \ - ndb_version_string_buf, \ - sizeof(ndb_version_string_buf))) + +void ndbPrintVersion(); + +Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build); + +Uint32 ndbGetMajor(Uint32 version); + +Uint32 ndbGetMinor(Uint32 version); + +Uint32 ndbGetBuild(Uint32 version); + +const char* ndbGetVersionString(Uint32 version, const char * status, + char *buf, unsigned sz); +const char* ndbGetOwnVersionString(); + +Uint32 ndbGetOwnVersion(); + +#ifdef __cplusplus +} +#endif + +#define NDB_VERSION_STRING ndbGetOwnVersionString() #define NDB_VERSION ndbGetOwnVersion() @@ -59,19 +74,19 @@ char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ]; /** * From which version do we support rowid */ -#define NDBD_ROWID_VERSION (MAKE_VERSION(5,1,6)) -#define NDBD_INCL_NODECONF_VERSION_4 MAKE_VERSION(4,1,17) -#define NDBD_INCL_NODECONF_VERSION_5 MAKE_VERSION(5,0,18) -#define NDBD_FRAGID_VERSION (MAKE_VERSION(5,1,6)) -#define NDBD_DICT_LOCK_VERSION_5 MAKE_VERSION(5,0,23) -#define NDBD_DICT_LOCK_VERSION_5_1 MAKE_VERSION(5,1,12) +#define NDBD_ROWID_VERSION (NDB_MAKE_VERSION(5,1,6)) +#define NDBD_INCL_NODECONF_VERSION_4 NDB_MAKE_VERSION(4,1,17) +#define NDBD_INCL_NODECONF_VERSION_5 NDB_MAKE_VERSION(5,0,18) +#define NDBD_FRAGID_VERSION (NDB_MAKE_VERSION(5,1,6)) +#define NDBD_DICT_LOCK_VERSION_5 NDB_MAKE_VERSION(5,0,23) +#define NDBD_DICT_LOCK_VERSION_5_1 NDB_MAKE_VERSION(5,1,12) -#define NDBD_UPDATE_FRAG_DIST_KEY_50 MAKE_VERSION(5,0,26) -#define NDBD_UPDATE_FRAG_DIST_KEY_51 MAKE_VERSION(5,1,12) +#define NDBD_UPDATE_FRAG_DIST_KEY_50 NDB_MAKE_VERSION(5,0,26) +#define NDBD_UPDATE_FRAG_DIST_KEY_51 NDB_MAKE_VERSION(5,1,12) -#define NDBD_QMGR_SINGLEUSER_VERSION_5 MAKE_VERSION(5,0,25) +#define NDBD_QMGR_SINGLEUSER_VERSION_5 NDB_MAKE_VERSION(5,0,25) -#define NDBD_NODE_VERSION_REP MAKE_VERSION(6,1,1) +#define NDBD_NODE_VERSION_REP NDB_MAKE_VERSION(6,1,1) #endif diff --git a/storage/ndb/include/util/version.h b/storage/ndb/include/util/version.h index 42513d00442..9ea18ecd9d9 100644 --- a/storage/ndb/include/util/version.h +++ b/storage/ndb/include/util/version.h @@ -16,25 +16,18 @@ #ifndef VERSION_H #define VERSION_H -#include +#include + +/* some backwards compatible macros */ +#define MAKE_VERSION(A,B,C) NDB_MAKE_VERSION(A,B,C) +#define getMajor(a) ndbGetMajor(a) +#define getMinor(a) ndbGetMinor(a) +#define getBuild(a) ndbGetBuild(a) + #ifdef __cplusplus extern "C" { #endif - Uint32 getMajor(Uint32 version); - - Uint32 getMinor(Uint32 version); - - Uint32 getBuild(Uint32 version); - - Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build); - - const char* getVersionString(Uint32 version, const char * status, - char *buf, unsigned sz); - - void ndbPrintVersion(); - Uint32 ndbGetOwnVersion(); - int ndbCompatible_mgmt_ndb(Uint32 ownVersion, Uint32 otherVersion); int ndbCompatible_ndb_mgmt(Uint32 ownVersion, Uint32 otherVersion); int ndbCompatible_mgmt_api(Uint32 ownVersion, Uint32 otherVersion); diff --git a/storage/ndb/src/common/util/version.c b/storage/ndb/src/common/util/version.c index f309a3d4ad5..56a92489131 100644 --- a/storage/ndb/src/common/util/version.c +++ b/storage/ndb/src/common/util/version.c @@ -20,26 +20,33 @@ #include #include -Uint32 getMajor(Uint32 version) { +Uint32 ndbGetMajor(Uint32 version) { return (version >> 16) & 0xFF; } -Uint32 getMinor(Uint32 version) { +Uint32 ndbGetMinor(Uint32 version) { return (version >> 8) & 0xFF; } -Uint32 getBuild(Uint32 version) { +Uint32 ndbGetBuild(Uint32 version) { return (version >> 0) & 0xFF; } -Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) { - return MAKE_VERSION(major, minor, build); +Uint32 ndbMakeVersion(Uint32 major, Uint32 minor, Uint32 build) { + return NDB_MAKE_VERSION(major, minor, build); } -char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ]; -const char * getVersionString(Uint32 version, const char * status, - char *buf, unsigned sz) +const char * ndbGetOwnVersionString() +{ + static char ndb_version_string_buf[NDB_VERSION_STRING_BUF_SZ]; + return ndbGetVersionString(NDB_VERSION, NDB_VERSION_STATUS, + ndb_version_string_buf, + sizeof(ndb_version_string_buf)); +} + +const char * ndbGetVersionString(Uint32 version, const char * status, + char *buf, unsigned sz) { if (status && status[0] != 0) basestring_snprintf(buf, sz, diff --git a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp index 602881095c3..44326e213d0 100644 --- a/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp +++ b/storage/ndb/src/kernel/blocks/dbdict/printSchemaFile.cpp @@ -15,7 +15,7 @@ #include -#include +#include #include #include diff --git a/storage/ndb/src/kernel/blocks/diskpage.cpp b/storage/ndb/src/kernel/blocks/diskpage.cpp index 3f98e078746..50e9b6e53cb 100644 --- a/storage/ndb/src/kernel/blocks/diskpage.cpp +++ b/storage/ndb/src/kernel/blocks/diskpage.cpp @@ -49,7 +49,7 @@ operator<<(NdbOut& out, const File_formats::Zero_page_header& obj) char buf[256]; out << "page size: " << obj.m_page_size << endl; out << "ndb version: " << obj.m_ndb_version << ", " << - getVersionString(obj.m_ndb_version, 0, buf, sizeof(buf)) << endl; + ndbGetVersionString(obj.m_ndb_version, 0, buf, sizeof(buf)) << endl; out << "ndb node id: " << obj.m_node_id << endl; out << "file type: " << obj.m_file_type << endl; out << "time: " << obj.m_time << ", " diff --git a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 52045fd63cd..1fba4d62e17 100644 --- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -2793,7 +2793,7 @@ void Qmgr::execAPI_REGREQ(Signal* signal) "incompatible with %s", type == NodeInfo::API ? "api or mysqld" : "management server", apiNodePtr.i, - getVersionString(version,"",buf,sizeof(buf)), + ndbGetVersionString(version,"",buf,sizeof(buf)), NDB_VERSION_STRING); apiNodePtr.p->phase = ZAPI_INACTIVE; sendApiRegRef(signal, ref, ApiRegRef::UnsupportedVersion); diff --git a/storage/ndb/src/kernel/blocks/restore.cpp b/storage/ndb/src/kernel/blocks/restore.cpp index 2d40cd79daa..efc4bc1948a 100644 --- a/storage/ndb/src/kernel/blocks/restore.cpp +++ b/storage/ndb/src/kernel/blocks/restore.cpp @@ -1271,7 +1271,7 @@ Restore::check_file_version(Signal* signal, Uint32 file_version) { char buf[255]; char verbuf[255]; - getVersionString(file_version, 0, verbuf, sizeof(verbuf)); + ndbGetVersionString(file_version, 0, verbuf, sizeof(verbuf)); BaseString::snprintf(buf, sizeof(buf), "Unsupported version of LCP files found on disk, " " found: %s", verbuf); diff --git a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp index a78ee21fb8f..31f219718e5 100644 --- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include "VMSignal.hpp" diff --git a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp index f260ff7e3ec..9272b5ab532 100644 --- a/storage/ndb/src/mgmsrv/Services.cpp +++ b/storage/ndb/src/mgmsrv/Services.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include diff --git a/storage/ndb/src/ndbapi/ClusterMgr.cpp b/storage/ndb/src/ndbapi/ClusterMgr.cpp index f51a5098c53..448bc1025e8 100644 --- a/storage/ndb/src/ndbapi/ClusterMgr.cpp +++ b/storage/ndb/src/ndbapi/ClusterMgr.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include "TransporterFacade.hpp" #include "ClusterMgr.hpp" diff --git a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 63d36bf012f..ab6d90ad59e 100644 --- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #define DEBUG_PRINT 0 #define INCOMPATIBLE_VERSION -2 diff --git a/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp index 79aebbaac45..30ecc695eba 100644 --- a/storage/ndb/tools/restore/restore_main.cpp +++ b/storage/ndb/tools/restore/restore_main.cpp @@ -684,7 +684,7 @@ main(int argc, char** argv) char buf[NDB_VERSION_STRING_BUF_SZ]; info.setLevel(254); info << "Ndb version in backup files: " - << getVersionString(version, 0, buf, sizeof(buf)) << endl; + << ndbGetVersionString(version, 0, buf, sizeof(buf)) << endl; /** * check wheater we can restore the backup (right version). @@ -694,9 +694,9 @@ main(int argc, char** argv) if (version >= MAKE_VERSION(5,1,3) && version <= MAKE_VERSION(5,1,9)) { err << "Restore program incompatible with backup versions between " - << getVersionString(MAKE_VERSION(5,1,3), 0, buf, sizeof(buf)) + << ndbGetVersionString(MAKE_VERSION(5,1,3), 0, buf, sizeof(buf)) << " and " - << getVersionString(MAKE_VERSION(5,1,9), 0, buf, sizeof(buf)) + << ndbGetVersionString(MAKE_VERSION(5,1,9), 0, buf, sizeof(buf)) << endl; exitHandler(NDBT_FAILED); } From 847d6ed75bf396eeccef04205822c6314ff55065 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 15:26:19 +0200 Subject: [PATCH 136/227] fix for smarter index mergein fulltext to work for queries like "+a (b)" mysql-test/r/fulltext.result: second test for BUG#29445 mysql-test/t/fulltext.test: second test for BUG#29445 storage/myisam/ft_boolean_search.c: fix for smarter index merge, to work for queries like "+a (b)" --- mysql-test/r/fulltext.result | 3 +++ mysql-test/t/fulltext.test | 1 + storage/myisam/ft_boolean_search.c | 25 +++++++++++++++++++------ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 6f6760e31bc..02b115cb6dc 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -485,4 +485,7 @@ INSERT INTO t1 VALUES('Offside'),('City Of God'); SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE); a City Of God +SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of)*' IN BOOLEAN MODE); +a +City Of God DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 4e0c65267c4..b1bf0036c70 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -414,6 +414,7 @@ DROP TABLE t1; CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a)); INSERT INTO t1 VALUES('Offside'),('City Of God'); SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE); +SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of)*' IN BOOLEAN MODE); DROP TABLE t1; # End of 4.1 tests diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index ce93ba28da9..5c421d3688b 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -24,7 +24,7 @@ subtree, but it could be updated by plus-word only. The idea is: there is no need to search for docid smaller than - biggest docid inside current plus subtree. + biggest docid inside current plus subtree or any upper plus subtree. Examples: +word1 word2 @@ -36,6 +36,13 @@ +(word1 -word2) +(+word3 word4) share same max_docid max_docid updated by word3 + +word1 word2 (+word3 word4 (+word5 word6)) + three subexpressions (including the top-level one), + every one has its own max_docid, updated by its plus word. + but for the search word6 uses + max(word1.max_docid, word3.max_docid, word5.max_docid), + while word4 uses, accordingly, + max(word1.max_docid, word3.max_docid). */ #define FT_CORE @@ -104,7 +111,7 @@ typedef struct st_ftb_word /* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */ my_off_t docid[2]; /* for index search and for scan */ my_off_t key_root; - my_off_t *max_docid; + FTB_EXPR *max_docid_expr; MI_KEYDEF *keyinfo; struct st_ftb_word *prev; float weight; @@ -208,7 +215,7 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param, for (tmp_expr= ftb_param->ftbe; tmp_expr->up; tmp_expr= tmp_expr->up) if (! (tmp_expr->flags & FTB_FLAG_YES)) break; - ftbw->max_docid= &tmp_expr->max_docid; + ftbw->max_docid_expr= tmp_expr; /* fall through */ case FT_TOKEN_STOPWORD: if (! ftb_param->up_quot) break; @@ -347,11 +354,17 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) else { uint sflag= SEARCH_BIGGER; - if (ftbw->docid[0] < *ftbw->max_docid) + my_off_t max_docid=0; + FTB_EXPR *tmp; + + for (tmp= ftbw->max_docid_expr; tmp; tmp= tmp->up) + set_if_bigger(max_docid, tmp->max_docid); + + if (ftbw->docid[0] < max_docid) { sflag|= SEARCH_SAME; _mi_dpointer(info, (uchar *)(ftbw->word + ftbw->len + HA_FT_WLEN), - *ftbw->max_docid); + max_docid); } r=_mi_search(info, ftbw->keyinfo, (uchar*) lastkey_buf, USE_WHOLE_KEY, sflag, ftbw->key_root); @@ -431,7 +444,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) } ftbw->docid[0]=info->lastpos; if (ftbw->flags & FTB_FLAG_YES) - *ftbw->max_docid= info->lastpos; + ftbw->max_docid_expr->max_docid= info->lastpos; return 0; } From 8abc8b9dc7ce5cf7ef52b0dfa43deaf7e2e177f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 18:38:45 +0400 Subject: [PATCH 137/227] Fix for bug #24192 "MySQL replication does not exit server when running out of memory" In case of out-of-memory error received from the master, print the corresponding message to the error log and stop slave I/O thread to avoid reconnecting with a wrong binary log position. sql/slave.cc: In case of out-of-memory error received from the master, print the corresponding message to the error log and stop slave I/O thread to avoid reconnecting with a wrong binary log position. --- sql/slave.cc | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index 97615165803..32f500723d3 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -26,6 +26,7 @@ #include #include #include +#include #define MAX_SLAVE_RETRY_PAUSE 5 bool use_slave_mask = 0; @@ -3610,22 +3611,25 @@ after reconnect"); if (event_len == packet_error) { - uint mysql_error_number= mysql_errno(mysql); - if (mysql_error_number == CR_NET_PACKET_TOO_LARGE) - { - sql_print_error("\ + uint mysql_error_number= mysql_errno(mysql); + switch (mysql_error_number) { + case CR_NET_PACKET_TOO_LARGE: + sql_print_error("\ Log entry on master is longer than max_allowed_packet (%ld) on \ slave. If the entry is correct, restart the server with a higher value of \ max_allowed_packet", - thd->variables.max_allowed_packet); - goto err; - } - if (mysql_error_number == ER_MASTER_FATAL_ERROR_READING_BINLOG) - { - sql_print_error(ER(mysql_error_number), mysql_error_number, - mysql_error(mysql)); - goto err; - } + thd->variables.max_allowed_packet); + goto err; + case ER_MASTER_FATAL_ERROR_READING_BINLOG: + sql_print_error(ER(mysql_error_number), mysql_error_number, + mysql_error(mysql)); + goto err; + case EE_OUTOFMEMORY: + case ER_OUTOFMEMORY: + sql_print_error("\ +Stopping slave I/O thread due to out-of-memory error from master"); + goto err; + } mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; thd->proc_info = "Waiting to reconnect after a failed master event read"; #ifdef SIGNAL_WITH_VIO_CLOSE From 2f0e00175b56af824f0946284053e5a5a30b2c82 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 18:02:47 +0300 Subject: [PATCH 138/227] Addendum to bug 29325: test if TRUNCATE TABLE works with keep_files_on_create --- mysql-test/r/create.result | 7 ++++++- mysql-test/t/create.test | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 16bc534ba92..ff963892bc9 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1515,8 +1515,13 @@ USE db1; SET SESSION keep_files_on_create = TRUE; CREATE TABLE t1 (a INT) ENGINE MYISAM; ERROR HY000: Can't create/write to file './db1/t1.MYD' (Errcode: 17) +CREATE TABLE t3 (a INT) Engine=MyISAM; +INSERT INTO t3 VALUES (1),(2),(3); +TRUNCATE TABLE t3; +SELECT * from t3; +a SET SESSION keep_files_on_create = DEFAULT; -DROP TABLE db2.t1; +DROP TABLE db2.t1, db1.t3; DROP DATABASE db1; DROP DATABASE db2; USE test; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 610a208ebf0..a1d3d488f1c 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1142,9 +1142,15 @@ SET SESSION keep_files_on_create = TRUE; --disable_abort_on_error CREATE TABLE t1 (a INT) ENGINE MYISAM; --enable_abort_on_error + +CREATE TABLE t3 (a INT) Engine=MyISAM; +INSERT INTO t3 VALUES (1),(2),(3); +TRUNCATE TABLE t3; +SELECT * from t3; + SET SESSION keep_files_on_create = DEFAULT; -DROP TABLE db2.t1; +DROP TABLE db2.t1, db1.t3; DROP DATABASE db1; DROP DATABASE db2; USE test; From 0920c75b5efa164253c546f88e30b9b4fe686e6b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 00:03:08 +0500 Subject: [PATCH 139/227] Fixed bug #29360. The special `zero' enum value was coerced to the normal empty string enum value during a field-to-field copy. This bug affected CREATE ... SELECT statements and SELECT aggregate GROUP BY enum field statements. Also this bug made unnecessary warnings during the execution of CREATE ... SELECT statements: Warning 1265 Data truncated for column... sql/field_conv.cc: Fixed bug #29360. The field_conv function has been modified to properly convert the special `zero' enum value between enum fields. mysql-test/t/type_enum.test: Updated test case for bug #29360. mysql-test/r/type_enum.result: Updated test case for bug #29360. mysql-test/r/type_ranges.result: Updated test case for bug #29360. --- mysql-test/r/type_enum.result | 20 ++++++++++++++++++++ mysql-test/r/type_ranges.result | 4 ---- mysql-test/t/type_enum.test | 18 ++++++++++++++++++ sql/field_conv.cc | 16 +++++++++++----- 4 files changed, 49 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index f537b7140ba..ca516f027ba 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1809,3 +1809,23 @@ f1 drop table t1; +CREATE TABLE t1 (c1 ENUM('a', '', 'b')); +INSERT INTO t1 (c1) VALUES ('b'); +INSERT INTO t1 (c1) VALUES (''); +INSERT INTO t1 (c1) VALUES (0); +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +INSERT INTO t1 (c1) VALUES (''); +SELECT c1 + 0, COUNT(c1) FROM t1 GROUP BY c1; +c1 + 0 COUNT(c1) +0 1 +2 2 +3 1 +CREATE TABLE t2 SELECT * FROM t1; +SELECT c1 + 0 FROM t2; +c1 + 0 +3 +2 +0 +2 +DROP TABLE t1,t2; diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index e949d734944..5c2d3b84d89 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -208,10 +208,6 @@ options flags one one drop table t2; create table t2 select * from t1; -Warnings: -Warning 1265 Data truncated for column 'options' at row 4 -Warning 1265 Data truncated for column 'options' at row 5 -Warning 1265 Data truncated for column 'options' at row 6 update t2 set string="changed" where auto=16; show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index ecc945a3157..fbba38f926d 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -182,3 +182,21 @@ create table t1(f1 set('a','b'), index(f1)); insert into t1 values(''),(''),('a'),('b'); select * from t1 where f1=''; drop table t1; + +# +# Bug#29360: Confluence of the special 0 enum value with the normal empty string +# value during field to field copy. +# + +CREATE TABLE t1 (c1 ENUM('a', '', 'b')); +INSERT INTO t1 (c1) VALUES ('b'); +INSERT INTO t1 (c1) VALUES (''); +INSERT INTO t1 (c1) VALUES (0); +INSERT INTO t1 (c1) VALUES (''); + +SELECT c1 + 0, COUNT(c1) FROM t1 GROUP BY c1; + +CREATE TABLE t2 SELECT * FROM t1; +SELECT c1 + 0 FROM t2; + +DROP TABLE t1,t2; diff --git a/sql/field_conv.cc b/sql/field_conv.cc index a286255ec23..2df65b62de6 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -790,11 +790,17 @@ int field_conv(Field *to,Field *from) blob->value.copy(); return blob->store(blob->value.ptr(),blob->value.length(),from->charset()); } - if ((from->result_type() == STRING_RESULT && - (to->result_type() == STRING_RESULT || - (from->real_type() != FIELD_TYPE_ENUM && - from->real_type() != FIELD_TYPE_SET))) || - to->type() == FIELD_TYPE_DECIMAL) + if (from->real_type() == FIELD_TYPE_ENUM && + to->real_type() == FIELD_TYPE_ENUM && + from->val_int() == 0) + { + ((Field_enum *)(to))->store_type(0); + } + else if ((from->result_type() == STRING_RESULT && + (to->result_type() == STRING_RESULT || + (from->real_type() != FIELD_TYPE_ENUM && + from->real_type() != FIELD_TYPE_SET))) || + to->type() == FIELD_TYPE_DECIMAL) { char buff[MAX_FIELD_WIDTH]; String result(buff,sizeof(buff),from->charset()); From 25e28d4d28e7052d31079a9c8b6f65e4e94041ca Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 23:18:02 +0400 Subject: [PATCH 140/227] Bug#29555: Comparing time values as strings may lead to a wrong result. Time values were compared as strings. This led to a wrong comparison result when comparing values one of which is under 100 hours and another is over 100 hours. Now when the Arg_comparator::set_cmp_func function sees that both items to compare are of the TIME type it sets the comparator to the Arg_comparator::compare_e_int or the Arg_comparator::compare_int_unsigned functions. sql/item_cmpfunc.cc: Bug#29555: Comparing time values as strings may lead to a wrong result. Now when the Arg_comparator::set_cmp_func function sees that both items to compare are of the TIME type it sets the comparator to the Arg_comparator::compare_e_int or the Arg_comparator::compare_int_unsigned functions. mysql-test/r/type_time.result: Added a test case for the bug#29555: Comparing time values as strings may lead to a wrong result. mysql-test/t/type_time.test: Added a test case for the bug#29555: Comparing time values as strings may lead to a wrong result. --- mysql-test/r/type_time.result | 18 ++++++++++++++++++ mysql-test/t/type_time.test | 10 ++++++++++ sql/item_cmpfunc.cc | 12 ++++++++++++ 3 files changed, 40 insertions(+) diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 442435b0459..6124f6e39f1 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -85,3 +85,21 @@ sec_to_time(time_to_sec(t)) 13:00:00 09:00:00 drop table t1; +select cast('100:55:50' as time) < cast('24:00:00' as time); +cast('100:55:50' as time) < cast('24:00:00' as time) +0 +select cast('100:55:50' as time) < cast('024:00:00' as time); +cast('100:55:50' as time) < cast('024:00:00' as time) +0 +select cast('300:55:50' as time) < cast('240:00:00' as time); +cast('300:55:50' as time) < cast('240:00:00' as time) +0 +select cast('100:55:50' as time) > cast('24:00:00' as time); +cast('100:55:50' as time) > cast('24:00:00' as time) +1 +select cast('100:55:50' as time) > cast('024:00:00' as time); +cast('100:55:50' as time) > cast('024:00:00' as time) +1 +select cast('300:55:50' as time) > cast('240:00:00' as time); +cast('300:55:50' as time) > cast('240:00:00' as time) +1 diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index cb7e4f85ad1..d294e53a12f 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -40,3 +40,13 @@ drop table t1; # ########################################################## # End of 4.1 tests + +# +# Bug#29555: Comparing time values as strings may lead to a wrong result. +# +select cast('100:55:50' as time) < cast('24:00:00' as time); +select cast('100:55:50' as time) < cast('024:00:00' as time); +select cast('300:55:50' as time) < cast('240:00:00' as time); +select cast('100:55:50' as time) > cast('24:00:00' as time); +select cast('100:55:50' as time) > cast('024:00:00' as time); +select cast('300:55:50' as time) > cast('240:00:00' as time); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index ed0c09f0b32..70df1b4d09c 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -706,6 +706,18 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg, func= &Arg_comparator::compare_datetime; return 0; } + else if (type == STRING_RESULT && (*a)->field_type() == MYSQL_TYPE_TIME && + (*b)->field_type() == MYSQL_TYPE_TIME) + { + /* Compare TIME values as integers. */ + thd= current_thd; + owner= owner_arg; + func= ((test(owner && owner->functype() == Item_func::EQUAL_FUNC)) ? + &Arg_comparator::compare_e_int : + &Arg_comparator::compare_int_unsigned); + return 0; + } + return set_compare_func(owner_arg, type); } From b6e01cbba30f2e951b5dcae1be65fc79c58ab088 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 00:55:40 +0500 Subject: [PATCH 141/227] field_conv.cc: Additional fix for bug #29360. sql/field_conv.cc: Additional fix for bug #29360. --- sql/field_conv.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 2df65b62de6..2705d4f617b 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -795,6 +795,7 @@ int field_conv(Field *to,Field *from) from->val_int() == 0) { ((Field_enum *)(to))->store_type(0); + return 0; } else if ((from->result_type() == STRING_RESULT && (to->result_type() == STRING_RESULT || From 0bc3e69f92497c04cdd48e7936888183fd8a21d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 01:10:29 +0400 Subject: [PATCH 142/227] A fix and a test case for Bug#25859 ALTER DATABASE works w/o parameters. Fix the parser to make the database options not optional. mysql-test/r/information_schema.result: Update results (Bug#25859) mysql-test/t/information_schema.test: Add a test case for Bug#25859 "ALTER DATABASE works w/o parameters" sql/sql_yacc.yy: Fix Bug#25859 ALTER DATABASE works w/o parameters - require parameters in the parser. --- mysql-test/r/information_schema.result | 7 ++++++- mysql-test/t/information_schema.test | 11 +++++++++-- sql/sql_yacc.yy | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 4947fd7aecc..9d0e41b341a 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1013,7 +1013,7 @@ c int(11) YES NULL drop view v1; drop table t1; alter database information_schema; -ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 drop database information_schema; ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema' drop table information_schema.tables; @@ -1326,3 +1326,8 @@ v2 YES delete from v1; drop view v1,v2; drop table t1,t2; +alter database; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +alter database test; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +End of 5.0 tests. diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 1d368ac6075..6cf4ad8f576 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -697,7 +697,7 @@ drop table t1; # # Bug #9846 Inappropriate error displayed while dropping table from 'INFORMATION_SCHEMA' # ---error 1044 +--error ER_PARSE_ERROR alter database information_schema; --error 1044 drop database information_schema; @@ -1038,4 +1038,11 @@ delete from v1; drop view v1,v2; drop table t1,t2; -# End of 5.0 tests. +# +# Bug#25859 ALTER DATABASE works w/o parameters +# +--error ER_PARSE_ERROR +alter database; +--error ER_PARSE_ERROR +alter database test; +--echo End of 5.0 tests. diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 949f3ed4161..6c38c5984a3 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3621,7 +3621,7 @@ alter: Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; } - opt_create_database_options + create_database_options { LEX *lex=Lex; lex->sql_command=SQLCOM_ALTER_DB; From b1e55680437cefcfa087fd7531c0d351da87306e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Jul 2007 18:45:35 -0700 Subject: [PATCH 143/227] Fixed bug #29604. A bug in the restore_prev_nj_state function allowed interleaving inner tables of outer join operations with outer tables. With the current implementation of the nested loops algorithm it could lead to wrong result sets for queries with nested outer joins. Another bug in this procedure effectively blocked evaluation of some valid execution plans for queries with nested outer joins. mysql-test/r/join_nested.result: Added a test case for bug #29604. mysql-test/t/join_nested.test: Added a test case for bug #29604. --- mysql-test/r/join_nested.result | 111 +++++++++++++++++++++++++++++++ mysql-test/t/join_nested.test | 114 ++++++++++++++++++++++++++++++++ sql/sql_select.cc | 10 ++- 3 files changed, 233 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result index 006488f9d43..daf63579e9c 100644 --- a/mysql-test/r/join_nested.result +++ b/mysql-test/r/join_nested.result @@ -1632,4 +1632,115 @@ INSERT INTO t3 VALUES (1,1); SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a); ERROR 23000: Column 'a' in from clause is ambiguous DROP TABLE t1,t2,t3; +CREATE TABLE t1 ( +carrier char(2) default NULL, +id int NOT NULL auto_increment PRIMARY KEY +); +INSERT INTO t1 VALUES +('CO',235371754),('CO',235376554),('CO',235376884),('CO',235377874), +('CO',231060394),('CO',231059224),('CO',231059314),('CO',231060484), +('CO',231060274),('CO',231060124),('CO',231060244),('CO',231058594), +('CO',231058924),('CO',231058504),('CO',231059344),('CO',231060424), +('CO',231059554),('CO',231060304),('CO',231059644),('CO',231059464), +('CO',231059764),('CO',231058294),('CO',231058624),('CO',231058864), +('CO',231059374),('CO',231059584),('CO',231059734),('CO',231059014), +('CO',231059854),('CO',231059494),('CO',231059794),('CO',231058534), +('CO',231058324),('CO',231058684),('CO',231059524),('CO',231059974); +CREATE TABLE t2 ( +scan_date date default NULL, +package_id int default NULL, +INDEX scan_date(scan_date), +INDEX package_id(package_id) +); +INSERT INTO t2 VALUES +('2008-12-29',231062944),('2008-12-29',231065764),('2008-12-29',231066124), +('2008-12-29',231060094),('2008-12-29',231061054),('2008-12-29',231065644), +('2008-12-29',231064384),('2008-12-29',231064444),('2008-12-29',231073774), +('2008-12-29',231058594),('2008-12-29',231059374),('2008-12-29',231066004), +('2008-12-29',231068494),('2008-12-29',231070174),('2008-12-29',231071884), +('2008-12-29',231063274),('2008-12-29',231063754),('2008-12-29',231064144), +('2008-12-29',231069424),('2008-12-29',231073714),('2008-12-29',231058414), +('2008-12-29',231060994),('2008-12-29',231069154),('2008-12-29',231068614), +('2008-12-29',231071464),('2008-12-29',231074014),('2008-12-29',231059614), +('2008-12-29',231059074),('2008-12-29',231059464),('2008-12-29',231069094), +('2008-12-29',231067294),('2008-12-29',231070144),('2008-12-29',231073804), +('2008-12-29',231072634),('2008-12-29',231058294),('2008-12-29',231065344), +('2008-12-29',231066094),('2008-12-29',231069034),('2008-12-29',231058594), +('2008-12-29',231059854),('2008-12-29',231059884),('2008-12-29',231059914), +('2008-12-29',231063664),('2008-12-29',231063814),('2008-12-29',231063904); +CREATE TABLE t3 ( +package_id int default NULL, +INDEX package_id(package_id) +); +INSERT INTO t3 VALUES +(231058294),(231058324),(231058354),(231058384),(231058414),(231058444), +(231058474),(231058504),(231058534),(231058564),(231058594),(231058624), +(231058684),(231058744),(231058804),(231058864),(231058924),(231058954), +(231059014),(231059074),(231059104),(231059134),(231059164),(231059194), +(231059224),(231059254),(231059284),(231059314),(231059344),(231059374), +(231059404),(231059434),(231059464),(231059494),(231059524),(231059554), +(231059584),(231059614),(231059644),(231059674),(231059704),(231059734), +(231059764),(231059794),(231059824),(231059854),(231059884),(231059914), +(231059944),(231059974),(231060004),(231060034),(231060064),(231060094), +(231060124),(231060154),(231060184),(231060214),(231060244),(231060274), +(231060304),(231060334),(231060364),(231060394),(231060424),(231060454), +(231060484),(231060514),(231060544),(231060574),(231060604),(231060634), +(231060664),(231060694),(231060724),(231060754),(231060784),(231060814), +(231060844),(231060874),(231060904),(231060934),(231060964),(231060994), +(231061024),(231061054),(231061084),(231061144),(231061174),(231061204), +(231061234),(231061294),(231061354),(231061384),(231061414),(231061474), +(231061564),(231061594),(231061624),(231061684),(231061714),(231061774), +(231061804),(231061894),(231061984),(231062074),(231062134),(231062224), +(231062254),(231062314),(231062374),(231062434),(231062494),(231062554), +(231062584),(231062614),(231062644),(231062704),(231062734),(231062794), +(231062854),(231062884),(231062944),(231063004),(231063034),(231063064), +(231063124),(231063154),(231063184),(231063214),(231063274),(231063334), +(231063394),(231063424),(231063454),(231063514),(231063574),(231063664); +CREATE TABLE t4 ( +carrier char(2) NOT NULL default '' PRIMARY KEY, +id int(11) default NULL, +INDEX id(id) +); +INSERT INTO t4 VALUES +('99',6),('SK',456),('UA',486),('AI',1081),('OS',1111),('VS',1510); +CREATE TABLE t5 ( +carrier_id int default NULL, +INDEX carrier_id(carrier_id) +); +INSERT INTO t5 VALUES +(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), +(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), +(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), +(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), +(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), +(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(456),(456),(456), +(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456), +(456),(486),(1081),(1111),(1111),(1111),(1111),(1510); +SELECT COUNT(*) +FROM((t2 JOIN t1 ON t2.package_id = t1.id) +JOIN t3 ON t3.package_id = t1.id); +COUNT(*) +6 +EXPLAIN +SELECT COUNT(*) +FROM ((t2 JOIN t1 ON t2.package_id = t1.id) +JOIN t3 ON t3.package_id = t1.id) +LEFT JOIN +(t5 JOIN t4 ON t5.carrier_id = t4.id) +ON t4.carrier = t1.carrier; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index package_id package_id 5 NULL 45 Using index +1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.package_id 1 +1 SIMPLE t4 eq_ref PRIMARY,id PRIMARY 2 test.t1.carrier 1 +1 SIMPLE t5 ref carrier_id carrier_id 5 test.t4.id 22 Using index +1 SIMPLE t3 ref package_id package_id 5 test.t1.id 1 Using where; Using index +SELECT COUNT(*) +FROM ((t2 JOIN t1 ON t2.package_id = t1.id) +JOIN t3 ON t3.package_id = t1.id) +LEFT JOIN +(t5 JOIN t4 ON t5.carrier_id = t4.id) +ON t4.carrier = t1.carrier; +COUNT(*) +6 +DROP TABLE t1,t2,t3,t4,t5; End of 5.0 tests diff --git a/mysql-test/t/join_nested.test b/mysql-test/t/join_nested.test index f29366797f6..5b07d8966f1 100644 --- a/mysql-test/t/join_nested.test +++ b/mysql-test/t/join_nested.test @@ -1083,4 +1083,118 @@ SELECT * FROM t1 JOIN (t2 JOIN t3 USING (b)) USING (a); DROP TABLE t1,t2,t3; +# +# BUG#29604: inner nest of left join interleaves with outer tables +# + +CREATE TABLE t1 ( + carrier char(2) default NULL, + id int NOT NULL auto_increment PRIMARY KEY +); +INSERT INTO t1 VALUES + ('CO',235371754),('CO',235376554),('CO',235376884),('CO',235377874), + ('CO',231060394),('CO',231059224),('CO',231059314),('CO',231060484), + ('CO',231060274),('CO',231060124),('CO',231060244),('CO',231058594), + ('CO',231058924),('CO',231058504),('CO',231059344),('CO',231060424), + ('CO',231059554),('CO',231060304),('CO',231059644),('CO',231059464), + ('CO',231059764),('CO',231058294),('CO',231058624),('CO',231058864), + ('CO',231059374),('CO',231059584),('CO',231059734),('CO',231059014), + ('CO',231059854),('CO',231059494),('CO',231059794),('CO',231058534), + ('CO',231058324),('CO',231058684),('CO',231059524),('CO',231059974); + +CREATE TABLE t2 ( + scan_date date default NULL, + package_id int default NULL, + INDEX scan_date(scan_date), + INDEX package_id(package_id) +); +INSERT INTO t2 VALUES + ('2008-12-29',231062944),('2008-12-29',231065764),('2008-12-29',231066124), + ('2008-12-29',231060094),('2008-12-29',231061054),('2008-12-29',231065644), + ('2008-12-29',231064384),('2008-12-29',231064444),('2008-12-29',231073774), + ('2008-12-29',231058594),('2008-12-29',231059374),('2008-12-29',231066004), + ('2008-12-29',231068494),('2008-12-29',231070174),('2008-12-29',231071884), + ('2008-12-29',231063274),('2008-12-29',231063754),('2008-12-29',231064144), + ('2008-12-29',231069424),('2008-12-29',231073714),('2008-12-29',231058414), + ('2008-12-29',231060994),('2008-12-29',231069154),('2008-12-29',231068614), + ('2008-12-29',231071464),('2008-12-29',231074014),('2008-12-29',231059614), + ('2008-12-29',231059074),('2008-12-29',231059464),('2008-12-29',231069094), + ('2008-12-29',231067294),('2008-12-29',231070144),('2008-12-29',231073804), + ('2008-12-29',231072634),('2008-12-29',231058294),('2008-12-29',231065344), + ('2008-12-29',231066094),('2008-12-29',231069034),('2008-12-29',231058594), + ('2008-12-29',231059854),('2008-12-29',231059884),('2008-12-29',231059914), + ('2008-12-29',231063664),('2008-12-29',231063814),('2008-12-29',231063904); + +CREATE TABLE t3 ( + package_id int default NULL, + INDEX package_id(package_id) +); +INSERT INTO t3 VALUES + (231058294),(231058324),(231058354),(231058384),(231058414),(231058444), + (231058474),(231058504),(231058534),(231058564),(231058594),(231058624), + (231058684),(231058744),(231058804),(231058864),(231058924),(231058954), + (231059014),(231059074),(231059104),(231059134),(231059164),(231059194), + (231059224),(231059254),(231059284),(231059314),(231059344),(231059374), + (231059404),(231059434),(231059464),(231059494),(231059524),(231059554), + (231059584),(231059614),(231059644),(231059674),(231059704),(231059734), + (231059764),(231059794),(231059824),(231059854),(231059884),(231059914), + (231059944),(231059974),(231060004),(231060034),(231060064),(231060094), + (231060124),(231060154),(231060184),(231060214),(231060244),(231060274), + (231060304),(231060334),(231060364),(231060394),(231060424),(231060454), + (231060484),(231060514),(231060544),(231060574),(231060604),(231060634), + (231060664),(231060694),(231060724),(231060754),(231060784),(231060814), + (231060844),(231060874),(231060904),(231060934),(231060964),(231060994), + (231061024),(231061054),(231061084),(231061144),(231061174),(231061204), + (231061234),(231061294),(231061354),(231061384),(231061414),(231061474), + (231061564),(231061594),(231061624),(231061684),(231061714),(231061774), + (231061804),(231061894),(231061984),(231062074),(231062134),(231062224), + (231062254),(231062314),(231062374),(231062434),(231062494),(231062554), + (231062584),(231062614),(231062644),(231062704),(231062734),(231062794), + (231062854),(231062884),(231062944),(231063004),(231063034),(231063064), + (231063124),(231063154),(231063184),(231063214),(231063274),(231063334), + (231063394),(231063424),(231063454),(231063514),(231063574),(231063664); + +CREATE TABLE t4 ( + carrier char(2) NOT NULL default '' PRIMARY KEY, + id int(11) default NULL, + INDEX id(id) +); +INSERT INTO t4 VALUES + ('99',6),('SK',456),('UA',486),('AI',1081),('OS',1111),('VS',1510); + +CREATE TABLE t5 ( + carrier_id int default NULL, + INDEX carrier_id(carrier_id) +); +INSERT INTO t5 VALUES + (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), + (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), + (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), + (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), + (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6), + (6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(6),(456),(456),(456), + (456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456),(456), + (456),(486),(1081),(1111),(1111),(1111),(1111),(1510); + +SELECT COUNT(*) + FROM((t2 JOIN t1 ON t2.package_id = t1.id) + JOIN t3 ON t3.package_id = t1.id); + +EXPLAIN +SELECT COUNT(*) + FROM ((t2 JOIN t1 ON t2.package_id = t1.id) + JOIN t3 ON t3.package_id = t1.id) + LEFT JOIN + (t5 JOIN t4 ON t5.carrier_id = t4.id) + ON t4.carrier = t1.carrier; +SELECT COUNT(*) + FROM ((t2 JOIN t1 ON t2.package_id = t1.id) + JOIN t3 ON t3.package_id = t1.id) + LEFT JOIN + (t5 JOIN t4 ON t5.carrier_id = t4.id) + ON t4.carrier = t1.carrier; + +DROP TABLE t1,t2,t3,t4,t5; + --echo End of 5.0 tests + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9d27ab4bb4e..c62a19b2752 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8486,9 +8486,15 @@ static void restore_prev_nj_state(JOIN_TAB *last) { TABLE_LIST *last_emb= last->table->pos_in_table_list->embedding; JOIN *join= last->join; - while (last_emb && !(--last_emb->nested_join->counter)) + while (last_emb) { - join->cur_embedding_map &= last_emb->nested_join->nj_map; + if (!(--last_emb->nested_join->counter)) + join->cur_embedding_map&= ~last_emb->nested_join->nj_map; + else if (last_emb->nested_join->join_list.elements-1 == + last_emb->nested_join->counter) + join->cur_embedding_map|= last_emb->nested_join->nj_map; + else + break; last_emb= last_emb->embedding; } } From 6ba23b0ac9a4548de36386b4f892af9c7d471e97 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 12:49:39 +0400 Subject: [PATCH 144/227] Fix for 5.1 for BUG#10491: Server returns data as charset binary SHOW CREATE TABLE or SELECT FROM I_S. This is the last patch for this bug, which depends on the big CS patch and was pending. The problem was that SHOW CREATE statements returned original queries in the binary character set. That could cause the query to be unreadable. The fix is to use original character_set_client when sending the original query to the client. In order to preserve the query in mysqldump, 'binary' character set results should be set when issuing SHOW CREATE statement. If either source or destination character set is 'binary' , no conversion is performed. The idea is that since the source character set is no longer 'binary', we fix the destination character set to still produce valid dumps. client/mysqldump.c: Switch character_set_results of mysqldump-connection before calling SHOW CREATE statements for the objects. mysql-test/r/show_check.result: Result file. mysql-test/t/show_check.test: Add test case for the part of BUG#10491. sql/events.cc: Send original query in the original character set. sql/sp_head.cc: Send original query in the original character set. sql/sql_show.cc: Send original query in the original character set. --- client/mysqldump.c | 43 +++++++++++++++++++++++ mysql-test/r/show_check.result | 39 +++++++++++++++++++++ mysql-test/t/show_check.test | 64 ++++++++++++++++++++++++++++++++++ sql/events.cc | 3 +- sql/sp_head.cc | 3 +- sql/sql_show.cc | 12 +++++-- 6 files changed, 160 insertions(+), 4 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 812a158048e..11be212ec3b 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1201,6 +1201,20 @@ static void restore_time_zone(FILE *sql_file, (const char *) delimiter); } + +static int switch_character_set_results(MYSQL *mysql, const char *cs_name) +{ + char query_buffer[QUERY_LENGTH]; + size_t query_length; + + query_length= my_snprintf(query_buffer, + sizeof (query_buffer), + "SET SESSION character_set_results = '%s'", + (const char *) cs_name); + + return mysql_real_query(mysql, query_buffer, query_length); +} + /* Open a new .sql file to dump the table or view into @@ -1706,6 +1720,9 @@ static uint dump_events_for_db(char *db) if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name))) DBUG_RETURN(1); + if (switch_character_set_results(mysql, "binary")) + DBUG_RETURN(1); + while ((event_list_row= mysql_fetch_row(event_list_res)) != NULL) { event_name= quote_name(event_list_row[1], name_buff, 0); @@ -1774,6 +1791,9 @@ static uint dump_events_for_db(char *db) } /* end of list of events */ fprintf(sql_file, "DELIMITER ;\n"); fprintf(sql_file, "/*!50106 SET TIME_ZONE= @save_time_zone */ ;\n"); + + if (switch_character_set_results(mysql, default_charset)) + DBUG_RETURN(1); } mysql_free_result(event_list_res); @@ -1853,6 +1873,9 @@ static uint dump_routines_for_db(char *db) if (fetch_db_collation(db_name_buff, db_cl_name, sizeof (db_cl_name))) DBUG_RETURN(1); + if (switch_character_set_results(mysql, "binary")) + DBUG_RETURN(1); + /* 0, retrieve and dump functions, 1, procedures */ for (i= 0; i <= 1; i++) { @@ -1990,6 +2013,9 @@ static uint dump_routines_for_db(char *db) mysql_free_result(routine_list_res); } /* end of for i (0 .. 1) */ + if (switch_character_set_results(mysql, default_charset)) + DBUG_RETURN(1); + if (lock_tables) VOID(mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES")); DBUG_RETURN(0); @@ -2542,6 +2568,9 @@ static void dump_triggers_for_table(char *table, char *db_name) if (fetch_db_collation(db_name, db_cl_name, sizeof (db_cl_name))) DBUG_VOID_RETURN; + if (switch_character_set_results(mysql, "binary")) + DBUG_VOID_RETURN; + /* Dump triggers. */ while ((row= mysql_fetch_row(result))) @@ -2637,6 +2666,9 @@ static void dump_triggers_for_table(char *table, char *db_name) mysql_free_result(result); + if (switch_character_set_results(mysql, default_charset)) + DBUG_VOID_RETURN; + /* make sure to set back opt_compatible mode to original value @@ -4390,14 +4422,22 @@ static my_bool get_view_structure(char *table, char* db) result_table= quote_name(table, table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); + if (switch_character_set_results(mysql, "binary")) + DBUG_RETURN(1); + my_snprintf(query, sizeof(query), "SHOW CREATE TABLE %s", result_table); + if (mysql_query_with_error_report(mysql, &table_res, query)) + { + switch_character_set_results(mysql, default_charset); DBUG_RETURN(0); + } /* Check if this is a view */ field= mysql_fetch_field_direct(table_res, 0); if (strcmp(field->name, "View") != 0) { + switch_character_set_results(mysql, default_charset); verbose_msg("-- It's base table, skipped\n"); DBUG_RETURN(0); } @@ -4540,6 +4580,9 @@ static my_bool get_view_structure(char *table, char* db) dynstr_free(&ds_view); } + if (switch_character_set_results(mysql, default_charset)) + DBUG_RETURN(1); + /* If a separate .sql file was opened, close it now */ if (sql_file != md_result_file) { diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 9ef10865cd7..c89f386623b 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1282,4 +1282,43 @@ t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR E DROP TABLE t1; DROP PROCEDURE p1; DEALLOCATE PREPARE stmt1; +set names koi8r; +DROP VIEW IF EXISTS v1; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TABLE IF EXISTS t1; +DROP EVENT IF EXISTS ev1; +CREATE VIEW v1 AS SELECT 'ÔÅÓÔ' AS test; +CREATE PROCEDURE p1() SELECT 'ÔÅÓÔ' AS test; +CREATE FUNCTION f1() RETURNS CHAR(10) RETURN 'ÔÅÓÔ'; +CREATE TABLE t1(c1 CHAR(10)); +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 +FOR EACH ROW +SET NEW.c1 = 'ÔÅÓÔ'; +CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ÔÅÓÔ' AS test; +set names utf8; +SHOW CREATE VIEW v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select _koi8r'теÑÑ‚' AS `test` koi8r koi8r_general_ci +SHOW CREATE PROCEDURE p1; +Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function character_set_client collation_connection Database Collation +f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS char(10) CHARSET latin1 +RETURN 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci +SHOW CREATE TRIGGER t1_bi; +Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation +t1_bi CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 +FOR EACH ROW +SET NEW.c1 = 'теÑÑ‚' koi8r koi8r_general_ci latin1_swedish_ci +SHOW CREATE EVENT ev1; +Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation +ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'теÑÑ‚' AS test koi8r koi8r_general_ci latin1_swedish_ci +DROP VIEW v1; +DROP PROCEDURE p1; +DROP FUNCTION f1; +DROP TABLE t1; +DROP EVENT ev1; End of 5.1 tests diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 341c9039390..2f474d0335b 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -897,4 +897,68 @@ DROP TABLE t1; DROP PROCEDURE p1; DEALLOCATE PREPARE stmt1; +# +# BUG#10491: Server returns data as charset binary SHOW CREATE TABLE or SELECT +# FROM INFORMATION_SCHEMA. +# +# Before the change performed to fix the bug, the metadata of the output of +# SHOW CREATE statements would always describe the result as 'binary'. That +# would ensure that the result is never converted to character_set_client +# (which was essential to mysqldump). Now we return to the client the actual +# character set of the object -- which is character_set_client of the +# connection that issues the CREATE statement, and this triggers an automatic +# conversion to character_set_results of the connection that issues SHOW CREATE +# statement. +# +# This test demonstrates that this conversion indeed is taking place. +# + +# Prepare: create objects in a one character set. + +set names koi8r; + +--disable_warnings +DROP VIEW IF EXISTS v1; +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; +DROP TABLE IF EXISTS t1; +DROP EVENT IF EXISTS ev1; +--enable_warnings + +CREATE VIEW v1 AS SELECT 'ÔÅÓÔ' AS test; + +CREATE PROCEDURE p1() SELECT 'ÔÅÓÔ' AS test; + +CREATE FUNCTION f1() RETURNS CHAR(10) RETURN 'ÔÅÓÔ'; + +CREATE TABLE t1(c1 CHAR(10)); +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 + FOR EACH ROW + SET NEW.c1 = 'ÔÅÓÔ'; + +CREATE EVENT ev1 ON SCHEDULE AT '2030-01-01 00:00:00' DO SELECT 'ÔÅÓÔ' AS test; + +# Test: switch the character set and show that SHOW CREATE output is +# automatically converted to the new character_set_client. + +set names utf8; + +SHOW CREATE VIEW v1; + +SHOW CREATE PROCEDURE p1; + +SHOW CREATE FUNCTION f1; + +SHOW CREATE TRIGGER t1_bi; + +SHOW CREATE EVENT ev1; + +# Cleanup. + +DROP VIEW v1; +DROP PROCEDURE p1; +DROP FUNCTION f1; +DROP TABLE t1; +DROP EVENT ev1; + --echo End of 5.1 tests diff --git a/sql/events.cc b/sql/events.cc index e48daeca63d..8d32580816f 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -717,7 +717,8 @@ send_show_create_event(THD *thd, Event_timed *et, Protocol *protocol) protocol->store(et->name.str, et->name.length, system_charset_info); protocol->store(sql_mode.str, sql_mode.length, system_charset_info); protocol->store(tz_name->ptr(), tz_name->length(), system_charset_info); - protocol->store(show_str.c_ptr(), show_str.length(), &my_charset_bin); + protocol->store(show_str.c_ptr(), show_str.length(), + et->creation_ctx->get_client_cs()); protocol->store(et->creation_ctx->get_client_cs()->csname, strlen(et->creation_ctx->get_client_cs()->csname), system_charset_info); diff --git a/sql/sp_head.cc b/sql/sp_head.cc index f0cc5204749..d3a9787ee2b 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -2260,7 +2260,8 @@ sp_head::show_create_routine(THD *thd, int type) protocol->store(sql_mode.str, sql_mode.length, system_charset_info); if (full_access) - protocol->store(m_defstr.str, m_defstr.length, &my_charset_bin); + protocol->store(m_defstr.str, m_defstr.length, + m_creation_ctx->get_client_cs()); else protocol->store_null(); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index f66897df671..04374c1d1c1 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -639,7 +639,8 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) if (table_list->view) { - protocol->store(buffer.ptr(), buffer.length(), &my_charset_bin); + protocol->store(buffer.ptr(), buffer.length(), + table_list->view_creation_ctx->get_client_cs()); protocol->store(table_list->view_creation_ctx->get_client_cs()->csname, system_charset_info); @@ -5983,6 +5984,8 @@ static bool show_create_trigger_impl(THD *thd, LEX_STRING trg_connection_cl_name; LEX_STRING trg_db_cl_name; + CHARSET_INFO *trg_client_cs; + /* TODO: Check privileges here. This functionality will be added by implementation of the following WL items: @@ -6008,6 +6011,11 @@ static bool show_create_trigger_impl(THD *thd, trg_sql_mode, &trg_sql_mode_str); + /* Resolve trigger client character set. */ + + if (resolve_charset(trg_client_cs_name.str, NULL, &trg_client_cs)) + return TRUE; + /* Send header. */ fields.push_back(new Item_empty_string("Trigger", NAME_LEN)); @@ -6054,7 +6062,7 @@ static bool show_create_trigger_impl(THD *thd, p->store(trg_sql_original_stmt.str, trg_sql_original_stmt.length, - &my_charset_bin); + trg_client_cs); p->store(trg_client_cs_name.str, trg_client_cs_name.length, From 30810f80b1070cbfd4579835353bb6e84fd1b233 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 13:29:51 +0200 Subject: [PATCH 145/227] Bug#28249 Query Cache returns wrong result with concurrent insert / certain lock A race condition in the integration between MyISAM and the query cache code caused the query cache to fail to invalidate itself on concurrently inserted data. This patch fix this problem by using the existing handler interface which, upon each statement cache attempt, compare the size of the table as viewed from the cache writing thread and with any snap shot of the global table state. If the two sizes are different the global table size is unknown and the current statement can't be cached. mysql-test/r/query_cache.result: Added test case mysql-test/t/query_cache.test: Added test case sql/ha_myisam.cc: - Implemented handler interface for ha_myisam class to dermine if the table belonging to the currently processed statement can be cached or not. sql/ha_myisam.h: - Implemented handler interface for ha_myisam class to dermine if the table belonging to the currently processed statement can be cached or not. sql/handler.h: - Documented register_query_cache_table method in the handler interface. --- mysql-test/r/query_cache.result | 39 +++++++++++++++++ mysql-test/t/query_cache.test | 73 ++++++++++++++++++++++++++++++++ sql/ha_myisam.cc | 74 +++++++++++++++++++++++++++++++++ sql/ha_myisam.h | 7 ++++ sql/handler.h | 45 +++++++++++++++++--- 5 files changed, 232 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 79471ee5c02..58b8aad6fc9 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1409,3 +1409,42 @@ set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size= default; +Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock +set GLOBAL query_cache_type=1; +set GLOBAL query_cache_limit=10000; +set GLOBAL query_cache_min_res_unit=0; +set GLOBAL query_cache_size= 100000; +flush tables; +drop table if exists t1, t2; +create table t1 (a int); +create table t2 (a int); +insert into t1 values (1),(2),(3); +Locking table T2 with a write lock. +lock table t2 write; +Select blocked by write lock. +select *, (select count(*) from t2) from t1;; +Sleeing is ok, because selecting should be done very fast. +Inserting into table T1. +insert into t1 values (4); +Unlocking the tables. +unlock tables; +Collecting result from previously blocked select. +Next select should contain 4 rows, as the insert is long finished. +select *, (select count(*) from t2) from t1; +a (select count(*) from t2) +1 0 +2 0 +3 0 +4 0 +reset query cache; +select *, (select count(*) from t2) from t1; +a (select count(*) from t2) +1 0 +2 0 +3 0 +4 0 +drop table t1,t2; +set GLOBAL query_cache_type=default; +set GLOBAL query_cache_limit=default; +set GLOBAL query_cache_min_res_unit=default; +set GLOBAL query_cache_size=default; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 1ef104f820b..17073e039c2 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -970,4 +970,77 @@ set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size= default; +# +# Bug #28249 Query Cache returns wrong result with concurrent insert / certain lock +# +--echo Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock +connect (user1,localhost,root,,test,,); +connect (user2,localhost,root,,test,,); +connect (user3,localhost,root,,test,,); + +connection user1; + +set GLOBAL query_cache_type=1; +set GLOBAL query_cache_limit=10000; +set GLOBAL query_cache_min_res_unit=0; +set GLOBAL query_cache_size= 100000; + +flush tables; +--disable_warnings +drop table if exists t1, t2; +--enable_warnings +create table t1 (a int); +create table t2 (a int); +insert into t1 values (1),(2),(3); +connection user2; +--echo Locking table T2 with a write lock. +lock table t2 write; + +connection user1; +--echo Select blocked by write lock. +--send select *, (select count(*) from t2) from t1; +--echo Sleeing is ok, because selecting should be done very fast. +sleep 5; + +connection user3; +--echo Inserting into table T1. +insert into t1 values (4); + +connection user2; +--echo Unlocking the tables. +unlock tables; + +connection user1; +--echo Collecting result from previously blocked select. +# +# Since the lock ordering rule in thr_multi_lock depends on +# pointer values, from execution to execution we might have +# different lock order, and therefore, sometimes lock t1 and block +# on t2, and sometimes block on t2 right away. In the second case, +# the following insert succeeds, and only then this select can +# proceed, and we actually test nothing, as the very first select +# returns 4 rows right away. +# It's fine to have a test case that covers the problematic area +# at least once in a while. +# We, however, need to disable the result log here to make the +# test repeatable. +--disable_result_log +--reap +--enable_result_log +--echo Next select should contain 4 rows, as the insert is long finished. +select *, (select count(*) from t2) from t1; +reset query cache; +select *, (select count(*) from t2) from t1; + +drop table t1,t2; + +connection default; +disconnect user1; +disconnect user2; +disconnect user3; +set GLOBAL query_cache_type=default; +set GLOBAL query_cache_limit=default; +set GLOBAL query_cache_min_res_unit=default; +set GLOBAL query_cache_size=default; # End of 5.0 tests + diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 6d8a770175d..ebaa1d6bd3b 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1922,3 +1922,77 @@ uint ha_myisam::checksum() const return (uint)file->state->checksum; } +#ifdef HAVE_QUERY_CACHE +/** + @brief Register a named table with a call back function to the query cache. + + @param thd The thread handle + @param table_key A pointer to the table name in the table cache + @param key_length The length of the table name + @param[out] engine_callback The pointer to the storage engine call back + function, currently 0 + @param[out] engine_data Engine data will be set to 0. + + @note Despite the name of this function, it is used to check each statement + before it is cached and not to register a table or callback function. + + @see handler::register_query_cache_table + + @return The error code. The engine_data and engine_callback will be set to 0. + @retval TRUE Success + @retval FALSE An error occured +*/ + +my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name, + uint table_name_len, + qc_engine_callback + *engine_callback, + ulonglong *engine_data) +{ + /* + No call back function is needed to determine if a cached statement + is valid or not. + */ + *engine_callback= 0; + + /* + No engine data is needed. + */ + *engine_data= 0; + + /* + If a concurrent INSERT has happened just before the currently processed + SELECT statement, the total size of the table is unknown. + + To determine if the table size is known, the current thread's snap shot of + the table size with the actual table size are compared. + + If the table size is unknown the SELECT statement can't be cached. + */ + ulonglong actual_data_file_length; + ulonglong current_data_file_length; + + /* + POSIX visibility rules specify that "2. Whatever memory values a + thread can see when it unlocks a mutex <...> can also be seen by any + thread that later locks the same mutex". In this particular case, + concurrent insert thread had modified the data_file_length in + MYISAM_SHARE before it has unlocked (or even locked) + structure_guard_mutex. So, here we're guaranteed to see at least that + value after we've locked the same mutex. We can see a later value + (modified by some other thread) though, but it's ok, as we only want + to know if the variable was changed, the actual new value doesn't matter + */ + actual_data_file_length= file->s->state.state.data_file_length; + current_data_file_length= file->save_state.data_file_length; + + if (current_data_file_length != actual_data_file_length) + { + /* Don't cache current statement. */ + return FALSE; + } + + /* It is ok to try to cache current statement. */ + return TRUE; +} +#endif diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h index b186d9c7bb8..536ea211820 100644 --- a/sql/ha_myisam.h +++ b/sql/ha_myisam.h @@ -127,4 +127,11 @@ class ha_myisam: public handler int dump(THD* thd, int fd); int net_read_dump(NET* net); #endif +#ifdef HAVE_QUERY_CACHE + my_bool register_query_cache_table(THD *thd, char *table_key, + uint key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data); +#endif }; diff --git a/sql/handler.h b/sql/handler.h index 9863d541b5f..d25796d8546 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -841,16 +841,49 @@ public: /* Type of table for caching query */ virtual uint8 table_cache_type() { return HA_CACHE_TBL_NONTRANSACT; } - /* ask handler about permission to cache table when query is to be cached */ + + + /** + @brief Register a named table with a call back function to the query cache. + + @param thd The thread handle + @param table_key A pointer to the table name in the table cache + @param key_length The length of the table name + @param[out] engine_callback The pointer to the storage engine call back + function + @param[out] engine_data Storage engine specific data which could be + anything + + This method offers the storage engine, the possibility to store a reference + to a table name which is going to be used with query cache. + The method is called each time a statement is written to the cache and can + be used to verify if a specific statement is cachable. It also offers + the possibility to register a generic (but static) call back function which + is called each time a statement is matched against the query cache. + + @note If engine_data supplied with this function is different from + engine_data supplied with the callback function, and the callback returns + FALSE, a table invalidation on the current table will occur. + + @return Upon success the engine_callback will point to the storage engine + call back function, if any, and engine_data will point to any storage + engine data used in the specific implementation. + @retval TRUE Success + @retval FALSE The specified table or current statement should not be + cached + */ + virtual my_bool register_query_cache_table(THD *thd, char *table_key, - uint key_length, - qc_engine_callback - *engine_callback, - ulonglong *engine_data) + uint key_length, + qc_engine_callback + *engine_callback, + ulonglong *engine_data) { *engine_callback= 0; - return 1; + return TRUE; } + + /* RETURN true Primary key (if there is one) is clustered key covering all fields From ad492a6db7582a35a95e7f0d9e9e7392efd353eb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 15:12:56 +0300 Subject: [PATCH 146/227] Bug 29325: test suite is not applicable on windows --- mysql-test/r/create.result | 22 --------------- mysql-test/r/create_not_windows.result | 22 +++++++++++++++ mysql-test/t/create.test | 37 ------------------------ mysql-test/t/create_not_windows.test | 39 ++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 59 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index ff963892bc9..e692dbf3938 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1503,26 +1503,4 @@ t1 CREATE TABLE `t1` ( `c17` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; -CREATE DATABASE db1; -CREATE DATABASE db2; -USE db2; -INSERT INTO db2.t1 VALUES (1); -SELECT * FROM db2.t1; -b -1 -RESET QUERY CACHE; -USE db1; -SET SESSION keep_files_on_create = TRUE; -CREATE TABLE t1 (a INT) ENGINE MYISAM; -ERROR HY000: Can't create/write to file './db1/t1.MYD' (Errcode: 17) -CREATE TABLE t3 (a INT) Engine=MyISAM; -INSERT INTO t3 VALUES (1),(2),(3); -TRUNCATE TABLE t3; -SELECT * from t3; -a -SET SESSION keep_files_on_create = DEFAULT; -DROP TABLE db2.t1, db1.t3; -DROP DATABASE db1; -DROP DATABASE db2; -USE test; End of 5.0 tests diff --git a/mysql-test/r/create_not_windows.result b/mysql-test/r/create_not_windows.result index b975c98c2b1..a07ffa82610 100644 --- a/mysql-test/r/create_not_windows.result +++ b/mysql-test/r/create_not_windows.result @@ -12,3 +12,25 @@ about:text CREATE TABLE `about:text` ( PRIMARY KEY (`_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table `about:text`; +CREATE DATABASE db1; +CREATE DATABASE db2; +USE db2; +INSERT INTO db2.t1 VALUES (1); +SELECT * FROM db2.t1; +b +1 +RESET QUERY CACHE; +USE db1; +SET SESSION keep_files_on_create = TRUE; +CREATE TABLE t1 (a INT) ENGINE MYISAM; +ERROR HY000: Can't create/write to file './db1/t1.MYD' (Errcode: 17) +CREATE TABLE t3 (a INT) Engine=MyISAM; +INSERT INTO t3 VALUES (1),(2),(3); +TRUNCATE TABLE t3; +SELECT * from t3; +a +SET SESSION keep_files_on_create = DEFAULT; +DROP TABLE db2.t1, db1.t3; +DROP DATABASE db1; +DROP DATABASE db2; +USE test; diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index a1d3d488f1c..99f3fea416a 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1118,42 +1118,5 @@ show create table t1; drop table t1; -# -# Bug #29325: create table overwrites .MYD file of other table (datadir) -# - -CREATE DATABASE db1; -CREATE DATABASE db2; - -USE db2; ---disable_query_log -eval CREATE TABLE t1 (b INT) ENGINE MYISAM -DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/'; ---enable_query_log - -INSERT INTO db2.t1 VALUES (1); -SELECT * FROM db2.t1; -RESET QUERY CACHE; - -USE db1; - -#no warning from create table -SET SESSION keep_files_on_create = TRUE; ---disable_abort_on_error -CREATE TABLE t1 (a INT) ENGINE MYISAM; ---enable_abort_on_error - -CREATE TABLE t3 (a INT) Engine=MyISAM; -INSERT INTO t3 VALUES (1),(2),(3); -TRUNCATE TABLE t3; -SELECT * from t3; - -SET SESSION keep_files_on_create = DEFAULT; - -DROP TABLE db2.t1, db1.t3; -DROP DATABASE db1; -DROP DATABASE db2; -USE test; - --echo End of 5.0 tests diff --git a/mysql-test/t/create_not_windows.test b/mysql-test/t/create_not_windows.test index 71ad9ccd7fe..c6547b1376b 100644 --- a/mysql-test/t/create_not_windows.test +++ b/mysql-test/t/create_not_windows.test @@ -17,4 +17,43 @@ primary key (_id) show create table `about:text`; drop table `about:text`; + +# +# Bug #29325: create table overwrites .MYD file of other table (datadir) +# + +CREATE DATABASE db1; +CREATE DATABASE db2; + +USE db2; +--disable_query_log +eval CREATE TABLE t1 (b INT) ENGINE MYISAM +DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/'; +--enable_query_log + +INSERT INTO db2.t1 VALUES (1); +SELECT * FROM db2.t1; +RESET QUERY CACHE; + +USE db1; + +#no warning from create table +SET SESSION keep_files_on_create = TRUE; +--disable_abort_on_error +CREATE TABLE t1 (a INT) ENGINE MYISAM; +--enable_abort_on_error + +CREATE TABLE t3 (a INT) Engine=MyISAM; +INSERT INTO t3 VALUES (1),(2),(3); +TRUNCATE TABLE t3; +SELECT * from t3; + +SET SESSION keep_files_on_create = DEFAULT; + +DROP TABLE db2.t1, db1.t3; +DROP DATABASE db1; +DROP DATABASE db2; +USE test; + + # End of 5.0 tests From 4922166ed1739d067719200f6542e09f4cc48c1f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 17:27:53 +0200 Subject: [PATCH 147/227] Bug #29612 Cluster ndbd can't write to file, linux kernel 2.4 - remove usage for now --- mysql-test/ndb/ndb_config_2_node.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index 6bcb148d471..57e4d049ad6 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -13,7 +13,8 @@ TimeBetweenGlobalCheckpoints= 500 NoOfFragmentLogFiles= 4 FragmentLogFileSize=12M DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory -ODirect= 1 +# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612 +#ODirect= 1 # the following parametes just function as a small regression # test that the parameter exists InitialNoOfOpenFiles= 27 From afbac0070f7dd7e5f37d5b99375568bfe09463cc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 20:21:17 +0200 Subject: [PATCH 148/227] Bug#28158 - table->read_set is set incorrectly, causing wrong error message in Falcon An error message about a duplicate key could show a wrong key value when not all columns of the key were used to select the rows for update. Some storage engines return a record with only the selected columns filled. This is fixed by re-reading the record with a read_set which includes all columns of the duplicate key after a duplicate key error happens and before the error message is printed. mysql-test/r/ndb_update.result: Bug#28158 - table->read_set is set incorrectly, causing wrong error message in Falcon Added test result. mysql-test/t/ndb_update.test: Bug#28158 - table->read_set is set incorrectly, causing wrong error message in Falcon Added test from falcon_bug_28158. sql/sql_update.cc: Bug#28158 - table->read_set is set incorrectly, causing wrong error message in Falcon Added a function for re-reading a record with a read_set that contains all fields used by a duplicate key. Called the function before every call to handler::print_error(), which could print a duplicate key value. --- mysql-test/r/ndb_update.result | 46 +++++++++++++++++ mysql-test/t/ndb_update.test | 50 +++++++++++++++++- sql/sql_update.cc | 94 ++++++++++++++++++++++++++++++++-- 3 files changed, 186 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result index 919b8c44a40..daea0e27a6a 100644 --- a/mysql-test/r/ndb_update.result +++ b/mysql-test/r/ndb_update.result @@ -1,4 +1,6 @@ DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; CREATE TABLE t1 ( pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, @@ -40,3 +42,47 @@ pk1 b c 12 2 2 14 1 1 DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a int, b int, KEY (a, b)) ENGINE=ndbcluster; +CREATE TABLE t2 (a int, b int, UNIQUE KEY (a, b)) ENGINE=ndbcluster; +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a, b)) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (1, 2); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t2 VALUES (1, 2); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t3 VALUES (1, 2); +INSERT INTO t3 VALUES (2, 2); +UPDATE t1 SET a = 1; +UPDATE t1 SET a = 1 ORDER BY a; +UPDATE t2 SET a = 1; +ERROR 23000: Duplicate entry '' for key '*UNKNOWN*' +UPDATE t2 SET a = 1 ORDER BY a; +ERROR 23000: Duplicate entry '' for key '*UNKNOWN*' +UPDATE t3 SET a = 1; +ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY' +UPDATE t3 SET a = 1 ORDER BY a; +ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY' +SELECT count(*) FROM t1; +count(*) +2 +SELECT count(*) FROM t2; +count(*) +2 +SELECT count(*) FROM t3; +count(*) +2 +SELECT * FROM t1 ORDER by a; +a b +1 2 +1 2 +SELECT * FROM t2 ORDER by a; +a b +1 2 +2 2 +SELECT * FROM t3 ORDER by a; +a b +1 2 +2 2 +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +End of 5.1 tests diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test index 73a0ebc69cb..c45f990edcc 100644 --- a/mysql-test/t/ndb_update.test +++ b/mysql-test/t/ndb_update.test @@ -3,10 +3,12 @@ --disable_warnings DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; --enable_warnings # -# Basic test of INSERT in NDB +# Basic test of UPDATE in NDB # # @@ -39,3 +41,49 @@ DROP TABLE IF EXISTS t1; --enable_warnings # End of 4.1 tests + +# +# Bug#28158: table->read_set is set incorrectly, +# causing wrong error message in Falcon +# +CREATE TABLE t1 (a int, b int, KEY (a, b)) ENGINE=ndbcluster; +CREATE TABLE t2 (a int, b int, UNIQUE KEY (a, b)) ENGINE=ndbcluster; +CREATE TABLE t3 (a int, b int, PRIMARY KEY (a, b)) ENGINE=ndbcluster; +# +INSERT INTO t1 VALUES (1, 2); +INSERT INTO t1 VALUES (2, 2); +# +INSERT INTO t2 VALUES (1, 2); +INSERT INTO t2 VALUES (2, 2); +# +INSERT INTO t3 VALUES (1, 2); +INSERT INTO t3 VALUES (2, 2); +# +UPDATE t1 SET a = 1; +UPDATE t1 SET a = 1 ORDER BY a; +# +--error ER_DUP_ENTRY +UPDATE t2 SET a = 1; +--error ER_DUP_ENTRY +UPDATE t2 SET a = 1 ORDER BY a; +# +--error ER_DUP_ENTRY +UPDATE t3 SET a = 1; +--error ER_DUP_ENTRY +UPDATE t3 SET a = 1 ORDER BY a; +# +SELECT count(*) FROM t1; +SELECT count(*) FROM t2; +SELECT count(*) FROM t3; +SELECT * FROM t1 ORDER by a; +SELECT * FROM t2 ORDER by a; +SELECT * FROM t3 ORDER by a; +# +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +--enable_warnings + +--echo End of 5.1 tests + diff --git a/sql/sql_update.cc b/sql/sql_update.cc index ef1f46bfdd2..873aa6cfbeb 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -83,6 +83,75 @@ static bool check_fields(THD *thd, List &items) } +/** + @brief Re-read record if more columns are needed for error message. + + @detail If we got a duplicate key error, we want to write an error + message containing the value of the duplicate key. If we do not have + all fields of the key value in record[0], we need to re-read the + record with a proper read_set. + + @param[in] error error number + @param[in] table table +*/ + +static void prepare_record_for_error_message(int error, TABLE *table) +{ + Field **field_p; + Field *field; + uint keynr; + MY_BITMAP unique_map; /* Fields in offended unique. */ + my_bitmap_map unique_map_buf[bitmap_buffer_size(MAX_FIELDS)]; + DBUG_ENTER("prepare_record_for_error_message"); + + /* + Only duplicate key errors print the key value. + If storage engine does always read all columns, we have the value alraedy. + */ + if ((error != HA_ERR_FOUND_DUPP_KEY) || + !(table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ)) + DBUG_VOID_RETURN; + + /* + Get the number of the offended index. + We will see MAX_KEY if the engine cannot determine the affected index. + */ + if ((keynr= table->file->get_dup_key(error)) >= MAX_KEY) + DBUG_VOID_RETURN; + + /* Create unique_map with all fields used by that index. */ + bitmap_init(&unique_map, unique_map_buf, table->s->fields, FALSE); + table->mark_columns_used_by_index_no_reset(keynr, &unique_map); + + /* Subtract read_set and write_set. */ + bitmap_subtract(&unique_map, table->read_set); + bitmap_subtract(&unique_map, table->write_set); + + /* + If the unique index uses columns that are neither in read_set + nor in write_set, we must re-read the record. + Otherwise no need to do anything. + */ + if (bitmap_is_clear_all(&unique_map)) + DBUG_VOID_RETURN; + + /* Get identifier of last read record into table->file->ref. */ + table->file->position(table->record[0]); + /* Add all fields used by unique index to read_set. */ + bitmap_union(table->read_set, &unique_map); + /* Tell the engine about the new set. */ + table->file->column_bitmaps_signal(); + /* Read record that is identified by table->file->ref. */ + (void) table->file->rnd_pos(table->record[1], table->file->ref); + /* Copy the newly read columns into the new record. */ + for (field_p= table->field; (field= *field_p); field_p++) + if (bitmap_is_set(&unique_map, field->field_index)) + field->copy_from_tmp(table->s->rec_buff_length); + + DBUG_VOID_RETURN; +} + + /* Process usual UPDATE @@ -470,6 +539,13 @@ int mysql_update(THD *thd, else will_batch= !table->file->start_bulk_update(); + /* + Assure that we can use position() + if we need to create an error message. + */ + if (table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) + table->prepare_for_position(); + /* We can use compare_record() to optimize away updates if the table handler is returning all columns OR if @@ -573,6 +649,8 @@ int mysql_update(THD *thd, */ if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY)) thd->fatal_error(); /* Other handler errors are fatal */ + + prepare_record_for_error_message(error, table); table->file->print_error(error,MYF(0)); error= 1; break; @@ -596,13 +674,16 @@ int mysql_update(THD *thd, { if (error) { + /* purecov: begin inspected */ /* The handler should not report error of duplicate keys if they are ignored. This is a requirement on batching handlers. */ + prepare_record_for_error_message(error, table); table->file->print_error(error,MYF(0)); error= 1; break; + /* purecov: end */ } /* Either an error was found and we are ignoring errors or there @@ -668,9 +749,12 @@ int mysql_update(THD *thd, in the batched update. */ { + /* purecov: begin inspected */ thd->fatal_error(); + prepare_record_for_error_message(loc_error, table); table->file->print_error(loc_error,MYF(0)); error= 1; + /* purecov: end */ } else updated-= dup_key_found; @@ -1540,6 +1624,8 @@ bool multi_update::send_data(List ¬_used_values) */ if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY)) thd->fatal_error(); /* Other handler errors are fatal */ + + prepare_record_for_error_message(error, table); table->file->print_error(error,MYF(0)); DBUG_RETURN(1); } @@ -1676,7 +1762,7 @@ int multi_update::do_updates(bool from_send_error) ha_rows org_updated; TABLE *table, *tmp_table; List_iterator_fast check_opt_it(unupdated_check_opt_tables); - DBUG_ENTER("do_updates"); + DBUG_ENTER("multi_update::do_updates"); do_update= 0; // Don't retry this function if (!found) @@ -1819,6 +1905,7 @@ err: if (!from_send_error) { thd->fatal_error(); + prepare_record_for_error_message(local_error, table); table->file->print_error(local_error,MYF(0)); } @@ -1849,6 +1936,7 @@ bool multi_update::send_eof() { char buff[STRING_BUFFER_USUAL_SIZE]; ulonglong id; + DBUG_ENTER("multi_update::send_eof"); thd->proc_info="updating reference tables"; /* Does updates for the last n - 1 tables, returns 0 if ok */ @@ -1904,7 +1992,7 @@ bool multi_update::send_eof() /* Safety: If we haven't got an error before (can happen in do_updates) */ my_message(ER_UNKNOWN_ERROR, "An error occured in multi-table update", MYF(0)); - return TRUE; + DBUG_RETURN(TRUE); } id= thd->arg_of_last_insert_id_function ? @@ -1914,5 +2002,5 @@ bool multi_update::send_eof() thd->row_count_func= (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated; ::send_ok(thd, (ulong) thd->row_count_func, id, buff); - return FALSE; + DBUG_RETURN(FALSE); } From 9dc3088f9e4cad7b6e33d4d1b35f11d4b5b5e372 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 22:26:41 +0400 Subject: [PATCH 149/227] A fix and a test case for Bug#26141 mixing table types in trigger causes full table lock on innodb table. Also fixes Bug#28502 Triggers that update another innodb table will block on X lock unnecessarily (duplciate). Code review fixes. Both bugs' synopses are misleading: InnoDB table is not X locked. The statements, however, cannot proceed concurrently, but this happens due to lock conflicts for tables used in triggers, not for the InnoDB table. If a user had an InnoDB table, and two triggers, AFTER UPDATE and AFTER INSERT, competing for different resources (e.g. two distinct MyISAM tables), then these two triggers would not be able to execute concurrently. Moreover, INSERTS/UPDATES of the InnoDB table would not be able to run concurrently. The problem had other side-effects (see respective bug reports). This behavior was a consequence of a shortcoming of the pre-locking algorithm, which would not distinguish between different DML operations (e.g. INSERT and DELETE) and pre-lock all the tables that are used by any trigger defined on the subject table. The idea of the fix is to extend the pre-locking algorithm to keep track, for each table, what DML operation it is used for and not load triggers that are known to never be fired. mysql-test/r/trigger-trans.result: Update results (Bug#26141) mysql-test/r/trigger.result: Update results (Bug#28502) mysql-test/t/trigger-trans.test: Add a test case for Bug#26141 mixing table types in trigger causes full table lock on innodb table. mysql-test/t/trigger.test: Add a test case for Bug#28502 Triggers that update another innodb table will block echo on X lock unnecessarily. Add more test coverage for triggers. sql/item.h: enum trg_event_type is needed in table.h sql/sp.cc: Take into account table_list->trg_event_map when determining what tables to pre-lock. After this change, if we attempt to fire a trigger for which we had not pre-locked any tables, error 'Table was not locked with LOCK TABLES' will be printed. This, however, should never happen, provided the pre-locking algorithm has no programming bugs. Previously a trigger key in the sroutines hash was based on the name of the table the trigger belongs to. This was possible because we would always add to the pre-locking list all the triggers defined for a table when handling this table. Now the key is based on the name of the trigger, owing to the fact that a trigger name must be unique in the database it belongs to. sql/sp_head.cc: Generate sroutines hash key in init_spname(). This is a convenient place since there we have all the necessary information and can avoid an extra alloc. Maintain and merge trg_event_map when adding and merging elements of the pre-locking list. sql/sp_head.h: Add ,m_sroutines_key member, used when inserting the sphead for a trigger into the cache of routines used by a statement. Previously the key was based on the table name the trigger belonged to, since for a given table we would add to the sroutines list all the triggers defined on it. sql/sql_lex.cc: Introduce a new lex step: set_trg_event_type_for_tables(). It is called when we have finished parsing but before opening and locking tables. Now this step is used to evaluate for each TABLE_LIST instance which INSERT/UPDATE/DELETE operation, if any, it is used in. In future this method could be extended to aggregate other information that is hard to aggregate during parsing. sql/sql_lex.h: Add declaration for set_trg_event_type_for_tables(). sql/sql_parse.cc: Call set_trg_event_type_for_tables() after MYSQLparse(). Remove tabs. sql/sql_prepare.cc: Call set_trg_event_type_for_tables() after MYSQLparse(). sql/sql_trigger.cc: Call set_trg_event_type_for_tables() after MYSQLparse(). sql/sql_trigger.h: Remove an obsolete member. sql/sql_view.cc: Call set_trg_event_type_for_tables() after MYSQLparse(). sql/sql_yacc.yy: Move assignment of sp_head::m_type before calling sp_head::init_spname(), one is now used inside another. sql/table.cc: Implement TABLE_LIST::set_trg_event_map() - a method that calculates wh triggers may be fired on this table when executing a statement. sql/table.h: Add missing declarations. Move declaration of trg_event_type from item.h (it will be needed for trg_event_map bitmap when we start using Bitmap template instead of uint8). --- mysql-test/r/trigger-trans.result | 59 ++++ mysql-test/r/trigger.result | 457 ++++++++++++++++++++++++++++++ mysql-test/t/trigger-trans.test | 82 +++++- mysql-test/t/trigger.test | 365 ++++++++++++++++++++++++ sql/item.h | 8 - sql/sp.cc | 53 ++-- sql/sp_head.cc | 53 +++- sql/sp_head.h | 6 + sql/sql_lex.cc | 21 ++ sql/sql_lex.h | 2 + sql/sql_parse.cc | 5 +- sql/sql_prepare.cc | 1 + sql/sql_trigger.cc | 28 +- sql/sql_trigger.h | 8 - sql/sql_view.cc | 13 + sql/sql_yacc.yy | 4 +- sql/table.cc | 129 +++++++++ sql/table.h | 19 ++ 18 files changed, 1255 insertions(+), 58 deletions(-) diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result index b56abf1f59a..cd5f629564f 100644 --- a/mysql-test/r/trigger-trans.result +++ b/mysql-test/r/trigger-trans.result @@ -82,3 +82,62 @@ ALICE 33 1 0 THE CROWN 43 1 0 THE PIE 53 1 1 drop table t1; + +Bug#26141 mixing table types in trigger causes full +table lock on innodb table + +Ensure we do not open and lock tables for the triggers we do not +fire. + +drop table if exists t1, t2, t3; +drop trigger if exists trg_bug26141_au; +drop trigger if exists trg_bug26141_ai; +create table t1 (c int primary key) engine=innodb; +create table t2 (c int) engine=myisam; +create table t3 (c int) engine=myisam; +insert into t1 (c) values (1); +create trigger trg_bug26141_ai after insert on t1 +for each row +begin +insert into t2 (c) values (1); +# We need the 'sync' lock to synchronously wait in connection 2 till +# the moment when the trigger acquired all the locks. +select release_lock("lock_bug26141_sync") into @a; +# 1000 is time in seconds of lock wait timeout -- this is a way +# to cause a manageable sleep up to 1000 seconds +select get_lock("lock_bug26141_wait", 1000) into @a; +end| +create trigger trg_bug26141_au after update on t1 +for each row +begin +insert into t3 (c) values (1); +end| +select get_lock("lock_bug26141_wait", 0); +get_lock("lock_bug26141_wait", 0) +1 +select get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0); +get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0) +1 +insert into t1 (c) values (2); +select get_lock("lock_bug26141_sync", 1000); +get_lock("lock_bug26141_sync", 1000) +1 +update t1 set c=3 where c=1; +select release_lock("lock_bug26141_sync"); +release_lock("lock_bug26141_sync") +1 +select release_lock("lock_bug26141_wait"); +release_lock("lock_bug26141_wait") +1 +select * from t1; +c +2 +3 +select * from t2; +c +1 +select * from t3; +c +1 +drop table t1, t2, t3; +End of 5.0 tests diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 290929d476d..4b18e525e62 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -1476,4 +1476,461 @@ DROP TRIGGER t1_test; DROP TABLE t1,t2; SET SESSION LOW_PRIORITY_UPDATES=DEFAULT; SET GLOBAL LOW_PRIORITY_UPDATES=DEFAULT; + +Bug#28502 Triggers that update another innodb table will block +on X lock unnecessarily + +Ensure we do not open and lock tables for triggers we do not fire. + +drop table if exists t1, t2; +drop trigger if exists trg_bug28502_au; +create table t1 (id int, count int); +create table t2 (id int); +create trigger trg_bug28502_au before update on t2 +for each row +begin +if (new.id is not null) then +update t1 set count= count + 1 where id = old.id; +end if; +end| +insert into t1 (id, count) values (1, 0); +lock table t1 write; +insert into t2 set id=1; +unlock tables; +update t2 set id=1 where id=1; +select * from t1; +id count +1 1 +select * from t2; +id +1 +drop table t1, t2; + +Additionally, provide test coverage for triggers and +all MySQL data changing commands. + +drop table if exists t1, t2, t1_op_log; +drop view if exists v1; +drop trigger if exists trg_bug28502_bi; +drop trigger if exists trg_bug28502_ai; +drop trigger if exists trg_bug28502_bu; +drop trigger if exists trg_bug28502_au; +drop trigger if exists trg_bug28502_bd; +drop trigger if exists trg_bug28502_ad; +create table t1 (id int primary key auto_increment, operation varchar(255)); +create table t2 (id int primary key); +create table t1_op_log(operation varchar(255)); +create view v1 as select * from t1; +create trigger trg_bug28502_bi before insert on t1 +for each row +insert into t1_op_log (operation) +values (concat("Before INSERT, new=", new.operation)); +create trigger trg_bug28502_ai after insert on t1 +for each row +insert into t1_op_log (operation) +values (concat("After INSERT, new=", new.operation)); +create trigger trg_bug28502_bu before update on t1 +for each row +insert into t1_op_log (operation) +values (concat("Before UPDATE, new=", new.operation, +", old=", old.operation)); +create trigger trg_bug28502_au after update on t1 +for each row +insert into t1_op_log (operation) +values (concat("After UPDATE, new=", new.operation, +", old=", old.operation)); +create trigger trg_bug28502_bd before delete on t1 +for each row +insert into t1_op_log (operation) +values (concat("Before DELETE, old=", old.operation)); +create trigger trg_bug28502_ad after delete on t1 +for each row +insert into t1_op_log (operation) +values (concat("After DELETE, old=", old.operation)); +insert into t1 (operation) values ("INSERT"); +set @id=last_insert_id(); +select * from t1; +id operation +1 INSERT +select * from t1_op_log; +operation +Before INSERT, new=INSERT +After INSERT, new=INSERT +truncate t1_op_log; +update t1 set operation="UPDATE" where id=@id; +select * from t1; +id operation +1 UPDATE +select * from t1_op_log; +operation +Before UPDATE, new=UPDATE, old=INSERT +After UPDATE, new=UPDATE, old=INSERT +truncate t1_op_log; +delete from t1 where id=@id; +select * from t1; +id operation +select * from t1_op_log; +operation +Before DELETE, old=UPDATE +After DELETE, old=UPDATE +truncate t1; +truncate t1_op_log; +insert into t1 (id, operation) values +(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key") +on duplicate key update id=NULL, operation="Should never happen"; +set @id=last_insert_id(); +select * from t1; +id operation +1 INSERT ON DUPLICATE KEY UPDATE, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key +After INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key +truncate t1_op_log; +insert into t1 (id, operation) values +(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same") +on duplicate key update id=NULL, +operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate"; +select * from t1; +id operation +0 INSERT ON DUPLICATE KEY UPDATE, updating the duplicate +select * from t1_op_log; +operation +Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, the key value is the same +Before UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key +After UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key +truncate t1; +truncate t1_op_log; +replace into t1 values (NULL, "REPLACE, inserting a new key"); +set @id=last_insert_id(); +select * from t1; +id operation +1 REPLACE, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=REPLACE, inserting a new key +After INSERT, new=REPLACE, inserting a new key +truncate t1_op_log; +replace into t1 values (@id, "REPLACE, deleting the duplicate"); +select * from t1; +id operation +1 REPLACE, deleting the duplicate +select * from t1_op_log; +operation +Before INSERT, new=REPLACE, deleting the duplicate +Before DELETE, old=REPLACE, inserting a new key +After DELETE, old=REPLACE, inserting a new key +After INSERT, new=REPLACE, deleting the duplicate +truncate t1; +truncate t1_op_log; +create table if not exists t1 +select NULL, "CREATE TABLE ... SELECT, inserting a new key"; +Warnings: +Note 1050 Table 't1' already exists +set @id=last_insert_id(); +select * from t1; +id operation +1 CREATE TABLE ... SELECT, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=CREATE TABLE ... SELECT, inserting a new key +After INSERT, new=CREATE TABLE ... SELECT, inserting a new key +truncate t1_op_log; +create table if not exists t1 replace +select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key"; +Warnings: +Note 1050 Table 't1' already exists +select * from t1; +id operation +1 CREATE TABLE ... REPLACE SELECT, deleting a duplicate key +select * from t1_op_log; +operation +Before INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key +Before DELETE, old=CREATE TABLE ... SELECT, inserting a new key +After DELETE, old=CREATE TABLE ... SELECT, inserting a new key +After INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key +truncate t1; +truncate t1_op_log; +insert into t1 (id, operation) +select NULL, "INSERT ... SELECT, inserting a new key"; +set @id=last_insert_id(); +select * from t1; +id operation +1 INSERT ... SELECT, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=INSERT ... SELECT, inserting a new key +After INSERT, new=INSERT ... SELECT, inserting a new key +truncate t1_op_log; +insert into t1 (id, operation) +select @id, +"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate" +on duplicate key update id=NULL, +operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"; +select * from t1; +id operation +0 INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate +select * from t1_op_log; +operation +Before INSERT, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate +Before UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key +After UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key +truncate t1; +truncate t1_op_log; +replace into t1 (id, operation) +select NULL, "REPLACE ... SELECT, inserting a new key"; +set @id=last_insert_id(); +select * from t1; +id operation +1 REPLACE ... SELECT, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=REPLACE ... SELECT, inserting a new key +After INSERT, new=REPLACE ... SELECT, inserting a new key +truncate t1_op_log; +replace into t1 (id, operation) +select @id, "REPLACE ... SELECT, deleting a duplicate"; +select * from t1; +id operation +1 REPLACE ... SELECT, deleting a duplicate +select * from t1_op_log; +operation +Before INSERT, new=REPLACE ... SELECT, deleting a duplicate +Before DELETE, old=REPLACE ... SELECT, inserting a new key +After DELETE, old=REPLACE ... SELECT, inserting a new key +After INSERT, new=REPLACE ... SELECT, deleting a duplicate +truncate t1; +truncate t1_op_log; +insert into t1 (id, operation) values (1, "INSERT for multi-DELETE"); +insert into t2 (id) values (1); +delete t1.*, t2.* from t1, t2 where t1.id=1; +select * from t1; +id operation +select * from t2; +id +select * from t1_op_log; +operation +Before INSERT, new=INSERT for multi-DELETE +After INSERT, new=INSERT for multi-DELETE +Before DELETE, old=INSERT for multi-DELETE +After DELETE, old=INSERT for multi-DELETE +truncate t1; +truncate t2; +truncate t1_op_log; +insert into t1 (id, operation) values (1, "INSERT for multi-UPDATE"); +insert into t2 (id) values (1); +update t1, t2 set t1.id=2, operation="multi-UPDATE" where t1.id=1; +update t1, t2 +set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where t1.id=2; +select * from t1; +id operation +2 multi-UPDATE, SET for t2, but the trigger is fired +select * from t2; +id +3 +select * from t1_op_log; +operation +Before INSERT, new=INSERT for multi-UPDATE +After INSERT, new=INSERT for multi-UPDATE +Before UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE +After UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE +Before UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE +After UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE +truncate table t1; +truncate table t2; +truncate table t1_op_log; + +Now do the same but use a view instead of the base table. + +insert into v1 (operation) values ("INSERT"); +set @id=last_insert_id(); +select * from t1; +id operation +1 INSERT +select * from t1_op_log; +operation +Before INSERT, new=INSERT +After INSERT, new=INSERT +truncate t1_op_log; +update v1 set operation="UPDATE" where id=@id; +select * from t1; +id operation +1 UPDATE +select * from t1_op_log; +operation +Before UPDATE, new=UPDATE, old=INSERT +After UPDATE, new=UPDATE, old=INSERT +truncate t1_op_log; +delete from v1 where id=@id; +select * from t1; +id operation +select * from t1_op_log; +operation +Before DELETE, old=UPDATE +After DELETE, old=UPDATE +truncate t1; +truncate t1_op_log; +insert into v1 (id, operation) values +(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key") +on duplicate key update id=NULL, operation="Should never happen"; +set @id=last_insert_id(); +select * from t1; +id operation +1 INSERT ON DUPLICATE KEY UPDATE, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key +After INSERT, new=INSERT ON DUPLICATE KEY UPDATE, inserting a new key +truncate t1_op_log; +insert into v1 (id, operation) values +(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same") +on duplicate key update id=NULL, +operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate"; +select * from t1; +id operation +0 INSERT ON DUPLICATE KEY UPDATE, updating the duplicate +select * from t1_op_log; +operation +Before INSERT, new=INSERT ON DUPLICATE KEY UPDATE, the key value is the same +Before UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key +After UPDATE, new=INSERT ON DUPLICATE KEY UPDATE, updating the duplicate, old=INSERT ON DUPLICATE KEY UPDATE, inserting a new key +truncate t1; +truncate t1_op_log; +replace into v1 values (NULL, "REPLACE, inserting a new key"); +set @id=last_insert_id(); +select * from t1; +id operation +1 REPLACE, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=REPLACE, inserting a new key +After INSERT, new=REPLACE, inserting a new key +truncate t1_op_log; +replace into v1 values (@id, "REPLACE, deleting the duplicate"); +select * from t1; +id operation +1 REPLACE, deleting the duplicate +select * from t1_op_log; +operation +Before INSERT, new=REPLACE, deleting the duplicate +Before DELETE, old=REPLACE, inserting a new key +After DELETE, old=REPLACE, inserting a new key +After INSERT, new=REPLACE, deleting the duplicate +truncate t1; +truncate t1_op_log; +create table if not exists v1 +select NULL, "CREATE TABLE ... SELECT, inserting a new key"; +Warnings: +Note 1050 Table 'v1' already exists +set @id=last_insert_id(); +select * from t1; +id operation +1 CREATE TABLE ... SELECT, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=CREATE TABLE ... SELECT, inserting a new key +After INSERT, new=CREATE TABLE ... SELECT, inserting a new key +truncate t1_op_log; +create table if not exists v1 replace +select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key"; +Warnings: +Note 1050 Table 'v1' already exists +select * from t1; +id operation +1 CREATE TABLE ... REPLACE SELECT, deleting a duplicate key +select * from t1_op_log; +operation +Before INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key +Before DELETE, old=CREATE TABLE ... SELECT, inserting a new key +After DELETE, old=CREATE TABLE ... SELECT, inserting a new key +After INSERT, new=CREATE TABLE ... REPLACE SELECT, deleting a duplicate key +truncate t1; +truncate t1_op_log; +insert into v1 (id, operation) +select NULL, "INSERT ... SELECT, inserting a new key"; +set @id=last_insert_id(); +select * from t1; +id operation +1 INSERT ... SELECT, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=INSERT ... SELECT, inserting a new key +After INSERT, new=INSERT ... SELECT, inserting a new key +truncate t1_op_log; +insert into v1 (id, operation) +select @id, +"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate" +on duplicate key update id=NULL, +operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"; +select * from t1; +id operation +0 INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate +select * from t1_op_log; +operation +Before INSERT, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate +Before UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key +After UPDATE, new=INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate, old=INSERT ... SELECT, inserting a new key +truncate t1; +truncate t1_op_log; +replace into v1 (id, operation) +select NULL, "REPLACE ... SELECT, inserting a new key"; +set @id=last_insert_id(); +select * from t1; +id operation +1 REPLACE ... SELECT, inserting a new key +select * from t1_op_log; +operation +Before INSERT, new=REPLACE ... SELECT, inserting a new key +After INSERT, new=REPLACE ... SELECT, inserting a new key +truncate t1_op_log; +replace into v1 (id, operation) +select @id, "REPLACE ... SELECT, deleting a duplicate"; +select * from t1; +id operation +1 REPLACE ... SELECT, deleting a duplicate +select * from t1_op_log; +operation +Before INSERT, new=REPLACE ... SELECT, deleting a duplicate +Before DELETE, old=REPLACE ... SELECT, inserting a new key +After DELETE, old=REPLACE ... SELECT, inserting a new key +After INSERT, new=REPLACE ... SELECT, deleting a duplicate +truncate t1; +truncate t1_op_log; +insert into v1 (id, operation) values (1, "INSERT for multi-DELETE"); +insert into t2 (id) values (1); +delete v1.*, t2.* from v1, t2 where v1.id=1; +select * from t1; +id operation +select * from t2; +id +select * from t1_op_log; +operation +Before INSERT, new=INSERT for multi-DELETE +After INSERT, new=INSERT for multi-DELETE +Before DELETE, old=INSERT for multi-DELETE +After DELETE, old=INSERT for multi-DELETE +truncate t1; +truncate t2; +truncate t1_op_log; +insert into v1 (id, operation) values (1, "INSERT for multi-UPDATE"); +insert into t2 (id) values (1); +update v1, t2 set v1.id=2, operation="multi-UPDATE" where v1.id=1; +update v1, t2 +set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where v1.id=2; +select * from t1; +id operation +2 multi-UPDATE, SET for t2, but the trigger is fired +select * from t2; +id +3 +select * from t1_op_log; +operation +Before INSERT, new=INSERT for multi-UPDATE +After INSERT, new=INSERT for multi-UPDATE +Before UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE +After UPDATE, new=multi-UPDATE, old=INSERT for multi-UPDATE +Before UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE +After UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE +drop view v1; +drop table t1, t2, t1_op_log; End of 5.0 tests diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test index 5c135d98878..8103a1ba0b1 100644 --- a/mysql-test/t/trigger-trans.test +++ b/mysql-test/t/trigger-trans.test @@ -49,4 +49,84 @@ insert into t1 values ('The Pie', 50, 1, 1); select * from t1; drop table t1; -# End of 5.0 tests +--echo +--echo Bug#26141 mixing table types in trigger causes full +--echo table lock on innodb table +--echo +--echo Ensure we do not open and lock tables for the triggers we do not +--echo fire. +--echo +--disable_warnings +drop table if exists t1, t2, t3; +drop trigger if exists trg_bug26141_au; +drop trigger if exists trg_bug26141_ai; +--enable_warnings +# Note, for InnoDB to allow concurrent UPDATE and INSERT the +# table must have a unique key. +create table t1 (c int primary key) engine=innodb; +create table t2 (c int) engine=myisam; +create table t3 (c int) engine=myisam; +insert into t1 (c) values (1); +delimiter |; + +create trigger trg_bug26141_ai after insert on t1 +for each row +begin + insert into t2 (c) values (1); +# We need the 'sync' lock to synchronously wait in connection 2 till +# the moment when the trigger acquired all the locks. + select release_lock("lock_bug26141_sync") into @a; +# 1000 is time in seconds of lock wait timeout -- this is a way +# to cause a manageable sleep up to 1000 seconds + select get_lock("lock_bug26141_wait", 1000) into @a; +end| + +create trigger trg_bug26141_au after update on t1 +for each row +begin + insert into t3 (c) values (1); +end| +delimiter ;| + +# Establish an alternative connection. +--connect (connection_aux,localhost,root,,test,,) +--connect (connection_update,localhost,root,,test,,) + +connection connection_aux; +# Lock the wait lock, it must not be locked, so specify zero timeout. +select get_lock("lock_bug26141_wait", 0); + +# +connection default; +# +# Run the trigger synchronously +# +select get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0); +# Will acquire the table level locks, perform the insert into t2, +# release the sync lock and block on the wait lock. +send insert into t1 (c) values (2); + +connection connection_update; +# Wait for the trigger to acquire its locks and unlock the sync lock. +select get_lock("lock_bug26141_sync", 1000); +# +# This must continue: after the fix for the bug, we do not +# open tables for t2, and with c=4 innobase allows the update +# to run concurrently with insert. +update t1 set c=3 where c=1; +select release_lock("lock_bug26141_sync"); +connection connection_aux; +select release_lock("lock_bug26141_wait"); +connection default; +reap; +select * from t1; +select * from t2; +select * from t3; + +# Drops the trigger as well. +drop table t1, t2, t3; +disconnect connection_update; +disconnect connection_aux; + + +--echo End of 5.0 tests diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 0fa92f33de2..a6390036322 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -1828,5 +1828,370 @@ DROP TRIGGER t1_test; DROP TABLE t1,t2; SET SESSION LOW_PRIORITY_UPDATES=DEFAULT; SET GLOBAL LOW_PRIORITY_UPDATES=DEFAULT; +--echo +--echo Bug#28502 Triggers that update another innodb table will block +--echo on X lock unnecessarily +--echo +--echo Ensure we do not open and lock tables for triggers we do not fire. +--echo +--disable_warnings +drop table if exists t1, t2; +drop trigger if exists trg_bug28502_au; +--enable_warnings +create table t1 (id int, count int); +create table t2 (id int); +delimiter |; + +create trigger trg_bug28502_au before update on t2 +for each row +begin + if (new.id is not null) then + update t1 set count= count + 1 where id = old.id; + end if; +end| + +delimiter ;| +insert into t1 (id, count) values (1, 0); + +lock table t1 write; + +--connect (connection_insert, localhost, root, , test, , ) +connection connection_insert; +# Is expected to pass. +insert into t2 set id=1; +connection default; +unlock tables; +update t2 set id=1 where id=1; +select * from t1; +select * from t2; +# Will drop the trigger +drop table t1, t2; +disconnect connection_insert; +--echo +--echo Additionally, provide test coverage for triggers and +--echo all MySQL data changing commands. +--echo +--disable_warnings +drop table if exists t1, t2, t1_op_log; +drop view if exists v1; +drop trigger if exists trg_bug28502_bi; +drop trigger if exists trg_bug28502_ai; +drop trigger if exists trg_bug28502_bu; +drop trigger if exists trg_bug28502_au; +drop trigger if exists trg_bug28502_bd; +drop trigger if exists trg_bug28502_ad; +--enable_warnings +create table t1 (id int primary key auto_increment, operation varchar(255)); +create table t2 (id int primary key); +create table t1_op_log(operation varchar(255)); +create view v1 as select * from t1; +create trigger trg_bug28502_bi before insert on t1 +for each row + insert into t1_op_log (operation) + values (concat("Before INSERT, new=", new.operation)); + +create trigger trg_bug28502_ai after insert on t1 +for each row + insert into t1_op_log (operation) + values (concat("After INSERT, new=", new.operation)); + +create trigger trg_bug28502_bu before update on t1 +for each row + insert into t1_op_log (operation) + values (concat("Before UPDATE, new=", new.operation, + ", old=", old.operation)); + +create trigger trg_bug28502_au after update on t1 +for each row + insert into t1_op_log (operation) + values (concat("After UPDATE, new=", new.operation, + ", old=", old.operation)); + +create trigger trg_bug28502_bd before delete on t1 +for each row + insert into t1_op_log (operation) + values (concat("Before DELETE, old=", old.operation)); + +create trigger trg_bug28502_ad after delete on t1 +for each row + insert into t1_op_log (operation) + values (concat("After DELETE, old=", old.operation)); + +insert into t1 (operation) values ("INSERT"); + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +update t1 set operation="UPDATE" where id=@id; + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +delete from t1 where id=@id; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +insert into t1 (id, operation) values +(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key") +on duplicate key update id=NULL, operation="Should never happen"; + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +insert into t1 (id, operation) values +(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same") +on duplicate key update id=NULL, +operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate"; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +replace into t1 values (NULL, "REPLACE, inserting a new key"); + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +replace into t1 values (@id, "REPLACE, deleting the duplicate"); + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +create table if not exists t1 +select NULL, "CREATE TABLE ... SELECT, inserting a new key"; + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +create table if not exists t1 replace +select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key"; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +insert into t1 (id, operation) +select NULL, "INSERT ... SELECT, inserting a new key"; + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +insert into t1 (id, operation) +select @id, +"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate" +on duplicate key update id=NULL, +operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +replace into t1 (id, operation) +select NULL, "REPLACE ... SELECT, inserting a new key"; + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +replace into t1 (id, operation) +select @id, "REPLACE ... SELECT, deleting a duplicate"; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +insert into t1 (id, operation) values (1, "INSERT for multi-DELETE"); +insert into t2 (id) values (1); + +delete t1.*, t2.* from t1, t2 where t1.id=1; + +select * from t1; +select * from t2; +select * from t1_op_log; +truncate t1; +truncate t2; +truncate t1_op_log; + +insert into t1 (id, operation) values (1, "INSERT for multi-UPDATE"); +insert into t2 (id) values (1); +update t1, t2 set t1.id=2, operation="multi-UPDATE" where t1.id=1; +update t1, t2 +set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where t1.id=2; + +select * from t1; +select * from t2; +select * from t1_op_log; +truncate table t1; +truncate table t2; +truncate table t1_op_log; + +--echo +--echo Now do the same but use a view instead of the base table. +--echo + +insert into v1 (operation) values ("INSERT"); + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +update v1 set operation="UPDATE" where id=@id; + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +delete from v1 where id=@id; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +insert into v1 (id, operation) values +(NULL, "INSERT ON DUPLICATE KEY UPDATE, inserting a new key") +on duplicate key update id=NULL, operation="Should never happen"; + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +insert into v1 (id, operation) values +(@id, "INSERT ON DUPLICATE KEY UPDATE, the key value is the same") +on duplicate key update id=NULL, +operation="INSERT ON DUPLICATE KEY UPDATE, updating the duplicate"; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +replace into v1 values (NULL, "REPLACE, inserting a new key"); + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +replace into v1 values (@id, "REPLACE, deleting the duplicate"); + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +create table if not exists v1 +select NULL, "CREATE TABLE ... SELECT, inserting a new key"; + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +create table if not exists v1 replace +select @id, "CREATE TABLE ... REPLACE SELECT, deleting a duplicate key"; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +insert into v1 (id, operation) +select NULL, "INSERT ... SELECT, inserting a new key"; + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +insert into v1 (id, operation) +select @id, +"INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate" +on duplicate key update id=NULL, +operation="INSERT ... SELECT ... ON DUPLICATE KEY UPDATE, updating a duplicate"; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +replace into v1 (id, operation) +select NULL, "REPLACE ... SELECT, inserting a new key"; + +set @id=last_insert_id(); + +select * from t1; +select * from t1_op_log; +truncate t1_op_log; + +replace into v1 (id, operation) +select @id, "REPLACE ... SELECT, deleting a duplicate"; + +select * from t1; +select * from t1_op_log; +truncate t1; +truncate t1_op_log; + +insert into v1 (id, operation) values (1, "INSERT for multi-DELETE"); +insert into t2 (id) values (1); + +delete v1.*, t2.* from v1, t2 where v1.id=1; + +select * from t1; +select * from t2; +select * from t1_op_log; +truncate t1; +truncate t2; +truncate t1_op_log; + +insert into v1 (id, operation) values (1, "INSERT for multi-UPDATE"); +insert into t2 (id) values (1); +update v1, t2 set v1.id=2, operation="multi-UPDATE" where v1.id=1; +update v1, t2 +set t2.id=3, operation="multi-UPDATE, SET for t2, but the trigger is fired" where v1.id=2; + +select * from t1; +select * from t2; +select * from t1_op_log; + +drop view v1; +drop table t1, t2, t1_op_log; + +# +# TODO: test LOAD DATA INFILE --echo End of 5.0 tests diff --git a/sql/item.h b/sql/item.h index 58e3ec439b4..07bf7fec0ea 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2309,14 +2309,6 @@ enum trg_action_time_type TRG_ACTION_BEFORE= 0, TRG_ACTION_AFTER= 1, TRG_ACTION_MAX }; -/* - Event on which trigger is invoked. -*/ -enum trg_event_type -{ - TRG_EVENT_INSERT= 0 , TRG_EVENT_UPDATE= 1, TRG_EVENT_DELETE= 2, TRG_EVENT_MAX -}; - class Table_triggers_list; /* diff --git a/sql/sp.cc b/sql/sp.cc index 3c8ebed4ae6..c0e7d5e2271 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -440,6 +440,19 @@ db_load_routine(THD *thd, int type, sp_name *name, sp_head **sphp, lex_start(thd); thd->spcont= NULL; ret= MYSQLparse(thd); + + if (ret == 0) + { + /* + Not strictly necessary to invoke this method here, since we know + that we've parsed CREATE PROCEDURE/FUNCTION and not an + UPDATE/DELETE/INSERT/REPLACE/LOAD/CREATE TABLE, but we try to + maintain the invariant that this method is called for each + distinct statement, in case its logic is extended with other + types of analyses in future. + */ + newlex.set_trg_event_type_for_tables(); + } } if (ret || thd->is_fatal_error || newlex.sphead == NULL) @@ -1742,31 +1755,39 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, TABLE_LIST *table) { int ret= 0; - Table_triggers_list *triggers= table->table->triggers; - if (add_used_routine(lex, thd->stmt_arena, &triggers->sroutines_key, - table->belong_to_view)) + + Sroutine_hash_entry **last_cached_routine_ptr= + (Sroutine_hash_entry **)lex->sroutines_list.next; + + if (static_cast(table->lock_type) >= + static_cast(TL_WRITE_ALLOW_WRITE)) { - Sroutine_hash_entry **last_cached_routine_ptr= - (Sroutine_hash_entry **)lex->sroutines_list.next; for (int i= 0; i < (int)TRG_EVENT_MAX; i++) { - for (int j= 0; j < (int)TRG_ACTION_MAX; j++) + if (table->trg_event_map & + static_cast(1 << static_cast(i))) { - if (triggers->bodies[i][j]) + for (int j= 0; j < (int)TRG_ACTION_MAX; j++) { - (void)triggers->bodies[i][j]-> - add_used_tables_to_table_list(thd, &lex->query_tables_last, - table->belong_to_view); - sp_update_stmt_used_routines(thd, lex, - &triggers->bodies[i][j]->m_sroutines, - table->belong_to_view); + /* We can have only one trigger per action type currently */ + sp_head *trigger= table->table->triggers->bodies[i][j]; + if (trigger && + add_used_routine(lex, thd->stmt_arena, &trigger->m_sroutines_key, + table->belong_to_view)) + { + trigger->add_used_tables_to_table_list(thd, &lex->query_tables_last, + table->belong_to_view); + sp_update_stmt_used_routines(thd, lex, + &trigger->m_sroutines, + table->belong_to_view); + } } } } - ret= sp_cache_routines_and_add_tables_aux(thd, lex, - *last_cached_routine_ptr, - FALSE, NULL); } + ret= sp_cache_routines_and_add_tables_aux(thd, lex, + *last_cached_routine_ptr, + FALSE, NULL); return ret; } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index d939fd20b9b..0ac1db336d0 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -478,12 +478,35 @@ sp_head::init(LEX *lex) */ lex->trg_table_fields.empty(); my_init_dynamic_array(&m_instr, sizeof(sp_instr *), 16, 8); - m_param_begin= m_param_end= m_body_begin= 0; - m_qname.str= m_db.str= m_name.str= m_params.str= - m_body.str= m_defstr.str= 0; - m_qname.length= m_db.length= m_name.length= m_params.length= - m_body.length= m_defstr.length= 0; + + m_param_begin= NULL; + m_param_end= NULL; + + m_body_begin= NULL ; + + m_qname.str= NULL; + m_qname.length= 0; + + m_db.str= NULL; + m_db.length= 0; + + m_name.str= NULL; + m_name.length= 0; + + m_params.str= NULL; + m_params.length= 0; + + m_body.str= NULL; + m_body.length= 0; + + m_defstr.str= NULL; + m_defstr.length= 0; + + m_sroutines_key.str= NULL; + m_sroutines_key.length= 0; + m_return_field_def.charset= NULL; + DBUG_VOID_RETURN; } @@ -509,9 +532,14 @@ sp_head::init_sp_name(THD *thd, sp_name *spname) if (spname->m_qname.length == 0) spname->init_qname(thd); - m_qname.length= spname->m_qname.length; - m_qname.str= strmake_root(thd->mem_root, spname->m_qname.str, - m_qname.length); + m_sroutines_key.length= spname->m_sroutines_key.length; + m_sroutines_key.str= memdup_root(thd->mem_root, + spname->m_sroutines_key.str, + spname->m_sroutines_key.length + 1); + m_sroutines_key.str[0]= static_cast(m_type); + + m_qname.length= m_sroutines_key.length - 1; + m_qname.str= m_sroutines_key.str + 1; DBUG_VOID_RETURN; } @@ -1796,8 +1824,11 @@ sp_head::restore_lex(THD *thd) { DBUG_ENTER("sp_head::restore_lex"); LEX *sublex= thd->lex; - LEX *oldlex= (LEX *)m_lex.pop(); + LEX *oldlex; + sublex->set_trg_event_type_for_tables(); + + oldlex= (LEX *)m_lex.pop(); if (! oldlex) return; // Nothing to restore @@ -3429,6 +3460,7 @@ typedef struct st_sp_table thr_lock_type lock_type; /* lock type used for prelocking */ uint lock_count; uint query_lock_count; + uint8 trg_event_map; } SP_TABLE; byte * @@ -3515,6 +3547,7 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check) tab->query_lock_count++; if (tab->query_lock_count > tab->lock_count) tab->lock_count++; + tab->trg_event_map|= table->trg_event_map; } else { @@ -3536,6 +3569,7 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check) tab->db_length= table->db_length; tab->lock_type= table->lock_type; tab->lock_count= tab->query_lock_count= 1; + tab->trg_event_map= table->trg_event_map; my_hash_insert(&m_sptabs, (byte *)tab); } } @@ -3613,6 +3647,7 @@ sp_head::add_used_tables_to_table_list(THD *thd, table->cacheable_table= 1; table->prelocking_placeholder= 1; table->belong_to_view= belong_to_view; + table->trg_event_map= stab->trg_event_map; /* Everyting else should be zeroed */ diff --git a/sql/sp_head.h b/sql/sp_head.h index ed99885ae9a..ebe40ce9c87 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -130,6 +130,12 @@ public: st_sp_chistics *m_chistics; ulong m_sql_mode; // For SHOW CREATE and execution LEX_STRING m_qname; // db.name + /** + Key representing routine in the set of stored routines used by statement. + [routine_type]db.name\0 + @sa sp_name::m_sroutines_key + */ + LEX_STRING m_sroutines_key; LEX_STRING m_db; LEX_STRING m_name; LEX_STRING m_params; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index dbce1e38139..c37d77345b6 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2034,6 +2034,27 @@ void st_select_lex_unit::set_limit(SELECT_LEX *sl) } +/** + Update the parsed tree with information about triggers that + may be fired when executing this statement. +*/ + +void st_lex::set_trg_event_type_for_tables() +{ + /* + Do not iterate over sub-selects, only the tables in the outermost + SELECT_LEX can be modified, if any. + */ + TABLE_LIST *tables= select_lex.get_table_list(); + + while (tables) + { + tables->set_trg_event_type(this); + tables= tables->next_local; + } +} + + /* Unlink the first table from the global table list and the first table from outer select (lex->select_lex) local list diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 25a6c31e21c..bfa6c05974f 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1188,6 +1188,8 @@ typedef struct st_lex : public Query_tables_list un->uncacheable|= cause; } } + void set_trg_event_type_for_tables(); + TABLE_LIST *unlink_first_table(bool *link_to_local); void link_first_table_back(TABLE_LIST *first, bool link_to_local); void first_lists_tables_same(); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 124fcff9517..91c51641fc0 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6080,8 +6080,9 @@ void mysql_parse(THD *thd, const char *inBuf, uint length, (thd->query_length= (ulong)(lip.found_semicolon - thd->query))) thd->query_length--; /* Actually execute the query */ - mysql_execute_command(thd); - query_cache_end_of_result(thd); + lex->set_trg_event_type_for_tables(); + mysql_execute_command(thd); + query_cache_end_of_result(thd); } } } diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 567f92b55ba..c993ce32e50 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2826,6 +2826,7 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) lex_start(thd); lex->safe_to_cache_query= FALSE; int err= MYSQLparse((void *)thd); + lex->set_trg_event_type_for_tables(); error= err || thd->is_fatal_error || thd->net.report_error || init_param_array(this); diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 5762614e47f..6e4b5defb97 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -942,17 +942,6 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, table->triggers= triggers; - /* - Construct key that will represent triggers for this table in the set - of routines used by statement. - */ - triggers->sroutines_key.length= 1+strlen(db)+1+strlen(table_name)+1; - if (!(triggers->sroutines_key.str= - alloc_root(&table->mem_root, triggers->sroutines_key.length))) - DBUG_RETURN(1); - triggers->sroutines_key.str[0]= TYPE_ENUM_TRIGGER; - strxmov(triggers->sroutines_key.str+1, db, ".", table_name, NullS); - /* TODO: This could be avoided if there is no triggers for UPDATE and DELETE. @@ -991,6 +980,15 @@ bool Table_triggers_list::check_n_load(THD *thd, const char *db, DBUG_ASSERT(lex.sphead == 0); goto err_with_lex_cleanup; } + /* + Not strictly necessary to invoke this method here, since we know + that we've parsed CREATE TRIGGER and not an + UPDATE/DELETE/INSERT/REPLACE/LOAD/CREATE TABLE, but we try to + maintain the invariant that this method is called for each + distinct statement, in case its logic is extended with other + types of analyses in future. + */ + lex.set_trg_event_type_for_tables(); lex.sphead->set_info(0, 0, &lex.sp_chistics, (ulong) *trg_sql_mode); @@ -1550,6 +1548,12 @@ bool Table_triggers_list::process_triggers(THD *thd, trg_event_type event, new_field= record1_field; old_field= trigger_table->field; } + /* + This trigger must have been processed by the pre-locking + algorithm. + */ + DBUG_ASSERT(trigger_table->pos_in_table_list->trg_event_map & + static_cast(1 << static_cast(event))); thd->reset_sub_statement_state(&statement_state, SUB_STMT_TRIGGER); err_status= sp_trigger->execute_trigger @@ -1568,7 +1572,7 @@ bool Table_triggers_list::process_triggers(THD *thd, trg_event_type event, SYNOPSIS mark_fields_used() thd Current thread context - event Type of event triggers for which we are going to inspect + event Type of event triggers for which we are going to ins DESCRIPTION This method marks fields of subject table which are read/set in its diff --git a/sql/sql_trigger.h b/sql/sql_trigger.h index b029a70ca20..1dc573995f1 100644 --- a/sql/sql_trigger.h +++ b/sql/sql_trigger.h @@ -56,14 +56,6 @@ class Table_triggers_list: public Sql_alloc updating trigger definitions during RENAME TABLE. */ List on_table_names_list; - /* - Key representing triggers for this table in set of all stored - routines used by statement. - TODO: We won't need this member once triggers namespace will be - database-wide instead of table-wide because then we will be able - to use key based on sp_name as for other stored routines. - */ - LEX_STRING sroutines_key; /* Grant information for each trigger (pair: subject table, trigger definer). diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 6c94d388d0e..7857ba267c5 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1153,7 +1153,20 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, */ for (tbl= view_main_select_tables; tbl; tbl= tbl->next_local) tbl->lock_type= table->lock_type; + /* + If the view is mergeable, we might want to + INSERT/UPDATE/DELETE into tables of this view. Preserve the + original sql command and 'duplicates' of the outer lex. + This is used later in set_trg_event_type_for_command. + */ + lex->sql_command= old_lex->sql_command; + lex->duplicates= old_lex->duplicates; } + /* + This method has a dependency on the proper lock type being set, + so in case of views should be called here. + */ + lex->set_trg_event_type_for_tables(); /* If we are opening this view as part of implicit LOCK TABLES, then diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 949f3ed4161..8cc6642ae7e 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -9644,13 +9644,13 @@ trigger_tail: MYSQL_YYABORT; sp->reset_thd_mem_root(thd); sp->init(lex); + sp->m_type= TYPE_ENUM_TRIGGER; sp->init_sp_name(thd, $3); lex->stmt_definition_begin= $2; lex->ident.str= $7; lex->ident.length= $10 - $7; - sp->m_type= TYPE_ENUM_TRIGGER; lex->sphead= sp; lex->spname= $3; /* @@ -9728,9 +9728,9 @@ sp_tail: sp= new sp_head(); sp->reset_thd_mem_root(YYTHD); sp->init(lex); + sp->m_type= TYPE_ENUM_PROCEDURE; sp->init_sp_name(YYTHD, $3); - sp->m_type= TYPE_ENUM_PROCEDURE; lex->sphead= sp; /* * We have to turn of CLIENT_MULTI_QUERIES while parsing a diff --git a/sql/table.cc b/sql/table.cc index 899d0ab2ed0..9c3e7618aa0 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1776,6 +1776,135 @@ void st_table::reset_item_list(List *item_list) const } } + +/** + Set the initial purpose of this TABLE_LIST object in the list of + used tables. We need to track this information on table-by- + table basis, since when this table becomes an element of the + pre-locked list, it's impossible to identify which SQL + sub-statement it has been originally used in. + + E.g.: + + User request: SELECT * FROM t1 WHERE f1(); + FUNCTION f1(): DELETE FROM t2; RETURN 1; + BEFORE DELETE trigger on t2: INSERT INTO t3 VALUES (old.a); + + For this user request, the pre-locked list will contain t1, t2, t3 + table elements, each needed for different DML. + + This method is called immediately after parsing for tables + of the table list of the top-level select lex. + + The trigger event map is updated to reflect INSERT, UPDATE, DELETE, + REPLACE, LOAD DATA, CREATE TABLE .. SELECT, CREATE TABLE .. + REPLACE SELECT statements, and additionally ON DUPLICATE KEY UPDATE + clause. +*/ + +void +TABLE_LIST::set_trg_event_type(const st_lex *lex) +{ + enum trg_event_type trg_event; + + /* + Some auxiliary operations + (e.g. GRANT processing) create TABLE_LIST instances outside + the parser. Additionally, some commands (e.g. OPTIMIZE) change + the lock type for a table only after parsing is done. Luckily, + these do not fire triggers and do not need to pre-load them. + For these TABLE_LISTs set_trg_event_type is never called, and + trg_event_map is always empty. That means that the pre-locking + algorithm will ignore triggers defined on these tables, if + any, and the execution will either fail with an assert in + sql_trigger.cc or with an error that a used table was not + pre-locked, in case of a production build. + + TODO: this usage pattern creates unnecessary module dependencies + and should be rewritten to go through the parser. + Table list instances created outside the parser in most cases + refer to mysql.* system tables. It is not allowed to have + a trigger on a system table, but keeping track of + initialization provides extra safety in case this limitation + is circumvented. + */ + + /* + This is a fast check to filter out statements that do + not change data, or tables on the right side, in case of + INSERT .. SELECT, CREATE TABLE .. SELECT and so on. + Here we also filter out OPTIMIZE statement and non-updateable + views, for which lock_type is TL_UNLOCK or TL_READ after + parsing. + */ + if (static_cast(lock_type) < static_cast(TL_WRITE_ALLOW_WRITE)) + return; + + switch (lex->sql_command) { + /* + Basic INSERT. If there is an additional ON DUPLIATE KEY UPDATE + clause, it will be handled later in this method. + */ + case SQLCOM_INSERT: /* fall through */ + case SQLCOM_INSERT_SELECT: + /* + LOAD DATA ... INFILE is expected to fire BEFORE/AFTER INSERT + triggers. + If the statement also has REPLACE clause, it will be + handled later in this method. + */ + case SQLCOM_LOAD: /* fall through */ + /* + REPLACE is semantically equivalent to INSERT. In case + of a primary or unique key conflict, it deletes the old + record and inserts a new one. So we also may need to + fire ON DELETE triggers. This functionality is handled + later in this method. + */ + case SQLCOM_REPLACE: /* fall through */ + case SQLCOM_REPLACE_SELECT: + /* + CREATE TABLE ... SELECT defaults to INSERT if the table or + view already exists. REPLACE option of CREATE TABLE ... + REPLACE SELECT is handled later in this method. + */ + case SQLCOM_CREATE_TABLE: + trg_event= TRG_EVENT_INSERT; + break; + /* Basic update and multi-update */ + case SQLCOM_UPDATE: /* fall through */ + case SQLCOM_UPDATE_MULTI: + trg_event= TRG_EVENT_UPDATE; + break; + /* Basic delete and multi-delete */ + case SQLCOM_DELETE: /* fall through */ + case SQLCOM_DELETE_MULTI: + trg_event= TRG_EVENT_DELETE; + break; + default: + /* + OK to return, since value of 'duplicates' is irrelevant + for non-updating commands. + */ + return; + } + trg_event_map|= static_cast(1 << static_cast(trg_event)); + + switch (lex->duplicates) { + case DUP_UPDATE: + trg_event= TRG_EVENT_UPDATE; + break; + case DUP_REPLACE: + trg_event= TRG_EVENT_DELETE; + break; + case DUP_ERROR: + default: + return; + } + trg_event_map|= static_cast(1 << static_cast(trg_event)); +} + + /* calculate md5 of query diff --git a/sql/table.h b/sql/table.h index b29ef8c6566..f8f7d7f06b7 100644 --- a/sql/table.h +++ b/sql/table.h @@ -59,6 +59,17 @@ enum tmp_table_type {NO_TMP_TABLE=0, NON_TRANSACTIONAL_TMP_TABLE=1, TRANSACTIONAL_TMP_TABLE=2, SYSTEM_TMP_TABLE=3}; + +/** Event on which trigger is invoked. */ +enum trg_event_type +{ + TRG_EVENT_INSERT= 0, + TRG_EVENT_UPDATE= 1, + TRG_EVENT_DELETE= 2, + TRG_EVENT_MAX +}; + + enum frm_type_enum { FRMTYPE_ERROR= 0, @@ -702,6 +713,13 @@ struct TABLE_LIST */ bool create; + /** + Indicates what triggers we need to pre-load for this TABLE_LIST + when opening an associated TABLE. This is filled after + the parsed tree is created. + */ + uint8 trg_event_map; + enum enum_schema_table_state schema_table_state; void calc_md5(char *buffer); void set_underlying_merge(); @@ -752,6 +770,7 @@ struct TABLE_LIST void reinit_before_use(THD *thd); Item_subselect *containing_subselect(); + void set_trg_event_type(const st_lex *lex); private: bool prep_check_option(THD *thd, uint8 check_opt_type); bool prep_where(THD *thd, Item **conds, bool no_where_clause); From e08e63b192ac37b372b1cbb9014ef8180527e48a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 23:09:55 +0400 Subject: [PATCH 150/227] Bug#29739: Incorrect time comparison in BETWEEN. Time values were compared by the BETWEEN function as strings. This led to a wrong result in cases when some of arguments are less than 100 hours and other are greater. Now if all 3 arguments of the BETWEEN function are of the TIME type then they are compared as integers. mysql-test/t/type_time.test: Added a tes tcase for the bug#29739: Incorrect time comparison in BETWEEN. mysql-test/r/type_time.result: Added a tes tcase for the bug#29739: Incorrect time comparison in BETWEEN. sql/item_cmpfunc.cc: Bug#29739: Incorrect time comparison in BETWEEN. Now if all 3 arguments of the BETWEEN function are of the TIME type then they are compared as integers. --- mysql-test/r/type_time.result | 6 ++++++ mysql-test/t/type_time.test | 8 ++++++++ sql/item_cmpfunc.cc | 24 ++++++++++++++++-------- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 6124f6e39f1..71bd8b68a0b 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -103,3 +103,9 @@ cast('100:55:50' as time) > cast('024:00:00' as time) select cast('300:55:50' as time) > cast('240:00:00' as time); cast('300:55:50' as time) > cast('240:00:00' as time) 1 +create table t1(f1 time, f2 time); +insert into t1 values('20:00:00','150:00:00'); +select 1 from t1 where cast('100:00:00' as time) between f1 and f2; +1 +1 +drop table t1; diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index d294e53a12f..82d701e29b5 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -50,3 +50,11 @@ select cast('300:55:50' as time) < cast('240:00:00' as time); select cast('100:55:50' as time) > cast('24:00:00' as time); select cast('100:55:50' as time) > cast('024:00:00' as time); select cast('300:55:50' as time) > cast('240:00:00' as time); + +# +# Bug#29739: Incorrect time comparison in BETWEEN. +# +create table t1(f1 time, f2 time); +insert into t1 values('20:00:00','150:00:00'); +select 1 from t1 where cast('100:00:00' as time) between f1 and f2; +drop table t1; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 70df1b4d09c..555384b2bfc 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1728,6 +1728,7 @@ void Item_func_between::fix_length_and_dec() THD *thd= current_thd; int i; bool datetime_found= FALSE; + int time_items_found= 0; compare_as_dates= TRUE; /* @@ -1747,17 +1748,19 @@ void Item_func_between::fix_length_and_dec() At least one of items should be a DATE/DATETIME item and other items should return the STRING result. */ - for (i= 0; i < 3; i++) + if (cmp_type == STRING_RESULT) { - if (args[i]->is_datetime()) + for (i= 0; i < 3; i++) { - datetime_found= TRUE; - continue; + if (args[i]->is_datetime()) + { + datetime_found= TRUE; + continue; + } + if (args[i]->field_type() == MYSQL_TYPE_TIME && + args[i]->result_as_longlong()) + time_items_found++; } - if (args[i]->result_type() == STRING_RESULT) - continue; - compare_as_dates= FALSE; - break; } if (!datetime_found) compare_as_dates= FALSE; @@ -1767,6 +1770,11 @@ void Item_func_between::fix_length_and_dec() ge_cmp.set_datetime_cmp_func(args, args + 1); le_cmp.set_datetime_cmp_func(args, args + 2); } + else if (time_items_found == 3) + { + /* Compare TIME items as integers. */ + cmp_type= INT_RESULT; + } else if (args[0]->real_item()->type() == FIELD_ITEM && thd->lex->sql_command != SQLCOM_CREATE_VIEW && thd->lex->sql_command != SQLCOM_SHOW_CREATE) From 0e2bb8dd43303331404615acdbc5c7ec91906113 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 23:14:00 +0400 Subject: [PATCH 151/227] Apply community contributed fix for Bug#13326 SQLPS statement logging is incomplete in 5.0 (and review fixes). When in 5.0.13 I introduced class Prepared_statement and methods ::prepare and ::execute, general logging was left out of this class. This was good for stored procedures, since in stored procedures we do not log sub-statements, but introduced a regression in case of SQL syntax for prepared statements, as previously we would log the actual statements to the log, and after the change we would log only COM_QUERY text. Restore the old behavior, but still suppress logging if inside a stored procedure. Based on a community contributed patch from Vladimir Shebordaev. No test case since we do not have a mechanism to test output of the general log. sql/sql_prepare.cc: Apply community contributed fix for Bug#13326 SQLPS statement logging is incomplete in 5.0 (and review fixes). --- sql/sql_prepare.cc | 59 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 567f92b55ba..90a4a05dadd 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1900,13 +1900,6 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length) /* Statement map deletes statement on erase */ thd->stmt_map.erase(stmt); } - else - { - const char *format= "[%lu] %.*b"; - mysql_log.write(thd, COM_STMT_PREPARE, format, stmt->id, - stmt->query_length, stmt->query); - - } /* check_prepared_statemnt sends the metadata packet in case of success */ DBUG_VOID_RETURN; } @@ -2289,13 +2282,6 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length) test(flags & (ulong) CURSOR_TYPE_READ_ONLY)); if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), WAIT_PRIOR); - if (error == 0) - { - const char *format= "[%lu] %.*b"; - mysql_log.write(thd, COM_STMT_EXECUTE, format, stmt->id, - thd->query_length, thd->query); - } - DBUG_VOID_RETURN; set_params_data_err: @@ -2878,6 +2864,29 @@ bool Prepared_statement::prepare(const char *packet, uint packet_len) init_stmt_after_parse(lex); state= Query_arena::PREPARED; flags&= ~ (uint) IS_IN_USE; + + /* + Log COM_EXECUTE to the general log. Note, that in case of SQL + prepared statements this causes two records to be output: + + Query PREPARE stmt from @user_variable + Prepare + + This is considered user-friendly, since in the + second log entry we output the actual statement text. + + Do not print anything if this is an SQL prepared statement and + we're inside a stored procedure (also called Dynamic SQL) -- + sub-statements inside stored procedures are not logged into + the general log. + */ + if (thd->spcont == NULL) + { + const char *format= "[%lu] %.*b"; + mysql_log.write(thd, COM_STMT_PREPARE, format, id, + query_length, query); + + } } DBUG_RETURN(error); } @@ -3015,6 +3024,28 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor) if (state == Query_arena::PREPARED) state= Query_arena::EXECUTED; + /* + Log COM_EXECUTE to the general log. Note, that in case of SQL + prepared statements this causes two records to be output: + + Query EXECUTE + Execute + + This is considered user-friendly, since in the + second log entry we output values of parameter markers. + + Do not print anything if this is an SQL prepared statement and + we're inside a stored procedure (also called Dynamic SQL) -- + sub-statements inside stored procedures are not logged into + the general log. + */ + if (error == 0 && thd->spcont == NULL) + { + const char *format= "[%lu] %.*b"; + mysql_log.write(thd, COM_STMT_EXECUTE, format, id, + thd->query_length, thd->query); + } + error: flags&= ~ (uint) IS_IN_USE; return error; From 62738bf97e7a653030361f0dcedf0f4a5c97388d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 03:25:27 +0500 Subject: [PATCH 152/227] BUG#29445 - match ... against () never returns Part 2: Searching fulltext index for a word with boolean mode truncation operator may cause infinite loop. The problem was that "smarter index merge" was used with "trunc-words", which must never happen. Affects 5.1 only. mysql-test/r/fulltext.result: Addition to a test case for BUG#29445. mysql-test/t/fulltext.test: Addition to a test case for BUG#29445. storage/myisam/ft_boolean_search.c: Fulltext "smarter index merge" optimization assumes that rows it gets are ordered by doc_id. That is not the case when we search for a word with truncation operator. It may return rows in random order. Thus we may not use "smarter index merge" optimization with "trunc-words". Also fixed compiler warning introduced by Part 1 patch. --- mysql-test/r/fulltext.result | 5 ++++- mysql-test/t/fulltext.test | 3 ++- storage/myisam/ft_boolean_search.c | 10 ++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 02b115cb6dc..a649f70b6f2 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -485,7 +485,10 @@ INSERT INTO t1 VALUES('Offside'),('City Of God'); SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE); a City Of God -SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of)*' IN BOOLEAN MODE); +SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of*)' IN BOOLEAN MODE); +a +City Of God +SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE); a City Of God DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index b1bf0036c70..ecb4a0e5691 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -414,7 +414,8 @@ DROP TABLE t1; CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a)); INSERT INTO t1 VALUES('Offside'),('City Of God'); SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE); -SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of)*' IN BOOLEAN MODE); +SELECT a FROM t1 WHERE MATCH a AGAINST ('+city (of*)' IN BOOLEAN MODE); +SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE); DROP TABLE t1; # End of 4.1 tests diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 5c421d3688b..c881f7a7480 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -23,6 +23,12 @@ inside plus subtree. max_docid could be used by any word in plus subtree, but it could be updated by plus-word only. + Fulltext "smarter index merge" optimization assumes that rows + it gets are ordered by doc_id. That is not the case when we + search for a word with truncation operator. It may return + rows in random order. Thus we may not use "smarter index merge" + optimization with "trunc-words". + The idea is: there is no need to search for docid smaller than biggest docid inside current plus subtree or any upper plus subtree. @@ -443,7 +449,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search) memcpy(lastkey_buf+off, info->lastkey, info->lastkey_length); } ftbw->docid[0]=info->lastpos; - if (ftbw->flags & FTB_FLAG_YES) + if (ftbw->flags & FTB_FLAG_YES && !(ftbw->flags & FTB_FLAG_TRUNC)) ftbw->max_docid_expr->max_docid= info->lastpos; return 0; } @@ -488,7 +494,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) { if (ftbe->flags & FTB_FLAG_NO || /* 2 */ ftbe->up->ythresh - ftbe->up->yweaks > - test(ftbe->flags & FTB_FLAG_YES)) /* 1 */ + (uint) test(ftbe->flags & FTB_FLAG_YES)) /* 1 */ { FTB_EXPR *top_ftbe=ftbe->up; ftbw->docid[0]=HA_OFFSET_ERROR; From bae6562762e8a35793faf5c2708b1401f81f81fe Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 03:29:25 +0500 Subject: [PATCH 153/227] BUG#29464 - load data infile into table with big5 chinese fulltext index hangs 100% cpu Moved a test case for BUG#29464 into fulltext3.test, since it requires big5 character set. mysql-test/r/fulltext.result: Moved a test case for BUG#29464 into fulltext3.test, since it requires big5 character set. mysql-test/r/fulltext3.result: Moved a test case for BUG#29464 into fulltext3.test, since it requires big5 character set. mysql-test/t/fulltext.test: Moved a test case for BUG#29464 into fulltext3.test, since it requires big5 character set. mysql-test/t/fulltext3.test: Moved a test case for BUG#29464 into fulltext3.test, since it requires big5 character set. --- mysql-test/r/fulltext.result | 4 ---- mysql-test/r/fulltext3.result | 4 ++++ mysql-test/t/fulltext.test | 9 --------- mysql-test/t/fulltext3.test | 10 ++++++++++ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index a649f70b6f2..96ebb9bf254 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -476,10 +476,6 @@ ALTER TABLE t1 DISABLE KEYS; SELECT * FROM t1 WHERE MATCH(a) AGAINST('test'); ERROR HY000: Can't find FULLTEXT index matching the column list DROP TABLE t1; -CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci, -FULLTEXT(a)); -INSERT INTO t1 VALUES(0xA3C2); -DROP TABLE t1; CREATE TABLE t1(a VARCHAR(20), FULLTEXT(a)); INSERT INTO t1 VALUES('Offside'),('City Of God'); SELECT a FROM t1 WHERE MATCH a AGAINST ('+city of*' IN BOOLEAN MODE); diff --git a/mysql-test/r/fulltext3.result b/mysql-test/r/fulltext3.result index 019d5f472ed..4ec48369ad1 100644 --- a/mysql-test/r/fulltext3.result +++ b/mysql-test/r/fulltext3.result @@ -11,3 +11,7 @@ Table Op Msg_type Msg_text test.t1 check status OK SET NAMES latin1; DROP TABLE t1; +CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci, +FULLTEXT(a)); +INSERT INTO t1 VALUES(0xA3C2); +DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index ecb4a0e5691..1f8a3b82cfd 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -399,15 +399,6 @@ ALTER TABLE t1 DISABLE KEYS; SELECT * FROM t1 WHERE MATCH(a) AGAINST('test'); DROP TABLE t1; -# -# BUG#29464 - load data infile into table with big5 chinese fulltext index -# hangs 100% cpu -# -CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci, -FULLTEXT(a)); -INSERT INTO t1 VALUES(0xA3C2); -DROP TABLE t1; - # # BUG#29445 - match ... against () never returns # diff --git a/mysql-test/t/fulltext3.test b/mysql-test/t/fulltext3.test index a57fd48daaa..1b6a07c540f 100644 --- a/mysql-test/t/fulltext3.test +++ b/mysql-test/t/fulltext3.test @@ -22,3 +22,13 @@ DROP TABLE t1; # End of 5.0 tests +# +# BUG#29464 - load data infile into table with big5 chinese fulltext index +# hangs 100% cpu +# +CREATE TABLE t1(a VARCHAR(2) CHARACTER SET big5 COLLATE big5_chinese_ci, +FULLTEXT(a)); +INSERT INTO t1 VALUES(0xA3C2); +DROP TABLE t1; + +# End of 5.1 tests From b7527f6b72cbd3d919671ed15262b1893166e125 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Jul 2007 22:06:33 -0400 Subject: [PATCH 154/227] Bug #29579 Clients using SSL can hang the server Added an option to yassl to allow "quiet shutdown" like openssl does. This option causes the SSL libs to NOT perform the close_notify handshake during shutdown. This fixes a hang we experience because we hold a lock during socket shutdown. mysql-test/t/ssl_big.test: BitKeeper file /Users/dkatz/50/mysql-test/t/ssl_big.test mysql-test/r/ssl-big.result: BitKeeper file /Users/dkatz/50/mysql-test/r/ssl-big.result client/mysqltest.c: Added new command to mysqltest to send a quit command to the server, but to not close the actual socket on our end. Also changed code to reuse connection slots, so that the tests can open and close sockets in a loop. extra/yassl/include/openssl/ssl.h: Added C accessors to the quietShutdown option. extra/yassl/include/yassl_int.hpp: Added quietShutdown_ member and accessor methods to the SSL class. extra/yassl/src/ssl.cpp: Added accessors to get/set the quietShutdown option and to not perform the shutdown handshake if quietShutdown is set. extra/yassl/src/yassl_int.cpp: Added quietShutdown_ member and accessor methods to the SSL class. vio/viossl.c: Added line to set the quiet_shutdown option before shutting down the socket. mysql-test/t/ssl-big.test: Added a test that causes an unpatched server to hang during SSL socket shutdown. --- client/mysqltest.c | 85 +++++++++++++++++++++++++------ extra/yassl/include/openssl/ssl.h | 2 + extra/yassl/include/yassl_int.hpp | 3 ++ extra/yassl/src/ssl.cpp | 18 ++++++- extra/yassl/src/yassl_int.cpp | 14 ++++- mysql-test/r/ssl-big.result | 3 ++ mysql-test/t/ssl-big.test | 56 ++++++++++++++++++++ mysql-test/t/ssl_big.test | 62 ++++++++++++++++++++++ vio/viossl.c | 10 ++++ 9 files changed, 234 insertions(+), 19 deletions(-) create mode 100644 mysql-test/r/ssl-big.result create mode 100644 mysql-test/t/ssl-big.test create mode 100644 mysql-test/t/ssl_big.test diff --git a/client/mysqltest.c b/client/mysqltest.c index 7eb80e4594f..2e964056a73 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -280,6 +280,7 @@ enum enum_commands { Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST, Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP, Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES, + Q_SEND_QUIT, Q_UNKNOWN, /* Unknown command. */ Q_COMMENT, /* Comments, ignored. */ @@ -367,6 +368,7 @@ const char *command_names[]= "append_file", "cat_file", "diff_files", + "send_quit", 0 }; @@ -2555,6 +2557,48 @@ void do_diff_files(struct st_command *command) DBUG_VOID_RETURN; } + /* + SYNOPSIS + do_send_quit + command called command + + DESCRIPTION + Sends a simple quit command to the server for the named connection. + + */ + +void do_send_quit(struct st_command *command) +{ + char *p= command->first_argument, *name; + struct st_connection *con; + + DBUG_ENTER("do_send_quit"); + DBUG_PRINT("enter",("name: '%s'",p)); + + if (!*p) + die("Missing connection name in do_send_quit"); + name= p; + while (*p && !my_isspace(charset_info,*p)) + p++; + + if (*p) + *p++= 0; + command->last_argument= p; + + /* Loop through connection pool for connection to close */ + for (con= connections; con < next_con; con++) + { + DBUG_PRINT("info", ("con->name: %s", con->name)); + if (!strcmp(con->name, name)) + { + simple_command(&con->mysql,COM_QUIT,NullS,0,1); + DBUG_VOID_RETURN; + } + } + die("connection '%s' not found in connection pool", name); +} + + /* SYNOPSIS do_perl @@ -3464,11 +3508,10 @@ void do_close_connection(struct st_command *command) my_free(con->name, MYF(0)); /* - When the connection is closed set name to "closed_connection" + When the connection is closed set name to "-closed_connection-" to make it possible to reuse the connection name. - The connection slot will not be reused */ - if (!(con->name = my_strdup("closed_connection", MYF(MY_WME)))) + if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME)))) die("Out of memory"); DBUG_VOID_RETURN; @@ -3646,6 +3689,7 @@ void do_connect(struct st_command *command) int con_port= opt_port; char *con_options; bool con_ssl= 0, con_compress= 0; + struct st_connection* con_slot; static DYNAMIC_STRING ds_connection_name; static DYNAMIC_STRING ds_host; @@ -3731,19 +3775,24 @@ void do_connect(struct st_command *command) con_options= end; } - if (next_con == connections_end) - die("Connection limit exhausted, you can have max %d connections", - (int) (sizeof(connections)/sizeof(struct st_connection))); - if (find_connection_by_name(ds_connection_name.str)) die("Connection %s already exists", ds_connection_name.str); + + if (!(con_slot= find_connection_by_name("-closed_connection-"))) + { + if (next_con == connections_end) + die("Connection limit exhausted, you can have max %d connections", + (int) (sizeof(connections)/sizeof(struct st_connection))); + + con_slot= next_con; + } - if (!mysql_init(&next_con->mysql)) + if (!mysql_init(&con_slot->mysql)) die("Failed on mysql_init()"); if (opt_compress || con_compress) - mysql_options(&next_con->mysql, MYSQL_OPT_COMPRESS, NullS); - mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0); - mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME, + mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS); + mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0); + mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_NAME, charset_info->csname); if (opt_charsets_dir) mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_DIR, @@ -3752,12 +3801,12 @@ void do_connect(struct st_command *command) #ifdef HAVE_OPENSSL if (opt_use_ssl || con_ssl) { - mysql_ssl_set(&next_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, + mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, opt_ssl_capath, opt_ssl_cipher); #if MYSQL_VERSION_ID >= 50000 /* Turn on ssl_verify_server_cert only if host is "localhost" */ opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost"); - mysql_options(&next_con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, + mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &opt_ssl_verify_server_cert); #endif } @@ -3771,16 +3820,19 @@ void do_connect(struct st_command *command) if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*")) dynstr_set(&ds_database, ""); - if (connect_n_handle_errors(command, &next_con->mysql, + if (connect_n_handle_errors(command, &con_slot->mysql, ds_host.str,ds_user.str, ds_password.str, ds_database.str, con_port, ds_sock.str)) { DBUG_PRINT("info", ("Inserting connection %s in connection pool", ds_connection_name.str)); - if (!(next_con->name= my_strdup(ds_connection_name.str, MYF(MY_WME)))) + if (!(con_slot->name= my_strdup(ds_connection_name.str, MYF(MY_WME)))) die("Out of memory"); - cur_con= next_con++; + cur_con= con_slot; + + if (con_slot == next_con) + next_con++; /* if we used the next_con slot, advance the pointer */ } dynstr_free(&ds_connection_name); @@ -6349,6 +6401,7 @@ int main(int argc, char **argv) case Q_WRITE_FILE: do_write_file(command); break; case Q_APPEND_FILE: do_append_file(command); break; case Q_DIFF_FILES: do_diff_files(command); break; + case Q_SEND_QUIT: do_send_quit(command); break; case Q_CAT_FILE: do_cat_file(command); break; case Q_COPY_FILE: do_copy_file(command); break; case Q_CHMOD_FILE: do_chmod_file(command); break; diff --git a/extra/yassl/include/openssl/ssl.h b/extra/yassl/include/openssl/ssl.h index 7dd33e3fcad..efd0dec75b6 100644 --- a/extra/yassl/include/openssl/ssl.h +++ b/extra/yassl/include/openssl/ssl.h @@ -277,6 +277,8 @@ int SSL_session_reused(SSL*); int SSL_set_rfd(SSL*, int); int SSL_set_wfd(SSL*, int); void SSL_set_shutdown(SSL*, int); +void SSL_set_quiet_shutdown(SSL *ssl,int mode); +int SSL_get_quiet_shutdown(SSL *ssl); int SSL_want_read(SSL*); int SSL_want_write(SSL*); diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp index 94cb85c3300..b207f0bffbd 100644 --- a/extra/yassl/include/yassl_int.hpp +++ b/extra/yassl/include/yassl_int.hpp @@ -584,6 +584,7 @@ class SSL { Socket socket_; // socket wrapper Buffers buffers_; // buffered handshakes and data Log log_; // logger + bool quietShutdown_; // optimization variables bool has_data_; // buffered data ready? @@ -610,6 +611,7 @@ public: Buffers& useBuffers(); bool HasData() const; + bool GetQuietShutdown() const; // sets void set_pending(Cipher suite); @@ -621,6 +623,7 @@ public: void SetError(YasslError); int SetCompression(); void UnSetCompression(); + void SetQuietShutdown(bool mode); // helpers bool isTLS() const; diff --git a/extra/yassl/src/ssl.cpp b/extra/yassl/src/ssl.cpp index 86dfa1c6ebd..c3d580a93ab 100644 --- a/extra/yassl/src/ssl.cpp +++ b/extra/yassl/src/ssl.cpp @@ -411,8 +411,10 @@ int SSL_clear(SSL* ssl) int SSL_shutdown(SSL* ssl) { - Alert alert(warning, close_notify); - sendAlert(*ssl, alert); + if (!ssl->GetQuietShutdown()) { + Alert alert(warning, close_notify); + sendAlert(*ssl, alert); + } ssl->useLog().ShowTCP(ssl->getSocket().get_fd(), true); GetErrors().Remove(); @@ -421,6 +423,18 @@ int SSL_shutdown(SSL* ssl) } +void SSL_set_quiet_shutdown(SSL *ssl,int mode) +{ + ssl->SetQuietShutdown(mode != 0); +} + + +int SSL_get_quiet_shutdown(SSL *ssl) +{ + return ssl->GetQuietShutdown(); +} + + /* on by default but allow user to turn off */ long SSL_CTX_set_session_cache_mode(SSL_CTX* ctx, long mode) { diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index ae16abf9e49..ba4678d70b9 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -291,7 +291,7 @@ const ClientKeyFactory& sslFactory::getClientKey() const SSL::SSL(SSL_CTX* ctx) : secure_(ctx->getMethod()->getVersion(), crypto_.use_random(), ctx->getMethod()->getSide(), ctx->GetCiphers(), ctx, - ctx->GetDH_Parms().set_), has_data_(false) + ctx->GetDH_Parms().set_), has_data_(false), quietShutdown_(false) { if (int err = crypto_.get_random().GetError()) { SetError(YasslError(err)); @@ -773,6 +773,12 @@ void SSL::SetError(YasslError ye) // TODO: add string here } +// set the quiet shutdown mode (close_nofiy not sent or received on shutdown) +void SSL::SetQuietShutdown(bool mode) +{ + quietShutdown_ = mode; +} + Buffers& SSL::useBuffers() { @@ -1330,6 +1336,12 @@ YasslError SSL::GetError() const } +bool SSL::GetQuietShutdown() const +{ + return quietShutdown_; +} + + bool SSL::GetMultiProtocol() const { return secure_.GetContext()->getMethod()->multipleProtocol(); diff --git a/mysql-test/r/ssl-big.result b/mysql-test/r/ssl-big.result new file mode 100644 index 00000000000..39c4f34e46c --- /dev/null +++ b/mysql-test/r/ssl-big.result @@ -0,0 +1,3 @@ +DROP TABLE IF EXISTS t1, t2; +create table t1 (a int); +drop table t1; diff --git a/mysql-test/t/ssl-big.test b/mysql-test/t/ssl-big.test new file mode 100644 index 00000000000..099c64df08f --- /dev/null +++ b/mysql-test/t/ssl-big.test @@ -0,0 +1,56 @@ +# Turn on ssl between the client and server +# and run a number of tests + +-- source include/have_ssl.inc +-- source include/big_test.inc + +--disable_warnings +DROP TABLE IF EXISTS t1, t2; +--enable_warnings + +# +# Bug #29579 Clients using SSL can hang the server +# + +connect (ssl_con,localhost,root,,,,,SSL); + +create table t1 (a int); + +disconnect ssl_con; + + +--disable_query_log +--disable_result_log + +let $count= 2000; +while ($count) +{ + connect (ssl_con,localhost,root,,,,,SSL); + + eval insert into t1 values ($count); + dec $count; + + # This select causes the net buffer to fill as the server sends the results + # but the client doesn't reap the results. The results are larger each time + # through the loop, so that eventually the buffer is completely full + # at the exact moment the server attempts to the close the connection with + # the lock held. + send select * from t1; + + # now send the quit the command so the server will initiate the shutdown. + send_quit ssl_con; + + # if the server is hung, this will hang too: + connect (ssl_con2,localhost,root,,,,,SSL); + + # no hang if we get here, close and retry + disconnect ssl_con2; + disconnect ssl_con; +} +--enable_query_log +--enable_result_log + +connect (ssl_con,localhost,root,,,,,SSL); + +drop table t1; + diff --git a/mysql-test/t/ssl_big.test b/mysql-test/t/ssl_big.test new file mode 100644 index 00000000000..58c11899e55 --- /dev/null +++ b/mysql-test/t/ssl_big.test @@ -0,0 +1,62 @@ +# Turn on ssl between the client and server +# and run a number of tests + +-- source include/have_ssl.inc + +connect (ssl_con,localhost,root,,,,,SSL); + +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; + +# Source select test case +-- source include/common-tests.inc + +# Check ssl turned on +SHOW STATUS LIKE 'Ssl_cipher'; + +disconnect ssl_con; + + +# +# Bug #29579 Clients using SSL can hang the server +# + +connect (ssl_con,localhost,root,,,,,SSL); + +create table t1 (a int); + +disconnect ssl_con; + +let $count= 2000; +while ($count) +{ + + connect (ssl_con,localhost,root,,,,,SSL); + + let $i= 1; + while ($i) + { + eval insert into t1 values ($count); + dec $count; + dec $i; + } + + # This select causes the net buffer to fill as the server sends the results + # but the client doesn't reap the results. The results are larger each time + # through the loop, so that eventually the buffer is completely full + # at the exact moment the server attempts to the close the connection with + # the lock held. + send select * from t1; + + # now send the quit the command so the server will initiate the shutdown. + send_quit ssl_con; + + # if the server is hung, this will hang too: + connect (ssl_con2,localhost,root,,,,,SSL); + + # no hang if we get here, close and retry + disconnect ssl_con2; + + disconnect ssl_con; +} + diff --git a/vio/viossl.c b/vio/viossl.c index 5e4203a3fb5..861989136d3 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -123,6 +123,16 @@ int vio_ssl_close(Vio *vio) if (ssl) { + /* + THE SSL standard says that SSL sockets must send and receive a close_notify + alert on socket shutdown to avoid truncation attacks. However, this can + cause problems since we often hold a lock during shutdown and this IO can + take an unbounded amount of time to complete. Since our packets are self + describing with length, we aren't vunerable to these attacks. Therefore, + we just shutdown by closing the socket (quiet shutdown). + */ + SSL_set_quiet_shutdown(ssl, 1); + switch ((r= SSL_shutdown(ssl))) { case 1: From 4bbeef1c123213fc73fe8bb23f77607176c06086 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 00:45:54 -0400 Subject: [PATCH 155/227] Minor fixes for test failures and compiler warnings for Bug #29579. BitKeeper/deleted/.del-ssl_big.test: Delete: mysql-test/t/ssl_big.test extra/yassl/include/yassl_int.hpp: added comment extra/yassl/src/yassl_int.cpp: Changed init order to fix a compiler warning. mysql-test/r/mysqltest.result: There is no limit to connections anymore. mysql-test/t/mysqltest.test: There is no limit to connections anymore. --- extra/yassl/include/yassl_int.hpp | 2 +- extra/yassl/src/yassl_int.cpp | 2 +- mysql-test/r/mysqltest.result | 2 +- mysql-test/t/mysqltest.test | 2 +- mysql-test/t/ssl_big.test | 62 ------------------------------- 5 files changed, 4 insertions(+), 66 deletions(-) delete mode 100644 mysql-test/t/ssl_big.test diff --git a/extra/yassl/include/yassl_int.hpp b/extra/yassl/include/yassl_int.hpp index b207f0bffbd..b7bd35f5fa2 100644 --- a/extra/yassl/include/yassl_int.hpp +++ b/extra/yassl/include/yassl_int.hpp @@ -584,7 +584,7 @@ class SSL { Socket socket_; // socket wrapper Buffers buffers_; // buffered handshakes and data Log log_; // logger - bool quietShutdown_; + bool quietShutdown_; // shutdown without handshakes // optimization variables bool has_data_; // buffered data ready? diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index ba4678d70b9..f5ab2f200a5 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -291,7 +291,7 @@ const ClientKeyFactory& sslFactory::getClientKey() const SSL::SSL(SSL_CTX* ctx) : secure_(ctx->getMethod()->getVersion(), crypto_.use_random(), ctx->getMethod()->getSide(), ctx->GetCiphers(), ctx, - ctx->GetDH_Parms().set_), has_data_(false), quietShutdown_(false) + ctx->GetDH_Parms().set_), quietShutdown_(false), has_data_(false) { if (int err = crypto_.get_random().GetError()) { SetError(YasslError(err)); diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 8cf5f99dca3..55f78d22272 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -420,7 +420,7 @@ mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1 mysqltest: At line 1: Illegal argument for port: 'illegal_port' mysqltest: At line 1: Illegal option to connect: SMTP OK -mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 7: Connection limit exhausted, you can have max 128 connections +mysqltest: The test didn't produce any output mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 3: connection 'test_con1' not found in connection pool mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql": At line 2: Connection test_con1 already exists connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET); diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index aa0e2f89382..b01579dce53 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1263,7 +1263,7 @@ while ($i) EOF --exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql; echo OK;" | $MYSQL_TEST 2>&1 -# Repeat connect/disconnect, exceed max number of connections +# Repeat connect/disconnect --write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql let $i=200; while ($i) diff --git a/mysql-test/t/ssl_big.test b/mysql-test/t/ssl_big.test deleted file mode 100644 index 58c11899e55..00000000000 --- a/mysql-test/t/ssl_big.test +++ /dev/null @@ -1,62 +0,0 @@ -# Turn on ssl between the client and server -# and run a number of tests - --- source include/have_ssl.inc - -connect (ssl_con,localhost,root,,,,,SSL); - -# Check ssl turned on -SHOW STATUS LIKE 'Ssl_cipher'; - -# Source select test case --- source include/common-tests.inc - -# Check ssl turned on -SHOW STATUS LIKE 'Ssl_cipher'; - -disconnect ssl_con; - - -# -# Bug #29579 Clients using SSL can hang the server -# - -connect (ssl_con,localhost,root,,,,,SSL); - -create table t1 (a int); - -disconnect ssl_con; - -let $count= 2000; -while ($count) -{ - - connect (ssl_con,localhost,root,,,,,SSL); - - let $i= 1; - while ($i) - { - eval insert into t1 values ($count); - dec $count; - dec $i; - } - - # This select causes the net buffer to fill as the server sends the results - # but the client doesn't reap the results. The results are larger each time - # through the loop, so that eventually the buffer is completely full - # at the exact moment the server attempts to the close the connection with - # the lock held. - send select * from t1; - - # now send the quit the command so the server will initiate the shutdown. - send_quit ssl_con; - - # if the server is hung, this will hang too: - connect (ssl_con2,localhost,root,,,,,SSL); - - # no hang if we get here, close and retry - disconnect ssl_con2; - - disconnect ssl_con; -} - From d3d38d0b14e6ad4acfcd89a7ef8c6b7eaef23e8a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 01:55:04 -0400 Subject: [PATCH 156/227] When opening a new connecgtion, changed mysqltest to prefer a brand new connection slot over an existing, closed slot. Fixes a problem with reused slots that can cause tests to fail. bug#29579 client/mysqltest.c: When opening a new connecgtion, changed mysqltest to prefer a brand new connection slot over an existing, closed slot. Fixes a problem with reused slots that can cause tests to fail. --- client/mysqltest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 2e964056a73..d1ec753b54b 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3777,14 +3777,14 @@ void do_connect(struct st_command *command) if (find_connection_by_name(ds_connection_name.str)) die("Connection %s already exists", ds_connection_name.str); - - if (!(con_slot= find_connection_by_name("-closed_connection-"))) + + if (next_con != connections_end) + con_slot= next_con; + else { - if (next_con == connections_end) + if (!(con_slot= find_connection_by_name("-closed_connection-"))) die("Connection limit exhausted, you can have max %d connections", (int) (sizeof(connections)/sizeof(struct st_connection))); - - con_slot= next_con; } if (!mysql_init(&con_slot->mysql)) From b806ca22c6bcab929c0121d23f686a0484e64ed1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 13:56:22 +0300 Subject: [PATCH 157/227] Bug 29325: moved the test from create_not_windows to symlink. --- mysql-test/r/create_not_windows.result | 22 --------------- mysql-test/r/symlink.result | 24 ++++++++++++++++ mysql-test/t/create_not_windows.test | 38 -------------------------- mysql-test/t/symlink.test | 36 ++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/mysql-test/r/create_not_windows.result b/mysql-test/r/create_not_windows.result index a07ffa82610..b975c98c2b1 100644 --- a/mysql-test/r/create_not_windows.result +++ b/mysql-test/r/create_not_windows.result @@ -12,25 +12,3 @@ about:text CREATE TABLE `about:text` ( PRIMARY KEY (`_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table `about:text`; -CREATE DATABASE db1; -CREATE DATABASE db2; -USE db2; -INSERT INTO db2.t1 VALUES (1); -SELECT * FROM db2.t1; -b -1 -RESET QUERY CACHE; -USE db1; -SET SESSION keep_files_on_create = TRUE; -CREATE TABLE t1 (a INT) ENGINE MYISAM; -ERROR HY000: Can't create/write to file './db1/t1.MYD' (Errcode: 17) -CREATE TABLE t3 (a INT) Engine=MyISAM; -INSERT INTO t3 VALUES (1),(2),(3); -TRUNCATE TABLE t3; -SELECT * from t3; -a -SET SESSION keep_files_on_create = DEFAULT; -DROP TABLE db2.t1, db1.t3; -DROP DATABASE db1; -DROP DATABASE db2; -USE test; diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result index 4725bcc0ac9..02c3a085eef 100644 --- a/mysql-test/r/symlink.result +++ b/mysql-test/r/symlink.result @@ -133,4 +133,28 @@ a 42 drop table t1; End of 4.1 tests +CREATE DATABASE db1; +CREATE DATABASE db2; +USE db2; +CREATE TABLE t1 (b INT) ENGINE MYISAM +DATA DIRECTORY = '/home/kgeorge/mysql/work/B29325-winfix-5.0-opt/mysql-test/var/master-data/db1/'; +INSERT INTO db2.t1 VALUES (1); +SELECT * FROM db2.t1; +b +1 +RESET QUERY CACHE; +USE db1; +SET SESSION keep_files_on_create = TRUE; +CREATE TABLE t1 (a INT) ENGINE MYISAM; +ERROR HY000: Can't create/write to file './db1/t1.MYD' (Errcode: 17) +CREATE TABLE t3 (a INT) Engine=MyISAM; +INSERT INTO t3 VALUES (1),(2),(3); +TRUNCATE TABLE t3; +SELECT * from t3; +a +SET SESSION keep_files_on_create = DEFAULT; +DROP TABLE db2.t1, db1.t3; +DROP DATABASE db1; +DROP DATABASE db2; +USE test; End of 5.0 tests diff --git a/mysql-test/t/create_not_windows.test b/mysql-test/t/create_not_windows.test index c6547b1376b..7e51ff51024 100644 --- a/mysql-test/t/create_not_windows.test +++ b/mysql-test/t/create_not_windows.test @@ -18,42 +18,4 @@ show create table `about:text`; drop table `about:text`; -# -# Bug #29325: create table overwrites .MYD file of other table (datadir) -# - -CREATE DATABASE db1; -CREATE DATABASE db2; - -USE db2; ---disable_query_log -eval CREATE TABLE t1 (b INT) ENGINE MYISAM -DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/'; ---enable_query_log - -INSERT INTO db2.t1 VALUES (1); -SELECT * FROM db2.t1; -RESET QUERY CACHE; - -USE db1; - -#no warning from create table -SET SESSION keep_files_on_create = TRUE; ---disable_abort_on_error -CREATE TABLE t1 (a INT) ENGINE MYISAM; ---enable_abort_on_error - -CREATE TABLE t3 (a INT) Engine=MyISAM; -INSERT INTO t3 VALUES (1),(2),(3); -TRUNCATE TABLE t3; -SELECT * from t3; - -SET SESSION keep_files_on_create = DEFAULT; - -DROP TABLE db2.t1, db1.t3; -DROP DATABASE db1; -DROP DATABASE db2; -USE test; - - # End of 5.0 tests diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index d79b6905224..46a9ead5829 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -178,4 +178,40 @@ drop table t1; --echo End of 4.1 tests +# +# Bug #29325: create table overwrites .MYD file of other table (datadir) +# + +CREATE DATABASE db1; +CREATE DATABASE db2; + +USE db2; +eval CREATE TABLE t1 (b INT) ENGINE MYISAM +DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/'; + +INSERT INTO db2.t1 VALUES (1); +SELECT * FROM db2.t1; +RESET QUERY CACHE; + +USE db1; + +#no warning from create table +SET SESSION keep_files_on_create = TRUE; +--disable_abort_on_error +CREATE TABLE t1 (a INT) ENGINE MYISAM; +--enable_abort_on_error + +CREATE TABLE t3 (a INT) Engine=MyISAM; +INSERT INTO t3 VALUES (1),(2),(3); +TRUNCATE TABLE t3; +SELECT * from t3; + +SET SESSION keep_files_on_create = DEFAULT; + +DROP TABLE db2.t1, db1.t3; +DROP DATABASE db1; +DROP DATABASE db2; +USE test; + + --echo End of 5.0 tests From fe6d5d631d52f28188f1c45dda661cad54e95c41 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 14:31:40 +0200 Subject: [PATCH 158/227] avoid some sporadic startup issues --- mysql-test/include/have_ndb.inc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc index cb2f2f7cd9e..d087a45a15a 100644 --- a/mysql-test/include/have_ndb.inc +++ b/mysql-test/include/have_ndb.inc @@ -1,6 +1,10 @@ # Check that server is compiled and started with support for NDB -disable_query_log; ---require r/true.require -select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster'; ---source include/ndb_not_readonly.inc -enable_query_log; +#disable_query_log; +#--require r/true.require +#select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster'; +#--source include/ndb_not_readonly.inc +#enable_query_log; +# always make sure we have both mysql servers started ok before test starts +# there are some initial startup bugs that are avoided by doing this, avoiding sporadic +# failures in mysql-test-run +--source include/have_multi_ndb.inc From 701dfda11b529643693cc18e23bd48e39e71503b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 15:30:36 +0200 Subject: [PATCH 159/227] Bug #29762 The ndbapi-examples don't work as expected due to api changes in MySQL 5.1.16] --- .../ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp b/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp index 0a4f6d92f2c..4e82fc3e42b 100644 --- a/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp +++ b/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp @@ -281,12 +281,14 @@ static void do_read(Ndb &myNdb) if (myRecAttr == NULL) APIERROR(myTransaction->getNdbError()); if(myTransaction->execute( NdbTransaction::Commit ) == -1) - if (i == 3) { - std::cout << "Detected that deleted tuple doesn't exist!" << std::endl; - } else { - APIERROR(myTransaction->getNdbError()); - } + APIERROR(myTransaction->getNdbError()); + if (myTransaction->getNdbError().classification == NdbError::NoDataFound) + if (i == 3) + std::cout << "Detected that deleted tuple doesn't exist!" << std::endl; + else + APIERROR(myTransaction->getNdbError()); + if (i != 3) { printf(" %2d %2d\n", i, myRecAttr->u_32_value()); } From 2a0498c0f9a67676aedef2699fe5a14150ce5f4d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 16:32:29 +0300 Subject: [PATCH 160/227] disabled the output of the full path in tesing bug 29325 --- mysql-test/r/symlink.result | 2 -- mysql-test/t/symlink.test | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result index 02c3a085eef..18299bf4298 100644 --- a/mysql-test/r/symlink.result +++ b/mysql-test/r/symlink.result @@ -136,8 +136,6 @@ End of 4.1 tests CREATE DATABASE db1; CREATE DATABASE db2; USE db2; -CREATE TABLE t1 (b INT) ENGINE MYISAM -DATA DIRECTORY = '/home/kgeorge/mysql/work/B29325-winfix-5.0-opt/mysql-test/var/master-data/db1/'; INSERT INTO db2.t1 VALUES (1); SELECT * FROM db2.t1; b diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 46a9ead5829..8c67a4c1048 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -186,8 +186,10 @@ CREATE DATABASE db1; CREATE DATABASE db2; USE db2; +--disable_query_log eval CREATE TABLE t1 (b INT) ENGINE MYISAM DATA DIRECTORY = '$MYSQLTEST_VARDIR/master-data/db1/'; +--enable_query_log INSERT INTO db2.t1 VALUES (1); SELECT * FROM db2.t1; From 23ab9bd4db3f8c497b0b88e46034f6c957946fce Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 16:06:12 +0200 Subject: [PATCH 161/227] update bug dependency on failing test mysql-test/suite/ndb/t/ndb_binlog_format.test: Rename: mysql-test/t/ndb_binlog_format.test -> mysql-test/suite/ndb/t/ndb_binlog_format.test mysql-test/suite/ndb/r/ndb_binlog_format.result: Rename: mysql-test/r/ndb_binlog_format.result -> mysql-test/suite/ndb/r/ndb_binlog_format.result --- mysql-test/{ => suite/ndb}/r/ndb_binlog_format.result | 0 mysql-test/{ => suite/ndb}/t/ndb_binlog_format.test | 0 mysql-test/suite/rpl_ndb/t/disabled.def | 5 ++--- 3 files changed, 2 insertions(+), 3 deletions(-) rename mysql-test/{ => suite/ndb}/r/ndb_binlog_format.result (100%) rename mysql-test/{ => suite/ndb}/t/ndb_binlog_format.test (100%) diff --git a/mysql-test/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result similarity index 100% rename from mysql-test/r/ndb_binlog_format.result rename to mysql-test/suite/ndb/r/ndb_binlog_format.result diff --git a/mysql-test/t/ndb_binlog_format.test b/mysql-test/suite/ndb/t/ndb_binlog_format.test similarity index 100% rename from mysql-test/t/ndb_binlog_format.test rename to mysql-test/suite/ndb/t/ndb_binlog_format.test diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index f5c99129c89..e4c1d875a67 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -15,9 +15,8 @@ rpl_ndb_circular_simplex : BUG#27972 2007-04-20 mats Slave cannot start where it rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2myisam : BUG#19227 Seems to pass currently rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD -rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement -rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement -#rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly +rpl_ndb_innodb2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue +rpl_ndb_myisam2ndb : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb failed on Solaris for pack_length issue rpl_ndb_ddl : BUG#28798 2007-05-31 lars Valgrind failure in NDB rpl_ndb_mix_innodb : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core on sol10-sparc-a rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld default multibyte charset From 38f4c6137a64192a962ad9d357055ced0f9150fa Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 19:13:40 +0400 Subject: [PATCH 162/227] BUG#29740: Wrong query results for index_merge/union over HEAP table. - return HA_KEY_SCAN_NOT_ROR flag for HASH indexes; - Fix ha_heap::cmp_ref() to work with BTREE index scans. mysql-test/r/index_merge.result: BUG#29740: testcase mysql-test/t/index_merge.test: BUG#29740: testcase sql/ha_heap.h: BUG#29740: Wrong query results for index_merge/union over HEAP table. - make HEAP table engine return HA_KEY_SCAN_NOT_ROR flag for HASH indexes,as HASH index does not guarantee any ordering for rows within the hash bucket. - Fix BTREE indexes: make ha_heap::cmp_ref() compare the rowids in the same way as ha_key_cmp() does. sql/opt_range.cc: BUG#29740: Fix comment about ROR scans. --- mysql-test/r/index_merge.result | 61 +++++++++++++++++++++++++++++++++ mysql-test/t/index_merge.test | 43 +++++++++++++++++++++++ sql/ha_heap.h | 8 ++--- sql/opt_range.cc | 25 ++++++-------- 4 files changed, 118 insertions(+), 19 deletions(-) diff --git a/mysql-test/r/index_merge.result b/mysql-test/r/index_merge.result index 9456b4ec978..c7e4ead9eeb 100644 --- a/mysql-test/r/index_merge.result +++ b/mysql-test/r/index_merge.result @@ -455,3 +455,64 @@ a 1 UNLOCK TABLES; DROP TABLE t1, t2; +CREATE TABLE `t1` ( +`a` int(11) DEFAULT NULL, +`filler` char(200) DEFAULT NULL, +`b` int(11) DEFAULT NULL, +KEY `a` (`a`), +KEY `b` (`b`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1; +insert into t1 values +(0, 'filler', 0), (1, 'filler', 1), (2, 'filler', 2), (3, 'filler', 3), +(4, 'filler', 4), (5, 'filler', 5), (6, 'filler', 6), (7, 'filler', 7), +(8, 'filler', 8), (9, 'filler', 9), (0, 'filler', 0), (1, 'filler', 1), +(2, 'filler', 2), (3, 'filler', 3), (4, 'filler', 4), (5, 'filler', 5), +(6, 'filler', 6), (7, 'filler', 7), (8, 'filler', 8), (9, 'filler', 9), +(10, 'filler', 10), (11, 'filler', 11), (12, 'filler', 12), (13, 'filler', 13), +(14, 'filler', 14), (15, 'filler', 15), (16, 'filler', 16), (17, 'filler', 17), +(18, 'filler', 18), (19, 'filler', 19), (4, '5 ', 0), (5, '4 ', 0), +(4, '4 ', 0), (4, 'qq ', 5), (5, 'qq ', 4), (4, 'zz ', 4); +create table t2( +`a` int(11) DEFAULT NULL, +`filler` char(200) DEFAULT NULL, +`b` int(11) DEFAULT NULL, +KEY USING BTREE (`a`), +KEY USING BTREE (`b`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1; +insert into t2 select * from t1; +must use sort-union rather than union: +explain select * from t1 where a=4 or b=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 4 Using sort_union(a,b); Using where +select * from t1 where a=4 or b=4; +a filler b +4 zz 4 +5 qq 4 +4 filler 4 +4 qq 5 +4 4 0 +4 filler 4 +4 5 0 +select * from t1 ignore index(a,b) where a=4 or b=4; +a filler b +4 filler 4 +4 filler 4 +4 5 0 +4 4 0 +4 qq 5 +5 qq 4 +4 zz 4 +must use union, not sort-union: +explain select * from t2 where a=4 or b=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index_merge a,b a,b 5,5 NULL 7 Using union(a,b); Using where +select * from t2 where a=4 or b=4; +a filler b +4 5 0 +4 zz 4 +5 qq 4 +4 filler 4 +4 qq 5 +4 4 0 +4 filler 4 +drop table t1, t2; diff --git a/mysql-test/t/index_merge.test b/mysql-test/t/index_merge.test index 30eb0b40fca..7d9a4340b0f 100644 --- a/mysql-test/t/index_merge.test +++ b/mysql-test/t/index_merge.test @@ -415,3 +415,46 @@ INSERT INTO t2(a,b) VALUES(1,2); SELECT t2.a FROM t1,t2 WHERE t2.b=2 AND t2.a=1; UNLOCK TABLES; DROP TABLE t1, t2; + +# +# BUG#29740: HA_KEY_SCAN_NOT_ROR wasn't set for HEAP engine +# +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `filler` char(200) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY `a` (`a`), + KEY `b` (`b`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1; + +insert into t1 values +(0, 'filler', 0), (1, 'filler', 1), (2, 'filler', 2), (3, 'filler', 3), +(4, 'filler', 4), (5, 'filler', 5), (6, 'filler', 6), (7, 'filler', 7), +(8, 'filler', 8), (9, 'filler', 9), (0, 'filler', 0), (1, 'filler', 1), +(2, 'filler', 2), (3, 'filler', 3), (4, 'filler', 4), (5, 'filler', 5), +(6, 'filler', 6), (7, 'filler', 7), (8, 'filler', 8), (9, 'filler', 9), +(10, 'filler', 10), (11, 'filler', 11), (12, 'filler', 12), (13, 'filler', 13), +(14, 'filler', 14), (15, 'filler', 15), (16, 'filler', 16), (17, 'filler', 17), +(18, 'filler', 18), (19, 'filler', 19), (4, '5 ', 0), (5, '4 ', 0), +(4, '4 ', 0), (4, 'qq ', 5), (5, 'qq ', 4), (4, 'zz ', 4); + +create table t2( + `a` int(11) DEFAULT NULL, + `filler` char(200) DEFAULT NULL, + `b` int(11) DEFAULT NULL, + KEY USING BTREE (`a`), + KEY USING BTREE (`b`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1; +insert into t2 select * from t1; + +--echo must use sort-union rather than union: +explain select * from t1 where a=4 or b=4; +select * from t1 where a=4 or b=4; +select * from t1 ignore index(a,b) where a=4 or b=4; + +--echo must use union, not sort-union: +explain select * from t2 where a=4 or b=4; +select * from t2 where a=4 or b=4; + +drop table t1, t2; + diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 18389c1298d..27846ca4a8e 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -54,8 +54,8 @@ public: ulong index_flags(uint inx, uint part, bool all_parts) const { return ((table->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ? - HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE : - HA_ONLY_WHOLE_INDEX); + HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE : + HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR); } const key_map *keys_to_use_for_scanning() { return &btree_keys; } uint max_supported_keys() const { return MAX_KEY; } @@ -101,9 +101,7 @@ public: enum thr_lock_type lock_type); int cmp_ref(const byte *ref1, const byte *ref2) { - HEAP_PTR ptr1=*(HEAP_PTR*)ref1; - HEAP_PTR ptr2=*(HEAP_PTR*)ref2; - return ptr1 < ptr2? -1 : (ptr1 > ptr2? 1 : 0); + return memcmp(ref1, ref2, sizeof(HEAP_PTR)); } private: void update_key_stats(); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index c3aa1f52556..952e5abfd13 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -6007,27 +6007,24 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree, ROR (Rowid Ordered Retrieval) key scan is a key scan that produces ordered sequence of rowids (ha_xxx::cmp_ref is the comparison function) - An index scan is a ROR scan if it is done using a condition in form + This function is needed to handle a practically-important special case: + an index scan is a ROR scan if it is done using a condition in form - "key1_1=c_1 AND ... AND key1_n=c_n" (1) + "key1_1=c_1 AND ... AND key1_n=c_n" where the index is defined on (key1_1, ..., key1_N [,a_1, ..., a_n]) - and the table has a clustered Primary Key + and the table has a clustered Primary Key defined as - PRIMARY KEY(a_1, ..., a_n, b1, ..., b_k) with first key parts being - identical to uncovered parts ot the key being scanned (2) - - Scans on HASH indexes are not ROR scans, - any range scan on clustered primary key is ROR scan (3) - - Check (1) is made in check_quick_keys() - Check (3) is made check_quick_select() - Check (2) is made by this function. + PRIMARY KEY(a_1, ..., a_n, b1, ..., b_k) + + i.e. the first key parts of it are identical to uncovered parts ot the + key being scanned. This function assumes that the index flags do not + include HA_KEY_SCAN_NOT_ROR flag (that is checked elsewhere). RETURN - TRUE If the scan is ROR-scan - FALSE otherwise + TRUE The scan is ROR-scan + FALSE Otherwise */ static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts) From a7e5f73abb9da35a1c199b89df84596cffe59901 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 17:50:58 +0200 Subject: [PATCH 163/227] Bug#27198: Error returns from time() are ignored gettimeofday() can fail and presumably, so can time(). Keep an eye on it. Since we have no data on this at all so far, we just retry on failure (and log the event), assuming that this is just an intermittant failure. This might of course hang the threat until we succeed. Once we know more about these failures, an appropriate more clever scheme may be picked (only try so many times per thread, etc., if that fails, return last "good" time() we got or some such). Using sql_print_information() to log as this probably only occurs in high load scenarios where the debug- trace likely is disabled (or might interfere with testing the effect). No test-case as this is a non-deterministic issue. sql/mysql_priv.h: Bug#27198: Error returns from time() are ignored move declarations for log.cc to before inclusion of sql_class.h as we now use sql_print_information() in there. sql/sql_class.h: Bug#27198: Error returns from time() are ignored gettimeofday() can fail and presumably, so can time(). Keep an eye on it. --- sql/mysql_priv.h | 17 ++++++++--------- sql/sql_class.h | 26 +++++++++++++++++++++----- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3972a01f7ba..173bfe678e8 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -302,6 +302,14 @@ inline THD *_current_thd(void) } #define current_thd _current_thd() +/* log.cc */ +void sql_perror(const char *message); + +void vprint_msg_to_log( enum loglevel level, const char *format, va_list args ); +void sql_print_error( const char *format, ... ); +void sql_print_warning( const char *format, ...); +void sql_print_information( const char *format, ...); + #include "sql_string.h" #include "sql_list.h" #include "sql_map.h" @@ -657,15 +665,6 @@ void key_unpack(String *to,TABLE *form,uint index); bool check_if_key_used(TABLE *table, uint idx, List &fields); void init_errmessage(void); -void sql_perror(const char *message); - -void vprint_msg_to_log( enum loglevel level, const char *format, va_list args ); -void sql_print_error( const char *format, ... ); -void sql_print_warning( const char *format, ...); -void sql_print_information( const char *format, ...); - - - bool fn_format_relative_to_data_home(my_string to, const char *name, const char *dir, const char *extension); bool open_log(MYSQL_LOG *log, const char *hostname, diff --git a/sql/sql_class.h b/sql/sql_class.h index 17d371d3dc0..25828ac2b7e 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -569,17 +569,33 @@ public: proc_info = old_msg; pthread_mutex_unlock(&mysys_var->mutex); } + + static inline void safe_time(time_t *t) + { + /** + Wrapper around time() which retries on error (-1) + + @details + This is needed because, despite the documentation, time() may fail + in some circumstances. Here we retry time() until it succeeds, and + log the failure so that performance problems related to this can be + identified. + */ + while(unlikely(time(t) == ((time_t) -1))) + sql_print_information("time() failed with %d", errno); + } + inline time_t query_start() { query_start_used=1; return start_time; } - inline void set_time() { if (user_time) start_time=time_after_lock=user_time; else time_after_lock=time(&start_time); } - inline void end_time() { time(&start_time); } + inline void set_time() { if (user_time) start_time=time_after_lock=user_time; else { safe_time(&start_time); time_after_lock= start_time; }} + inline void end_time() { safe_time(&start_time); } inline void set_time(time_t t) { time_after_lock=start_time=user_time=t; } - inline void lock_time() { time(&time_after_lock); } + inline void lock_time() { safe_time(&time_after_lock); } inline void insert_id(ulonglong id) { last_insert_id=id; insert_id_used=1; } inline ulonglong insert_id(void) { if (!last_insert_id_used) - { + { last_insert_id_used=1; current_insert_id=last_insert_id; } @@ -588,7 +604,7 @@ public: inline ulonglong found_rows(void) { return limit_found_rows; - } + } inline bool active_transaction() { #ifdef USING_TRANSACTIONS From 3a979065e90b8938f88307fa4dbd762b8d786e0b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 18:32:22 +0200 Subject: [PATCH 164/227] Additional tests checking for symptoms observed within Bug28309 First insert violates unique constraint - was "memory" table empty ? --- Add missing phony targets Makefile.am: Add execution of the ddl stress tests. (modified) test-bt: Short running variant added (new) test-ext-stress: Longer running variant (modified) test-ext: test-ext-stress added (modified) test-fast: Short running variant with MyISAM only added --- Declare test-ext-jp and test-ext-stress to PHONY make targets. mysql-test/suite/stress/include/ddl.cln: Script for cleanup at execution end mysql-test/suite/stress/include/ddl.pre: Script for general preparations at execution start mysql-test/suite/stress/include/ddl1.inc: ddl stress script mysql-test/suite/stress/include/ddl2.inc: ddl stress script mysql-test/suite/stress/include/ddl3.inc: ddl stress script mysql-test/suite/stress/include/ddl4.inc: ddl stress script mysql-test/suite/stress/include/ddl5.inc: ddl stress script mysql-test/suite/stress/include/ddl6.inc: ddl stress script mysql-test/suite/stress/include/ddl7.inc: ddl stress script mysql-test/suite/stress/include/ddl8.inc: ddl stress script mysql-test/suite/stress/r/ddl_archive.result: File with expected results mysql-test/suite/stress/r/ddl_csv.result: File with expected results mysql-test/suite/stress/r/ddl_innodb.result: File with expected results mysql-test/suite/stress/r/ddl_memory.result: File with expected results mysql-test/suite/stress/r/ddl_myisam.result: File with expected results mysql-test/suite/stress/r/ddl_ndb.result: File with expected results mysql-test/suite/stress/t/ddl_archive.test: Storage engine specific toplevel testscript mysql-test/suite/stress/t/ddl_csv.test: Storage engine specific toplevel testscript mysql-test/suite/stress/t/ddl_innodb.test: Storage engine specific toplevel testscript mysql-test/suite/stress/t/ddl_memory.test: Storage engine specific toplevel testscript mysql-test/suite/stress/t/ddl_myisam.test: Storage engine specific toplevel testscript mysql-test/suite/stress/t/ddl_ndb.test: Storage engine specific toplevel testscript --- Makefile.am | 14 +- mysql-test/suite/stress/include/ddl.cln | 4 + mysql-test/suite/stress/include/ddl.pre | 21 ++ mysql-test/suite/stress/include/ddl1.inc | 277 +++++++++++++++ mysql-test/suite/stress/include/ddl2.inc | 259 ++++++++++++++ mysql-test/suite/stress/include/ddl3.inc | 242 +++++++++++++ mysql-test/suite/stress/include/ddl4.inc | 339 +++++++++++++++++++ mysql-test/suite/stress/include/ddl5.inc | 227 +++++++++++++ mysql-test/suite/stress/include/ddl6.inc | 266 +++++++++++++++ mysql-test/suite/stress/include/ddl7.inc | 274 +++++++++++++++ mysql-test/suite/stress/include/ddl8.inc | 302 +++++++++++++++++ mysql-test/suite/stress/r/ddl_archive.result | 79 +++++ mysql-test/suite/stress/r/ddl_csv.result | 55 +++ mysql-test/suite/stress/r/ddl_innodb.result | 251 ++++++++++++++ mysql-test/suite/stress/r/ddl_memory.result | 251 ++++++++++++++ mysql-test/suite/stress/r/ddl_myisam.result | 251 ++++++++++++++ mysql-test/suite/stress/r/ddl_ndb.result | 216 ++++++++++++ mysql-test/suite/stress/t/ddl_archive.test | 51 +++ mysql-test/suite/stress/t/ddl_csv.test | 51 +++ mysql-test/suite/stress/t/ddl_innodb.test | 49 +++ mysql-test/suite/stress/t/ddl_memory.test | 48 +++ mysql-test/suite/stress/t/ddl_myisam.test | 48 +++ mysql-test/suite/stress/t/ddl_ndb.test | 56 +++ 23 files changed, 3628 insertions(+), 3 deletions(-) create mode 100644 mysql-test/suite/stress/include/ddl.cln create mode 100644 mysql-test/suite/stress/include/ddl.pre create mode 100644 mysql-test/suite/stress/include/ddl1.inc create mode 100644 mysql-test/suite/stress/include/ddl2.inc create mode 100644 mysql-test/suite/stress/include/ddl3.inc create mode 100644 mysql-test/suite/stress/include/ddl4.inc create mode 100644 mysql-test/suite/stress/include/ddl5.inc create mode 100644 mysql-test/suite/stress/include/ddl6.inc create mode 100644 mysql-test/suite/stress/include/ddl7.inc create mode 100644 mysql-test/suite/stress/include/ddl8.inc create mode 100644 mysql-test/suite/stress/r/ddl_archive.result create mode 100644 mysql-test/suite/stress/r/ddl_csv.result create mode 100644 mysql-test/suite/stress/r/ddl_innodb.result create mode 100644 mysql-test/suite/stress/r/ddl_memory.result create mode 100644 mysql-test/suite/stress/r/ddl_myisam.result create mode 100644 mysql-test/suite/stress/r/ddl_ndb.result create mode 100644 mysql-test/suite/stress/t/ddl_archive.test create mode 100644 mysql-test/suite/stress/t/ddl_csv.test create mode 100644 mysql-test/suite/stress/t/ddl_innodb.test create mode 100644 mysql-test/suite/stress/t/ddl_memory.test create mode 100644 mysql-test/suite/stress/t/ddl_myisam.test create mode 100644 mysql-test/suite/stress/t/ddl_ndb.test diff --git a/Makefile.am b/Makefile.am index 88e0f949657..18477afb398 100644 --- a/Makefile.am +++ b/Makefile.am @@ -58,7 +58,8 @@ tags: test test-force test-full test-force-full test-force-mem \ test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \ test-unit test-ps test-nr test-pr test-ns test-binlog-statement \ - test-ext-funcs test-ext-rpl test-ext-partitions test-ext \ + test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \ + test-ext-stress test-ext \ test-fast test-fast-cursor test-fast-view test-fast-prepare \ test-full-qa @@ -144,6 +145,8 @@ test-bt: cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --comment=NIST+ps --force --suite=nist --ps-protocol ; \ fi + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress # Re-enable the "rowlock" suite when bug#28685 is fixed # -cd mysql-test ; MTR_BUILD_THREAD=auto \ @@ -182,12 +185,17 @@ test-ext-jp: cd mysql-test ; \ @PERL@ ./mysql-test-run.pl --force --suite=jp -test-ext: test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp +test-ext-stress: + cd mysql-test ; \ + @PERL@ ./mysql-test-run.pl --force --big-test --suite=stress + +test-ext: test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp test-ext-stress test-fast: cd mysql-test ; \ @PERL@ ./mysql-test-run.pl $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \ - @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam + @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam ; \ + @PERL@ ./mysql-test-run.pl $(subset) --force --suite=stress --do-test=ddl_myisam test-fast-view: $(MAKE) subset=--view-protocol test-fast diff --git a/mysql-test/suite/stress/include/ddl.cln b/mysql-test/suite/stress/include/ddl.cln new file mode 100644 index 00000000000..7d021a8c912 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl.cln @@ -0,0 +1,4 @@ +######## include/ddl.cln ######## +disconnect con2; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/include/ddl.pre b/mysql-test/suite/stress/include/ddl.pre new file mode 100644 index 00000000000..52de4a3665b --- /dev/null +++ b/mysql-test/suite/stress/include/ddl.pre @@ -0,0 +1,21 @@ +######## include/ddl.pre ######## +# The variable +# $runtime -- rough intended runtime per subtest variant +# must be set within the routine sourcing this script. +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-11 mleich +# +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +--replace_result $runtime +eval SET @runtime = $runtime; +eval PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +connect (con2,localhost,root,,); +connection default; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings diff --git a/mysql-test/suite/stress/include/ddl1.inc b/mysql-test/suite/stress/include/ddl1.inc new file mode 100644 index 00000000000..96adadc5af5 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl1.inc @@ -0,0 +1,277 @@ +######## include/ddl1.inc ###### +# +# Purpose of include/ddl1.inc - include/ddl8.inc: +# +# Stress storage engines with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# Real runtime without server restarts and comparison is: +# - >= $runtime +# - > runtime needed for $loop_size execution loops +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Attention: +# The test does suppress the writing of most statements, server error +# messages and result sets. +# This is needed because their number is usual not deterministic. +# The test is partially self checking. That means is prints some +# helpful hints into the protocol and aborts if something is wrong. +# +# Creation of this test: +# 2007-07-04 mleich +# +############################################################################ +# +# Some details: +# +# 1. Base question of the test: +# There was just a create or drop of some object (TABLE/INDEX). +# +# Could it happen that the next statement referring to this +# object gets a somehow wrong server response (result set, +# error message, warning) because the creation or removal of +# the object is in an incomplete state? +# +# Thinkable reasons for incomplete state of creation or removal: +# The server performs the creation or removal +# - all time incomplete. +# Example: +# Bug#28309 First insert violates unique constraint +# - was "memory" table empty ? +# - asynchronous +# In that case the next statement has probably to wait till +# completion. +# +# 2. Why do we use in some scripts "--error 0," followed +# a check of $mysql_errno? +# +# System reactions when running with "--error 0,": +# - RC=0 --> no error message +# - RC= --> no error message +# - RC not in (0,) --> error message + abort of script +# execution +# +# Requirements and tricky solution for statements which are expected +# to fail: +# 1. RC= +# - no abort of script execution +# --> add "--error " +# - no error message into the protocol, because the number of +# executions is NOT deterministic +# --> use "--error 0," +# 2. RC=0 = failure +# - abort of script execution +# "--error 0," prevents the automatic abort of +# execution. Therefore we do not need to code the abort. +# --> Check $mysql_errno and do an explicit abort if $mysql_errno = 0. +# 3. RC not in (0,) +# - abort of script execution +# "--error 0," causes an automatic abort. +# +# 3. We do not check the correctness of the SHOW CREATE TABLE output +# in detail. This must be done within other tests. +# We only check here that +# - same CREATE TABLE/INDEX statements lead to the same +# - different CREATE TABLE/INDEX statements lead to different +# SHOW CREATE TABLE output +# (Applies to ddl4.inc. and ddl8.inc.) +# +# 4. It could be assumed that running this test with +# - PS-PROTOCOL +# There are already subtests using prepared statements contained. +# - SP/CURSOR/VIEW-PROTOCOL +# These protocol variants transform SELECTs to hopefully much +# stressing statement sequencies using SP/CURSOR/VIEW. +# The SELECTs within include/ddl*.inc are very simple. +# does not increase the coverage. +# Therefore we skip runs with these protocols. +# +# 5. The test consumes significant runtime when running on a non RAM +# based filesystem (run without "--mem"). +# Therefore we adjust $runtime and $loop_size depending on "--big-test" +# option. +# $runtime and $loop_size do not influence the expected results. +# Rough runtime in seconds reported by mysql-test-run.pl: +# (engine_type = MEMORY) +# option set -> $runtime $loop_size real runtime in seconds +# 1 20 68 +# --mem 1 20 32 +# --big-test 5 100 200 +# --mem --big-test 5 100 400 +# I assume that runs with slow filesystems are as much valuable +# as runs with extreme fast filesystems. +# +# 6. Hints for analysis of test failures: +# 1. Look into the protocol and check in which ddl*.inc +# script the difference to the expected result occured. +# 2. Comment the sourcing of all other ddl*.inc scripts +# out. +# 3. Edit the ddl*.inc script where the error occured and +# remove all +# - "--disable_query_log", "--disable_result_log" +# - successful passed subtests. +# 4. Alternative: +# Have a look into VARDIR/master-data/mysql/general_log.CSV +# and construct a new testcase from that. +# 5. If the problem is not deterministic, please try the following +# - increase $runtime (important), $loop_size (most probably +# less important) within the "t/ddl_.test" and +# maybe the "--testcase-timeout" assigned to mysqltest-run.pl +# - vary the I/O performance of the testing machine by using +# a RAM or disk based filesystem for VARDIR +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 1 variants +# Scenario: CREATE with UNIQUE KEY/INSERT/DROP TABLE like in Bug#28309 +let $create_table= CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = $engine_type; +let $insert_into= INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +let $drop_table= DROP TABLE t1; +#---------------------------------------------------------------------- + +# +--echo # Subtest 1A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $insert_into +--echo # default: $drop_table +--disable_query_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + eval $insert_into; + eval $drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_query_log +# +--echo # Subtest 1B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $insert_into +--echo # default: $drop_table +--disable_query_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE insert_into FROM "$insert_into"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + EXECUTE insert_into; + EXECUTE drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE insert_into; +DEALLOCATE PREPARE drop_table; +--enable_query_log +# +--echo # Subtest 1C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $insert_into +--echo # con2: $drop_table +--disable_query_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + connection con2; + eval $insert_into; + eval $drop_table; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_query_log +# +--echo # Subtest 1D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $insert_into +--echo # con2: $drop_table +--disable_query_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +connection con2; +eval PREPARE insert_into FROM "$insert_into"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + connection con2; + EXECUTE insert_into; + EXECUTE drop_table; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +connection con2; +DEALLOCATE PREPARE insert_into; +DEALLOCATE PREPARE drop_table; +connection default; +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl2.inc b/mysql-test/suite/stress/include/ddl2.inc new file mode 100644 index 00000000000..dd2ec0fd804 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl2.inc @@ -0,0 +1,259 @@ +######## include/ddl2.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 2 variants (2A - 2D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 2 variants +# Scenario: CREATE TABLE AS SELECT/SELECT/DROP/SELECT(F) +let $create_table= CREATE TABLE t1 ENGINE = $engine_type AS SELECT 1 AS f1; +let $select_record= SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1; +let $drop_table= DROP TABLE t1; +#---------------------------------------------------------------------- + +# +--echo # Subtest 2A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $select_record +--echo # default: $drop_table +--echo # default: $select_record (expect to get ER_NO_SUCH_TABLE) +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + if (`$select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + eval $select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + eval $drop_table; + --error 0,ER_NO_SUCH_TABLE + eval $select_record; + if (!$mysql_errno) + { + --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE + --echo # abort + exit; + } + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 2B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $select_record +--echo # default: $drop_table +--echo # default: $select_record (expect to get ER_NO_SUCH_TABLE) +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE select_record FROM "$select_record"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + if (`EXECUTE select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + EXECUTE select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + EXECUTE drop_table; + --error 0,ER_NO_SUCH_TABLE + EXECUTE select_record; + if (!$mysql_errno) + { + --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE + --echo # abort + exit; + } + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE select_record; +DEALLOCATE PREPARE drop_table; +--enable_result_log +--enable_query_log +# +--echo # Subtest 2C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $select_record +--echo # default: $drop_table +--echo # con2: $select_record (expect to get ER_NO_SUCH_TABLE) +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + connection con2; + if (`$select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + eval $select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + connection default; + eval $drop_table; + connection con2; + --error 0,ER_NO_SUCH_TABLE + eval $select_record; + if (!$mysql_errno) + { + --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE + --echo # abort + exit; + } + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 2D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $select_record +--echo # default: $drop_table +--echo # con2: $select_record (expect to get ER_NO_SUCH_TABLE) +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table FROM "$create_table"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE create_table; +connection con2; +eval PREPARE select_record FROM "$select_record"; +connection default; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + connection con2; + if (`EXECUTE select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + EXECUTE select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + connection default; + EXECUTE drop_table; + connection con2; + --error 0,ER_NO_SUCH_TABLE + EXECUTE select_record; + if (!$mysql_errno) + { + --echo # Error: SELECT was successful though we expected ER_NO_SUCH_TABLE + --echo # abort + exit; + } + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE drop_table; +connection con2; +DEALLOCATE PREPARE select_record; +connection default; +--enable_result_log +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl3.inc b/mysql-test/suite/stress/include/ddl3.inc new file mode 100644 index 00000000000..aacf09f9428 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl3.inc @@ -0,0 +1,242 @@ +######## include/ddl3.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 3 variants (3A - 3D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl2.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 3 variants +# Scenario: CREATE TABLE/CREATE TABLE(F)/DROP TABLE/DROP TABLE(F) +let $create_table= CREATE TABLE t1 (f1 BIGINT) ENGINE=$engine_type; +let $drop_table= DROP TABLE t1; +#---------------------------------------------------------------------- + +# +--echo # Subtest 3A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $create_table (expect to get ER_TABLE_EXISTS_ERROR) +--echo # default: $drop_table +--echo # default: $drop_table (expect to get ER_BAD_TABLE_ERROR) +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + --error 0,ER_TABLE_EXISTS_ERROR + eval $create_table; + if (!$mysql_errno) + { + --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR + --echo # abort + exit; + } + eval $drop_table; + --error 0,ER_BAD_TABLE_ERROR + eval $drop_table; + if (!$mysql_errno) + { + --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR) + --echo # abort + exit; + } + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 3B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $create_table (expect to get ER_TABLE_EXISTS_ERROR) +--echo # default: $drop_table +--echo # default: $drop_table (expect to get ER_BAD_TABLE_ERROR) +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + --error 0,ER_TABLE_EXISTS_ERROR + EXECUTE create_table; + if (!$mysql_errno) + { + --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR + --echo # abort + exit; + } + EXECUTE drop_table; + --error 0,ER_BAD_TABLE_ERROR + EXECUTE drop_table; + if (!$mysql_errno) + { + --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR) + --echo # abort + exit; + } + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE drop_table; +--enable_result_log +--enable_query_log +# +--echo # Subtest 3C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $create_table (expect to get ER_TABLE_EXISTS_ERROR) +--echo # default: $drop_table +--echo # con2: $drop_table (expect to get ER_BAD_TABLE_ERROR) +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + connection con2; + --error 0,ER_TABLE_EXISTS_ERROR + eval $create_table; + if (!$mysql_errno) + { + --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR + --echo # abort + exit; + } + connection default; + eval $drop_table; + connection con2; + --error 0,ER_BAD_TABLE_ERROR + eval $drop_table; + if (!$mysql_errno) + { + --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR) + --echo # abort + exit; + } + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 3D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $create_table (expect to get ER_TABLE_EXISTS_ERROR) +--echo # default: $drop_table +--echo # con2: $drop_table (expect to get ER_BAD_TABLE_ERROR) +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table FROM "$create_table"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE create_table; +connection con2; +eval PREPARE create_table FROM "$create_table"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + connection con2; + --error 0,ER_TABLE_EXISTS_ERROR + EXECUTE create_table; + if (!$mysql_errno) + { + --echo # Error: CREATE TABLE was successful though we expected ER_TABLE_EXISTS_ERROR + --echo # abort + exit; + } + connection default; + EXECUTE drop_table; + connection con2; + --error 0,ER_BAD_TABLE_ERROR + EXECUTE drop_table; + if (!$mysql_errno) + { + --echo # Error: DROP TABLE was successful though we expected ER_BAD_TABLE_ERROR) + --echo # abort + exit; + } + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE drop_table; +connection con2; +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE drop_table; +connection default; +--enable_result_log +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl4.inc b/mysql-test/suite/stress/include/ddl4.inc new file mode 100644 index 00000000000..10452a453a5 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl4.inc @@ -0,0 +1,339 @@ +######## include/ddl4.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 4 variants (4A - 4D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 4 variants +# Scenario: CREATE TABLE variant1/SHOW/DROP TABLE/SHOW(F)/ +# CREATE TABLE variant2/SHOW/DROP TABLE +let $create_table1= CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=$engine_type; +let $create_table2= CREATE TABLE t1 (f1 BIGINT) ENGINE=$engine_type; +let $show_table= SHOW CREATE TABLE t1; +let $drop_table= DROP TABLE t1; +# +eval $create_table1; +let $cr_value1= INITIALIZED; +let $cr_value1= query_get_value($show_table, Create Table, 1); +eval $drop_table; +eval $create_table2; +let $cr_value2= INITIALIZED; +let $cr_value2= query_get_value($show_table, Create Table, 1); +eval $drop_table; +if (`SELECT '$cr_value1' = '$cr_value2'`) +{ + --echo # Error during generation of prerequisites. + --echo # cr_value1 equals cr_value2 + --echo # cr_value1: $cr_value1 + --echo # cr_value2: $cr_value2 + --echo # abort + exit; +} +#---------------------------------------------------------------------- + +# +--echo # Subtest 4A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table1 +--echo # default: $show_table +--echo # default: $drop_table +--echo # default: $show_table (expect to get ER_NO_SUCH_TABLE) +--echo # default: $create_table2 +--echo # default: $show_table +--echo # default: $drop_table +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table1; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + eval $drop_table; + --error 0,ER_NO_SUCH_TABLE + eval $show_table; + if (!$mysql_errno) + { + --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE) + --echo # abort + exit; + } + eval $create_table2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + eval $drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 4B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table1 +--echo # default: $show_table +--echo # default: $drop_table +--echo # default: $show_table (expect to get ER_NO_SUCH_TABLE) +--echo # default: $create_table2 +--echo # default: $show_table +--echo # default: $drop_table +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table1 FROM "$create_table1"; +eval PREPARE create_table2 FROM "$create_table2"; +EXECUTE create_table1; +eval PREPARE show_table FROM "$show_table"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table1; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + EXECUTE drop_table; + --error 0,ER_NO_SUCH_TABLE + EXECUTE show_table; + if (!$mysql_errno) + { + --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE) + --echo # abort + exit; + } + EXECUTE create_table2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + EXECUTE drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table1; +DEALLOCATE PREPARE create_table2; +DEALLOCATE PREPARE show_table; +DEALLOCATE PREPARE drop_table; +--enable_result_log +--enable_query_log +# +--echo # Subtest 4C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table1 +--echo # con2: $show_table +--echo # default: $drop_table +--echo # con2: $show_table (expect to get ER_NO_SUCH_TABLE) +--echo # default: $create_table2 +--echo # con2: $show_table +--echo # default: $drop_table +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table1; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + connection default; + eval $drop_table; + connection con2; + --error 0,ER_NO_SUCH_TABLE + eval $show_table; + if (!$mysql_errno) + { + --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE) + --echo # abort + exit; + } + connection default; + eval $create_table2; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + connection default; + eval $drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 4D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table1 +--echo # con2: $show_table +--echo # default: $drop_table +--echo # con2: $show_table (expect to get ER_NO_SUCH_TABLE) +--echo # default: $create_table2 +--echo # con2: $show_table +--echo # default: $drop_table +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_table1 FROM "$create_table1"; +eval PREPARE create_table2 FROM "$create_table2"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE create_table1; +connection con2; +eval PREPARE show_table FROM "$show_table"; +connection default; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table1; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + connection default; + EXECUTE drop_table; + connection con2; + --error 0,ER_NO_SUCH_TABLE + EXECUTE show_table; + if (!$mysql_errno) + { + --echo # Error: SHOW CREATE TABLE was successful though we expected ER_NO_SUCH_TABLE) + --echo # abort + exit; + } + connection default; + EXECUTE create_table2; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + connection default; + EXECUTE drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table1; +DEALLOCATE PREPARE create_table2; +DEALLOCATE PREPARE drop_table; +connection con2; +DEALLOCATE PREPARE show_table; +connection default; +--enable_result_log +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl5.inc b/mysql-test/suite/stress/include/ddl5.inc new file mode 100644 index 00000000000..5a6c2fa0e96 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl5.inc @@ -0,0 +1,227 @@ +######## include/ddl5.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 5 variants (5A - 5D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +#---------------------------------------------------------------------- +# Settings for Subtest 5 variants +# Scenario: CREATE TABLE with AUTOINC/INSERT/SELECT/DROP TABLE +let $create_table= CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = $engine_type; +let $insert_into= INSERT INTO t1 SET f2 = 9; +let $select_record= SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9; +let $drop_table= DROP TABLE t1; +#---------------------------------------------------------------------- + +# +--echo # Subtest 5A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $insert_into +--echo # default: $select_record +--echo # default: $drop_table +--disable_query_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + eval $insert_into; + if (`$select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + eval $select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + eval $drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_query_log +# +--echo # Subtest 5B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # default: $insert_into +--echo # default: $select_record +--echo # default: $drop_table +--disable_query_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE insert_into FROM "$insert_into"; +eval PREPARE select_record FROM "$select_record"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + EXECUTE insert_into; + if (`EXECUTE select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + EXECUTE select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + EXECUTE drop_table; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE insert_into; +DEALLOCATE PREPARE select_record; +DEALLOCATE PREPARE drop_table; +--enable_query_log +# +--echo # Subtest 5C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $insert_into +--echo # default: $select_record +--echo # con2: $drop_table +--disable_query_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_table; + connection con2; + eval $insert_into; + connection default; + if (`$select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + eval $select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + connection con2; + eval $drop_table; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_query_log +# +--echo # Subtest 5D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_table +--echo # con2: $insert_into +--echo # default: $select_record +--echo # con2: $drop_table +--disable_query_log +connection default; +eval PREPARE create_table FROM "$create_table"; +EXECUTE create_table; +eval PREPARE select_record FROM "$select_record"; +connection con2; +eval PREPARE insert_into FROM "$insert_into"; +eval PREPARE drop_table FROM "$drop_table"; +EXECUTE drop_table; +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_table; + connection con2; + EXECUTE insert_into; + connection default; + if (`EXECUTE select_record`) + { + --enable_result_log + --enable_query_log + --echo # Error: Unexpected content within t1. + --echo # Expected: 0 + --echo # Got: + EXECUTE select_record; + SELECT * FROM t1; + --echo # abort + exit; + } + connection con2; + EXECUTE drop_table; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_table; +DEALLOCATE PREPARE select_record; +connection con2; +DEALLOCATE PREPARE insert_into; +DEALLOCATE PREPARE drop_table; +connection default; +--enable_query_log diff --git a/mysql-test/suite/stress/include/ddl6.inc b/mysql-test/suite/stress/include/ddl6.inc new file mode 100644 index 00000000000..7bbfe300eaa --- /dev/null +++ b/mysql-test/suite/stress/include/ddl6.inc @@ -0,0 +1,266 @@ +######## include/ddl6.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 6 variants (6A - 6D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 6 variants +# Scenario: CREATE INDEX/CREATE INDEX(F)/DROP INDEX/DROP INDEX(F) +let $create_index= CREATE INDEX IDX1 ON t1 (f2); +let $drop_index= DROP INDEX IDX1 ON t1; +eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=$engine_type; +#---------------------------------------------------------------------- + + +# +--echo # Subtest 6A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $create_index (expect to get ER_DUP_KEYNAME) +--echo # default: $drop_index +--echo # default: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY) +--echo # default: $create_index +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index; + --error 0,ER_DUP_KEYNAME + eval $create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME + --echo # abort + exit; + } + eval $drop_index; + --error 0,ER_CANT_DROP_FIELD_OR_KEY + eval $drop_index; + if (!$mysql_errno) + { + --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY + --echo # abort + exit; + } + eval $create_index; + eval $drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 6B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $create_index (expect to get ER_DUP_KEYNAME) +--echo # default: $drop_index +--echo # default: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY) +--echo # default: $create_index +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index FROM "$create_index"; +EXECUTE create_index; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE drop_index; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index; + --error 0,ER_DUP_KEYNAME + EXECUTE create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME + --echo # abort + exit; + } + EXECUTE drop_index; + --error 0,ER_CANT_DROP_FIELD_OR_KEY + EXECUTE drop_index; + if (!$mysql_errno) + { + --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY + --echo # abort + exit; + } + EXECUTE create_index; + EXECUTE drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE drop_index; +--enable_result_log +--enable_query_log +# +--echo # Subtest 6C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # con2: $create_index (expect to get ER_DUP_KEYNAME) +--echo # default: $drop_index +--echo # con2: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY) +--echo # default: $create_index +--echo # con2: $drop_index +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index; + connection con2; + --error 0,ER_DUP_KEYNAME + eval $create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME + --echo # abort + exit; + } + connection default; + eval $drop_index; + connection con2; + --error 0,ER_CANT_DROP_FIELD_OR_KEY + eval $drop_index; + if (!$mysql_errno) + { + --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY + --echo # abort + exit; + } + connection default; + eval $create_index; + connection con2; + eval $drop_index; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 6D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # con2: $create_index (expect to get ER_DUP_KEYNAME) +--echo # default: $drop_index +--echo # con2: $drop_index (expect to get ER_CANT_DROP_FIELD_OR_KEY) +--echo # default: $create_index +--echo # con2: $drop_index +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE create_index; +connection con2; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE drop_index; +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index; + connection con2; + --error 0,ER_DUP_KEYNAME + EXECUTE create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_KEYNAME + --echo # abort + exit; + } + connection default; + EXECUTE drop_index; + connection con2; + --error 0,ER_CANT_DROP_FIELD_OR_KEY + EXECUTE drop_index; + if (!$mysql_errno) + { + --echo # Error: DROP INDEX was successful though we expected ER_CANT_DROP_FIELD_OR_KEY + --echo # abort + exit; + } + connection default; + EXECUTE create_index; + connection con2; + EXECUTE drop_index; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE drop_index; +connection con2; +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE drop_index; +connection default; +--enable_result_log +--enable_query_log + +DROP TABLE t1; diff --git a/mysql-test/suite/stress/include/ddl7.inc b/mysql-test/suite/stress/include/ddl7.inc new file mode 100644 index 00000000000..76ba8066c66 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl7.inc @@ -0,0 +1,274 @@ +######## include/ddl7.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 7 variants (7A - 7D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 7 variants +# Scenario: CREATE INDEX/INSERT(F)/DROP INDEX/INSERT/CREATE INDEX(F)/DELETE +let $create_index= CREATE UNIQUE INDEX IDX1 ON t1 (f2); +let $insert_record= INSERT INTO t1 VALUES(1,1); +let $drop_index= DROP INDEX IDX1 ON t1; +let $delete_record= DELETE FROM t1 WHERE f1 = 1; +eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=$engine_type; +INSERT INTO t1 VALUES(0,1); +#---------------------------------------------------------------------- + +# +--echo # Subtest 7A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $insert_record (expect to get ER_DUP_ENTRY) +--echo # default: $drop_index +--echo # default: $insert_record +--echo # default: $create_index (expect to get ER_DUP_ENTRY) +--echo # default: $delete_record +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +let $counter= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index; + --error 0,ER_DUP_ENTRY + eval $insert_record; + if (!$mysql_errno) + { + --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + eval $drop_index; + eval $insert_record; + # NDB: ER_DUP_UNIQUE, others: ER_DUP_ENTRY + --error 0,ER_DUP_ENTRY,ER_DUP_UNIQUE + eval $create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY + --echo # Error: or ER_DUP_UNIQUE (NDB only) + --echo # abort + exit; + } + eval $delete_record; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 7B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $insert_record (expect to get ER_DUP_ENTRY) +--echo # default: $drop_index +--echo # default: $insert_record +--echo # default: $create_index (expect to get ER_DUP_ENTRY) +--echo # default: $delete_record +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE insert_record FROM "$insert_record"; +eval PREPARE delete_record FROM "$delete_record"; +eval PREPARE drop_index FROM "$drop_index"; +let $run= 1; +let $counter= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index; + --error 0,ER_DUP_ENTRY + EXECUTE insert_record; + if (!$mysql_errno) + { + --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + EXECUTE drop_index; + EXECUTE insert_record; + --error 0,ER_DUP_ENTRY + EXECUTE create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + EXECUTE delete_record; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE insert_record; +DEALLOCATE PREPARE delete_record; +DEALLOCATE PREPARE drop_index; +--enable_result_log +--enable_query_log +# +--echo # Subtest 7C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $insert_record (expect to get ER_DUP_ENTRY) +--echo # con2: $drop_index +--echo # default: $insert_record +--echo # con2: $create_index (expect to get ER_DUP_ENTRY) +--echo # con2: $delete_record +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +let $counter= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index; + --error 0,ER_DUP_ENTRY + eval $insert_record; + if (!$mysql_errno) + { + --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + connection con2; + eval $drop_index; + connection default; + eval $insert_record; + connection con2; + --error 0,ER_DUP_ENTRY + eval $create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + eval $delete_record; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 7D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index +--echo # default: $insert_record (expect to get ER_DUP_ENTRY) +--echo # con2: $drop_index +--echo # default: $insert_record +--echo # con2: $create_index (expect to get ER_DUP_ENTRY) +--echo # con2: $delete_record +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE insert_record FROM "$insert_record"; +EXECUTE create_index; +connection con2; +eval PREPARE create_index FROM "$create_index"; +eval PREPARE drop_index FROM "$drop_index"; +eval PREPARE delete_record FROM "$delete_record"; +EXECUTE drop_index; +connection default; +let $run= 1; +let $counter= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index; + --error 0,ER_DUP_ENTRY + EXECUTE insert_record; + if (!$mysql_errno) + { + --echo # Error: INSERT was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + connection con2; + EXECUTE drop_index; + connection default; + EXECUTE insert_record; + connection con2; + --error 0,ER_DUP_ENTRY + EXECUTE create_index; + if (!$mysql_errno) + { + --echo # Error: CREATE INDEX was successful though we expected ER_DUP_ENTRY + --echo # abort + exit; + } + EXECUTE delete_record; + connection default; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE insert_record; +connection con2; +DEALLOCATE PREPARE create_index; +DEALLOCATE PREPARE drop_index; +DEALLOCATE PREPARE delete_record; +connection default; +--enable_result_log +--enable_query_log + +DROP TABLE t1; diff --git a/mysql-test/suite/stress/include/ddl8.inc b/mysql-test/suite/stress/include/ddl8.inc new file mode 100644 index 00000000000..85a70770a56 --- /dev/null +++ b/mysql-test/suite/stress/include/ddl8.inc @@ -0,0 +1,302 @@ +######## include/ddl8.inc ###### +# +# Stress the storage engine with rapid CREATE/DROP TABLE/INDEX +# and following SELECT/INSERT/SHOW etc. +# Subtest 8 variants (8A - 8D) +# +# The variables +# $loop_size -- number of rounds till we look at the clock again +# $runtime -- rough intended runtime per subtest variant +# $engine_type -- storage engine to be used in CREATE TABLE +# must be set within the routine sourcing this script. +# +# Other stuff which must already exist: +# - connection con2 +# - stmt_start and stmt_break prepared by the default connection +# +# Please look for more details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + + +#---------------------------------------------------------------------- +# Settings for Subtest 8 variants +# Scenario: CREATE INDEX variant1/SHOW/DROP INDEX/ +# CREATE INDEX variant2/SHOW/DROP INDEX +let $create_index1= CREATE INDEX IDX ON t1 (f2); +let $create_index2= CREATE UNIQUE INDEX IDX ON t1 (f2); +let $show_table= SHOW CREATE TABLE t1; +let $drop_index= DROP INDEX IDX ON t1; +eval CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=$engine_type; +INSERT INTO t1 VALUES(1,1); +eval $create_index1; +let $cr_value1= INITIALIZED; +let $cr_value1= query_get_value($show_table, Create Table, 1); +eval $drop_index; +eval $create_index2; +let $cr_value2= INITIALIZED; +let $cr_value2= query_get_value($show_table, Create Table, 1); +eval $drop_index; +if (`SELECT '$cr_value1' = '$cr_value2'`) +{ + --echo # Error during generation of prerequisites. + --echo # cr_value1 equals cr_value2 + --echo # cr_value1: $cr_value1 + --echo # cr_value2: $cr_value2 + --echo # abort + exit; +} +#---------------------------------------------------------------------- + +# +--echo # Subtest 8A (one connection, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index1 +--echo # default: $show_table +--echo # default: $drop_index +--echo # default: $create_index2 +--echo # default: $show_table +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index1; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + eval $drop_index; + eval $create_index2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + eval $drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 8B (one connection, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index1 +--echo # default: $show_table +--echo # default: $drop_index +--echo # default: $create_index2 +--echo # default: $show_table +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index1 FROM "$create_index1"; +eval PREPARE create_index2 FROM "$create_index2"; +EXECUTE create_index1; +eval PREPARE show_table FROM "$show_table"; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE drop_index; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index1; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + EXECUTE drop_index; + EXECUTE create_index2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + EXECUTE drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index1; +DEALLOCATE PREPARE create_index2; +DEALLOCATE PREPARE show_table; +DEALLOCATE PREPARE drop_index; +--enable_result_log +--enable_query_log +# +--echo # Subtest 8C (two connections, no PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index1 +--echo # con2: $show_table +--echo # default: $drop_index +--echo # default: $create_index2 +--echo # con2: $show_table +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + eval $create_index1; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + connection default; + eval $drop_index; + eval $create_index2; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value($show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + connection default; + eval $drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +--enable_result_log +--enable_query_log +# +--echo # Subtest 8D (two connections, use PREPARE/EXECUTE) +--echo # connection action +--echo # default: $create_index1 +--echo # con2: $show_table +--echo # default: $drop_index +--echo # default: $create_index2 +--echo # con2: $show_table +--echo # default: $drop_index +--disable_query_log +--disable_result_log +connection default; +eval PREPARE create_index1 FROM "$create_index1"; +eval PREPARE create_index2 FROM "$create_index2"; +eval PREPARE drop_index FROM "$drop_index"; +EXECUTE create_index1; +connection con2; +eval PREPARE show_table FROM "$show_table"; +connection default; +EXECUTE drop_index; +let $run= 1; +# Determine the current time. +EXECUTE stmt_start; +# Run execution loops till the planned runtime is reached +while ($run) +{ + let $loop_run= $loop_size; + while ($loop_run) + { + EXECUTE create_index1; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value1'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value1 + --echo # abort + exit; + } + connection default; + EXECUTE drop_index; + EXECUTE create_index2; + connection con2; + let $value= INITIALIZED; + let $value= query_get_value(EXECUTE show_table, Create Table, 1); + if (`SELECT '$value' <> '$cr_value2'`) + { + --echo # Error: Unexpected SHOW CREATE TABLE output + --echo # Got: $value + --echo # Expected: $cr_value2 + --echo # abort + exit; + } + connection default; + EXECUTE drop_index; + dec $loop_run; + } + if (`EXECUTE stmt_break`) + { + let $run= 0; + } +} +DEALLOCATE PREPARE create_index1; +DEALLOCATE PREPARE create_index2; +DEALLOCATE PREPARE drop_index; +connection con2; +DEALLOCATE PREPARE show_table; +connection default; +--enable_result_log +--enable_query_log + +DROP TABLE t1; diff --git a/mysql-test/suite/stress/r/ddl_archive.result b/mysql-test/suite/stress/r/ddl_archive.result new file mode 100644 index 00000000000..47c64a6af94 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_archive.result @@ -0,0 +1,79 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = ; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = ARCHIVE AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=ARCHIVE (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = ARCHIVE +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_csv.result b/mysql-test/suite/stress/r/ddl_csv.result new file mode 100644 index 00000000000..3dfa0c8fd15 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_csv.result @@ -0,0 +1,55 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = ; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = CSV AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_innodb.result b/mysql-test/suite/stress/r/ddl_innodb.result new file mode 100644 index 00000000000..6417d3e1c5c --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_innodb.result @@ -0,0 +1,251 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = ; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 1A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = InnoDB +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = InnoDB +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = InnoDB +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 1D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = InnoDB +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = InnoDB AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB; +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB; +DROP TABLE t1; +# Subtest 4A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=InnoDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=InnoDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = InnoDB +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=InnoDB; +# Subtest 6A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +# Subtest 6D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(0,1); +# Subtest 7A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1,1); +CREATE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +CREATE UNIQUE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +# Subtest 8A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +DROP TABLE t1; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_memory.result b/mysql-test/suite/stress/r/ddl_memory.result new file mode 100644 index 00000000000..1700fbc2745 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_memory.result @@ -0,0 +1,251 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = ; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 1A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MEMORY +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MEMORY +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MEMORY +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 1D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MEMORY +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MEMORY AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY; +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY; +DROP TABLE t1; +# Subtest 4A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MEMORY +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MEMORY +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MEMORY +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MEMORY; +# Subtest 6A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +# Subtest 6D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=MEMORY; +INSERT INTO t1 VALUES(0,1); +# Subtest 7A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MEMORY; +INSERT INTO t1 VALUES(1,1); +CREATE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +CREATE UNIQUE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +# Subtest 8A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +DROP TABLE t1; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_myisam.result b/mysql-test/suite/stress/r/ddl_myisam.result new file mode 100644 index 00000000000..82be55b8371 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_myisam.result @@ -0,0 +1,251 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = ; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 1A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MyISAM +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MyISAM +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MyISAM +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 1D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = MyISAM +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = MyISAM AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM; +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM; +DROP TABLE t1; +# Subtest 4A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=MyISAM +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=MyISAM +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = MyISAM +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM; +# Subtest 6A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +# Subtest 6D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, PRIMARY KEY(f1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES(0,1); +# Subtest 7A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# default: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# default: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +# Subtest 7D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE UNIQUE INDEX IDX1 ON t1 (f2) +# default: INSERT INTO t1 VALUES(1,1) (expect to get ER_DUP_ENTRY) +# con2: DROP INDEX IDX1 ON t1 +# default: INSERT INTO t1 VALUES(1,1) +# con2: CREATE UNIQUE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_ENTRY) +# con2: DELETE FROM t1 WHERE f1 = 1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1,1); +CREATE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +CREATE UNIQUE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +# Subtest 8A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +DROP TABLE t1; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/r/ddl_ndb.result b/mysql-test/suite/stress/r/ddl_ndb.result new file mode 100644 index 00000000000..39146e65fb0 --- /dev/null +++ b/mysql-test/suite/stress/r/ddl_ndb.result @@ -0,0 +1,216 @@ +SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION'; +PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start"; +SET @runtime = ; +PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1"; +DROP TABLE IF EXISTS t1; +# Subtest 1A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = NDB +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = NDB +# default: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# default: DROP TABLE t1 +# Subtest 1C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = NDB +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 1D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT,f2 BIGINT,UNIQUE(f1),UNIQUE(f2)) +ENGINE = NDB +# con2: INSERT INTO t1 VALUES (1,1), (2,2), (3,3) +# con2: DROP TABLE t1 +# Subtest 2A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# default: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 2D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 ENGINE = NDB AS SELECT 1 AS f1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 +# default: DROP TABLE t1 +# con2: SELECT COUNT(*) <> 1 FROM t1 WHERE f1 = 1 (expect to get ER_NO_SUCH_TABLE) +# Subtest 3A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# default: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +# Subtest 3D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# con2: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB (expect to get ER_TABLE_EXISTS_ERROR) +# default: DROP TABLE t1 +# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR) +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB; +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB; +DROP TABLE t1; +# Subtest 4A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# default: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# default: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 4D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1), UNIQUE (f2)) ENGINE=NDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# con2: SHOW CREATE TABLE t1 (expect to get ER_NO_SUCH_TABLE) +# default: CREATE TABLE t1 (f1 BIGINT) ENGINE=NDB +# con2: SHOW CREATE TABLE t1 +# default: DROP TABLE t1 +# Subtest 5A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB +# default: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# default: DROP TABLE t1 +# Subtest 5C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +# Subtest 5D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE TABLE t1 (f1 MEDIUMINT NOT NULL AUTO_INCREMENT,f2 BIGINT, UNIQUE(f1)) ENGINE = NDB +# con2: INSERT INTO t1 SET f2 = 9 +# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9 +# con2: DROP TABLE t1 +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB; +# Subtest 6A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# default: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# default: DROP INDEX IDX1 ON t1 +# Subtest 6C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +# Subtest 6D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: CREATE INDEX IDX1 ON t1 (f2) (expect to get ER_DUP_KEYNAME) +# default: DROP INDEX IDX1 ON t1 +# con2: DROP INDEX IDX1 ON t1 (expect to get ER_CANT_DROP_FIELD_OR_KEY) +# default: CREATE INDEX IDX1 ON t1 (f2) +# con2: DROP INDEX IDX1 ON t1 +DROP TABLE t1; +CREATE TABLE t1 (f1 BIGINT, f2 BIGINT, UNIQUE(f1)) ENGINE=NDB; +INSERT INTO t1 VALUES(1,1); +CREATE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +CREATE UNIQUE INDEX IDX ON t1 (f2); +DROP INDEX IDX ON t1; +# Subtest 8A (one connection, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8B (one connection, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# default: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8C (two connections, no PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# Subtest 8D (two connections, use PREPARE/EXECUTE) +# connection action +# default: CREATE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +# default: CREATE UNIQUE INDEX IDX ON t1 (f2) +# con2: SHOW CREATE TABLE t1 +# default: DROP INDEX IDX ON t1 +DROP TABLE t1; +DEALLOCATE PREPARE stmt_start; +DEALLOCATE PREPARE stmt_break; diff --git a/mysql-test/suite/stress/t/ddl_archive.test b/mysql-test/suite/stress/t/ddl_archive.test new file mode 100644 index 00000000000..0c47b5fcdd5 --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_archive.test @@ -0,0 +1,51 @@ +######## t/ddl_archive.test ###### +# +# Stress the storage engine ARCHIVE with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +--source include/have_archive.inc +let $engine_type= ARCHIVE; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +# Tests set to comment fail because of CSV limitations +# (limited number of keys, NULL within index not supported) +# --source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +# --source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +# --source suite/stress/include/ddl6.inc +# --source suite/stress/include/ddl7.inc +# --source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_csv.test b/mysql-test/suite/stress/t/ddl_csv.test new file mode 100644 index 00000000000..9f6185c76be --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_csv.test @@ -0,0 +1,51 @@ +######## t/ddl_csv.test ###### +# +# Stress the storage engine CSV with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +--source include/have_csv.inc +let $engine_type= CSV; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +# Tests set to comment fail because of CSV limitations +# (limited number of keys, AUTOINC not supported) +# --source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +# --source suite/stress/include/ddl4.inc +# --source suite/stress/include/ddl5.inc +# --source suite/stress/include/ddl6.inc +# --source suite/stress/include/ddl7.inc +# --source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_innodb.test b/mysql-test/suite/stress/t/ddl_innodb.test new file mode 100644 index 00000000000..784ba8ff003 --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_innodb.test @@ -0,0 +1,49 @@ +######## t/ddl_innodb.test ###### +# +# Stress the storage engine InnoDB with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +--source include/have_innodb.inc +let $engine_type= InnoDB; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +--source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +--source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +--source suite/stress/include/ddl6.inc +--source suite/stress/include/ddl7.inc +--source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_memory.test b/mysql-test/suite/stress/t/ddl_memory.test new file mode 100644 index 00000000000..5178439bff1 --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_memory.test @@ -0,0 +1,48 @@ +######## t/ddl_memory.test ###### +# +# Stress the storage engine MEMORY with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +let $engine_type= MEMORY; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +--source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +--source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +--source suite/stress/include/ddl6.inc +--source suite/stress/include/ddl7.inc +--source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_myisam.test b/mysql-test/suite/stress/t/ddl_myisam.test new file mode 100644 index 00000000000..8d6226e573b --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_myisam.test @@ -0,0 +1,48 @@ +######## t/ddl_myisam.test ###### +# +# Stress the storage engine MyISAM with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +let $engine_type= MyISAM; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 100; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 20; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +--source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +--source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +--source suite/stress/include/ddl6.inc +--source suite/stress/include/ddl7.inc +--source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln diff --git a/mysql-test/suite/stress/t/ddl_ndb.test b/mysql-test/suite/stress/t/ddl_ndb.test new file mode 100644 index 00000000000..7eb45da8739 --- /dev/null +++ b/mysql-test/suite/stress/t/ddl_ndb.test @@ -0,0 +1,56 @@ +######## t/ddl_ndb.test ###### +# +# Stress the storage engine NDB with CREATE/DROP TABLE/INDEX +# +# Please look for details within include/ddl1.inc. +# +# Creation of this test: +# 2007-07-04 mleich +# + +# Storage engine to be used in CREATE TABLE +--source include/have_ndb.inc +let $engine_type= NDB; + + +if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL + $VIEW_PROTOCOL > 0`) +{ + --skip Test requires: ps-protocol/sp-protocol/cursor-protocol/view-protocol disabled +} +# Attention: We set here much smaller values for $runtime and $loop_size compared +# to the other storage engines. +# The reason is that NDB is extreme slow and should not exceed +# the "testcase-timeout". +let $run= `SELECT '$BIG_TEST' = '1'`; +if ($run) +{ + # A run started with "--big-test" should be allowed to consume more time. + # Rough intended runtime per subtest variant in seconds + let $runtime = 5; + # number of rounds till we look at the clock again + let $loop_size= 3; +} +if (!$run) +{ + let $runtime = 1; + let $loop_size= 1; +} + + +##### Some preparations needed for the ddl*.inc scripts +--source suite/stress/include/ddl.pre + +--source suite/stress/include/ddl1.inc +--source suite/stress/include/ddl2.inc +--source suite/stress/include/ddl3.inc +--source suite/stress/include/ddl4.inc +--source suite/stress/include/ddl5.inc +--source suite/stress/include/ddl6.inc +# The following test suffers from +# Bug#26043 UNIQUE INDEX create always fails after constraint violation +# and is therefore set to comment. +# --source suite/stress/include/ddl7.inc +--source suite/stress/include/ddl8.inc + +##### Cleanup +--source suite/stress/include/ddl.cln From e4b46e7af637b6b7b2fe0573f4885904aa6b495d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Jul 2007 00:13:37 +0500 Subject: [PATCH 165/227] Fix for bug #29253: csv table reportedly marked as crashed Problem: the data file changes made during delete/update are not visible to other threads as the file is reopened, so reading data with old descriptors might miss the changes. Fix: reopen the data file before reading if it was reopened during delete/update to ensure there's no data behind. Note: there's no simple test case. storage/csv/ha_tina.cc: Fix for bug #29253: csv table reportedly marked as crashed - use the data file version technic to ensure we always see changes made by other threads: a) increase share->data_file_version each time we reopen the data file, i.e. at the end of update/delete. b) compare the local data file version with the shared one each time we want to read data, reopen it if they differ. storage/csv/ha_tina.h: Fix for bug #29253: csv table reportedly marked as crashed - use the data file version technic to ensure we always see changes made by other threads: a) increase share->data_file_version each time we reopen the data file, i.e. at the end og update/delete. b) compare the local data file version with shared one each time we want to read data, reopen it if they differ. --- storage/csv/ha_tina.cc | 52 +++++++++++++++++++++++++++++++++++++----- storage/csv/ha_tina.h | 3 +++ 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 07bd28f8e65..34c1fcde58d 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -163,6 +163,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table) share->rows_recorded= 0; share->update_file_opened= FALSE; share->tina_write_opened= FALSE; + share->data_file_version= 0; strmov(share->table_name, table_name); fn_format(share->data_file_name, table_name, "", CSV_EXT, MY_REPLACE_EXT|MY_UNPACK_FILENAME); @@ -440,7 +441,7 @@ ha_tina::ha_tina(handlerton *hton, TABLE_SHARE *table_arg) */ current_position(0), next_position(0), local_saved_data_file_length(0), file_buff(0), chain_alloced(0), chain_size(DEFAULT_CHAIN_LENGTH), - records_is_known(0) + local_data_file_version(0), records_is_known(0) { /* Set our original buffers from pre-allocated memory */ buffer.set((char*)byte_buffer, IO_SIZE, &my_charset_bin); @@ -815,6 +816,7 @@ int ha_tina::open(const char *name, int mode, uint open_options) DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); } + local_data_file_version= share->data_file_version; if ((data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1) DBUG_RETURN(0); @@ -985,6 +987,33 @@ int ha_tina::delete_row(const uchar * buf) } +/** + @brief Initialize the data file. + + @details Compare the local version of the data file with the shared one. + If they differ, there are some changes behind and we have to reopen + the data file to make the changes visible. + Call @c file_buff->init_buff() at the end to read the beginning of the + data file into buffer. + + @retval 0 OK. + @retval 1 There was an error. +*/ + +int ha_tina::init_data_file() +{ + if (local_data_file_version != share->data_file_version) + { + local_data_file_version= share->data_file_version; + if (my_close(data_file, MYF(0)) || + (data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1) + return 1; + } + file_buff->init_buff(data_file); + return 0; +} + + /* All table scans call this first. The order of a table scan is: @@ -1021,9 +1050,8 @@ int ha_tina::rnd_init(bool scan) DBUG_ENTER("ha_tina::rnd_init"); /* set buffer to the beginning of the file */ - file_buff->init_buff(data_file); - if (share->crashed) - DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); + if (share->crashed || init_data_file()) + DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); current_position= next_position= 0; stats.records= 0; @@ -1246,6 +1274,16 @@ int ha_tina::rnd_end() /* Open the file again */ if (((data_file= my_open(share->data_file_name, O_RDONLY, MYF(0))) == -1)) DBUG_RETURN(-1); + /* + As we reopened the data file, increase share->data_file_version + in order to force other threads waiting on a table lock and + have already opened the table to reopen the data file. + That makes the latest changes become visible to them. + Update local_data_file_version as no need to reopen it in the + current thread. + */ + share->data_file_version++; + local_data_file_version= share->data_file_version; /* The datafile is consistent at this point and the write filedes is closed, so nothing worrying will happen to it in case of a crash. @@ -1308,7 +1346,8 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt) DBUG_RETURN(HA_ERR_OUT_OF_MEM); /* position buffer to the start of the file */ - file_buff->init_buff(data_file); + if (init_data_file()) + DBUG_RETURN(HA_ERR_CRASHED_ON_REPAIR); /* Local_saved_data_file_length is initialized during the lock phase. @@ -1480,7 +1519,8 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt) DBUG_RETURN(HA_ERR_OUT_OF_MEM); /* position buffer to the start of the file */ - file_buff->init_buff(data_file); + if (init_data_file()) + DBUG_RETURN(HA_ERR_CRASHED); /* Local_saved_data_file_length is initialized during the lock phase. diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 2e43f1a2307..5bb3e9a79a0 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -49,6 +49,7 @@ typedef struct st_tina_share { File tina_write_filedes; /* File handler for readers */ bool crashed; /* Meta file is crashed */ ha_rows rows_recorded; /* Number of rows in tables */ + uint data_file_version; /* Version of the data file used */ } TINA_SHARE; struct tina_set { @@ -79,12 +80,14 @@ class ha_tina: public handler tina_set *chain_ptr; uchar chain_alloced; uint32 chain_size; + uint local_data_file_version; /* Saved version of the data file used */ bool records_is_known; private: bool get_write_pos(off_t *end_pos, tina_set *closest_hole); int open_update_temp_file_if_needed(); int init_tina_writer(); + int init_data_file(); public: ha_tina(handlerton *hton, TABLE_SHARE *table_arg); From d8effbe36855fe1a3d34e37f3c72a643c67e45b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 22:21:19 +0200 Subject: [PATCH 166/227] avoid multiple defines of server1/2 --- mysql-test/include/ndb_master-slave.inc | 7 ++++++- mysql-test/t/ndb_multi.test | 1 - mysql-test/t/ndb_multi_row.test | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mysql-test/include/ndb_master-slave.inc b/mysql-test/include/ndb_master-slave.inc index 81dd63be78a..ad4eb103803 100644 --- a/mysql-test/include/ndb_master-slave.inc +++ b/mysql-test/include/ndb_master-slave.inc @@ -4,7 +4,12 @@ connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,); connect (slave1,127.0.0.1,root,,test,$SLAVE_MYPORT,); connection slave; --- source include/have_ndb.inc +# Check that server is compiled and started with support for NDB +disable_query_log; +--require r/true.require +select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster'; +--source include/ndb_not_readonly.inc +enable_query_log; -- source include/master-slave-reset.inc diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/t/ndb_multi.test index 3482db1d1b2..b8e052d606b 100644 --- a/mysql-test/t/ndb_multi.test +++ b/mysql-test/t/ndb_multi.test @@ -1,4 +1,3 @@ --- source include/have_ndb.inc -- source include/have_multi_ndb.inc -- source include/not_embedded.inc diff --git a/mysql-test/t/ndb_multi_row.test b/mysql-test/t/ndb_multi_row.test index 632a9fda89a..543e282b900 100644 --- a/mysql-test/t/ndb_multi_row.test +++ b/mysql-test/t/ndb_multi_row.test @@ -1,4 +1,3 @@ --- source include/have_ndb.inc -- source include/have_multi_ndb.inc -- source include/not_embedded.inc -- source include/have_binlog_format_row.inc From fea623a1b91340347a37889bad1b10d1fe2c1e91 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Jul 2007 01:34:46 +0500 Subject: [PATCH 167/227] symlink.test, symlink.result: Minor fix for test case of bug #29325 to make emb test happy. mysql-test/t/symlink.test: Minor fix for test case of bug #29325 to make emb test happy. mysql-test/r/symlink.result: Minor fix for test case of bug #29325 to make emb test happy. --- mysql-test/r/symlink.result | 2 +- mysql-test/t/symlink.test | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result index 093e1fd57cf..aba60f757c6 100644 --- a/mysql-test/r/symlink.result +++ b/mysql-test/r/symlink.result @@ -144,7 +144,7 @@ RESET QUERY CACHE; USE db1; SET SESSION keep_files_on_create = TRUE; CREATE TABLE t1 (a INT) ENGINE MYISAM; -ERROR HY000: Can't create/write to file './db1/t1.MYD' (Errcode: 17) +Got one of the listed errors CREATE TABLE t3 (a INT) Engine=MyISAM; INSERT INTO t3 VALUES (1),(2),(3); TRUNCATE TABLE t3; diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index edad6a11392..15f50b11e73 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -196,6 +196,7 @@ USE db1; #no warning from create table SET SESSION keep_files_on_create = TRUE; --disable_abort_on_error +--error 1,1 CREATE TABLE t1 (a INT) ENGINE MYISAM; --enable_abort_on_error From 11350e076756aa4e85e5fe5443cbe8ebfd68c7f2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jul 2007 22:45:05 +0200 Subject: [PATCH 168/227] correct cluster support check --- mysql-test/include/ndb_master-slave.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/include/ndb_master-slave.inc b/mysql-test/include/ndb_master-slave.inc index ad4eb103803..1568072202b 100644 --- a/mysql-test/include/ndb_master-slave.inc +++ b/mysql-test/include/ndb_master-slave.inc @@ -7,7 +7,7 @@ connection slave; # Check that server is compiled and started with support for NDB disable_query_log; --require r/true.require -select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster'; +select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'ndbcluster'; --source include/ndb_not_readonly.inc enable_query_log; From 31ea7d042ba48bd34a457bba138d2189f844731d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Jul 2007 02:04:48 +0400 Subject: [PATCH 169/227] A follow up after the patch for Bug#21074 - even though we now have exclusive name lock on the table name in mysql_rm_table_part2, we still should keep LOCK_open - some storage engines are not ready for locking scope change and assume that LOCK_open is kept. Still, the binary logging and query cache invalidation calls moved out of LOCK_open scope. Fixes some of the broken 5.1-runtime tests (tests break on asserts). sql/ha_ndbcluster.cc: Do not lock LOCK_open for mysql_rm_table_part2 - it does that for us now. sql/mysql_priv.h: Remove an unused flag. sql/sql_class.h: Fix an unrelated compiler warning. sql/sql_db.cc: Adjust to the changed signature. sql/sql_table.cc: mysql_rm_table_part2: we need to keep LOCK_open while calling storage engine functions, even though now we have an exclusive lock on the table name. Some of them assume that it's kept and attempt to unlock it. --- sql/ha_ndbcluster.cc | 6 ++---- sql/mysql_priv.h | 3 +-- sql/sql_class.h | 2 +- sql/sql_db.cc | 2 +- sql/sql_table.cc | 44 ++++++++++++++++++-------------------------- 5 files changed, 23 insertions(+), 34 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 393c2356404..24ce9946086 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -7019,8 +7019,6 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, } } - // Lock mutex before deleting and creating frm files - pthread_mutex_lock(&LOCK_open); if (!global_read_lock) { // Delete old files @@ -7037,14 +7035,14 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, FALSE, /* if_exists */ FALSE, /* drop_temporary */ FALSE, /* drop_view */ - TRUE, /* dont_log_query*/ - FALSE); /* need lock open */ + TRUE /* dont_log_query*/); /* Clear error message that is returned when table is deleted */ thd->clear_error(); } } + pthread_mutex_lock(&LOCK_open); // Create new files List_iterator_fast it2(create_list); while ((file_name=it2++)) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index e0de89a5b74..8b00cfb5d24 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -901,8 +901,7 @@ void mysql_client_binlog_statement(THD *thd); bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, my_bool drop_temporary); int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, - bool drop_temporary, bool drop_view, bool log_query, - bool need_lock_open); + bool drop_temporary, bool drop_view, bool log_query); bool quick_rm_table(handlerton *base,const char *db, const char *table_name, uint flags); void close_cached_table(THD *thd, TABLE *table); diff --git a/sql/sql_class.h b/sql/sql_class.h index a8d62d93b21..0dad4966623 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1999,8 +1999,8 @@ class select_insert :public select_result_interceptor { class select_create: public select_insert { ORDER *group; TABLE_LIST *create_table; - TABLE_LIST *select_tables; HA_CREATE_INFO *create_info; + TABLE_LIST *select_tables; Alter_info *alter_info; Field **field; public: diff --git a/sql/sql_db.cc b/sql/sql_db.cc index a0c6f8a8e9d..8b0e371be43 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -1113,7 +1113,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, } } if (thd->killed || - (tot_list && mysql_rm_table_part2(thd, tot_list, 1, 0, 1, 1, 1))) + (tot_list && mysql_rm_table_part2(thd, tot_list, 1, 0, 1, 1))) goto err; /* Remove RAID directories */ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 31120f8020e..c603f1ad77f 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1430,11 +1430,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, LOCK_open during wait_if_global_read_lock(), other threads could not close their tables. This would make a pretty deadlock. */ - error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0, 1); - pthread_mutex_lock(&thd->mysys_var->mutex); - thd->mysys_var->current_mutex= 0; - thd->mysys_var->current_cond= 0; - pthread_mutex_unlock(&thd->mysys_var->mutex); + error= mysql_rm_table_part2(thd, tables, if_exists, drop_temporary, 0, 0); if (need_start_waiters) start_waiting_global_read_lock(thd); @@ -1477,7 +1473,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists, int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, bool drop_temporary, bool drop_view, - bool dont_log_query, bool need_lock_open) + bool dont_log_query) { TABLE_LIST *table; char path[FN_REFLEN], *alias; @@ -1489,9 +1485,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, String built_query; DBUG_ENTER("mysql_rm_table_part2"); - if (need_lock_open) - pthread_mutex_lock(&LOCK_open); - LINT_INIT(alias); LINT_INIT(path_length); @@ -1503,6 +1496,9 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, else built_query.append("DROP TABLE "); } + + pthread_mutex_lock(&LOCK_open); + /* If we have the table in the definition cache, we don't have to check the .frm file to find if the table is a normal table (not view) and what @@ -1522,20 +1518,17 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, table->table_name_length, table->table_name, 1)) { my_error(ER_BAD_LOG_STATEMENT, MYF(0), "DROP"); + pthread_mutex_unlock(&LOCK_open); DBUG_RETURN(1); } } if (!drop_temporary && lock_table_names_exclusively(thd, tables)) { - if (need_lock_open) - pthread_mutex_unlock(&LOCK_open); + pthread_mutex_unlock(&LOCK_open); DBUG_RETURN(1); } - if (need_lock_open) - pthread_mutex_unlock(&LOCK_open); - /* Don't give warnings for not found errors, as we already generate notes */ thd->no_warnings_for_error= 1; @@ -1545,7 +1538,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, handlerton *table_type; enum legacy_db_type frm_db_type; - mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL, !need_lock_open); + mysql_ha_flush(thd, table, MYSQL_HA_CLOSE_FINAL, 1); if (!close_temporary_table(thd, table)) { tmp_table_deleted=1; @@ -1582,8 +1575,6 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, { TABLE *locked_table; abort_locked_tables(thd, db, table->table_name); - if (need_lock_open) - pthread_mutex_lock(&LOCK_open); remove_table_from_cache(thd, db, table->table_name, RTFC_WAIT_OTHER_THREAD_FLAG | RTFC_CHECK_KILLED_FLAG); @@ -1594,13 +1585,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, if ((locked_table= drop_locked_tables(thd, db, table->table_name))) table->table= locked_table; - if (need_lock_open) - pthread_mutex_unlock(&LOCK_open); - if (thd->killed) { - thd->no_warnings_for_error= 0; - DBUG_RETURN(-1); + error= -1; + goto err_with_placeholders; } alias= (lower_case_table_names == 2) ? table->alias : table->table_name; /* remove .frm file and engine files */ @@ -1663,6 +1651,11 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, wrong_tables.append(String(table->table_name,system_charset_info)); } } + /* + It's safe to unlock LOCK_open: we have an exclusive lock + on the table name. + */ + pthread_mutex_unlock(&LOCK_open); thd->tmp_table_used= tmp_table_deleted; error= 0; if (wrong_tables.length()) @@ -1722,11 +1715,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, */ } } - if (need_lock_open) - pthread_mutex_lock(&LOCK_open); + pthread_mutex_lock(&LOCK_open); +err_with_placeholders: unlock_table_names(thd, tables, (TABLE_LIST*) 0); - if (need_lock_open) - pthread_mutex_unlock(&LOCK_open); + pthread_mutex_unlock(&LOCK_open); thd->no_warnings_for_error= 0; DBUG_RETURN(error); } From 9a52e13ccb92d6f30bbd4e92e73771b2a2662021 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Jul 2007 04:38:21 +0400 Subject: [PATCH 170/227] Fix a warning in a non-debug build. --- sql/sql_cache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 69efbdf006a..0e4404b87fc 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -793,7 +793,8 @@ void query_cache_end_of_result(THD *thd) query_cache.wreck() switched query cache off but left content untouched for investigation (it is debugging method). */ - goto end; + STRUCT_UNLOCK(&query_cache.structure_guard_mutex); + DBUG_VOID_RETURN; } #endif header->found_rows(current_thd->limit_found_rows); @@ -808,7 +809,6 @@ void query_cache_end_of_result(THD *thd) } -end: STRUCT_UNLOCK(&query_cache.structure_guard_mutex); DBUG_VOID_RETURN; } From 393e0f654172bd90c2b079d79bc7ae381df7540a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Jul 2007 05:22:24 +0400 Subject: [PATCH 171/227] Fix a compiler warning. --- sql/sql_trigger.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index b5165a29ab4..55eae2f5ea5 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1805,16 +1805,16 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db, bzero(&table, sizeof(table)); init_alloc_root(&table.mem_root, 8192, 0); - uchar key[MAX_DBKEY_LENGTH]; - uint key_length= (uint) (strmov(strmov((char*)&key[0], db)+1, - old_table)-(char*)&key[0])+1; - /* This method interfaces the mysql server code protected by either LOCK_open mutex or with an exclusive table name lock. In the future, only an exclusive table name lock will be enough. */ #ifndef DBUG_OFF + uchar key[MAX_DBKEY_LENGTH]; + uint key_length= (uint) (strmov(strmov((char*)&key[0], db)+1, + old_table)-(char*)&key[0])+1; + if (!is_table_name_exclusively_locked_by_this_thread(thd, key, key_length)) safe_mutex_assert_owner(&LOCK_open); #endif From a9c6a0bbbc3f56e859848f2f4ac21412995dde2c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Jul 2007 17:58:39 +0500 Subject: [PATCH 172/227] BUG#29734 - thread_id=0 in binary log which leads to temporary table conflicts pseudo_thread_id was reset to zero via mysql_change_user() handling whereas there is no reason to do that. Moreover, having two concurrent threads that change user and create a namesake temp tables leads to recording the dup pair of queries: set @@session.pseudo_thread_id = 0; CREATE temporary table `the namesake`; which will stall the slave as the second instance can not be created. And that is the bug case. Fixed by correcting pseudo_thread_id value after mysql_change_user(). sql/sql_class.cc: Fixed that pseudo_thread_id was set to 0 after mysql_change_user(). --- sql/sql_class.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 036ba217a9b..ee4e1ea149c 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -211,7 +211,7 @@ THD::THD() time_after_lock=(time_t) 0; current_linfo = 0; slave_thread = 0; - variables.pseudo_thread_id= 0; + thread_id= 0; one_shot_set= 0; file_id = 0; query_id= 0; @@ -328,6 +328,12 @@ void THD::init(void) variables.date_format); variables.datetime_format= date_time_format_copy((THD*) 0, variables.datetime_format); + /* + variables= global_system_variables above has reset + variables.pseudo_thread_id to 0. We need to correct it here to + avoid temporary tables replication failure. + */ + variables.pseudo_thread_id= thread_id; pthread_mutex_unlock(&LOCK_global_system_variables); server_status= SERVER_STATUS_AUTOCOMMIT; if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) @@ -579,6 +585,9 @@ bool THD::store_globals() By default 'slave_proxy_id' is 'thread_id'. They may later become different if this is the slave SQL thread. */ + /** @todo we already do it in init(), see if we still need to do it here. + add DBUG_ASSERT(variables.pseudo_thread_id == thread_id) + */ variables.pseudo_thread_id= thread_id; /* We have to call thr_lock_info_init() again here as THD may have been From 25545b4bfb56ed4581edddb47820f4c968bb1f1f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Jul 2007 22:02:10 +0400 Subject: [PATCH 173/227] BUG#29740: Make the test result deterministic --- mysql-test/r/index_merge.result | 30 +++++++++++++++--------------- mysql-test/t/index_merge.test | 5 +++++ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/index_merge.result b/mysql-test/r/index_merge.result index c7e4ead9eeb..15aa636d740 100644 --- a/mysql-test/r/index_merge.result +++ b/mysql-test/r/index_merge.result @@ -483,36 +483,36 @@ insert into t2 select * from t1; must use sort-union rather than union: explain select * from t1 where a=4 or b=4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 4 Using sort_union(a,b); Using where +1 SIMPLE t1 index_merge a,b a,b 5,5 NULL # Using sort_union(a,b); Using where select * from t1 where a=4 or b=4; a filler b -4 zz 4 -5 qq 4 +4 4 0 +4 5 0 +4 filler 4 4 filler 4 4 qq 5 -4 4 0 -4 filler 4 -4 5 0 +4 zz 4 +5 qq 4 select * from t1 ignore index(a,b) where a=4 or b=4; a filler b -4 filler 4 -4 filler 4 -4 5 0 4 4 0 +4 5 0 +4 filler 4 +4 filler 4 4 qq 5 -5 qq 4 4 zz 4 +5 qq 4 must use union, not sort-union: explain select * from t2 where a=4 or b=4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index_merge a,b a,b 5,5 NULL 7 Using union(a,b); Using where +1 SIMPLE t2 index_merge a,b a,b 5,5 NULL # Using union(a,b); Using where select * from t2 where a=4 or b=4; a filler b +4 4 0 4 5 0 -4 zz 4 -5 qq 4 +4 filler 4 4 filler 4 4 qq 5 -4 4 0 -4 filler 4 +4 zz 4 +5 qq 4 drop table t1, t2; diff --git a/mysql-test/t/index_merge.test b/mysql-test/t/index_merge.test index 7d9a4340b0f..8c19ab4d7d6 100644 --- a/mysql-test/t/index_merge.test +++ b/mysql-test/t/index_merge.test @@ -448,12 +448,17 @@ create table t2( insert into t2 select * from t1; --echo must use sort-union rather than union: +--replace_column 9 # explain select * from t1 where a=4 or b=4; +--sorted_result select * from t1 where a=4 or b=4; +--sorted_result select * from t1 ignore index(a,b) where a=4 or b=4; --echo must use union, not sort-union: +--replace_column 9 # explain select * from t2 where a=4 or b=4; +--sorted_result select * from t2 where a=4 or b=4; drop table t1, t2; From 4f146f656c319f0ffb37f9f1428035aadf4acaf5 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 14 Jul 2007 22:43:58 +0400 Subject: [PATCH 174/227] Bug#29729: Wrong conversion error led to an empty result set. The Field_newdate::store when storing a DATETIME value was returning the 'value was cut' error even if the thd->count_cuted_fields flag is set to CHECK_FIELD_IGNORE. This made range optimizr think that there is no appropriate data in the table and thus to return an empty set. Now the Field_newdate::store function returns conversion error only if the thd->count_cuted_fields flag isn't set to CHECK_FIELD_IGNORE. mysql-test/t/type_time.test: Added a test case for the bug#29729: Wrong conversion error led to an empty result set. mysql-test/r/type_time.result: Added a test case for the bug#29729: Wrong conversion error led to an empty result set. sql/field.cc: Bug#29729: Wrong conversion error led to an empty result set. --- mysql-test/r/type_time.result | 13 +++++++++++++ mysql-test/t/type_time.test | 15 +++++++++++++++ sql/field.cc | 3 ++- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index 71bd8b68a0b..def94bd707b 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -109,3 +109,16 @@ select 1 from t1 where cast('100:00:00' as time) between f1 and f2; 1 1 drop table t1; +CREATE TABLE t1 ( +f2 date NOT NULL, +f3 int(11) unsigned NOT NULL default '0', +PRIMARY KEY (f3, f2) +); +insert into t1 values('2007-07-01', 1); +insert into t1 values('2007-07-01', 2); +insert into t1 values('2007-07-02', 1); +insert into t1 values('2007-07-02', 2); +SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2; +sum(f3) +3 +drop table t1; diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index 82d701e29b5..bc4f850dfee 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -58,3 +58,18 @@ create table t1(f1 time, f2 time); insert into t1 values('20:00:00','150:00:00'); select 1 from t1 where cast('100:00:00' as time) between f1 and f2; drop table t1; + +# +# Bug#29729: Wrong conversion error led to an empty result set. +# +CREATE TABLE t1 ( + f2 date NOT NULL, + f3 int(11) unsigned NOT NULL default '0', + PRIMARY KEY (f3, f2) +); +insert into t1 values('2007-07-01', 1); +insert into t1 values('2007-07-01', 2); +insert into t1 values('2007-07-02', 1); +insert into t1 values('2007-07-02', 2); +SELECT sum(f3) FROM t1 where f2='2007-07-01 00:00:00' group by f2; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 2e227f0e67e..993c1fb3c4f 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5271,7 +5271,8 @@ int Field_newdate::store(const char *from,uint len,CHARSET_INFO *cs) else { tmp= l_time.day + l_time.month*32 + l_time.year*16*32; - if (!error && (ret != MYSQL_TIMESTAMP_DATE)) + if (!error && (ret != MYSQL_TIMESTAMP_DATE) && + thd->count_cuted_fields != CHECK_FIELD_IGNORE) error= 3; // Datetime was cut (note) } From 7416224c60a876c5cde518e41469911d1b00b3ce Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 15 Jul 2007 13:25:38 +0400 Subject: [PATCH 175/227] A fix for Bug#27406 Events: failure only causes a warning. Update test results. When executing a CREATE EVENT statement with ON COMPLETION NOT PRESERVE clause (explicit or implicit) and completion date in the past, we do not create the event. Or, put it differently, we create it and then drop immediately. A warning is issued in this case, not an error -- we want to load successfully old database dumps, and such dumps may contain events that are no longer valid. Update the warning text to not imply an erroneous condition. mysql-test/r/events_bugs.result: Update the test results (Bug#27406) sql/share/errmsg.txt: Fix Bug#27406 "Events: failure only causes a warning" -- update the error message to not imply that there was a failure. --- mysql-test/r/events_bugs.result | 14 +++++++------- sql/share/errmsg.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index a01f098affb..14728bdcc2e 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -31,7 +31,7 @@ create event e_55 on schedule at 10000101000000 do drop table t; ERROR HY000: Incorrect AT value: '10000101000000' create event e_55 on schedule at 20000101000000 do drop table t; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation. show events; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t; @@ -447,32 +447,32 @@ e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00 The following should fail, and nothing should be altered. ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00'; -ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered +ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation. ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00' DISABLE; -ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered +ERROR HY000: Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation. The following should give warnings, and nothing should be created. CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00' DO SELECT 1; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation. CREATE EVENT e4 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00' ENDS '1999-01-02 00:00:00' DISABLE DO SELECT 1; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation. CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DO SELECT 1; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation. CREATE EVENT e4 ON SCHEDULE AT '1999-01-01 00:00:00' DISABLE DO SELECT 1; Warnings: -Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created +Note 1584 Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation. SHOW EVENTS; Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 0e3544415d1..0b26fa52e32 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6052,9 +6052,9 @@ ER_BINLOG_PURGE_EMFILE eng "Too many files opened, please execute the command again" ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus" ER_EVENT_CANNOT_CREATE_IN_THE_PAST - eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been created" + eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation." ER_EVENT_CANNOT_ALTER_IN_THE_PAST - eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. Event has not been altered" + eng "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation." ER_SLAVE_INCIDENT eng "The incident %s occured on the master. Message: %-.64s" ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT From 8023d91929247f1b2e2f81ca10daca4dde4ab2e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 15 Jul 2007 13:34:35 +0400 Subject: [PATCH 176/227] Add a teste case for Bug#27296 "Assertion in ALTER TABLE SET DEFAULT in Linux Debug build (possible deadlock)" The bug is not repeatable any more. mysql-test/r/innodb_mysql.result: Update test results (Bug#27296) mysql-test/t/innodb_mysql.test: Add a teste case for Bug#27296 "Assertion in ALTER TABLE SET DEFAULT in Linux Debug build (possible deadlock)" --- mysql-test/r/innodb_mysql.result | 4 ++++ mysql-test/t/innodb_mysql.test | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 11c7c2aedc9..847805e7b6f 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -676,4 +676,8 @@ INSERT INTO t1 VALUES (1); switch to connection default SET AUTOCOMMIT=default; DROP TABLE t1,t2; +drop table if exists t1; +create table t1 (a int) engine=innodb; +alter table t1 alter a set default 1; +drop table t1; End of 5.0 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index 25ba9a258ff..49ffe359fd9 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -670,5 +670,19 @@ DISCONNECT c1; DISCONNECT c2; DROP TABLE t1,t2; +# +# Bug#27296 Assertion in ALTER TABLE SET DEFAULT in Linux Debug build +# (possible deadlock). +# +# The bug is applicable only to a transactoinal table. +# Cover with tests behavior that no longer causes an +# assertion. +# +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1 (a int) engine=innodb; +alter table t1 alter a set default 1; +drop table t1; --echo End of 5.0 tests From 9828ab7096314b329a622e6daf0dbd512c1bb662 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 15 Jul 2007 18:47:57 +0200 Subject: [PATCH 177/227] Post-merge fixes Disabled tests which break automatic merging due to non-empty warnings file. --- mysql-test/suite/ndb/t/disabled.def | 1 + mysql-test/suite/rpl/t/disabled.def | 15 +++++++++++++++ mysql-test/suite/rpl_ndb/t/disabled.def | 2 ++ mysql-test/t/disabled.def | 2 ++ 4 files changed, 20 insertions(+) diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def index 96ef152f513..023c9c47210 100644 --- a/mysql-test/suite/ndb/t/disabled.def +++ b/mysql-test/suite/ndb/t/disabled.def @@ -22,3 +22,4 @@ ndb_partition_error2 : HF is not sure if the test can work as internded on all #ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events #ndb_binlog_discover : bug#21806 2006-08-24 #ndb_autodiscover3 : bug#21806 +ndb_autodiscover3 : Bug#20872 2007-07-15 ingo master*.err: miscellaneous error messages diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index fda40c30340..6ebbd3a2f46 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -14,3 +14,18 @@ rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after C rpl_innodb_mixed_ddl : Bug #29363 rpl.rpl_innodb_mixed_* test failures rpl_innodb_mixed_dml : Bug #29363 rpl.rpl_innodb_mixed_* test failures rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case +rpl_deadlock_innodb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_extraCol_innodb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_extraCol_myisam : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_incident : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_known_bugs_detection : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_loaddata : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_loaddata_fatal : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_rewrt_db : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_rotate_logs : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_row_inexist_tbl : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_row_tabledefs_2myisam : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_row_tabledefs_3innodb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_ssl : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_stm_EE_err2 : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_stm_mystery22 : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index f5c99129c89..8392c39331e 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -26,3 +26,5 @@ rpl_ndb_ctype_ucs2_def : BUG#27404 util thd mysql_parse sig11 when mysqld defa # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open #rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly +rpl_ndb_extraCol : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file +rpl_truncate_7ndb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 9d2b4abc929..b994561116d 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -25,3 +25,5 @@ ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Do mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage federated_innodb : Bug#29522 failed assertion in binlog_close_connection() +binlog_innodb : Bug#29806 2007-07-15 ingo master.err: InnoDB: Error: MySQL is freeing a thd +innodb_mysql : Bug#29807 2007-07-15 ingo master.err: Cannot find table test/t2 from the internal data dictionary From 6e078ff5433080699416ed473a332395d48a1bfa Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 15 Jul 2007 21:51:36 +0400 Subject: [PATCH 178/227] Extended fix for the bug#29555. The get_time_value function is added. It is used to obtain TIME values both from items the can return time as an integer and from items that can return time only as a string. The Arg_comparator::compare_datetime function now uses pointer to a getter function to obtain values to compare. Now this function is also used for comparison of TIME values. The get_value_func variable is added to the Arg_comparator class. It points to a getter function for the DATE/DATETIME/TIME comparator. mysql-test/t/type_time.test: Extended test case for the bug#29555. mysql-test/r/type_time.result: Extended test case for the bug#29555. sql/item_cmpfunc.cc: Extended fix for the bug#29555. The get_time_value function is added. It is used to obtain TIME values both from items the can return time as an integer and from items that can return time only as a string. The Arg_comparator::compare_datetime function now uses pointer to a getter function to obtain values to compare. Now this function is also used for comparison of TIME values. sql/item_cmpfunc.h: Extended fix for the bug#29555. The get_value_func variable is added to the Arg_comparator class. It points to a getter function for the DATE/DATETIME/TIME comparator. --- mysql-test/r/type_time.result | 6 +++ mysql-test/t/type_time.test | 4 ++ sql/item_cmpfunc.cc | 81 ++++++++++++++++++++++++++++++++--- sql/item_cmpfunc.h | 2 + 4 files changed, 86 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index def94bd707b..96bf23109df 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -103,6 +103,12 @@ cast('100:55:50' as time) > cast('024:00:00' as time) select cast('300:55:50' as time) > cast('240:00:00' as time); cast('300:55:50' as time) > cast('240:00:00' as time) 1 +create table t1 (f1 time); +insert into t1 values ('24:00:00'); +select cast('24:00:00' as time) = (select f1 from t1); +cast('24:00:00' as time) = (select f1 from t1) +1 +drop table t1; create table t1(f1 time, f2 time); insert into t1 values('20:00:00','150:00:00'); select 1 from t1 where cast('100:00:00' as time) between f1 and f2; diff --git a/mysql-test/t/type_time.test b/mysql-test/t/type_time.test index bc4f850dfee..5fc763be7fe 100644 --- a/mysql-test/t/type_time.test +++ b/mysql-test/t/type_time.test @@ -50,6 +50,10 @@ select cast('300:55:50' as time) < cast('240:00:00' as time); select cast('100:55:50' as time) > cast('24:00:00' as time); select cast('100:55:50' as time) > cast('024:00:00' as time); select cast('300:55:50' as time) > cast('240:00:00' as time); +create table t1 (f1 time); +insert into t1 values ('24:00:00'); +select cast('24:00:00' as time) = (select f1 from t1); +drop table t1; # # Bug#29739: Incorrect time comparison in BETWEEN. diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 555384b2bfc..8e16dfb4145 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -666,6 +666,68 @@ Arg_comparator::can_compare_as_dates(Item *a, Item *b, ulonglong *const_value) } +/* + Retrieves correct TIME value from the given item. + + SYNOPSIS + get_time_value() + thd thread handle + item_arg [in/out] item to retrieve TIME value from + cache_arg [in/out] pointer to place to store the caching item to + warn_item [in] unused + is_null [out] TRUE <=> the item_arg is null + + DESCRIPTION + Retrieves the correct TIME value from given item for comparison by the + compare_datetime() function. + If item's result can be compared as longlong then its int value is used + and a value returned by get_time function is used otherwise. + If an item is a constant one then its value is cached and it isn't + get parsed again. An Item_cache_int object is used for caching values. It + seamlessly substitutes the original item. The cache item is marked as + non-constant to prevent re-caching it again. + + RETURN + obtained value +*/ + +ulonglong +get_time_value(THD *thd, Item ***item_arg, Item **cache_arg, + Item *warn_item, bool *is_null) +{ + ulonglong value; + Item *item= **item_arg; + MYSQL_TIME ltime; + + if (item->result_as_longlong()) + { + value= item->val_int(); + *is_null= item->null_value; + } + else + { + *is_null= item->get_time(<ime); + if (!is_null) + value= TIME_to_ulonglong_datetime(<ime); + } + /* + Do not cache GET_USER_VAR() function as its const_item() may return TRUE + for the current thread but it still may change during the execution. + */ + if (item->const_item() && cache_arg && (item->type() != Item::FUNC_ITEM || + ((Item_func*)item)->functype() != Item_func::GUSERVAR_FUNC)) + { + Item_cache_int *cache= new Item_cache_int(); + /* Mark the cache as non-const to prevent re-caching. */ + cache->set_used_tables(1); + cache->store(item, value); + *cache_arg= cache; + *item_arg= cache_arg; + } + return value; +} + + int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg, Item **a1, Item **a2, Item_result type) @@ -704,6 +766,7 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg, } is_nulls_eq= test(owner && owner->functype() == Item_func::EQUAL_FUNC); func= &Arg_comparator::compare_datetime; + get_value_func= &get_datetime_value; return 0; } else if (type == STRING_RESULT && (*a)->field_type() == MYSQL_TYPE_TIME && @@ -712,9 +775,11 @@ int Arg_comparator::set_cmp_func(Item_bool_func2 *owner_arg, /* Compare TIME values as integers. */ thd= current_thd; owner= owner_arg; - func= ((test(owner && owner->functype() == Item_func::EQUAL_FUNC)) ? - &Arg_comparator::compare_e_int : - &Arg_comparator::compare_int_unsigned); + a_cache= 0; + b_cache= 0; + is_nulls_eq= test(owner && owner->functype() == Item_func::EQUAL_FUNC); + func= &Arg_comparator::compare_datetime; + get_value_func= &get_time_value; return 0; } @@ -735,8 +800,10 @@ void Arg_comparator::set_datetime_cmp_func(Item **a1, Item **b1) b_cache= 0; is_nulls_eq= FALSE; func= &Arg_comparator::compare_datetime; + get_value_func= &get_datetime_value; } + /* Retrieves correct DATETIME value from given item. @@ -850,8 +917,8 @@ int Arg_comparator::compare_datetime() bool is_null= FALSE; ulonglong a_value, b_value; - /* Get DATE/DATETIME value of the 'a' item. */ - a_value= get_datetime_value(thd, &a, &a_cache, *b, &is_null); + /* Get DATE/DATETIME/TIME value of the 'a' item. */ + a_value= (*get_value_func)(thd, &a, &a_cache, *b, &is_null); if (!is_nulls_eq && is_null) { if (owner) @@ -859,8 +926,8 @@ int Arg_comparator::compare_datetime() return -1; } - /* Get DATE/DATETIME value of the 'b' item. */ - b_value= get_datetime_value(thd, &b, &b_cache, *a, &is_null); + /* Get DATE/DATETIME/TIME value of the 'b' item. */ + b_value= (*get_value_func)(thd, &b, &b_cache, *a, &is_null); if (is_null) { if (owner) diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 79091b9c87d..9afc0507817 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -42,6 +42,8 @@ class Arg_comparator: public Sql_alloc bool is_nulls_eq; // TRUE <=> compare for the EQUAL_FUNC enum enum_date_cmp_type { CMP_DATE_DFLT= 0, CMP_DATE_WITH_DATE, CMP_DATE_WITH_STR, CMP_STR_WITH_DATE }; + ulonglong (*get_value_func)(THD *thd, Item ***item_arg, Item **cache_arg, + Item *warn_item, bool *is_null); public: DTCollation cmp_collation; From 16135c7dca88e7ed0d78bf2e5d5cc748d6320dfb Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 15 Jul 2007 23:40:57 +0400 Subject: [PATCH 179/227] item_cmpfunc.cc: A comment changed. sql/item_cmpfunc.cc: A comment changed. --- sql/item_cmpfunc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 8e16dfb4145..161a3f7bb19 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -673,7 +673,7 @@ Arg_comparator::can_compare_as_dates(Item *a, Item *b, ulonglong *const_value) get_time_value() thd thread handle item_arg [in/out] item to retrieve TIME value from - cache_arg [in/out] pointer to place to store the caching item to + cache_arg [in/out] pointer to place to store the cache item to warn_item [in] unused is_null [out] TRUE <=> the item_arg is null @@ -683,8 +683,8 @@ Arg_comparator::can_compare_as_dates(Item *a, Item *b, ulonglong *const_value) If item's result can be compared as longlong then its int value is used and a value returned by get_time function is used otherwise. If an item is a constant one then its value is cached and it isn't - get parsed again. An Item_cache_int object is used for caching values. It - seamlessly substitutes the original item. The cache item is marked as + get parsed again. An Item_cache_int object is used for for cached values. + It seamlessly substitutes the original item. The cache item is marked as non-constant to prevent re-caching it again. RETURN From 3e925554ece25332a21125233a13c0e10253d482 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 00:59:47 +0400 Subject: [PATCH 180/227] item_cmpfunc.cc: Fixed compiler warning. sql/item_cmpfunc.cc: Fixed compiler warning. --- sql/item_cmpfunc.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 161a3f7bb19..a89f6337f5f 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -707,8 +707,7 @@ get_time_value(THD *thd, Item ***item_arg, Item **cache_arg, else { *is_null= item->get_time(<ime); - if (!is_null) - value= TIME_to_ulonglong_datetime(<ime); + value= !is_null ? TIME_to_ulonglong_datetime(<ime) : 0; } /* Do not cache GET_USER_VAR() function as its const_item() may return TRUE From 56a65d7ad097ff9f2b0677338df059a6b96afd94 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 01:03:58 +0400 Subject: [PATCH 181/227] item_cmpfunc.cc: A typo fixed. sql/item_cmpfunc.cc: A typo fixed. --- sql/item_cmpfunc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index a89f6337f5f..86eb10d50b0 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -707,7 +707,7 @@ get_time_value(THD *thd, Item ***item_arg, Item **cache_arg, else { *is_null= item->get_time(<ime); - value= !is_null ? TIME_to_ulonglong_datetime(<ime) : 0; + value= !*is_null ? TIME_to_ulonglong_datetime(<ime) : 0; } /* Do not cache GET_USER_VAR() function as its const_item() may return TRUE From a21ff660953cae4c43b8221926a5f302e205c9c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 15:09:46 +0500 Subject: [PATCH 182/227] BUG#29807 - innodb_mysql.test: Cannot find table test/t2 from the internal data dictionary - re-enabled innodb_mysql test; - added a rule to through away expected warning to mtr_report.pl; - fixed a test case to produce unique warning. mysql-test/include/mix1.inc: Modified a test case to through away expected warning. mysql-test/lib/mtr_report.pl: Through away a warning produced by BUG#29807 test. mysql-test/r/innodb_mysql.result: Modified a test case to through away expected warning. mysql-test/t/disabled.def: Re-enabled innodb_mysql.test. --- mysql-test/include/mix1.inc | 10 +++++----- mysql-test/lib/mtr_report.pl | 6 +++++- mysql-test/r/innodb_mysql.result | 12 ++++++------ mysql-test/t/disabled.def | 1 - 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc index 11b0013fc38..6a82d2b126c 100644 --- a/mysql-test/include/mix1.inc +++ b/mysql-test/include/mix1.inc @@ -677,14 +677,14 @@ DROP TABLE t1,t2,t3; # create table t1 (a int) engine=innodb; -copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/t2.frm; +copy_file $MYSQLTEST_VARDIR/master-data/test/t1.frm $MYSQLTEST_VARDIR/master-data/test/bug29807.frm; --error 1146 -select * from t2; +select * from bug29807; drop table t1; --error 1051 -drop table t2; -create table t2 (a int); -drop table t2; +drop table bug29807; +create table bug29807 (a int); +drop table bug29807; # diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 317b5b8ba8e..306a0fe5d9d 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -358,7 +358,11 @@ sub mtr_report_stats ($) { # Test case for Bug#14233 produces the following warnings: /Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc/ or /Stored routine 'test'.'bug14233_2': invalid value in column mysql.proc/ or - /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/ + /Stored routine 'test'.'bug14233_3': invalid value in column mysql.proc/ or + + # BUG#29807 - innodb_mysql.test: Cannot find table test/t2 + # from the internal data dictionary + /Cannot find table test\/bug29807 from the internal data dictionary/ ) { next; # Skip these lines diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index cdea5c49594..a2ed8f6b175 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -666,13 +666,13 @@ SELECT * FROM t3 WHERE a = 'uk'; a DROP TABLE t1,t2,t3; create table t1 (a int) engine=innodb; -select * from t2; -ERROR 42S02: Table 'test.t2' doesn't exist +select * from bug29807; +ERROR 42S02: Table 'test.bug29807' doesn't exist drop table t1; -drop table t2; -ERROR 42S02: Unknown table 't2' -create table t2 (a int); -drop table t2; +drop table bug29807; +ERROR 42S02: Unknown table 'bug29807' +create table bug29807 (a int); +drop table bug29807; CREATE TABLE t1 (a INT) ENGINE=InnoDB; CREATE TABLE t2 (a INT) ENGINE=InnoDB; switch to connection c1 diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index b994561116d..17505cc91b7 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -26,4 +26,3 @@ ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Do mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage federated_innodb : Bug#29522 failed assertion in binlog_close_connection() binlog_innodb : Bug#29806 2007-07-15 ingo master.err: InnoDB: Error: MySQL is freeing a thd -innodb_mysql : Bug#29807 2007-07-15 ingo master.err: Cannot find table test/t2 from the internal data dictionary From 7d3cecca0ae25abdc2943e79410a19bdde5fff54 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 12:42:12 +0200 Subject: [PATCH 183/227] Raise version number after cloning 5.0.46 --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 5f02b5eae63..1da39ac1aa3 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.46) +AM_INIT_AUTOMAKE(mysql, 5.0.48) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=46 +NDB_VERSION_BUILD=48 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 02a832df2e9743fbe132fe84f906761fc00c1279 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 15:57:20 +0400 Subject: [PATCH 184/227] A follow up after the fix for Bug#21074 - fix NDB tests breaking on asserts. The patch for Bug#21074 replaces acquisition of the global LOCK_open lock with exclusive locks on table names in such operations ad DROP TABLE and RENAME TABLE. Unfortunately, NDB internally assumes that LOCK_open is acquired and tries to release it. This dependency should be fixed by a separate (and significant in size) patch. For now we just satisfy it - after all, the original goal of the patch for Bug#21074 was to move query_cache_invalidate outside of the scope of LOCK_open, and we still can do that. This fixes some failing NDB tests in the runtime tree. sql/sql_rename.cc: Move release of LOCK_open after ha_ndbcluster::rename_tables to satisfy an assert in ndb_log_schema_op. --- sql/sql_rename.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index e68a360f2d4..f5e1b8988f3 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -150,7 +150,6 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) pthread_mutex_unlock(&LOCK_open); goto err; } - pthread_mutex_unlock(&LOCK_open); error=0; if ((ren_table=rename_tables(thd,table_list,0))) @@ -174,6 +173,17 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent) error= 1; } + /* + An exclusive lock on table names is satisfactory to ensure + no other thread accesses this table. + However, NDB assumes that handler::rename_tables is called under + LOCK_open. And it indeed is, from ALTER TABLE. + TODO: remove this limitation. + We still should unlock LOCK_open as early as possible, to provide + higher concurrency - query_cache_invalidate can take minutes to + complete. + */ + pthread_mutex_unlock(&LOCK_open); /* Lets hope this doesn't fail as the result will be messy */ if (!silent && !error) From 9917ce268d41942e977e0cfe0f093c20bb4018a2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 19:08:07 +0500 Subject: [PATCH 185/227] Bug #29687 mysql_stmt_store_result memory leak in libmysqld In embedded server we use result->alloc to store field data for the result, but we didn't clean the result->alloc if the query returned an empty recordset. Cleaning for the empty recordset enabled libmysql/libmysql.c: Bug #29687 mysql_stmt_store_result memory leak in libmysqld we should clean result->alloc even if we have nothin in 'data' field --- libmysql/libmysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 72bc4445d83..1a0aae414ed 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -4945,7 +4945,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) Reset stored result set if so was requested or it's a part of cursor fetch. */ - if (result->data && (flags & RESET_STORE_RESULT)) + if (flags & RESET_STORE_RESULT) { /* Result buffered */ free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); From f3c857068dfc059d418bf20370fb5ec683a7e180 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 16:12:05 +0200 Subject: [PATCH 186/227] Post-merge fix Disabled a test that reports Slave SQL error in warnings file. --- mysql-test/suite/rpl/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 6ebbd3a2f46..14102c27c17 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -14,6 +14,7 @@ rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after C rpl_innodb_mixed_ddl : Bug #29363 rpl.rpl_innodb_mixed_* test failures rpl_innodb_mixed_dml : Bug #29363 rpl.rpl_innodb_mixed_* test failures rpl_invoked_features : BUG#29020 2007-06-21 Lars Non-deterministic test case +rpl_auto_increment_11932 : Bug#29809 2007-07-16 ingo Slave SQL errors in warnings file rpl_deadlock_innodb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file rpl_extraCol_innodb : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file rpl_extraCol_myisam : Bug#29809 2007-07-15 ingo Slave SQL errors in warnings file From b6c0fb605d613df14405e1d7c5621d22b35bc4fe Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 22:34:36 +0400 Subject: [PATCH 187/227] Fix ndb_cache* test failures in the -runtime tree. Do not try to acquire structure_guard_mutex for the second time when invalidating a table from send_result_to_client. sql/sql_cache.cc: Do not try to acquire mutex when invalidating a table from send_result_to_client(). A follow up patch for the patch for Bug#21074. Reuse code by moving locking-independent invalidation functionality into invalidate_table_internal. sql/sql_cache.h: Add a new declaration. --- sql/sql_cache.cc | 33 +++++++++++++++++++++++++-------- sql/sql_cache.h | 1 + 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index f7ad024c143..cab9ef94d6d 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1347,7 +1347,9 @@ def_week_frmt: %lu", ("Handler require invalidation queries of %s.%s %lu-%lu", table_list.db, table_list.alias, (ulong) engine_data, (ulong) table->engine_data())); - invalidate_table(thd, (uchar *) table->db(), table->key_length()); + invalidate_table_internal(thd, + (uchar *) table->db(), + table->key_length()); } else thd->lex->safe_to_cache_query= 0; // Don't try to cache this @@ -2468,13 +2470,8 @@ void Query_cache::invalidate_table(THD *thd, uchar * key, uint32 key_length) m_cache_status= Query_cache::TABLE_FLUSH_IN_PROGRESS; STRUCT_UNLOCK(&structure_guard_mutex); - Query_cache_block *table_block= - (Query_cache_block*)hash_search(&tables, key, key_length); - if (query_cache_size > 0 && table_block) - { - Query_cache_block_table *list_root= table_block->table(0); - invalidate_query_block_list(thd, list_root); - } + if (query_cache_size > 0) + invalidate_table_internal(thd, key, key_length); STRUCT_LOCK(&structure_guard_mutex); m_cache_status= Query_cache::NO_FLUSH_IN_PROGRESS; @@ -2488,6 +2485,26 @@ void Query_cache::invalidate_table(THD *thd, uchar * key, uint32 key_length) } +/** + Try to locate and invalidate a table by name. + The caller must ensure that no other thread is trying to work with + the query cache when this function is executed. + + @pre structure_guard_mutex is acquired or TABLE_FLUSH_IN_PROGRESS is set. +*/ + +void +Query_cache::invalidate_table_internal(THD *thd, uchar *key, uint32 key_length) +{ + Query_cache_block *table_block= + (Query_cache_block*)hash_search(&tables, key, key_length); + if (table_block) + { + Query_cache_block_table *list_root= table_block->table(0); + invalidate_query_block_list(thd, list_root); + } +} + /** @brief Invalidate a linked list of query cache blocks. diff --git a/sql/sql_cache.h b/sql/sql_cache.h index cfc52e5d33a..c4c7e1dbc5e 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -279,6 +279,7 @@ private: Cache_status m_cache_status; void free_query_internal(Query_cache_block *point); + void invalidate_table_internal(THD *thd, uchar *key, uint32 key_length); protected: /* From fcc51efc4df3814d1ea21cc92dc0fe719bddb613 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 14:53:05 -0400 Subject: [PATCH 188/227] Bug #29692 Single row inserts can incorrectly report a huge number of row insertions This bug was caused by unitialized value that was the result of a bad 5.0 merge. sql/sql_class.h: Readded comments lost in a bad merge. sql/sql_insert.cc: Fixed code to completely initialize (zero) the "COPY_INFO info" var in the same manner as the delayed write code. Readded a change that was lost in a bad merge. tests/mysql_client_test.c: Test case added for bug#29692. --- sql/sql_class.h | 20 ++++++++++++++++---- sql/sql_insert.cc | 9 +++++---- tests/mysql_client_test.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index 004c4aa4f5a..52feee47499 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -65,11 +65,23 @@ typedef struct st_user_var_events #define RP_LOCK_LOG_IS_ALREADY_LOCKED 1 #define RP_FORCE_ROTATE 2 +/* + The COPY_INFO structure is used by INSERT/REPLACE code. + The schema of the row counting by the INSERT/INSERT ... ON DUPLICATE KEY + UPDATE code: + If a row is inserted then the copied variable is incremented. + If a row is updated by the INSERT ... ON DUPLICATE KEY UPDATE and the + new data differs from the old one then the copied and the updated + variables are incremented. + The touched variable is incremented if a row was touched by the update part + of the INSERT ... ON DUPLICATE KEY UPDATE no matter whether the row + was actually changed or not. +*/ typedef struct st_copy_info { - ha_rows records; - ha_rows deleted; - ha_rows updated; - ha_rows copied; + ha_rows records; /* Number of processed records */ + ha_rows deleted; /* Number of deleted records */ + ha_rows updated; /* Number of updated records */ + ha_rows copied; /* Number of copied records */ ha_rows error_count; ha_rows touched; /* Number of touched records */ enum enum_duplicates handle_duplicates; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 11db88d8f5e..b4cf5231827 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -661,7 +661,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, /* Fill in the given fields and dump it to the table file */ - info.records= info.deleted= info.copied= info.updated= 0; + bzero((char*) &info,sizeof(info)); info.ignore= ignore; info.handle_duplicates=duplic; info.update_fields= &update_fields; @@ -1421,6 +1421,10 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) goto before_trg_err; table->file->restore_auto_increment(prev_insert_id); + if (table->next_number_field) + table->file->adjust_next_insert_id_after_explicit_value( + table->next_number_field->val_int()); + info->touched++; if ((table->file->ha_table_flags() & HA_PARTIAL_COLUMN_READ) || compare_record(table)) { @@ -1448,9 +1452,6 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) handled separately by THD::arg_of_last_insert_id_function. */ insert_id_for_cur_row= table->file->insert_id_for_cur_row= 0; - if (table->next_number_field) - table->file->adjust_next_insert_id_after_explicit_value( - table->next_number_field->val_int()); trg_error= (table->triggers && table->triggers->process_triggers(thd, TRG_EVENT_UPDATE, TRG_ACTION_AFTER, TRUE)); diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index cb1561ad6f5..51f627a16de 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16271,6 +16271,38 @@ static void test_bug27592() } +/* + Bug #29692 Single row inserts can incorrectly report a huge number of + row insertions +*/ + +static void test_bug29692() +{ + MYSQL* conn; + + if (!(conn= mysql_init(NULL))) + { + myerror("test_bug29692 init failed"); + exit(1); + } + + if (!(mysql_real_connect(conn, opt_host, opt_user, + opt_password, opt_db ? opt_db:"test", opt_port, + opt_unix_socket, CLIENT_FOUND_ROWS))) + { + myerror("test_bug29692 connection failed"); + mysql_close(mysql); + exit(1); + } + myquery(mysql_query(conn, "drop table if exists t1")); + myquery(mysql_query(conn, "create table t1(f1 int)")); + myquery(mysql_query(conn, "insert into t1 values(1)")); + DIE_UNLESS(1 == mysql_affected_rows(conn)); + myquery(mysql_query(conn, "drop table t1")); + mysql_close(conn); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -16560,6 +16592,7 @@ static struct my_tests_st my_tests[]= { { "test_bug28505", test_bug28505 }, { "test_bug28934", test_bug28934 }, { "test_bug27592", test_bug27592 }, + { "test_bug29692", test_bug29692 }, { 0, 0 } }; From de2089264fcafa7f850c73382200ed1d5d91fdef Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Jul 2007 23:37:02 +0400 Subject: [PATCH 189/227] Bug#29050 Creation of a legal stored procedure fails if a database is not selected prior: ensure the fix also works for information_schema tables. sql/sql_parse.cc: Ensure the fix for Bug#29050 works for information_schema tables. --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 91c51641fc0..a765dfe891f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2272,7 +2272,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident, DBUG_RETURN(1); #else if (lex->select_lex.db == NULL && - thd->copy_db_to(&lex->select_lex.db, NULL)) + lex->copy_db_to(&lex->select_lex.db, NULL)) { DBUG_RETURN(1); } From bc642e113255417907d2759e5355c7b374b8d479 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jul 2007 00:59:21 +0400 Subject: [PATCH 190/227] Post-merge fixes (merge from the main). mysql-test/r/innodb_mysql.result: Update test results (merge from the main tree). mysql-test/r/query_cache.result: Update test results (merge from the main tree). mysql-test/r/sp.result: Update test results (merge from the main tree). mysql-test/t/query_cache.test: Use --echo End of to simplify future merges. sql/handler.h: st_table_list -> TABLE_LIST sql/item_create.cc: A post-merge fix (this code is in sql_yacc.yy in 5.0) sql/rpl_utility.h: st_table_list -> TABLE_LIST sql/sp.cc: A post-merge fix. sql/sp_head.cc: In 5.1 memdup_root returns void*. sql/sql_show.cc: st_table_list -> TABLE_LIST sql/sql_show.h: st_table_list -> TABLE_LIST sql/sql_yacc.yy: A post-merge fix. sql/table.cc: st_table_list -> TABLE_LIST sql/table.h: st_table_list -> TABLE_LIST --- mysql-test/r/innodb_mysql.result | 52 +++----------------------------- mysql-test/r/query_cache.result | 1 + mysql-test/r/sp.result | 50 +++++++++++++++--------------- mysql-test/t/query_cache.test | 6 ++-- sql/handler.h | 2 +- sql/item_create.cc | 2 +- sql/rpl_utility.h | 2 +- sql/sp.cc | 2 +- sql/sp_head.cc | 6 ++-- sql/sql_show.cc | 4 +-- sql/sql_show.h | 3 +- sql/sql_yacc.yy | 3 +- sql/table.cc | 6 ++-- sql/table.h | 2 +- 14 files changed, 49 insertions(+), 92 deletions(-) diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 3e4e10780d2..8a4749a478d 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -166,7 +166,6 @@ t1.a4='UNcT5pIde4I6c2SheTo4gt92OV1jgJCVkXmzyf325R1DwLURkbYHwhydANIZMbKTgdcR5xS'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables DROP TABLE t1; -End of 4.1 tests create table t1m (a int) engine = MEMORY; create table t1i (a int); create table t2m (a int) engine = MEMORY; @@ -362,22 +361,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where DROP TABLE t1,t2; -CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB; -INSERT INTO t1 VALUES ( 1 , 1 , 1); -INSERT INTO t1 SELECT a + 1 , MOD(a + 1 , 20), 1 FROM t1; -INSERT INTO t1 SELECT a + 2 , MOD(a + 2 , 20), 1 FROM t1; -INSERT INTO t1 SELECT a + 4 , MOD(a + 4 , 20), 1 FROM t1; -INSERT INTO t1 SELECT a + 8 , MOD(a + 8 , 20), 1 FROM t1; -INSERT INTO t1 SELECT a + 16, MOD(a + 16, 20), 1 FROM t1; -INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20), 1 FROM t1; -INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20), 1 FROM t1; -EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index NULL b 5 NULL 128 -EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort -DROP TABLE t1; CREATE TABLE t1 ( id int NOT NULL, name varchar(20) NOT NULL, @@ -503,37 +486,6 @@ a 2 5 drop table t1; -set @save_qcache_size=@@global.query_cache_size; -set @save_qcache_type=@@global.query_cache_type; -set global query_cache_size=10*1024*1024; -set global query_cache_type=1; -drop table if exists `test`; -Warnings: -Note 1051 Unknown table 'test' -CREATE TABLE `test` (`test1` varchar(3) NOT NULL, -`test2` varchar(4) NOT NULL,PRIMARY KEY (`test1`)) -ENGINE=InnoDB DEFAULT CHARSET=latin1; -INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678'); -select * from test; -test1 test2 -tes 5678 -INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '1234') -ON DUPLICATE KEY UPDATE `test2` = '1234'; -select * from test; -test1 test2 -tes 1234 -flush tables; -select * from test; -test1 test2 -tes 1234 -drop table test; -set global query_cache_type=@save_qcache_type; -set global query_cache_size=@save_qcache_size; -drop table if exists t1; -create table t1 (a int) engine=innodb; -alter table t1 alter a set default 1; -drop table t1; -End of 5.0 tests create table t1( id int auto_increment, c char(1) not null, @@ -858,6 +810,10 @@ a 2 5 drop table t1; +drop table if exists t1; +create table t1 (a int) engine=innodb; +alter table t1 alter a set default 1; +drop table t1; End of 5.0 tests CREATE TABLE `t2` ( `k` int(11) NOT NULL auto_increment, diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index db513902b2c..7a3cbf26a21 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1301,6 +1301,7 @@ drop procedure f3; drop procedure f4; drop table t1; set GLOBAL query_cache_size=0; +End of 4.1 tests SET GLOBAL query_cache_size=102400; create table t1(a int); insert into t1 values(0), (1), (4), (5); diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 9c98dc8d027..273c60110b3 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5659,31 +5659,6 @@ t3_id_1 t3_id_2 t4_id DROP PROCEDURE p1| DROP VIEW v1, v2| DROP TABLE t3, t4| -drop database if exists mysqltest_db1; -create database mysqltest_db1; -create procedure mysqltest_db1.sp_bug28551() begin end; -call mysqltest_db1.sp_bug28551(); -show warnings; -Level Code Message -drop database mysqltest_db1; -drop database if exists mysqltest_db1; -drop table if exists test.t1; -create database mysqltest_db1; -use mysqltest_db1; -drop database mysqltest_db1; -create table test.t1 (id int); -insert into test.t1 (id) values (1); -create procedure test.sp_bug29050() begin select * from t1; end// -show warnings; -Level Code Message -call test.sp_bug29050(); -id -1 -show warnings; -Level Code Message -use test; -drop procedure sp_bug29050; -drop table t1; End of 5.0 tests Begin of 5.1 tests drop function if exists pi; @@ -6306,6 +6281,31 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI DROP VIEW v1; DROP FUNCTION metered; DROP TABLE t1; +drop database if exists mysqltest_db1; +create database mysqltest_db1; +create procedure mysqltest_db1.sp_bug28551() begin end; +call mysqltest_db1.sp_bug28551(); +show warnings; +Level Code Message +drop database mysqltest_db1; +drop database if exists mysqltest_db1; +drop table if exists test.t1; +create database mysqltest_db1; +use mysqltest_db1; +drop database mysqltest_db1; +create table test.t1 (id int); +insert into test.t1 (id) values (1); +create procedure test.sp_bug29050() begin select * from t1; end// +show warnings; +Level Code Message +call test.sp_bug29050(); +id +1 +show warnings; +Level Code Message +use test; +drop procedure sp_bug29050; +drop table t1; drop procedure if exists proc_25411_a; drop procedure if exists proc_25411_b; drop procedure if exists proc_25411_c; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 3a2434892c5..e0db99cf42b 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -878,7 +878,7 @@ drop procedure f4; drop table t1; set GLOBAL query_cache_size=0; -# End of 4.1 tests +--echo End of 4.1 tests # # Bug #10303: problem with last_query_cost @@ -1129,7 +1129,7 @@ set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; -# End of 5.0 tests +--echo End of 5.0 tests # @@ -1174,4 +1174,4 @@ show status like 'Qcache_queries_in_cache'; drop database db2; drop database db3; -# End of 5.1 tests +--echo End of 5.1 tests diff --git a/sql/handler.h b/sql/handler.h index c4e45e5b8f1..f45b28c55f5 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -663,7 +663,7 @@ struct handlerton uint (*alter_table_flags)(uint flags); int (*alter_tablespace)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info); int (*fill_files_table)(handlerton *hton, THD *thd, - struct st_table_list *tables, + TABLE_LIST *tables, class Item *cond); uint32 flags; /* global handler flags */ /* diff --git a/sql/item_create.cc b/sql/item_create.cc index e20926c564f..fa15b992e5c 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -2326,7 +2326,7 @@ Item* Create_qfunc::create(THD *thd, LEX_STRING name, List *item_list) { LEX_STRING db; - if (thd->copy_db_to(&db.str, &db.length)) + if (thd->lex->copy_db_to(&db.str, &db.length)) return NULL; return create(thd, db, name, false, item_list); diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index 2ce8def4577..79e69aecaeb 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -128,7 +128,7 @@ private: slave thread, but nowhere else. */ struct RPL_TABLE_LIST - : public st_table_list + : public TABLE_LIST { bool m_tabledef_valid; table_def m_tabledef; diff --git a/sql/sp.cc b/sql/sp.cc index d806673c6f3..aed4976f839 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1954,7 +1954,7 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, } ret= sp_cache_routines_and_add_tables_aux(thd, lex, *last_cached_routine_ptr, - FALSE, NULL); + FALSE); return ret; } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index a11c3c666c8..9b67a89bed2 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -567,9 +567,9 @@ sp_head::init_sp_name(THD *thd, sp_name *spname) spname->init_qname(thd); m_sroutines_key.length= spname->m_sroutines_key.length; - m_sroutines_key.str= memdup_root(thd->mem_root, - spname->m_sroutines_key.str, - spname->m_sroutines_key.length + 1); + m_sroutines_key.str= (char*) memdup_root(thd->mem_root, + spname->m_sroutines_key.str, + spname->m_sroutines_key.length + 1); m_sroutines_key.str[0]= static_cast(m_type); m_qname.length= m_sroutines_key.length - 1; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index e503d0acd84..c6bf816b290 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4094,7 +4094,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table, } -static int get_schema_partitions_record(THD *thd, struct st_table_list *tables, +static int get_schema_partitions_record(THD *thd, TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name) @@ -4640,7 +4640,7 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond) */ static int -get_referential_constraints_record(THD *thd, struct st_table_list *tables, +get_referential_constraints_record(THD *thd, TABLE_LIST *tables, TABLE *table, bool res, const char *base_name, const char *file_name) { diff --git a/sql/sql_show.h b/sql/sql_show.h index d5c3f3bf675..57004323ca9 100644 --- a/sql/sql_show.h +++ b/sql/sql_show.h @@ -20,9 +20,8 @@ class String; class THD; struct st_ha_create_information; -struct st_table_list; typedef st_ha_create_information HA_CREATE_INFO; -typedef st_table_list TABLE_LIST; +struct TABLE_LIST; enum find_files_result { FIND_FILES_OK, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 08ce421ef86..d9a808bf8f7 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1940,7 +1940,8 @@ sp_name: } | ident { - LEX *lex= Lex; + THD *thd= YYTHD; + LEX *lex= thd->lex; LEX_STRING db; if (check_routine_name(&$1)) { diff --git a/sql/table.cc b/sql/table.cc index 6678073e145..5ac43343934 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -98,7 +98,7 @@ View_creation_ctx *View_creation_ctx::create(THD *thd) /*************************************************************************/ View_creation_ctx * View_creation_ctx::create(THD *thd, - st_table_list *view) + TABLE_LIST *view) { View_creation_ctx *ctx= new (thd->mem_root) View_creation_ctx(thd); @@ -4588,7 +4588,7 @@ Item_subselect *TABLE_LIST::containing_subselect() DESCRIPTION The parser collects the index hints for each table in a "tagged list" - (st_table_list::index_hints). Using the information in this tagged list + (TABLE_LIST::index_hints). Using the information in this tagged list this function sets the members st_table::keys_in_use_for_query, st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by, st_table::force_index and st_table::covering_keys. @@ -4630,7 +4630,7 @@ Item_subselect *TABLE_LIST::containing_subselect() FALSE no errors found TRUE found and reported an error. */ -bool st_table_list::process_index_hints(TABLE *table) +bool TABLE_LIST::process_index_hints(TABLE *table) { /* initialize the result variables */ table->keys_in_use_for_query= table->keys_in_use_for_group_by= diff --git a/sql/table.h b/sql/table.h index b70517d5067..494b74d564c 100644 --- a/sql/table.h +++ b/sql/table.h @@ -38,7 +38,7 @@ public: static View_creation_ctx *create(THD *thd); static View_creation_ctx *create(THD *thd, - struct st_table_list *view); + TABLE_LIST *view); private: View_creation_ctx(THD *thd) From b5ad823b65c64c48fa2719a5af3115898396d7b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jul 2007 01:30:57 +0400 Subject: [PATCH 191/227] Fix a build break on 64 bit (uint and size_t are distinct types). --- sql/sql_lex.cc | 2 +- sql/sql_lex.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 5e91f147033..9f69e7dee05 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2326,7 +2326,7 @@ uint8 st_lex::get_effective_with_check(TABLE_LIST *view) */ bool -st_lex::copy_db_to(char **p_db, uint *p_db_length) const +st_lex::copy_db_to(char **p_db, size_t *p_db_length) const { if (sphead) { diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 09ace624559..4ac59fbacde 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1782,7 +1782,7 @@ typedef struct st_lex : public Query_tables_list context_stack.pop(); } - bool copy_db_to(char **p_db, uint *p_db_length) const; + bool copy_db_to(char **p_db, size_t *p_db_length) const; Name_resolution_context *current_context() { From 6e3d4f1c9844997c1a051efb8986698856410b4a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jul 2007 09:25:01 +0200 Subject: [PATCH 192/227] Post-merge fixes Disabled test cases that produce errors in a "server log". mysql-test/t/disabled.def: Post-merge fixes Removed 'binlog_innodb' from the wrong disabled.def file. --- mysql-test/suite/binlog/t/disabled.def | 14 ++++++++++++++ mysql-test/t/disabled.def | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/binlog/t/disabled.def diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def new file mode 100644 index 00000000000..76eeb5b00ef --- /dev/null +++ b/mysql-test/suite/binlog/t/disabled.def @@ -0,0 +1,14 @@ +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# : BUG# +# +# Do not use any TAB characters for whitespace. +# +############################################################################## + +binlog_innodb : Bug#29806 2007-07-15 ingo master.err: InnoDB: Error: MySQL is freeing a thd +binlog_killed : Bug#29806 2007-07-17 ingo master.err: InnoDB: Error: MySQL is freeing a thd diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index b994561116d..d253b4b51e2 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -25,5 +25,4 @@ ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Do mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage federated_innodb : Bug#29522 failed assertion in binlog_close_connection() -binlog_innodb : Bug#29806 2007-07-15 ingo master.err: InnoDB: Error: MySQL is freeing a thd innodb_mysql : Bug#29807 2007-07-15 ingo master.err: Cannot find table test/t2 from the internal data dictionary From cc533adf9cd6b1325a346c9d5c90ace6487a3ff1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jul 2007 09:52:55 +0200 Subject: [PATCH 193/227] Disabled a test case that reports an error on OSX. --- mysql-test/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index d253b4b51e2..3576f1dbc23 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -26,3 +26,4 @@ ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Do mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage federated_innodb : Bug#29522 failed assertion in binlog_close_connection() innodb_mysql : Bug#29807 2007-07-15 ingo master.err: Cannot find table test/t2 from the internal data dictionary +lowercase_table3 : Bug#29839 2007-07-17 ingo Cannot find table test/T1 from the internal data dictionary From e90b0c6e79218375ef69da4079e2ba26cecf83d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jul 2007 10:25:48 +0200 Subject: [PATCH 194/227] make_binary_distribution.sh: BUG#29382 scripts/make_binary_distribution.sh: BUG#29382 --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 77f51c51c19..eee5ed99fa5 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -295,6 +295,7 @@ $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ + mysql-test/std_data/Index.xml \ mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ $BASE/mysql-test/std_data From e44d995fa92c562e71e7fe65d6054e0383f493a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jul 2007 16:25:32 +0200 Subject: [PATCH 195/227] Ensure "mysql-stress-test.pl" is included in both "tar.gz" and RPM packages. Fixing bug#21023: "mysql-stress-test.pl" missing in builds mysql-test/Makefile.am: Ensure "mysql-stress-test.pl" is handled by "make install" in the "mysql-test" directory. This should get the script into the result tree of a RPM build. Fixing bug#21023. scripts/make_binary_distribution.sh: Copy "mysql-test/mysql-stress-test.pl" into a binary distribution ("tar.gz" and derived formats). Fixing bug#21023. --- mysql-test/Makefile.am | 2 +- scripts/make_binary_distribution.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index ebc2bbb83e8..1920a68b21b 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -35,7 +35,7 @@ testdir = $(benchdir_root)/mysql-test EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh valgrind.supp $(PRESCRIPTS) EXTRA_DIST = $(EXTRA_SCRIPTS) suite GENSCRIPTS = mysql-test-run-shell mysql-test-run install_test_db mtr -PRESCRIPTS = mysql-test-run.pl +PRESCRIPTS = mysql-test-run.pl mysql-stress-test.pl test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS) test_DATA = std_data/client-key.pem \ std_data/client-cert.pem \ diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 77f51c51c19..94b4019cd1e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -284,7 +284,8 @@ rm -f $MYSQL_SHARE/Makefile* $MYSQL_SHARE/*/*.OLD copyfileto $BASE/mysql-test \ mysql-test/mysql-test-run mysql-test/install_test_db \ mysql-test/mysql-test-run.pl mysql-test/README \ - mysql-test/valgrind.supp \ + mysql-test/mysql-stress-test.pl \ + mysql-test/valgrind.supp \ netware/mysql_test_run.nlm netware/install_test_db.ncf $CP mysql-test/lib/*.pl $BASE/mysql-test/lib From 955c19961df6f18cd0217b5522e69db7287af67c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jul 2007 19:51:50 +0400 Subject: [PATCH 196/227] [pb problem]: ha_heap->clone() fails on windows because of mess with '/' and '\' in path delimiters: - Fix this by creating new handler with exactly the same path line as was passed to ha_create/ha_open. sql/opt_range.cc: Set thd->net.report_error on handler::clone() failure --- sql/ha_heap.cc | 20 ++++++++++++++++++++ sql/ha_heap.h | 1 + sql/opt_range.cc | 8 ++++++++ 3 files changed, 29 insertions(+) diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 8838aa99c1a..62e6d0c47ee 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -114,6 +114,26 @@ int ha_heap::close(void) } +/* + Create a copy of this table + + DESCRIPTION + Do same as default implementation but use file->s->name instead of + table->s->path. This is needed by Windows where the clone() call sees + '/'-delimited path in table->s->path, while ha_peap::open() was called + with '\'-delimited path. +*/ + +handler *ha_heap::clone(MEM_ROOT *mem_root) +{ + handler *new_handler= get_new_handler(table, mem_root, table->s->db_type); + if (new_handler && !new_handler->ha_open(file->s->name, table->db_stat, + HA_OPEN_IGNORE_IF_LOCKED)) + return new_handler; + return NULL; +} + + /* Compute which keys to use for scanning diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 27846ca4a8e..23583d0a6a7 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -32,6 +32,7 @@ class ha_heap: public handler public: ha_heap(TABLE *table); ~ha_heap() {} + handler *clone(MEM_ROOT *mem_root); const char *table_type() const { return (table->in_use->variables.sql_mode & MODE_MYSQL323) ? diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 952e5abfd13..76e78c7e9b8 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1131,6 +1131,14 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) THD *thd= current_thd; if (!(file= head->file->clone(thd->mem_root))) { + /* + Manually set the error flag. Note: there seems to be quite a few + places where a failure could cause the server to "hang" the client by + sending no response to a query. ATM those are not real errors because + the storage engine calls in question happen to never fail with the + existing storage engines. + */ + thd->net.report_error= 1; /* Caller will free the memory */ goto failure; } From 3ec7c63645f8b6111cef864718fb8c6dfc298b0f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jul 2007 19:27:31 +0200 Subject: [PATCH 197/227] Handle "support-files/mysqld_multi.server.sh" like other shell scripts. Fixing bug#25486: mysqld_multi.server.sh missing from builds support-files/Makefile.am: Handle "mysqld_multi.server.sh" like other shell scripts. Fixing bug#25486. --- support-files/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/support-files/Makefile.am b/support-files/Makefile.am index af835bf350e..b9d6fde742a 100644 --- a/support-files/Makefile.am +++ b/support-files/Makefile.am @@ -25,6 +25,7 @@ EXTRA_DIST = mysql.spec.sh \ my-innodb-heavy-4G.cnf.sh \ mysql-log-rotate.sh \ mysql.server.sh \ + mysqld_multi.server.sh \ binary-configure.sh \ magic \ MySQL-shared-compat.spec.sh \ @@ -42,7 +43,8 @@ pkgdata_DATA = my-small.cnf \ binary-configure \ ndb-config-2-node.ini -pkgdata_SCRIPTS = mysql.server +pkgdata_SCRIPTS = mysql.server \ + mysqld_multi.server noinst_DATA = mysql-@VERSION@.spec \ MySQL-shared-compat.spec @@ -56,6 +58,7 @@ CLEANFILES = my-small.cnf \ mysql-@VERSION@.spec \ mysql-log-rotate \ mysql.server \ + mysqld_multi.server \ binary-configure \ MySQL-shared-compat.spec \ ndb-config-2-node.ini From 2679e53a73f2dbc51326d3cf59fcca7bc933a8da Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 17 Jul 2007 22:46:51 +0400 Subject: [PATCH 198/227] Small comments fix --- sql/opt_range.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 76e78c7e9b8..65acecc0b87 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -5824,6 +5824,11 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree) param->is_ror_scan is cleared if the function detects that the key scan is not a Rowid-Ordered Retrieval scan ( see comments for is_key_scan_ror function for description of which key scans are ROR scans) + + RETURN + #records E(#records) for given subtree + HA_POS_ERROR if subtree cannot be used for record retrieval + */ static ha_rows From 043f697aeecf0731fcc4e65263287b2953df6ee3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 00:29:25 +0400 Subject: [PATCH 199/227] Mark deadcode for gcov --- sql/ha_heap.cc | 2 +- sql/opt_range.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 62e6d0c47ee..9ebc5aecde2 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -129,7 +129,7 @@ handler *ha_heap::clone(MEM_ROOT *mem_root) handler *new_handler= get_new_handler(table, mem_root, table->s->db_type); if (new_handler && !new_handler->ha_open(file->s->name, table->db_stat, HA_OPEN_IGNORE_IF_LOCKED)) - return new_handler; + return new_handler; /* purecov: inspected */ return NULL; } diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 65acecc0b87..247f0eada49 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1138,9 +1138,9 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler) the storage engine calls in question happen to never fail with the existing storage engines. */ - thd->net.report_error= 1; + thd->net.report_error= 1; /* purecov: inspected */ /* Caller will free the memory */ - goto failure; + goto failure; /* purecov: inspected */ } if (file->external_lock(thd, F_RDLCK)) goto failure; From 06b446dae4a55b48108bb85bd3ca3f70924b9b8d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 11:12:15 +0400 Subject: [PATCH 200/227] Mark deadcode for gcov --- sql/ha_heap.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 9ebc5aecde2..bf807407df1 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -129,8 +129,8 @@ handler *ha_heap::clone(MEM_ROOT *mem_root) handler *new_handler= get_new_handler(table, mem_root, table->s->db_type); if (new_handler && !new_handler->ha_open(file->s->name, table->db_stat, HA_OPEN_IGNORE_IF_LOCKED)) - return new_handler; /* purecov: inspected */ - return NULL; + return new_handler; + return NULL; /* purecov: inspected */ } From 5f462f96266c193ea13bd2aa0a13c181c1d0919c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 14:42:06 +0400 Subject: [PATCH 201/227] Add a test case for Bug#27248 Triggers: error if insert affects temporary table. The bug itself is yet another manifestation of Bug 26141. mysql-test/r/trigger.result: Update results. mysql-test/t/trigger.test: Add a test case for Bug#27248 Triggers: error if insert affects temporary table --- mysql-test/r/trigger.result | 28 ++++++++++++++++++++++++++++ mysql-test/t/trigger.test | 23 +++++++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 4b18e525e62..a07318435f6 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -1933,4 +1933,32 @@ Before UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi After UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE drop view v1; drop table t1, t2, t1_op_log; + +Bug#27248 Triggers: error if insert affects temporary table + +The bug was fixed by the fix for Bug#26141 + +drop table if exists t1; +drop temporary table if exists t2; +create table t1 (s1 int); +create temporary table t2 (s1 int); +create trigger t1_bi before insert on t1 for each row insert into t2 values (0); +create trigger t1_bd before delete on t1 for each row delete from t2; +insert into t1 values (0); +insert into t1 values (0); +select * from t1; +s1 +0 +0 +select * from t2; +s1 +0 +0 +delete from t1; +select * from t1; +s1 +select * from t2; +s1 +drop table t1; +drop temporary table t2; End of 5.0 tests diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index a6390036322..2f62ad38621 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -2194,4 +2194,27 @@ drop table t1, t2, t1_op_log; # # TODO: test LOAD DATA INFILE +# +--echo +--echo Bug#27248 Triggers: error if insert affects temporary table +--echo +--echo The bug was fixed by the fix for Bug#26141 +--echo +--disable_warnings +drop table if exists t1; +drop temporary table if exists t2; +--enable_warnings +create table t1 (s1 int); +create temporary table t2 (s1 int); +create trigger t1_bi before insert on t1 for each row insert into t2 values (0); +create trigger t1_bd before delete on t1 for each row delete from t2; +insert into t1 values (0); +insert into t1 values (0); +select * from t1; +select * from t2; +delete from t1; +select * from t1; +select * from t2; +drop table t1; +drop temporary table t2; --echo End of 5.0 tests From c0277a1192d0526ea76968196584e7d2b5a51203 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 16:22:05 +0400 Subject: [PATCH 202/227] A fix and a test case for Bug#26104 Bug on foreign key class constructor. Fix the typo in the constructor. Cover a semantic check that previously never worked with a test. mysql-test/r/create.result: Update results (Bug#26104) mysql-test/r/innodb.result: Update results. mysql-test/t/create.test: Add a test case for Bug#26104 Bug on foreign key class constructor mysql-test/t/innodb.test: Return a new error number (MySQL error instead of internal InnoDB error). sql/sql_class.h: A fix for Bug#26104 Bug on foreign key class constructor -- fix the typo in the constructor --- mysql-test/r/create.result | 16 ++++++++++++++++ mysql-test/r/innodb.result | 2 +- mysql-test/t/create.test | 19 +++++++++++++++++++ mysql-test/t/innodb.test | 2 +- sql/sql_class.h | 2 +- 5 files changed, 38 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index e692dbf3938..a1843573794 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1503,4 +1503,20 @@ t1 CREATE TABLE `t1` ( `c17` int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; + +Bug #26104 Bug on foreign key class constructor + +Check that ref_columns is initalized correctly in the constructor +and semantic checks in mysql_prepare_table work. + +We do not need a storage engine that supports foreign keys +for this test, as the checks are purely syntax-based, and the +syntax is supported for all engines. + +drop table if exists t1,t2; +create table t1(a int not null, b int not null, primary key (a, b)); +create table t2(a int not null, b int not null, c int not null, primary key (a), +foreign key fk_bug26104 (b,c) references t1(a)); +ERROR 42000: Incorrect foreign key definition for 'fk_bug26104': Key reference and table reference don't match +drop table t1; End of 5.0 tests diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 80b46e5098a..6082a30bce3 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1648,7 +1648,7 @@ t2 CREATE TABLE `t2` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t2; create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; -ERROR HY000: Can't create table './test/t2' (errno: 150) +ERROR 42000: Incorrect foreign key definition for 't1_id_fk': Key reference and table reference don't match create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; show create table t2; Table Create Table diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 99f3fea416a..a6679cd674a 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -1118,5 +1118,24 @@ show create table t1; drop table t1; +--echo +--echo Bug #26104 Bug on foreign key class constructor +--echo +--echo Check that ref_columns is initalized correctly in the constructor +--echo and semantic checks in mysql_prepare_table work. +--echo +--echo We do not need a storage engine that supports foreign keys +--echo for this test, as the checks are purely syntax-based, and the +--echo syntax is supported for all engines. +--echo +--disable_warnings +drop table if exists t1,t2; +--enable_warnings + +create table t1(a int not null, b int not null, primary key (a, b)); +--error ER_WRONG_FK_DEF +create table t2(a int not null, b int not null, c int not null, primary key (a), +foreign key fk_bug26104 (b,c) references t1(a)); +drop table t1; --echo End of 5.0 tests diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index a9679c01071..04dfa1d0836 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1180,7 +1180,7 @@ drop table t2; # Clean up filename -- embedded server reports whole path without .frm, # regular server reports relative path with .frm (argh!) --replace_result \\ / $MYSQL_TEST_DIR . /var/master-data/ / t2.frm t2 ---error 1005 +--error ER_WRONG_FK_DEF create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; # bug#3749 diff --git a/sql/sql_class.h b/sql/sql_class.h index a5cbc21684f..1c52afb5bc5 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -450,7 +450,7 @@ public: Table_ident *table, List &ref_cols, uint delete_opt_arg, uint update_opt_arg, uint match_opt_arg) :Key(FOREIGN_KEY, name_arg, HA_KEY_ALG_UNDEF, 0, cols), - ref_table(table), ref_columns(cols), + ref_table(table), ref_columns(ref_cols), delete_opt(delete_opt_arg), update_opt(update_opt_arg), match_opt(match_opt_arg) {} From a266c16d14a82b601f60c1987f5a9c6c779215e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 15:33:41 +0300 Subject: [PATCH 203/227] Bug #29325: create table overwrites .MYD file of other table (datadir) Set errno when retunring an error in my_create_with_symlink. mysys/my_symlink2.c: Bug #29325: set errno when retunring an error in my_create_with_symlink --- mysys/my_symlink2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysys/my_symlink2.c b/mysys/my_symlink2.c index 2ad08ef67de..e2493874097 100644 --- a/mysys/my_symlink2.c +++ b/mysys/my_symlink2.c @@ -52,11 +52,13 @@ File my_create_with_symlink(const char *linkname, const char *filename, { if (!access(filename,F_OK)) { + my_errno= errno= EEXIST; my_error(EE_CANTCREATEFILE, MYF(0), filename, EEXIST); DBUG_RETURN(-1); } if (create_link && !access(linkname,F_OK)) { + my_errno= errno= EEXIST; my_error(EE_CANTCREATEFILE, MYF(0), linkname, EEXIST); DBUG_RETURN(-1); } From 6981af6ff53d63254284a4b6a5370c17075793bc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 17:09:03 +0400 Subject: [PATCH 204/227] Add a test case for Bug#22427 create table if not exists + stored function results in inconsistent behavior. The bug itself was fixed by the patch for bug 20662. mysql-test/r/sp-prelocking.result: Update results (Bug#22427) mysql-test/t/sp-prelocking.test: Add a test case for Bug#22427 create table if not exists + stored function results in inconsistent behavior --- mysql-test/r/sp-prelocking.result | 22 ++++++++++++++++++++++ mysql-test/t/sp-prelocking.test | 23 +++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result index 5eac54803f0..c19bd1abd26 100644 --- a/mysql-test/r/sp-prelocking.result +++ b/mysql-test/r/sp-prelocking.result @@ -267,4 +267,26 @@ drop table bug_27907_logs; insert into bug_27907_t1(a) values (1); ERROR 42S02: Table 'test.bug_27907_logs' doesn't exist drop table bug_27907_t1; + +Bug#22427 create table if not exists + stored function results in +inconsistent behavior + +Add a test case, the bug itself was fixed by the patch for +Bug#20662 + +drop table if exists t1; +drop function if exists f_bug22427; +create table t1 (i int); +insert into t1 values (1); +create function f_bug22427() returns int return (select max(i) from t1); +select f_bug22427(); +f_bug22427() +1 +create table if not exists t1 select f_bug22427() as i; +Warnings: +Note 1050 Table 't1' already exists +create table t1 select f_bug22427() as i; +ERROR 42S01: Table 't1' already exists +drop table t1; +drop function f_bug22427; End of 5.0 tests diff --git a/mysql-test/t/sp-prelocking.test b/mysql-test/t/sp-prelocking.test index ec5b7fbad7c..60e97260839 100644 --- a/mysql-test/t/sp-prelocking.test +++ b/mysql-test/t/sp-prelocking.test @@ -333,4 +333,27 @@ insert into bug_27907_t1(a) values (1); drop table bug_27907_t1; +--echo +--echo Bug#22427 create table if not exists + stored function results in +--echo inconsistent behavior +--echo +--echo Add a test case, the bug itself was fixed by the patch for +--echo Bug#20662 +--echo +--disable_warnings +drop table if exists t1; +drop function if exists f_bug22427; +--enable_warnings +create table t1 (i int); +insert into t1 values (1); +create function f_bug22427() returns int return (select max(i) from t1); +select f_bug22427(); +# Until this bug was fixed, the following emitted error +# ERROR 1213: Deadlock found when trying to get lock +create table if not exists t1 select f_bug22427() as i; +--error ER_TABLE_EXISTS_ERROR +create table t1 select f_bug22427() as i; +drop table t1; +drop function f_bug22427; + --echo End of 5.0 tests From 73a680a54dba628377970415856810d5d173e23a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 15:42:36 +0200 Subject: [PATCH 205/227] CMakeLists.txt, configure.js: Allow to set mysqld exe suffix sql/CMakeLists.txt: Allow to set mysqld exe suffix win/configure.js: Allow to set mysqld exe suffix --- sql/CMakeLists.txt | 16 +++++++++------- win/configure.js | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 1f02e3afc67..0cbeb97184f 100755 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -46,7 +46,8 @@ IF(DISABLE_GRANT_OPTIONS) ADD_DEFINITIONS(-DDISABLE_GRANT_OPTIONS) ENDIF(DISABLE_GRANT_OPTIONS) -ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc +ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX} + ../sql-common/client.c derror.cc des_key_file.cc discover.cc ../libmysql/errmsg.c field.cc field_conv.cc filesort.cc gstream.cc ha_blackhole.cc ha_archive.cc ha_heap.cc ha_myisam.cc ha_myisammrg.cc @@ -82,7 +83,8 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc ${PROJECT_SOURCE_DIR}/include/mysql_version.h ${PROJECT_SOURCE_DIR}/sql/lex_hash.h) -TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl +TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} + heap myisam myisammrg mysys yassl zlib dbug yassl taocrypt strings vio regex wsock32) IF(EMBED_MANIFESTS) @@ -90,19 +92,19 @@ IF(EMBED_MANIFESTS) ENDIF(EMBED_MANIFESTS) IF(WITH_EXAMPLE_STORAGE_ENGINE) - TARGET_LINK_LIBRARIES(mysqld example) + TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} example) ENDIF(WITH_EXAMPLE_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE) - TARGET_LINK_LIBRARIES(mysqld innobase) + TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} innobase) ENDIF(WITH_INNOBASE_STORAGE_ENGINE) IF(WITH_BERKELEY_STORAGE_ENGINE) - TARGET_LINK_LIBRARIES(mysqld bdb) + TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} bdb) ENDIF(WITH_BERKELEY_STORAGE_ENGINE) -ADD_DEPENDENCIES(mysqld GenError) +ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} GenError) # Sql Parser custom command ADD_CUSTOM_COMMAND( @@ -134,7 +136,7 @@ ADD_CUSTOM_COMMAND( COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h DEPENDS ${GEN_LEX_HASH_EXE} ) -ADD_DEPENDENCIES(mysqld gen_lex_hash) +ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} gen_lex_hash) ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def) ADD_DEPENDENCIES(udf_example strings) diff --git a/win/configure.js b/win/configure.js index a2502d96b80..7cdf6176e50 100755 --- a/win/configure.js +++ b/win/configure.js @@ -51,6 +51,7 @@ try configfile.WriteLine("SET (" + args.Item(i) + " TRUE)"); break; case "MYSQL_SERVER_SUFFIX": + case "MYSQLD_EXE_SUFFIX": configfile.WriteLine("SET (" + parts[0] + " \"" + parts[1] + "\")"); break; From 0114d8c0824091f455382ffd6b93b5d5307dc00c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 15:53:10 +0200 Subject: [PATCH 206/227] CMakeLists.txt, configure.js: Allow to set mysqld exe suffix sql/CMakeLists.txt: Allow to set mysqld exe suffix win/configure.js: Allow to set mysqld exe suffix --- sql/CMakeLists.txt | 20 +++++++++++--------- win/configure.js | 1 + 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 85c2013d8e7..a8aa7d70586 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -15,9 +15,10 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") SET(CMAKE_CXX_FLAGS_DEBUG - "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR") + "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi") SET(CMAKE_C_FLAGS_DEBUG - "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR") + "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_SYMDIR /Zi") +SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /MAP /MAPINFO:EXPORTS") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/extra/yassl/include @@ -40,7 +41,8 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN) -ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc +ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX} + ../sql-common/client.c derror.cc des_key_file.cc discover.cc ../libmysql/errmsg.c field.cc field_conv.cc filesort.cc gstream.cc ha_partition.cc @@ -81,7 +83,8 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc ${PROJECT_SOURCE_DIR}/include/mysql_version.h ${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc ${PROJECT_SOURCE_DIR}/sql/lex_hash.h) -TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg mysys yassl zlib dbug yassl +TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} + heap myisam myisammrg mysys yassl zlib dbug yassl taocrypt strings vio regex wsock32 ws2_32) IF(EMBED_MANIFESTS) @@ -97,16 +100,16 @@ IF(WITH_CSV_STORAGE_ENGINE) TARGET_LINK_LIBRARIES(mysqld csv) ENDIF(WITH_CSV_STORAGE_ENGINE) IF(WITH_EXAMPLE_STORAGE_ENGINE) - TARGET_LINK_LIBRARIES(mysqld example) + TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} example) ENDIF(WITH_EXAMPLE_STORAGE_ENGINE) IF(WITH_FEDERATED_STORAGE_ENGINE) TARGET_LINK_LIBRARIES(mysqld federated) ENDIF(WITH_FEDERATED_STORAGE_ENGINE) IF(WITH_INNOBASE_STORAGE_ENGINE) - TARGET_LINK_LIBRARIES(mysqld innobase) + TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} innobase) ENDIF(WITH_INNOBASE_STORAGE_ENGINE) -ADD_DEPENDENCIES(mysqld GenError) +ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} GenError) # Sql Parser custom command ADD_CUSTOM_COMMAND( @@ -138,8 +141,7 @@ ADD_CUSTOM_COMMAND( COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h DEPENDS ${GEN_LEX_HASH_EXE} ) - -ADD_DEPENDENCIES(mysqld gen_lex_hash) +ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} gen_lex_hash) ADD_LIBRARY(udf_example MODULE udf_example.c udf_example.def) ADD_DEPENDENCIES(udf_example strings) diff --git a/win/configure.js b/win/configure.js index 06c2fe56a51..2b0e2bbcc37 100644 --- a/win/configure.js +++ b/win/configure.js @@ -51,6 +51,7 @@ try configfile.WriteLine("SET (" + args.Item(i) + " TRUE)"); break; case "MYSQL_SERVER_SUFFIX": + case "MYSQLD_EXE_SUFFIX": configfile.WriteLine("SET (" + parts[0] + " \"" + parts[1] + "\")"); break; From 2bfe84d434104fdc1a9b69c62a237e01043f865f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 19:14:48 +0500 Subject: [PATCH 207/227] Fixed bug #28524. For each view the mysqldump utility creates a temporary table with the same name and the same columns as the view in order to satisfy views that depend on this view. After the creation of all tables, mysqldump drops all temporary tables and creates actual views. However, --skip-add-drop-table and --compact flags disable DROP TABLE statements for those temporary tables. Thus, it was impossible to create the views because of existence of the temporary tables with the same names. client/mysqldump.c: Fixed bug #28524. The mysqldump utility has been modified to unconditionally drop temporary tables before the creation of views. mysql-test/t/mysqldump.test: Updated test case for bug #28524 and updated result of previous tests. mysql-test/r/mysqldump.result: Updated test case for bug #28524 and updated result of previous tests. --- client/mysqldump.c | 3 +-- mysql-test/r/mysqldump.result | 33 +++++++++++++++++++++++---------- mysql-test/t/mysqldump.test | 13 +++++++++++++ 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 1a024a923f5..f72cb0171e1 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -3673,10 +3673,9 @@ static my_bool get_view_structure(char *table, char* db) result_table); check_io(sql_file); } + fprintf(sql_file, "/*!50001 DROP TABLE %s*/;\n", opt_quoted_table); if (opt_drop) { - fprintf(sql_file, "/*!50001 DROP TABLE IF EXISTS %s*/;\n", - opt_quoted_table); fprintf(sql_file, "/*!50001 DROP VIEW IF EXISTS %s*/;\n", opt_quoted_table); check_io(sql_file); diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 8eac7c7e715..da05fe7bc5b 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1889,7 +1889,7 @@ DROP TABLE IF EXISTS `v2`; /*!50001 CREATE TABLE `v2` ( `a` varchar(30) ) */; -/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 DROP TABLE `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ @@ -1968,7 +1968,7 @@ DROP TABLE IF EXISTS `v1`; /*!50001 CREATE TABLE `v1` ( `a` int(11) ) */; -/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 DROP TABLE `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ @@ -2027,7 +2027,7 @@ DROP TABLE IF EXISTS `v2`; /*!50001 CREATE TABLE `v2` ( `a` varchar(30) ) */; -/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 DROP TABLE `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ @@ -2137,17 +2137,17 @@ DROP TABLE IF EXISTS `v3`; `b` int(11), `c` varchar(30) ) */; -/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 DROP TABLE `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7)) */; -/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 DROP TABLE `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v2` AS select `v3`.`a` AS `a` from (`v3` join `v1`) where ((`v1`.`a` = `v3`.`a`) and (`v3`.`b` = 3)) limit 1 */; -/*!50001 DROP TABLE IF EXISTS `v3`*/; +/*!50001 DROP TABLE `v3`*/; /*!50001 DROP VIEW IF EXISTS `v3`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ @@ -2721,17 +2721,17 @@ DROP TABLE IF EXISTS `v2`; ) */; USE `test`; -/*!50001 DROP TABLE IF EXISTS `v0`*/; +/*!50001 DROP TABLE `v0`*/; /*!50001 DROP VIEW IF EXISTS `v0`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v0` AS select `v1`.`a` AS `a`,`v1`.`b` AS `b`,`v1`.`c` AS `c` from `v1` */; -/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 DROP TABLE `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1` */; -/*!50001 DROP TABLE IF EXISTS `v2`*/; +/*!50001 DROP TABLE `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ @@ -2941,11 +2941,13 @@ insert into t values(5, 51); create view v1 as select qty, price, qty*price as value from t; create view v2 as select qty from v1; mysqldump { +/*!50001 DROP TABLE `v1`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `t`.`qty` AS `qty`,`t`.`price` AS `price`,(`t`.`qty` * `t`.`price`) AS `value` from `t` */; } mysqldump { +/*!50001 DROP TABLE `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v2` AS select `v1`.`qty` AS `qty` from `v1` */; @@ -3029,7 +3031,7 @@ DROP TABLE IF EXISTS `v1`; ) */; USE `mysqldump_test_db`; -/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 DROP TABLE `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ @@ -3076,6 +3078,7 @@ USE `mysqldump_views`; USE `mysqldump_tables`; USE `mysqldump_views`; +/*!50001 DROP TABLE `nasishnasifu`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */; @@ -3321,5 +3324,15 @@ CREATE TABLE `t1` ( INSERT INTO `t1` VALUES (11,0x7171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171); DROP TABLE t1; # +# Bug #28524: mysqldump --skip-add-drop-table is not +# compatible with views +# +CREATE VIEW v1 AS SELECT 1; +DROP VIEW v1; +SELECT * FROM v1; +1 +1 +DROP VIEW v1; +# # End of 5.0 tests # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 30c241d4096..d42162541de 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1541,6 +1541,19 @@ INSERT INTO t1 SET c1=11, c2=REPEAT('q',509); --exec $MYSQL_DUMP --skip-create --compact --hex-blob test t1 DROP TABLE t1; +--echo # +--echo # Bug #28524: mysqldump --skip-add-drop-table is not +--echo # compatible with views +--echo # + +CREATE VIEW v1 AS SELECT 1; +--exec $MYSQL_DUMP --skip-add-drop-table test > $MYSQLTEST_VARDIR/tmp/bug28524.sql +DROP VIEW v1; + +--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug28524.sql +SELECT * FROM v1; +DROP VIEW v1; + --echo # --echo # End of 5.0 tests --echo # From 155eb4658d3c238d2d27e6ca9f7e0ef91cf045b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 18:08:05 +0300 Subject: [PATCH 208/227] 5.0-opt -> 5.1-opt merge --- mysql-test/r/index_merge_myisam.result | 61 ++++++++++++++++++++++++++ storage/heap/ha_heap.cc | 4 +- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result index f135d849f76..9d7d06f7f1b 100644 --- a/mysql-test/r/index_merge_myisam.result +++ b/mysql-test/r/index_merge_myisam.result @@ -457,6 +457,67 @@ a 1 UNLOCK TABLES; DROP TABLE t1, t2; +CREATE TABLE `t1` ( +`a` int(11) DEFAULT NULL, +`filler` char(200) DEFAULT NULL, +`b` int(11) DEFAULT NULL, +KEY `a` (`a`), +KEY `b` (`b`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1; +insert into t1 values +(0, 'filler', 0), (1, 'filler', 1), (2, 'filler', 2), (3, 'filler', 3), +(4, 'filler', 4), (5, 'filler', 5), (6, 'filler', 6), (7, 'filler', 7), +(8, 'filler', 8), (9, 'filler', 9), (0, 'filler', 0), (1, 'filler', 1), +(2, 'filler', 2), (3, 'filler', 3), (4, 'filler', 4), (5, 'filler', 5), +(6, 'filler', 6), (7, 'filler', 7), (8, 'filler', 8), (9, 'filler', 9), +(10, 'filler', 10), (11, 'filler', 11), (12, 'filler', 12), (13, 'filler', 13), +(14, 'filler', 14), (15, 'filler', 15), (16, 'filler', 16), (17, 'filler', 17), +(18, 'filler', 18), (19, 'filler', 19), (4, '5 ', 0), (5, '4 ', 0), +(4, '4 ', 0), (4, 'qq ', 5), (5, 'qq ', 4), (4, 'zz ', 4); +create table t2( +`a` int(11) DEFAULT NULL, +`filler` char(200) DEFAULT NULL, +`b` int(11) DEFAULT NULL, +KEY USING BTREE (`a`), +KEY USING BTREE (`b`) +) ENGINE=MEMORY DEFAULT CHARSET=latin1; +insert into t2 select * from t1; +must use sort-union rather than union: +explain select * from t1 where a=4 or b=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b a,b 5,5 NULL # Using sort_union(a,b); Using where +select * from t1 where a=4 or b=4; +a filler b +4 4 0 +4 5 0 +4 filler 4 +4 filler 4 +4 qq 5 +4 zz 4 +5 qq 4 +select * from t1 ignore index(a,b) where a=4 or b=4; +a filler b +4 4 0 +4 5 0 +4 filler 4 +4 filler 4 +4 qq 5 +4 zz 4 +5 qq 4 +must use union, not sort-union: +explain select * from t2 where a=4 or b=4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index_merge a,b a,b 5,5 NULL # Using union(a,b); Using where +select * from t2 where a=4 or b=4; +a filler b +4 4 0 +4 5 0 +4 filler 4 +4 filler 4 +4 qq 5 +4 zz 4 +5 qq 4 +drop table t1, t2; #---------------- ROR-index_merge tests ----------------------- SET SESSION STORAGE_ENGINE = MyISAM; drop table if exists t0,t1,t2; diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 5d34395fa5a..f2b67f20c57 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -136,8 +136,8 @@ int ha_heap::close(void) handler *ha_heap::clone(MEM_ROOT *mem_root) { - handler *new_handler= get_new_handler(table, mem_root, table->s->db_type); - if (new_handler && !new_handler->ha_open(file->s->name, table->db_stat, + handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type()); + if (new_handler && !new_handler->ha_open(table, file->s->name, table->db_stat, HA_OPEN_IGNORE_IF_LOCKED)) return new_handler; return NULL; /* purecov: inspected */ From 6d0419f6bcc213d387191a32e81a37ae877b84b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 12:27:54 -0400 Subject: [PATCH 209/227] Move the filling of the table_name column above the initialization, so that the init function has access to the name. --- sql/sql_show.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c6bf816b290..4d0783a9a92 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5904,6 +5904,7 @@ int initialize_schema_table(st_plugin_int *plugin) schema_table->old_format= make_old_format; schema_table->idx_field1= -1, schema_table->idx_field2= -1; + schema_table->table_name= plugin->name.str; if (plugin->plugin->init(schema_table)) { @@ -5911,7 +5912,6 @@ int initialize_schema_table(st_plugin_int *plugin) plugin->name.str); goto err; } - schema_table->table_name= plugin->name.str; } DBUG_RETURN(0); From b79daf410963420487778dc764192eab8c813778 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 13:37:56 -0400 Subject: [PATCH 210/227] Re-set the plugin name so that we can be sure the plugin init() function doesn't set it to something else. --- sql/sql_show.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4d0783a9a92..5b8cb93baab 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5904,6 +5904,8 @@ int initialize_schema_table(st_plugin_int *plugin) schema_table->old_format= make_old_format; schema_table->idx_field1= -1, schema_table->idx_field2= -1; + + /* Make the name available to the init() function. */ schema_table->table_name= plugin->name.str; if (plugin->plugin->init(schema_table)) @@ -5912,6 +5914,9 @@ int initialize_schema_table(st_plugin_int *plugin) plugin->name.str); goto err; } + + /* Make sure the plugin name is not set inside the init() function. */ + schema_table->table_name= plugin->name.str; } DBUG_RETURN(0); From b55bb35c25b48712b4b2da759697a9755f6996cb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jul 2007 15:31:24 -0600 Subject: [PATCH 211/227] ddl_i18n_utf8.test, ddl_i18n_koi8r.test: Don't run test with embedded server; requires external client connections mysql-test/t/ddl_i18n_koi8r.test: Don't run test with embedded server; requires external client connections mysql-test/t/ddl_i18n_utf8.test: Don't run test with embedded server; requires external client connections --- mysql-test/t/ddl_i18n_koi8r.test | 2 ++ mysql-test/t/ddl_i18n_utf8.test | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test index e636d801b07..1d16adbad55 100644 --- a/mysql-test/t/ddl_i18n_koi8r.test +++ b/mysql-test/t/ddl_i18n_koi8r.test @@ -30,6 +30,8 @@ # ########################################################################### +# Test requires server to accept client connections (for mysqldump portions) +--source include/not_embedded.inc --source include/have_utf8.inc --source include/have_cp866.inc --source include/have_cp1251.inc diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test index 5f032232e56..c80137a58b5 100644 --- a/mysql-test/t/ddl_i18n_utf8.test +++ b/mysql-test/t/ddl_i18n_utf8.test @@ -30,6 +30,8 @@ # ########################################################################### +# Test requires server to accept client connections (for mysqldump portions) +--source include/not_embedded.inc --source include/have_utf8.inc --source include/have_cp866.inc --source include/have_cp1251.inc From 8e500b7b75c94ad467a18adfddf6eebd28912281 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 14:56:04 +0500 Subject: [PATCH 212/227] mysqldump.result: Post-merge fix. mysql-test/r/mysqldump.result: Post-merge fix. --- mysql-test/r/mysqldump.result | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 5a073ffe7a4..e8c971a41bc 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2916,7 +2916,6 @@ USE `test`; /*!50001 SET character_set_client = @saved_cs_client */; /*!50001 SET character_set_results = @saved_cs_results */; /*!50001 SET collation_connection = @saved_col_connection */; -/*!50001 DROP TABLE IF EXISTS `v2`*/; /*!50001 DROP TABLE `v2`*/; /*!50001 DROP VIEW IF EXISTS `v2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; @@ -3146,13 +3145,13 @@ insert into t values(5, 51); create view v1 as select qty, price, qty*price as value from t; create view v2 as select qty from v1; mysqldump { +/*!50001 DROP TABLE `v1`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; /*!50001 SET @saved_col_connection = @@collation_connection */; /*!50001 SET character_set_client = latin1 */; /*!50001 SET character_set_results = latin1 */; /*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 DROP TABLE `v1`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v1` AS select `t`.`qty` AS `qty`,`t`.`price` AS `price`,(`t`.`qty` * `t`.`price`) AS `value` from `t` */; @@ -3161,13 +3160,13 @@ mysqldump { /*!50001 SET collation_connection = @saved_col_connection */; } mysqldump { +/*!50001 DROP TABLE `v2`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; /*!50001 SET @saved_col_connection = @@collation_connection */; /*!50001 SET character_set_client = latin1 */; /*!50001 SET character_set_results = latin1 */; /*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 DROP TABLE `v2`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `v2` AS select `v1`.`qty` AS `qty` from `v1` */; @@ -3310,13 +3309,13 @@ USE `mysqldump_views`; USE `mysqldump_tables`; USE `mysqldump_views`; +/*!50001 DROP TABLE `nasishnasifu`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; /*!50001 SET @saved_col_connection = @@collation_connection */; /*!50001 SET character_set_client = latin1 */; /*!50001 SET character_set_results = latin1 */; /*!50001 SET collation_connection = latin1_swedish_ci */; -/*!50001 DROP TABLE `nasishnasifu`*/; /*!50001 CREATE ALGORITHM=UNDEFINED */ /*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */ /*!50001 VIEW `mysqldump_views`.`nasishnasifu` AS select `mysqldump_tables`.`basetable`.`id` AS `id` from `mysqldump_tables`.`basetable` */; @@ -3876,7 +3875,7 @@ DROP TABLE IF EXISTS `v1`; ) */; USE `mysqldump_test_db`; -/*!50001 DROP TABLE IF EXISTS `v1`*/; +/*!50001 DROP TABLE `v1`*/; /*!50001 DROP VIEW IF EXISTS `v1`*/; /*!50001 SET @saved_cs_client = @@character_set_client */; /*!50001 SET @saved_cs_results = @@character_set_results */; From 9fa66ba423b776934513fd2a318a57ee16dc6bcf Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 14:12:05 +0200 Subject: [PATCH 213/227] field.cc, field.h: i5 compatibility sql/field.h: i5 compatibility sql/field.cc: i5 compatibility --- sql/field.cc | 1 + sql/field.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/field.cc b/sql/field.cc index 2e227f0e67e..58832db04cd 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -6270,6 +6270,7 @@ Field *Field_string::new_field(MEM_ROOT *root, struct st_table *new_table, is 2. ****************************************************************************/ +const uint Field_varstring::MAX_SIZE= UINT_MAX16; int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs) { diff --git a/sql/field.h b/sql/field.h index fb6534b7b55..fbf402ab5c3 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1116,7 +1116,7 @@ public: The maximum space available in a Field_varstring, in bytes. See length_bytes. */ - static const uint MAX_SIZE= UINT_MAX16; + static const uint MAX_SIZE; /* Store number of bytes used to store length (1 or 2) */ uint32 length_bytes; Field_varstring(char *ptr_arg, From f4209c71a24ec563dd876db3a94fad7d2c53b8aa Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 14:14:03 +0200 Subject: [PATCH 214/227] Avoid the name conflict between the system-provided "md5.h" and the MySQL one by renaming "include/md5.h" to "include/my_md5.h". Fixes bug#14151. include/my_md5.h: Rename: include/md5.h -> include/my_md5.h --- client/mysqlmanager-pwgen.c | 2 +- include/Makefile.am | 2 +- include/{md5.h => my_md5.h} | 0 mysys/md5.c | 2 +- os2/MySQL-Source.icc | 2 +- sql/item_strfunc.cc | 2 +- sql/table.cc | 2 +- tools/mysqlmanager.c | 2 +- 8 files changed, 7 insertions(+), 7 deletions(-) rename include/{md5.h => my_md5.h} (100%) diff --git a/client/mysqlmanager-pwgen.c b/client/mysqlmanager-pwgen.c index 716a1e4bf4e..7a857c59743 100644 --- a/client/mysqlmanager-pwgen.c +++ b/client/mysqlmanager-pwgen.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include "my_md5.h" const char* outfile=0,*user="root"; diff --git a/include/Makefile.am b/include/Makefile.am index ccd5ac627bf..2cd72052a15 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -32,7 +32,7 @@ noinst_HEADERS = config-win.h config-os2.h config-netware.h \ mysys_err.h my_base.h help_start.h help_end.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_aes.h my_tree.h hash.h thr_alarm.h \ - thr_lock.h t_ctype.h violite.h md5.h base64.h \ + thr_lock.h t_ctype.h violite.h my_md5.h base64.h \ mysql_version.h.in my_handler.h my_time.h \ my_user.h my_libwrap.h diff --git a/include/md5.h b/include/my_md5.h similarity index 100% rename from include/md5.h rename to include/my_md5.h diff --git a/mysys/md5.c b/mysys/md5.c index a88fb279a0b..0945f9ce5f4 100644 --- a/mysys/md5.c +++ b/mysys/md5.c @@ -45,7 +45,7 @@ documentation and/or software. #include #include -#include "md5.h" +#include "my_md5.h" /* Constants for MD5Transform routine. */ diff --git a/os2/MySQL-Source.icc b/os2/MySQL-Source.icc index 342cb6c96b9..285811d0eae 100644 --- a/os2/MySQL-Source.icc +++ b/os2/MySQL-Source.icc @@ -31,7 +31,7 @@ group server_global_pch = 'myisam.h', 'myisampack.h', '.\myisam\myisamdef.h', 'sql_string.h', 'item.h', 'unireg.h', 'field.h', 'sql_lex.h', 'sql_list.h', 'sql_repl.h', - 'md5.h', 'sql_acl.h', 'slave.h', + 'my_md5.h', 'sql_acl.h', 'slave.h', 'ha_myisam.h', 'procedure.h', 'sql_select.h', 'errmsg.h', 't_ctype.h', 'direct.h', 'mysys_err.h', 'zconf.h', 'zlib.h', diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 0c24f14c8fe..20a4b64640a 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -28,7 +28,7 @@ #ifdef HAVE_OPENSSL #include #endif /* HAVE_OPENSSL */ -#include "md5.h" +#include "my_md5.h" #include "sha1.h" #include "my_aes.h" C_MODE_START diff --git a/sql/table.cc b/sql/table.cc index 9c3e7618aa0..f24f5c6fbcc 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -19,7 +19,7 @@ #include "mysql_priv.h" #include #include -#include "md5.h" +#include "my_md5.h" /* Functions defined in this file */ diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c index f952a5806b4..faed9addf60 100644 --- a/tools/mysqlmanager.c +++ b/tools/mysqlmanager.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include "my_md5.h" #include #ifdef HAVE_SYS_WAIT_H #include From e81e55e78306643031e237c884c48f1d3d7b76c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 19:28:00 +0400 Subject: [PATCH 215/227] A fix for Bug#29431 killing an insert delayed thread causes crash No test case, since the bug requires a stress case with 30 INSERT DELAYED threads and 1 killer thread to repeat. The patch is verified manually. Review fixes. The server that is running DELAYED inserts would deadlock itself or crash under high load if some of the delayed threads were KILLed in the meanwhile. The fix is to change internal lock acquisition order of delayed inserts subsystem and to ensure that Delayed_insert::table_list::db does not point to volatile memory in some cases. For details, please see a comment for sql_insert.cc. sql/sql_insert.cc: A fix for Bug#29431 killing an insert delayed thread causes crash 1) The deadlock was caused by different lock acquisition order between delayed_get_table and handle_delayed_insert. delayed_get_table would: - acquire LOCK_delayed_create - create a new Delayed_insert instance - acquire instance mutex (di->mutex) - "lock the instance in memory" by increasing di->locked_in_memory variable - start the delayed thread - release di->mutex - let the delayed thread open the delayed table - discover that the delayed thread was killed - try to unlock() the delayed insert instance in memory - in Delayed_insert::unlock() do * lock LOCK_delayed_insert * decrease locks_in_memory and discover it's 0 * attempt to lock di->mutex to broadcast di->cond condition <-- deadlock here Meanwhile, the delayed thread would * lock di->mutex * open the table * get killed * not notice that and attempt to lock LOCK_delayed_insert to register itself in the delayed insert list <-- deadlock here. Simply put, delayed_get_table used to lock LOCK_delayed_insert and then di->mutex, and handle_delayed_insert would lock di->mutex and then LOCK_delayed_insert. Fixed by moving registration in the list of delayed insert threads from handle_delayed_insert to delayed_get_table - so that now handle_delayed_insert doesn't need to acquire LOCK_delayed_insert mutex. 2) di->table_list.db was copied by-pointer from table_list.db of the first producer -- the one who initiated creation of the delayed insert thread. This producer might be long gone when the member is needed (handle_delayed_insert:open_ltable), e.g. by having been killed with KILL CONNECTION statement. Fixed by using a pointer to the consumer's deep copy of THD::db. 3) In find_handler, we shouldn't assume that Delayed_insert object already (or still) has a table opened all the time it is present in the delayed insert list. E.g. it's not the case when Delayed_insert decided to terminate, closed the table, but haven't yet unregistered from the list (see the end of handle_delayed_insert). --- sql/sql_insert.cc | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 73f8c5e4418..1a8cacd4f8e 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1705,8 +1705,8 @@ Delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list) Delayed_insert *tmp; while ((tmp=it++)) { - if (!strcmp(tmp->thd.db,table_list->db) && - !strcmp(table_list->table_name,tmp->table->s->table_name)) + if (!strcmp(table_list->db, tmp->table_list.db) && + !strcmp(table_list->table_name, tmp->table_list.table_name)) { tmp->lock(); break; @@ -1739,7 +1739,27 @@ Delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list) Two latter cases indicate a request for lock upgrade. XXX: why do we regard INSERT DELAYED into a view as an error and - do not simply a lock upgrade? + do not simply perform a lock upgrade? + + TODO: The approach with using two mutexes to work with the + delayed thread list -- LOCK_delayed_insert and + LOCK_delayed_create -- is redundant, and we only need one of + them to protect the list. The reason we have two locks is that + we do not want to block look-ups in the list while we're waiting + for the newly created thread to open the delayed table. However, + this wait itself is redundant -- we always call get_local_table + later on, and there wait again until the created thread acquires + a table lock. + + As is redundant the concept of locks_in_memory, since we already + have another counter with similar semantics - tables_in_use, + both of them are devoted to counting the number of producers for + a given consumer (delayed insert thread), only at different + stages of producer-consumer relationship. + + 'dead' and 'status' variables in Delayed_insert are redundant + too, since there is already 'di->thd.killed' and + di->stacked_inserts. */ static @@ -1788,7 +1808,9 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list) goto end_create; } tmp->table_list= *table_list; // Needed to open table + /* Replace volatile strings with local copies */ tmp->table_list.alias= tmp->table_list.table_name= tmp->thd.query; + tmp->table_list.db= tmp->thd.db; tmp->lock(); pthread_mutex_lock(&tmp->mutex); if ((error=pthread_create(&tmp->thd.real_id,&connection_attrib, @@ -1834,6 +1856,9 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list) tmp->unlock(); goto end_create; } + pthread_mutex_lock(&LOCK_delayed_insert); + delayed_threads.append(tmp); + pthread_mutex_unlock(&LOCK_delayed_insert); } pthread_mutex_unlock(&LOCK_delayed_create); } @@ -2176,11 +2201,6 @@ pthread_handler_t handle_delayed_insert(void *arg) } di->table->copy_blobs=1; - /* One can now use this */ - pthread_mutex_lock(&LOCK_delayed_insert); - delayed_threads.append(di); - pthread_mutex_unlock(&LOCK_delayed_insert); - /* Tell client that the thread is initialized */ pthread_cond_signal(&di->cond_client); From 62eb5f17945972c1c1f6a78c95440c71afc7d7bc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 19:36:52 +0400 Subject: [PATCH 216/227] Rename all references to 'Delayed_insert' instances from 'tmp' to 'di' for consistency. --- sql/sql_insert.cc | 100 +++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 1a8cacd4f8e..19c9360b0ed 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1702,18 +1702,18 @@ Delayed_insert *find_handler(THD *thd, TABLE_LIST *table_list) thd->proc_info="waiting for delay_list"; pthread_mutex_lock(&LOCK_delayed_insert); // Protect master list I_List_iterator it(delayed_threads); - Delayed_insert *tmp; - while ((tmp=it++)) + Delayed_insert *di; + while ((di= it++)) { - if (!strcmp(table_list->db, tmp->table_list.db) && - !strcmp(table_list->table_name, tmp->table_list.table_name)) + if (!strcmp(table_list->db, di->table_list.db) && + !strcmp(table_list->table_name, di->table_list.table_name)) { - tmp->lock(); + di->lock(); break; } } pthread_mutex_unlock(&LOCK_delayed_insert); // For unlink from list - return tmp; + return di; } @@ -1766,14 +1766,14 @@ static bool delayed_get_table(THD *thd, TABLE_LIST *table_list) { int error; - Delayed_insert *tmp; + Delayed_insert *di; DBUG_ENTER("delayed_get_table"); /* Must be set in the parser */ DBUG_ASSERT(table_list->db); /* Find the thread which handles this table. */ - if (!(tmp=find_handler(thd,table_list))) + if (!(di= find_handler(thd, table_list))) { /* No match. Create a new thread to handle the table, but @@ -1787,9 +1787,9 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list) The first search above was done without LOCK_delayed_create. Another thread might have created the handler in between. Search again. */ - if (! (tmp= find_handler(thd, table_list))) + if (! (di= find_handler(thd, table_list))) { - if (!(tmp=new Delayed_insert())) + if (!(di= new Delayed_insert())) { my_error(ER_OUTOFMEMORY,MYF(0),sizeof(Delayed_insert)); thd->fatal_error(); @@ -1798,30 +1798,30 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list) pthread_mutex_lock(&LOCK_thread_count); thread_count++; pthread_mutex_unlock(&LOCK_thread_count); - tmp->thd.set_db(table_list->db, strlen(table_list->db)); - tmp->thd.query= my_strdup(table_list->table_name,MYF(MY_WME)); - if (tmp->thd.db == NULL || tmp->thd.query == NULL) + di->thd.set_db(table_list->db, strlen(table_list->db)); + di->thd.query= my_strdup(table_list->table_name, MYF(MY_WME)); + if (di->thd.db == NULL || di->thd.query == NULL) { /* The error is reported */ - delete tmp; + delete di; thd->fatal_error(); goto end_create; } - tmp->table_list= *table_list; // Needed to open table + di->table_list= *table_list; // Needed to open table /* Replace volatile strings with local copies */ - tmp->table_list.alias= tmp->table_list.table_name= tmp->thd.query; - tmp->table_list.db= tmp->thd.db; - tmp->lock(); - pthread_mutex_lock(&tmp->mutex); - if ((error=pthread_create(&tmp->thd.real_id,&connection_attrib, - handle_delayed_insert,(void*) tmp))) + di->table_list.alias= di->table_list.table_name= di->thd.query; + di->table_list.db= di->thd.db; + di->lock(); + pthread_mutex_lock(&di->mutex); + if ((error= pthread_create(&di->thd.real_id, &connection_attrib, + handle_delayed_insert, (void*) di))) { DBUG_PRINT("error", ("Can't create thread to handle delayed insert (error %d)", error)); - pthread_mutex_unlock(&tmp->mutex); - tmp->unlock(); - delete tmp; + pthread_mutex_unlock(&di->mutex); + di->unlock(); + delete di; my_error(ER_CANT_CREATE_THREAD, MYF(0), error); thd->fatal_error(); goto end_create; @@ -1829,15 +1829,15 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list) /* Wait until table is open */ thd->proc_info="waiting for handler open"; - while (!tmp->thd.killed && !tmp->table && !thd->killed) + while (!di->thd.killed && !di->table && !thd->killed) { - pthread_cond_wait(&tmp->cond_client,&tmp->mutex); + pthread_cond_wait(&di->cond_client, &di->mutex); } - pthread_mutex_unlock(&tmp->mutex); + pthread_mutex_unlock(&di->mutex); thd->proc_info="got old table"; - if (tmp->thd.killed) + if (di->thd.killed) { - if (tmp->thd.net.report_error) + if (di->thd.net.report_error) { /* Copy the error message. Note that we don't treat fatal @@ -1845,34 +1845,34 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list) main thread. Use of my_message will enable stored procedures continue handlers. */ - my_message(tmp->thd.net.last_errno, tmp->thd.net.last_error, + my_message(di->thd.net.last_errno, di->thd.net.last_error, MYF(0)); } - tmp->unlock(); + di->unlock(); goto end_create; } if (thd->killed) { - tmp->unlock(); + di->unlock(); goto end_create; } pthread_mutex_lock(&LOCK_delayed_insert); - delayed_threads.append(tmp); + delayed_threads.append(di); pthread_mutex_unlock(&LOCK_delayed_insert); } pthread_mutex_unlock(&LOCK_delayed_create); } - pthread_mutex_lock(&tmp->mutex); - table_list->table= tmp->get_local_table(thd); - pthread_mutex_unlock(&tmp->mutex); + pthread_mutex_lock(&di->mutex); + table_list->table= di->get_local_table(thd); + pthread_mutex_unlock(&di->mutex); if (table_list->table) { DBUG_ASSERT(thd->net.report_error == 0); - thd->di=tmp; + thd->di= di; } /* Unlock the delayed insert object after its last access. */ - tmp->unlock(); + di->unlock(); DBUG_RETURN(table_list->table == NULL); end_create: @@ -2102,26 +2102,26 @@ void kill_delayed_threads(void) VOID(pthread_mutex_lock(&LOCK_delayed_insert)); // For unlink from list I_List_iterator it(delayed_threads); - Delayed_insert *tmp; - while ((tmp=it++)) + Delayed_insert *di; + while ((di= it++)) { - tmp->thd.killed= THD::KILL_CONNECTION; - if (tmp->thd.mysys_var) + di->thd.killed= THD::KILL_CONNECTION; + if (di->thd.mysys_var) { - pthread_mutex_lock(&tmp->thd.mysys_var->mutex); - if (tmp->thd.mysys_var->current_cond) + pthread_mutex_lock(&di->thd.mysys_var->mutex); + if (di->thd.mysys_var->current_cond) { /* We need the following test because the main mutex may be locked in handle_delayed_insert() */ - if (&tmp->mutex != tmp->thd.mysys_var->current_mutex) - pthread_mutex_lock(tmp->thd.mysys_var->current_mutex); - pthread_cond_broadcast(tmp->thd.mysys_var->current_cond); - if (&tmp->mutex != tmp->thd.mysys_var->current_mutex) - pthread_mutex_unlock(tmp->thd.mysys_var->current_mutex); + if (&di->mutex != di->thd.mysys_var->current_mutex) + pthread_mutex_lock(di->thd.mysys_var->current_mutex); + pthread_cond_broadcast(di->thd.mysys_var->current_cond); + if (&di->mutex != di->thd.mysys_var->current_mutex) + pthread_mutex_unlock(di->thd.mysys_var->current_mutex); } - pthread_mutex_unlock(&tmp->thd.mysys_var->mutex); + pthread_mutex_unlock(&di->thd.mysys_var->mutex); } } VOID(pthread_mutex_unlock(&LOCK_delayed_insert)); // For unlink from list From 93de616578d601d49dfee8927bdd539da94dc69f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 19:56:07 +0400 Subject: [PATCH 217/227] A post-merge fix --- mysql-test/r/create.result | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index cdbb767dd9f..de25fb754e4 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1516,6 +1516,22 @@ t1 CREATE TABLE `t1` ( `c17` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; + +Bug #26104 Bug on foreign key class constructor + +Check that ref_columns is initalized correctly in the constructor +and semantic checks in mysql_prepare_table work. + +We do not need a storage engine that supports foreign keys +for this test, as the checks are purely syntax-based, and the +syntax is supported for all engines. + +drop table if exists t1,t2; +create table t1(a int not null, b int not null, primary key (a, b)); +create table t2(a int not null, b int not null, c int not null, primary key (a), +foreign key fk_bug26104 (b,c) references t1(a)); +ERROR 42000: Incorrect foreign key definition for 'fk_bug26104': Key reference and table reference don't match +drop table t1; End of 5.0 tests CREATE TABLE t1 (a int, b int); insert into t1 values (1,1),(1,2); From 223f3978f8f5acd52943c80097ea4919d4e4fcc1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 20:59:11 +0500 Subject: [PATCH 218/227] test case for memory leak added tests/mysql_client_test.c: test case added --- tests/mysql_client_test.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index cb1561ad6f5..3a516545096 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16271,6 +16271,38 @@ static void test_bug27592() } + +/* + Bug#29687 mysql_stmt_store_result memory leak in libmysqld +*/ + +static void test_bug29687() +{ + const int NUM_ITERATIONS= 40; + int i; + int rc; + MYSQL_STMT *stmt= NULL; + + DBUG_ENTER("test_bug29687"); + myheader("test_bug29687"); + + stmt= mysql_simple_prepare(mysql, "SELECT 1 FROM dual WHERE 0=2"); + DIE_UNLESS(stmt); + + for (i= 0; i < NUM_ITERATIONS; i++) + { + mysql_stmt_execute(stmt); + check_execute(stmt, rc); + mysql_stmt_store_result(stmt); + while (mysql_stmt_fetch(stmt)==0); + mysql_stmt_free_result(stmt); + } + + mysql_stmt_close(stmt); + DBUG_VOID_RETURN; +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -16560,6 +16592,7 @@ static struct my_tests_st my_tests[]= { { "test_bug28505", test_bug28505 }, { "test_bug28934", test_bug28934 }, { "test_bug27592", test_bug27592 }, + { "test_bug29687", test_bug29687 }, { 0, 0 } }; From 809e56e4677652e54ad2edca86d8ba6a565d60fe Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 18:05:55 +0200 Subject: [PATCH 219/227] After-merge fix for bug#14151. sql/sql_partition.cc: After-merge fix for bug#14151: This use of "md5.h" is new in 5.1 and must be changed to "my_md5.h" as well. --- sql/sql_partition.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 0584bb12b9e..5cfb46a99ab 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -36,7 +36,7 @@ #include "mysql_priv.h" #include #include -#include "md5.h" +#include "my_md5.h" #ifdef WITH_PARTITION_STORAGE_ENGINE #include "ha_partition.h" From 7f6a8164846da34a822e8f844d6ec9e1da3af412 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 20:21:23 +0400 Subject: [PATCH 220/227] Bug#29850: Wrong charset of GROUP_CONCAT result when the select employs a temporary table. The result string of the Item_func_group_concat wasn't initialized in the copying constructor of the Item_func_group_concat class. This led to a wrong charset of GROUP_CONCAT result when the select employs a temporary table. The copying constructor of the Item_func_group_concat class now correctly initializes the charset of the result string. mysql-test/t/func_gconcat.test: Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result when the select employs a temporary table. mysql-test/r/func_gconcat.result: Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result when the select employs a temporary table. sql/item_sum.cc: Bug#29850: Wrong charset of GROUP_CONCAT result when the select employs a temporary table. The copying constructor of the Item_func_group_concat class now correctly initializes the charset of the result string. --- mysql-test/r/func_gconcat.result | 9 +++++++++ mysql-test/t/func_gconcat.test | 11 +++++++++++ sql/item_sum.cc | 1 + 3 files changed, 21 insertions(+) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 8b71ad1940e..35487c25ae3 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -810,4 +810,13 @@ LENGTH( GROUP_CONCAT( a ) ) 65535 SET group_concat_max_len= DEFAULT; DROP TABLE t1, t2, t3; +set names latin1; +create table t1 (id int, name varchar(20)) DEFAULT CHARSET=utf8; +insert into t1 (id, name) values (1, "óra"); +insert into t1 (id, name) values (2, "óra"); +select b.id, group_concat(b.name) from t1 a, t1 b group by b.id; +id group_concat(b.name) +1 óra,óra +2 óra,óra +drop table t1; End of 5.0 tests diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 767df5ae233..ff3ba951870 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -551,4 +551,15 @@ SELECT LENGTH( GROUP_CONCAT( a ) ) FROM t3 WHERE b = 3; SET group_concat_max_len= DEFAULT; DROP TABLE t1, t2, t3; +# +# Bug#29850: Wrong charset of the GROUP_CONCAT result when the select employs +# a temporary table. +# +set names latin1; +create table t1 (id int, name varchar(20)) DEFAULT CHARSET=utf8; +insert into t1 (id, name) values (1, "óra"); +insert into t1 (id, name) values (2, "óra"); +select b.id, group_concat(b.name) from t1 a, t1 b group by b.id; +drop table t1; + --echo End of 5.0 tests diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 133f00039b0..fe9f58d84e1 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -3068,6 +3068,7 @@ Item_func_group_concat::Item_func_group_concat(THD *thd, original(item) { quick_group= item->quick_group; + result.set_charset(collation.collation); } From 6c24dd7f0cdc3d996610c4cfc8181d25c5f580fe Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 21:10:19 +0400 Subject: [PATCH 221/227] A follow-up fix for Bug#29431 "killing an insert delayed thread causes crash" in 5.1 sql/sql_insert.cc: Additional safety fix: do not assume we already have a share in get_local_table. --- sql/sql_insert.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 903300c0402..b362835412a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1961,7 +1961,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) my_ptrdiff_t adjust_ptrs; Field **field,**org_field, *found_next_number_field; TABLE *copy; - TABLE_SHARE *share= table->s; + TABLE_SHARE *share; uchar *bitmap; DBUG_ENTER("Delayed_insert::get_local_table"); @@ -1985,6 +1985,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd) goto error; } } + share= table->s; /* Allocate memory for the TABLE object, the field pointers array, and From 39433686e690866bcbf985839b587165ecc91506 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Jul 2007 00:04:30 +0500 Subject: [PATCH 222/227] mysql_client_test fixed tests/mysql_client_test.c: rc assignement added --- tests/mysql_client_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 3a516545096..6f279509614 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -16291,7 +16291,7 @@ static void test_bug29687() for (i= 0; i < NUM_ITERATIONS; i++) { - mysql_stmt_execute(stmt); + rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); mysql_stmt_store_result(stmt); while (mysql_stmt_fetch(stmt)==0); From a131428f041cd015662240bde255d159bcc53af7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Jul 2007 00:06:35 +0400 Subject: [PATCH 223/227] Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag. The Item_date_typecast::val_int function doesn't reset null_value flag. This makes all values that follows the first null value to be treated as nulls and led to a wrong result. Now the Item_date_typecast::val_int function correctly sets the null_value flag for both null and non-null values. mysql-test/t/cast.test: Added a test case for the bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag. mysql-test/r/cast.result: Added a test case for the bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag. sql/item_timefunc.cc: Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag. Now the Item_date_typecast::val_int function correctly sets the null_value flag for both null and non-null values. --- mysql-test/r/cast.result | 11 +++++++++++ mysql-test/t/cast.test | 9 +++++++++ sql/item_timefunc.cc | 5 +---- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 6eceeff87e2..524ff48d69e 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -403,4 +403,15 @@ hex(cast('a' as binary(2))) select hex(cast('a' as char(2) binary)); hex(cast('a' as char(2) binary)) 61 +CREATE TABLE t1 (d1 datetime); +INSERT INTO t1(d1) VALUES ('2007-07-19 08:30:00'), (NULL), +('2007-07-19 08:34:00'), (NULL), ('2007-07-19 08:36:00'); +SELECT cast(date(d1) as signed) FROM t1; +cast(date(d1) as signed) +20070719 +NULL +20070719 +NULL +20070719 +drop table t1; End of 5.0 tests diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index b665eb86656..316b79efe4d 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -237,4 +237,13 @@ select hex(cast('a' as char(2) binary)); select hex(cast('a' as binary(2))); select hex(cast('a' as char(2) binary)); +# +# Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag. +# +CREATE TABLE t1 (d1 datetime); +INSERT INTO t1(d1) VALUES ('2007-07-19 08:30:00'), (NULL), + ('2007-07-19 08:34:00'), (NULL), ('2007-07-19 08:36:00'); +SELECT cast(date(d1) as signed) FROM t1; +drop table t1; + --echo End of 5.0 tests diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 9795ec5f413..873e2833a1e 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2662,11 +2662,8 @@ longlong Item_date_typecast::val_int() { DBUG_ASSERT(fixed == 1); MYSQL_TIME ltime; - if (args[0]->get_date(<ime, TIME_FUZZY_DATE)) - { - null_value= 1; + if ((null_value= args[0]->get_date(<ime, TIME_FUZZY_DATE))) return 0; - } return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day); } From d9fda1cf9a8a460eb7cfb70615911580a429a280 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Jul 2007 23:06:34 +0200 Subject: [PATCH 224/227] BUG#20815 Errno 12 on Windows after 197 connections CMakeLists.txt: BUG#20815 Set stack size. This value is really supposed to be the linker's default. I'm not quite sure why we have to specify it manually too. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2a828c1843..cdd0cde8b8d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,6 +123,9 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR # generate map files SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MAP /MAPINFO:EXPORTS") + # set stack size (see bug#20815) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1048576") + # remove support for Exception handling STRING(REPLACE "/GX" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) From 7a99db0b7308f1636bbc7fafe36b478968497e50 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Jul 2007 19:46:13 +0400 Subject: [PATCH 225/227] Remove obvious comments. --- sql/sql_base.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index bf1c6d7cb0d..3860dfa1ded 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -62,11 +62,11 @@ Prelock_error_handler::handle_error(uint sql_errno, if (sql_errno == ER_NO_SUCH_TABLE) { m_handled_errors++; - return TRUE; // 'TRUE', as per coding style + return TRUE; } m_unhandled_errors++; - return FALSE; // 'FALSE', as per coding style + return FALSE; } @@ -2674,7 +2674,7 @@ int open_tables(THD *thd, TABLE_LIST **start, uint *counter, uint flags) */ for (tables= *start; tables ;tables= tables->next_global) { - safe_to_ignore_table= FALSE; // 'FALSE', as per coding style + safe_to_ignore_table= FALSE; if (tables->lock_type == TL_WRITE_DEFAULT) { From 16711062954bd202973339ac73382b435d209d9d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 20 Jul 2007 19:52:25 +0400 Subject: [PATCH 226/227] Fix the coding style. sql/sql_lex.cc: Fix the style. sql/sql_lex.h: Fix the style. --- sql/sql_lex.cc | 18 +++++++++--------- sql/sql_lex.h | 44 ++++++++++++++++++++++---------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 9f69e7dee05..e493dc05047 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -124,7 +124,7 @@ Lex_input_stream::Lex_input_stream(THD *thd, m_tok_start_prev(NULL), m_buf(buffer), m_buf_length(length), - m_echo(true), + m_echo(TRUE), m_cpp_tok_start(NULL), m_cpp_tok_start_prev(NULL), m_cpp_tok_end(NULL), @@ -1200,7 +1200,7 @@ int MYSQLlex(void *arg, void *yythd) { lip->in_comment= DISCARD_COMMENT; /* Accept '/' '*' '!', but do not keep this marker. */ - lip->set_echo(false); + lip->set_echo(FALSE); lip->yySkip(); lip->yySkip(); lip->yySkip(); @@ -1233,7 +1233,7 @@ int MYSQLlex(void *arg, void *yythd) if (version <= MYSQL_VERSION_ID) { /* Expand the content of the special comment as real code */ - lip->set_echo(true); + lip->set_echo(TRUE); state=MY_LEX_START; break; } @@ -1241,7 +1241,7 @@ int MYSQLlex(void *arg, void *yythd) else { state=MY_LEX_START; - lip->set_echo(true); + lip->set_echo(TRUE); break; } } @@ -1261,7 +1261,7 @@ int MYSQLlex(void *arg, void *yythd) if (! lip->eof()) lip->yySkip(); // remove last '/' state = MY_LEX_START; // Try again - lip->set_echo(true); + lip->set_echo(TRUE); break; case MY_LEX_END_LONG_COMMENT: if ((lip->in_comment != NO_COMMENT) && lip->yyPeek() == '/') @@ -1272,7 +1272,7 @@ int MYSQLlex(void *arg, void *yythd) lip->set_echo(lip->in_comment == PRESERVE_COMMENT); lip->yySkipn(2); /* And start recording the tokens again */ - lip->set_echo(true); + lip->set_echo(TRUE); lip->in_comment=NO_COMMENT; state=MY_LEX_START; } @@ -1297,7 +1297,7 @@ int MYSQLlex(void *arg, void *yythd) lip->found_semicolon= lip->get_ptr(); thd->server_status|= SERVER_MORE_RESULTS_EXISTS; lip->next_state= MY_LEX_END; - lip->set_echo(true); + lip->set_echo(TRUE); return (END_OF_INPUT); } state= MY_LEX_CHAR; // Return ';' @@ -1309,9 +1309,9 @@ int MYSQLlex(void *arg, void *yythd) if (lip->eof()) { lip->yyUnget(); // Reject the last '\0' - lip->set_echo(false); + lip->set_echo(FALSE); lip->yySkip(); - lip->set_echo(true); + lip->set_echo(TRUE); lip->next_state=MY_LEX_END; // Mark for next loop return(END_OF_INPUT); } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 4ac59fbacde..9ac7f2835f0 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1239,19 +1239,19 @@ public: } /** Get the raw query buffer. */ - const char* get_buf() + const char *get_buf() { return m_buf; } /** Get the pre-processed query buffer. */ - const char* get_cpp_buf() + const char *get_cpp_buf() { return m_cpp_buf; } /** Get the end of the raw query buffer. */ - const char* get_end_of_query() + const char *get_end_of_query() { return m_end_of_query; } @@ -1279,43 +1279,43 @@ public: } /** Get the token start position, in the raw buffer. */ - const char* get_tok_start() + const char *get_tok_start() { return m_tok_start; } /** Get the token start position, in the pre-processed buffer. */ - const char* get_cpp_tok_start() + const char *get_cpp_tok_start() { return m_cpp_tok_start; } /** Get the token end position, in the raw buffer. */ - const char* get_tok_end() + const char *get_tok_end() { return m_tok_end; } /** Get the token end position, in the pre-processed buffer. */ - const char* get_cpp_tok_end() + const char *get_cpp_tok_end() { return m_cpp_tok_end; } /** Get the previous token start position, in the raw buffer. */ - const char* get_tok_start_prev() + const char *get_tok_start_prev() { return m_tok_start_prev; } /** Get the current stream pointer, in the raw buffer. */ - const char* get_ptr() + const char *get_ptr() { return m_ptr; } /** Get the current stream pointer, in the pre-processed buffer. */ - const char* get_cpp_ptr() + const char *get_cpp_ptr() { return m_cpp_ptr; } @@ -1365,22 +1365,22 @@ public: private: /** Pointer to the current position in the raw input stream. */ - const char* m_ptr; + const char *m_ptr; /** Starting position of the last token parsed, in the raw buffer. */ - const char* m_tok_start; + const char *m_tok_start; /** Ending position of the previous token parsed, in the raw buffer. */ - const char* m_tok_end; + const char *m_tok_end; /** End of the query text in the input stream, in the raw buffer. */ - const char* m_end_of_query; + const char *m_end_of_query; /** Starting position of the previous token parsed, in the raw buffer. */ - const char* m_tok_start_prev; + const char *m_tok_start_prev; /** Begining of the query text in the input stream, in the raw buffer. */ - const char* m_buf; + const char *m_buf; /** Length of the raw buffer. */ uint m_buf_length; @@ -1389,28 +1389,28 @@ private: bool m_echo; /** Pre-processed buffer. */ - char* m_cpp_buf; + char *m_cpp_buf; /** Pointer to the current position in the pre-processed input stream. */ - char* m_cpp_ptr; + char *m_cpp_ptr; /** Starting position of the last token parsed, in the pre-processed buffer. */ - const char* m_cpp_tok_start; + const char *m_cpp_tok_start; /** Starting position of the previous token parsed, in the pre-procedded buffer. */ - const char* m_cpp_tok_start_prev; + const char *m_cpp_tok_start_prev; /** Ending position of the previous token parsed, in the pre-processed buffer. */ - const char* m_cpp_tok_end; + const char *m_cpp_tok_end; /** UTF8-body buffer created during parsing. */ char *m_body_utf8; @@ -1433,7 +1433,7 @@ public: Position of ';' in the stream, to delimit multiple queries. This delimiter is in the raw buffer. */ - const char* found_semicolon; + const char *found_semicolon; /** SQL_MODE = IGNORE_SPACE. */ bool ignore_space; From 20b9d9bb2ffec3eb2490047b4c9e4b6502342904 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 23 Jul 2007 22:01:22 -0600 Subject: [PATCH 227/227] Bug#29993 (Default value of log_output should be 'FILE', not 'TABLE') Changed the default location of the log output to LOG_FILE, for backward compatibility with MySQL 5.0 mysql-test/r/log_state.result: Changed the default location of the log output to LOG_FILE, for backward compatibility with MySQL 5.0 sql/set_var.cc: Changed the default location of the log output to LOG_FILE, for backward compatibility with MySQL 5.0 --- mysql-test/r/log_state.result | 2 +- sql/set_var.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result index 946797aeec7..38b3ebd6e98 100644 --- a/mysql-test/r/log_state.result +++ b/mysql-test/r/log_state.result @@ -131,7 +131,7 @@ set global general_log=ON; set global log_output=default; show variables like 'log_output'; Variable_name Value -log_output TABLE +log_output FILE set global general_log=OFF; set global log_output=FILE; truncate table mysql.general_log; diff --git a/sql/set_var.cc b/sql/set_var.cc index bd5234b42be..7f3e808090d 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2220,9 +2220,9 @@ void sys_var_log_output::set_default(THD *thd, enum_var_type type) { pthread_mutex_lock(&LOCK_global_system_variables); logger.lock(); - logger.init_slow_log(LOG_TABLE); - logger.init_general_log(LOG_TABLE); - *value= LOG_TABLE; + logger.init_slow_log(LOG_FILE); + logger.init_general_log(LOG_FILE); + *value= LOG_FILE; logger.unlock(); pthread_mutex_unlock(&LOCK_global_system_variables); }