diff options
120 files changed, 19040 insertions, 15646 deletions
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index 3e56cda98b7..726362872aa 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -312,10 +312,10 @@ int ha_spider::open( bool create_pt_handler_share = FALSE, pt_handler_mutex = FALSE, may_be_clone = FALSE; ha_spider **pt_handler_share_handlers; -#endif #ifdef SPIDER_HAS_HASH_VALUE_TYPE my_hash_value_type hash_value; #endif +#endif DBUG_ENTER("ha_spider::open"); DBUG_PRINT("info",("spider this=%p", this)); @@ -602,8 +602,10 @@ error_hash_insert: searched_bitmap = NULL; } error_searched_bitmap_alloc: +#ifdef WITH_PARTITION_STORAGE_ENGINE if (pt_handler_mutex) pthread_mutex_unlock(&partition_share->pt_handler_mutex); +#endif spider_free_share(share); share = NULL; error_get_share: @@ -8033,7 +8035,9 @@ int ha_spider::info( if (flag & HA_STATUS_AUTO) { if ( +#ifdef WITH_PARTITION_STORAGE_ENGINE share->partition_share && +#endif tmp_auto_increment_mode == 1 && !share->auto_increment_init ) { diff --git a/storage/spider/mysql-test/spider/bg/r/basic_sql.result b/storage/spider/mysql-test/spider/bg/r/basic_sql.result index e6202327ef6..1e9fe78acea 100644 --- a/storage/spider/mysql-test/spider/bg/r/basic_sql.result +++ b/storage/spider/mysql-test/spider/bg/r/basic_sql.result @@ -98,19 +98,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 4 i 2003-10-30 05:01:03 5 h 2001-10-31 23:59:59 -create table with partition and select test -CREATE TABLE ta_l2 ( -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 -SELECT a, b, c FROM tb_l -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - create no index table DROP TABLE IF EXISTS ta_l_no_idx; CREATE TABLE ta_l_no_idx @@ -282,18 +269,6 @@ a.a > 0 AND a.b = 'g' ORDER BY a.a; a b date_format(a.c, '%Y-%m-%d %H:%i:%s') 2 g 2000-02-01 00:00:00 -select partition using pushdown -SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE -a.b = 'g' ORDER BY a.a; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - -select partition using index pushdown -SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE -a.a > 0 AND a.b = 'g' ORDER BY a.a; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - insert TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); @@ -467,26 +442,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 g 2009-03-03 03:03:03 -update partition pushdown -UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 e 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -update partition index pushdown -UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -657,28 +612,6 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 10 j 2008-01-01 23:59:59 -delete partition pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -delete partition index pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - truncate TRUNCATE TABLE ta_l; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; diff --git a/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result b/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result new file mode 100644 index 00000000000..9e1201c17c9 --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result @@ -0,0 +1,121 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'f', '2008-07-01 10:21:39'), +(2, 'g', '2000-02-01 00:00:00'), +(3, 'j', '2007-05-04 20:03:11'), +(4, 'i', '2003-10-30 05:01:03'), +(5, 'h', '2001-10-31 23:59:59'); + +create table with partition and select test +CREATE TABLE ta_l2 ( +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 +SELECT a, b, c FROM tb_l +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +select partition using pushdown +SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE +a.b = 'g' ORDER BY a.a; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +select partition using index pushdown +SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE +a.a > 0 AND a.b = 'g' ORDER BY a.a; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +update partition pushdown +UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 e 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +update partition index pushdown +UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +DELETE FROM ta_l2 WHERE b = 'g'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition index pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result b/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result index 7bf1cb4aea7..5cc5760257d 100644 --- a/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result +++ b/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result @@ -74,47 +74,6 @@ SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value Spider_direct_aggregate 1 -with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 1 -SELECT COUNT(*) FROM ta_l2; -COUNT(*) -5 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MAX(a) FROM ta_l2; -MAX(a) -5 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MIN(a) FROM ta_l2; -MIN(a) -1 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MAX(a) FROM ta_l2 WHERE a < 5; -MAX(a) -4 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MIN(a) FROM ta_l2 WHERE a > 1; -MIN(a) -2 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result new file mode 100644 index 00000000000..9625519a53f --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result @@ -0,0 +1,82 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 + +with partition test +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 0 +SELECT COUNT(*) FROM ta_l2; +COUNT(*) +5 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MAX(a) FROM ta_l2; +MAX(a) +5 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MIN(a) FROM ta_l2; +MIN(a) +1 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MAX(a) FROM ta_l2 WHERE a < 5; +MAX(a) +4 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MIN(a) FROM ta_l2 WHERE a > 1; +MIN(a) +2 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/bg/r/direct_update.result b/storage/spider/mysql-test/spider/bg/r/direct_update.result index 135734641c1..517491253e9 100644 --- a/storage/spider/mysql-test/spider/bg/r/direct_update.result +++ b/storage/spider/mysql-test/spider/bg/r/direct_update.result @@ -121,94 +121,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 4 d 2003-12-01 05:01:03 -with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -update all rows with function -UPDATE ta_l2 SET c = ADDDATE(c, 1); -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 e 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by primary key -UPDATE ta_l2 SET b = 'x' WHERE a = 3; -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by a column without index -UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by primary key with order and limit -UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2011-10-18 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by primary key with order and limit -DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; -SHOW STATUS LIKE 'Spider_direct_delete'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-18 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by a column without index -DELETE FROM ta_l2 WHERE b = 'c'; -SHOW STATUS LIKE 'Spider_direct_delete'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-18 00:00:00 -4 d 2003-12-01 05:01:03 -delete by primary key -DELETE FROM ta_l2 WHERE a = 3; -SHOW STATUS LIKE 'Spider_direct_delete'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -4 d 2003-12-01 05:01:03 - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/bg/r/direct_update_part.result b/storage/spider/mysql-test/spider/bg/r/direct_update_part.result new file mode 100644 index 00000000000..bd8f1b89f69 --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/r/direct_update_part.result @@ -0,0 +1,129 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 + +with partition test +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +update all rows with function +UPDATE ta_l2 SET c = ADDDATE(c, 1); +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 e 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by primary key +UPDATE ta_l2 SET b = 'x' WHERE a = 3; +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by a column without index +UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by primary key with order and limit +UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2011-10-18 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by primary key with order and limit +DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; +SHOW STATUS LIKE 'Spider_direct_delete'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-18 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by a column without index +DELETE FROM ta_l2 WHERE b = 'c'; +SHOW STATUS LIKE 'Spider_direct_delete'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-18 00:00:00 +4 d 2003-12-01 05:01:03 +delete by primary key +DELETE FROM ta_l2 WHERE a = 3; +SHOW STATUS LIKE 'Spider_direct_delete'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +4 d 2003-12-01 05:01:03 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/bg/r/ha.result b/storage/spider/mysql-test/spider/bg/r/ha.result index e05ecb32e1b..9837faebd87 100644 --- a/storage/spider/mysql-test/spider/bg/r/ha.result +++ b/storage/spider/mysql-test/spider/bg/r/ha.result @@ -138,111 +138,6 @@ SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 1 -Spider_mon_table_cache_version_req 2 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'auto_test_remote3.ta_r4' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 3 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 2 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 2 -SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); -spider_copy_tables('ta_l2#P#pt2', '0', '1') -1 -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - active standby test create table test DROP TABLE IF EXISTS ta_l; @@ -271,7 +166,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') fail-over test SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value -Spider_mon_table_cache_version 2 +Spider_mon_table_cache_version 1 Spider_mon_table_cache_version_req 2 INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); @@ -284,7 +179,6 @@ auto_test_local ta_l 1 1 SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; db_name table_name link_id auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 auto_test_local ta_l 0 SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value @@ -316,91 +210,6 @@ SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 3 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'auto_test_remote.ta_r2' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 3 -auto_test_local ta_l2#P#pt2 1 1 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -auto_test_local ta_l 0 -auto_test_local ta_l2#P#pt2 0 -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 3 -Spider_mon_table_cache_version_req 3 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/bg/r/ha_part.result b/storage/spider/mysql-test/spider/bg/r/ha_part.result new file mode 100644 index 00000000000..8c0300ba5a5 --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/r/ha_part.result @@ -0,0 +1,262 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +DROP DATABASE IF EXISTS auto_test_remote3; +CREATE DATABASE auto_test_remote3; +USE auto_test_remote3; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; + +test select 1 +SELECT 1; +1 +1 + +create table with partition test +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 0 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'auto_test_remote3.ta_r4' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 3 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 2 +SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); +spider_copy_tables('ta_l2#P#pt2', '0', '1') +1 +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +create table with partition test +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'auto_test_remote.ta_r2' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 3 +auto_test_local ta_l2#P#pt2 1 1 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +auto_test_local ta_l2#P#pt2 0 +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +DROP DATABASE IF EXISTS auto_test_remote3; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result index a570e542771..98073fa5e54 100644 --- a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result +++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result @@ -190,167 +190,6 @@ id 3108 5000 10000 -auto_increment with partition -DROP TABLE IF EXISTS t1, t2; -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -CREATE TABLE t2 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_1"') -1 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_2"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', -'srv "s_2_1"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', -'srv "s_2_2"') -1 -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 -CREATE TABLE t2 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -777 -SELECT MAX(id) FROM t1; -MAX(id) -777 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -1554 -SELECT MAX(id) FROM t2; -MAX(id) -1554 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -778 -SELECT MAX(id) FROM t1; -MAX(id) -1554 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2331 -SELECT MAX(id) FROM t2; -MAX(id) -2331 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -1555 -SELECT id FROM t1 ORDER BY id; -id -777 -778 -1554 -1555 -2331 -2332 -3109 -3886 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3108 -SELECT id FROM t2 ORDER BY id; -id -777 -778 -1554 -1555 -2331 -2332 -3108 -3109 -3885 -3886 -4662 -5439 -TRUNCATE TABLE t1; -TRUNCATE TABLE t2; -INSERT INTO t1 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -777 -SELECT id FROM t1 ORDER BY id; -id -777 -1554 -2331 -3108 -INSERT INTO t2 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3885 -SELECT id FROM t2 ORDER BY id; -id -777 -1554 -2331 -3108 -3885 -4662 -5439 -6216 -SET INSERT_ID=5000; -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -6216 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6993 -SELECT MAX(id) FROM t2; -MAX(id) -6993 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6993 -SELECT MAX(id) FROM t1; -MAX(id) -10000 -INSERT INTO t2 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6993 -SELECT MAX(id) FROM t2; -MAX(id) -10000 -SELECT id FROM t1 ORDER BY id; -id -777 -1554 -2331 -3108 -5000 -10000 deinit DROP DATABASE IF EXISTS auto_test_local; diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result new file mode 100644 index 00000000000..12f43ef09b2 --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result @@ -0,0 +1,208 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +auto_increment with partition +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +CREATE TABLE t2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') +1 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"') +1 +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 +CREATE TABLE t2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +777 +SELECT MAX(id) FROM t1; +MAX(id) +777 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1554 +SELECT MAX(id) FROM t2; +MAX(id) +1554 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +778 +SELECT MAX(id) FROM t1; +MAX(id) +1554 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2331 +SELECT MAX(id) FROM t2; +MAX(id) +2331 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1555 +SELECT id FROM t1 ORDER BY id; +id +777 +778 +1554 +1555 +2331 +2332 +3109 +3886 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3108 +SELECT id FROM t2 ORDER BY id; +id +777 +778 +1554 +1555 +2331 +2332 +3108 +3109 +3885 +3886 +4662 +5439 +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +INSERT INTO t1 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +777 +SELECT id FROM t1 ORDER BY id; +id +777 +1554 +2331 +3108 +INSERT INTO t2 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3885 +SELECT id FROM t2 ORDER BY id; +id +777 +1554 +2331 +3108 +3885 +4662 +5439 +6216 +SET INSERT_ID=5000; +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +6216 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6993 +SELECT MAX(id) FROM t2; +MAX(id) +6993 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6993 +SELECT MAX(id) FROM t1; +MAX(id) +10000 +INSERT INTO t2 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6993 +SELECT MAX(id) FROM t2; +MAX(id) +10000 +SELECT id FROM t1 ORDER BY id; +id +777 +1554 +2331 +3108 +5000 +10000 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result index aedde01e178..2673c633f77 100644 --- a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result @@ -166,36 +166,8 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 3 e 2007-06-04 20:03:11 4 d 2003-11-30 05:01:03 5 c 2001-12-31 23:59:59 -partition with sort -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 -ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 2.23 -partition update with moving partition -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); -UPDATE ta_l2 SET a = 4 WHERE a = 3; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -4 B 2010-09-26 00:00:00 index merge CREATE TABLE ta_l_int ( a INT AUTO_INCREMENT, @@ -216,27 +188,6 @@ a b c 3 4 5 4 5 6 5 6 7 -index merge with partition -DROP TABLE IF EXISTS ta_l_int; -CREATE TABLE ta_l_int ( -a INT AUTO_INCREMENT, -b INT DEFAULT 10, -c INT DEFAULT 11, -PRIMARY KEY(a), -KEY idx1(b), -KEY idx2(c) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1 -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); -INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; -SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) -WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; -a b c -3 4 5 -4 5 6 -5 6 7 2.24 index scan update without PK @@ -250,29 +201,45 @@ KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1 SELECT a, b, c FROM ta_l_int ORDER BY a; a b c +1 2 3 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); UPDATE ta_l_int SET c = 4 WHERE b = 2; SELECT a, b, c FROM ta_l_int ORDER BY a; a b c 1 2 4 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 17 2 4 +18 2 4 2.25 direct order limit @@ -283,7 +250,7 @@ SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3; a b c 1 2 4 2 3 4 -4 5 6 +3 4 5 SHOW STATUS LIKE 'Spider_direct_order_limit'; Variable_name Value Spider_direct_order_limit 0 @@ -405,94 +372,12 @@ id 6216 10000 -auto_increment with partition +read only DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_1"') -1 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_2"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', -'srv "s_2_1"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', -'srv "s_2_2"') -1 -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, +id int(11) NOT NULL, PRIMARY KEY (id) -) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -777 -SELECT MAX(id) FROM t1; -MAX(id) -777 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -1554 -SELECT MAX(id) FROM t1; -MAX(id) -1554 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2331 -SELECT MAX(id) FROM t1; -MAX(id) -2331 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3108 -SELECT MAX(id) FROM t1; -MAX(id) -3108 -INSERT INTO t1 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3885 -SELECT id FROM t1 ORDER BY id; -id -777 -1554 -2331 -3108 -3885 -4662 -5439 -6216 -SET INSERT_ID=5000; -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -6216 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -10000 -INSERT INTO t1 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -10000 +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1 SELECT id FROM t1 ORDER BY id; id 777 @@ -506,27 +391,11 @@ id 5439 6216 10000 - -read only -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -id int(11) NOT NULL, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1 -SELECT id FROM t1 ORDER BY id; -id -1000 -1554 -3108 -4662 -5000 -6216 -10000 INSERT INTO t1 (id) VALUES (1); ERROR HY000: Table 'auto_test_local.t1' is read only -UPDATE t1 SET id = 4 WHERE id = 1000; +UPDATE t1 SET id = 4 WHERE id = 777; ERROR HY000: Table 'auto_test_local.t1' is read only -DELETE FROM t1 WHERE id = 1000; +DELETE FROM t1 WHERE id = 777; ERROR HY000: Table 'auto_test_local.t1' is read only DELETE FROM t1; ERROR HY000: Table 'auto_test_local.t1' is read only diff --git a/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result new file mode 100644 index 00000000000..104ba971df9 --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result @@ -0,0 +1,216 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +2.17 +partition with sort +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 +ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +2.23 +partition update with moving partition +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); +UPDATE ta_l2 SET a = 4 WHERE a = 3; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +4 B 2010-09-26 00:00:00 +index merge with partition +DROP TABLE IF EXISTS ta_l_int; +CREATE TABLE ta_l_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1 +INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; +SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) +WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; +a b c +3 4 5 +4 5 6 +5 6 7 + +2.26 +auto_increment with partition +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') +1 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"') +1 +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +777 +SELECT MAX(id) FROM t1; +MAX(id) +777 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1554 +SELECT MAX(id) FROM t1; +MAX(id) +1554 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2331 +SELECT MAX(id) FROM t1; +MAX(id) +2331 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3108 +SELECT MAX(id) FROM t1; +MAX(id) +3108 +INSERT INTO t1 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3885 +SELECT id FROM t1 ORDER BY id; +id +777 +1554 +2331 +3108 +3885 +4662 +5439 +6216 +SET INSERT_ID=5000; +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +6216 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +10000 +INSERT INTO t1 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +10000 +SELECT id FROM t1 ORDER BY id; +id +777 +1000 +1554 +2331 +3108 +3885 +4662 +5000 +5439 +6216 +10000 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/bg/t/basic_sql.test b/storage/spider/mysql-test/spider/bg/t/basic_sql.test index 2264b0e4e37..5bb040047fc 100644 --- a/storage/spider/mysql-test/spider/bg/t/basic_sql.test +++ b/storage/spider/mysql-test/spider/bg/t/basic_sql.test @@ -1,5 +1,4 @@ # This test tests by executing basic SQL ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -351,119 +328,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo create table with partition and select test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - if ($MASTER_1_MERGE) - { - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - } - if (!$MASTER_1_MERGE) - { - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - } - --enable_query_log - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo create no index table if ($USE_CHILD_GROUP2) { @@ -1279,116 +1143,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo select partition using pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo ---echo select partition using index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.a > 0 AND a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo insert --connection master_1 TRUNCATE TABLE ta_l; @@ -2367,126 +2121,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo update partition pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo update partition index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -3000,130 +2634,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo delete partition pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo delete partition index pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo truncate if ($USE_CHILD_GROUP2) { diff --git a/storage/spider/mysql-test/spider/bg/t/basic_sql_part.test b/storage/spider/mysql-test/spider/bg/t/basic_sql_part.test new file mode 100644 index 00000000000..e1638642ab7 --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/t/basic_sql_part.test @@ -0,0 +1,571 @@ +# This test tests by executing basic SQL +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'f', '2008-07-01 10:21:39'), + (2, 'g', '2000-02-01 00:00:00'), + (3, 'j', '2007-05-04 20:03:11'), + (4, 'i', '2003-10-30 05:01:03'), + (5, 'h', '2001-10-31 23:59:59'); + +--echo +--echo create table with partition and select test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + if ($MASTER_1_MERGE) + { + --error ER_WRONG_OBJECT + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + } + if (!$MASTER_1_MERGE) + { + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + } + --enable_query_log + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo select partition using pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo select partition using index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.a > 0 AND a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo update partition pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo update partition index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition index pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test b/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test index 59c45f3f190..5f17ac402e2 100644 --- a/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test +++ b/storage/spider/mysql-test/spider/bg/t/direct_aggregate.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON=
--disable_warnings
--disable_query_log
--disable_result_log
@@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -181,120 +158,6 @@ if ($USE_CHILD_GROUP2) }
--echo
---echo with partition test
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_TABLES;
- echo CHILD2_2_CREATE_TABLES;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_TABLES;
- --enable_warnings
- eval $CHILD2_2_CREATE_TABLES;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_TABLES2;
- echo CHILD2_1_CREATE_TABLES2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_TABLES2;
- --enable_warnings
- eval $CHILD2_1_CREATE_TABLES2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- --disable_query_log
- echo CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
- eval CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
- INSERT INTO ta_l2 (a, b, c) VALUES
- (1, 'a', '2008-08-01 10:21:39'),
- (2, 'b', '2000-01-01 00:00:00'),
- (3, 'e', '2007-06-04 20:03:11'),
- (4, 'd', '2003-11-30 05:01:03'),
- (5, 'c', '2001-12-31 23:59:59');
- --enable_query_log
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT COUNT(*) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2 WHERE a < 5;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2 WHERE a > 1;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_2_SELECT_TABLES;
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_1_SELECT_TABLES2;
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
---echo
--echo deinit
--disable_warnings
--connection master_1
diff --git a/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test b/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test new file mode 100644 index 00000000000..2d67e9af32c --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/t/direct_aggregate_part.test @@ -0,0 +1,192 @@ +--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+--echo
+--echo with partition test
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_TABLES;
+ echo CHILD2_2_CREATE_TABLES;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_TABLES;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_TABLES;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_TABLES2;
+ echo CHILD2_1_CREATE_TABLES2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_TABLES2;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_TABLES2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ --disable_query_log
+ echo CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
+ eval CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
+ INSERT INTO ta_l2 (a, b, c) VALUES
+ (1, 'a', '2008-08-01 10:21:39'),
+ (2, 'b', '2000-01-01 00:00:00'),
+ (3, 'e', '2007-06-04 20:03:11'),
+ (4, 'd', '2003-11-30 05:01:03'),
+ (5, 'c', '2001-12-31 23:59:59');
+ --enable_query_log
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT COUNT(*) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2 WHERE a < 5;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2 WHERE a > 1;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_2_SELECT_TABLES;
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_1_SELECT_TABLES2;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/bg/t/direct_update.test b/storage/spider/mysql-test/spider/bg/t/direct_update.test index 1c3ce91ff3f..e0901062201 100644 --- a/storage/spider/mysql-test/spider/bg/t/direct_update.test +++ b/storage/spider/mysql-test/spider/bg/t/direct_update.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -200,139 +177,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo with partition test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - --enable_query_log - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update all rows with function - UPDATE ta_l2 SET c = ADDDATE(c, 1); - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key - UPDATE ta_l2 SET b = 'x' WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by a column without index - UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key with order and limit - UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key with order and limit - DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by a column without index - DELETE FROM ta_l2 WHERE b = 'c'; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key - DELETE FROM ta_l2 WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo deinit --disable_warnings --connection master_1 diff --git a/storage/spider/mysql-test/spider/bg/t/direct_update_part.test b/storage/spider/mysql-test/spider/bg/t/direct_update_part.test new file mode 100644 index 00000000000..95e2e2ab0d5 --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/t/direct_update_part.test @@ -0,0 +1,211 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo with partition test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + --enable_query_log + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update all rows with function + UPDATE ta_l2 SET c = ADDDATE(c, 1); + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key + UPDATE ta_l2 SET b = 'x' WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by a column without index + UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key with order and limit + UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key with order and limit + DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by a column without index + DELETE FROM ta_l2 WHERE b = 'c'; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key + DELETE FROM ta_l2 WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/bg/t/function.test b/storage/spider/mysql-test/spider/bg/t/function.test index 2b1b53c8a4f..ec2eeab9c94 100644 --- a/storage/spider/mysql-test/spider/bg/t/function.test +++ b/storage/spider/mysql-test/spider/bg/t/function.test @@ -1,5 +1,4 @@ # This test tests for using functions ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/mysql-test/spider/bg/t/ha.test b/storage/spider/mysql-test/spider/bg/t/ha.test index 319b1793753..c12930e4aed 100644 --- a/storage/spider/mysql-test/spider/bg/t/ha.test +++ b/storage/spider/mysql-test/spider/bg/t/ha.test @@ -1,5 +1,4 @@ # This test tests for ha features ---let $SKIP_REASON= if ($USE_HA_TEST) { --disable_warnings @@ -48,40 +47,6 @@ if ($USE_CHILD_GROUP3) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - --connection child2_3 - DROP DATABASE IF EXISTS auto_test_remote3; - } - if ($USE_CHILD_GROUP3) - { - --connection child3_1 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_2 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_3 - DROP DATABASE IF EXISTS auto_test_local; - } - --disable_query_log - --disable_result_log - --source ha_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -514,455 +479,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_DROP_TABLES; - } - --disable_warnings - eval $CHILD2_3_HA_DROP_TABLES; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_CREATE_TABLES; - } - eval $CHILD2_3_HA_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_COPY_TABLES_P_2_1; - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo active standby test --echo create table test @@ -1327,438 +843,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_DROP_TABLES2; - } - --disable_warnings - eval $CHILD2_1_HA_AS_DROP_TABLES2; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_CREATE_TABLES2; - } - eval $CHILD2_1_HA_AS_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo deinit --disable_warnings diff --git a/storage/spider/mysql-test/spider/bg/t/ha_part.test b/storage/spider/mysql-test/spider/bg/t/ha_part.test new file mode 100644 index 00000000000..72ddcfd1f10 --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/t/ha_part.test @@ -0,0 +1,1017 @@ +# This test tests for ha features +if ($USE_HA_TEST) +{ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source ha_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source ha_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; + CREATE DATABASE auto_test_remote3; + USE auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + --connection child2_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +if ($USE_CHILD_GROUP3) +{ + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + SELECT 1; + --connection child3_2 + SELECT 1; + --connection child3_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_DROP_TABLES; + } + --disable_warnings + eval $CHILD2_3_HA_DROP_TABLES; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_CREATE_TABLES; + } + eval $CHILD2_3_HA_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_COPY_TABLES_P_2_1; + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_DROP_TABLES2; + } + --disable_warnings + eval $CHILD2_1_HA_AS_DROP_TABLES2; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_CREATE_TABLES2; + } + eval $CHILD2_1_HA_AS_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; +} +--disable_query_log +--disable_result_log +--source ha_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +} +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test index 4139f3af955..7530ce97837 100644 --- a/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider 3.0's bug fixes
---let $SKIP_REASON=
source include/have_log_bin.inc;
--disable_warnings
--disable_query_log
@@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_REPLICATION)
- {
- --connection slave1_1
- DROP DATABASE IF EXISTS auto_test_local;
- }
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source slave_test_deinit.inc
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -293,255 +264,6 @@ if ($USE_CHILD_GROUP2) }
---echo auto_increment with partition
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_INCREMENT_TABLES1;
- echo CHILD2_1_CREATE_INCREMENT_TABLES1;
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_INCREMENT_TABLES1;
- echo CHILD2_2_CREATE_INCREMENT_TABLES1;
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- --disable_query_log
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
- echo MASTER_1_AUTO_INCREMENT_OFFSET2;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
- if ($USE_REPLICATION)
- {
- SET SESSION sql_log_bin= 1;
- --connection slave1_1
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- --connection master_1
- }
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- TRUNCATE TABLE t1;
- TRUNCATE TABLE t2;
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- SET INSERT_ID=5000;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- INSERT INTO t1 (id) VALUES (10000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 (id) VALUES (1000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- SELECT id FROM t1 ORDER BY id;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
-
--echo
--echo deinit
--disable_warnings
diff --git a/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test new file mode 100644 index 00000000000..f25f000d80c --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/t/spider3_fixes_part.test @@ -0,0 +1,345 @@ +# This test tests for Spider 3.0's bug fixes
+source include/have_log_bin.inc;
+--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--source slave_test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source slave_test_deinit.inc
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+ CREATE DATABASE auto_test_local;
+ USE auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+
+--echo auto_increment with partition
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_INCREMENT_TABLES1;
+ echo CHILD2_1_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_INCREMENT_TABLES1;
+ echo CHILD2_2_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ --disable_query_log
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ echo MASTER_1_AUTO_INCREMENT_OFFSET2;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
+ if ($USE_REPLICATION)
+ {
+ SET SESSION sql_log_bin= 1;
+ --connection slave1_1
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ --connection master_1
+ }
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ TRUNCATE TABLE t1;
+ TRUNCATE TABLE t2;
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ SET INSERT_ID=5000;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ INSERT INTO t1 (id) VALUES (10000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 (id) VALUES (1000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ SELECT id FROM t1 ORDER BY id;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source slave_test_deinit.inc
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test index b9ff61abcb4..04e806fb612 100644 --- a/storage/spider/mysql-test/spider/bg/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/bg/t/spider_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider's bug fixes ---let $SKIP_REASON= source include/have_log_bin.inc; --disable_warnings --disable_query_log @@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_REPLICATION) - { - --connection slave1_1 - DROP DATABASE IF EXISTS auto_test_local; - } - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source slave_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -760,216 +731,8 @@ if ($USE_CHILD_GROUP2) } } ---echo partition with sort -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 - ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.23 ---echo partition update with moving partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); - UPDATE ta_l2 SET a = 4 WHERE a = 3; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo index merge if ($USE_CHILD_GROUP2) { @@ -1058,121 +821,6 @@ if ($USE_CHILD_GROUP2) } } ---echo index merge with partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l_int; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_result_log - } - --disable_query_log - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_2_DROP_TABLES5; - echo CHILD2_2_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES5; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES5; - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES5; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; - --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; - eval CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; - --enable_query_log - INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); - INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) - WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.24 --echo index scan update without PK @@ -1220,7 +868,7 @@ if (!$MASTER_1_NEEDPK) --enable_query_log SELECT a, b, c FROM ta_l_int ORDER BY a; INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -1515,202 +1163,6 @@ if ($USE_CHILD_GROUP2) --echo ---echo auto_increment with partition -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_INCREMENT_TABLES1; - echo CHILD2_2_CREATE_INCREMENT_TABLES1; - echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_2_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_2_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_2_CREATE_INCREMENT_TABLES1; - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - --disable_query_log - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; - echo MASTER_1_AUTO_INCREMENT_INCREMENT2; - echo MASTER_1_AUTO_INCREMENT_OFFSET2; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; - eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; - eval $MASTER_1_AUTO_INCREMENT_OFFSET2; - if ($USE_REPLICATION) - { - SET SESSION sql_log_bin= 1; - --connection slave1_1 - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; - --connection master_1 - } - --enable_query_log - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (),(),(),(); - SELECT LAST_INSERT_ID(); - SELECT id FROM t1 ORDER BY id; - SET INSERT_ID=5000; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (10000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (1000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - SELECT id FROM t1 ORDER BY id; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_2_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - - ---echo --echo read only let $MASTER_1_ENGINE_IS_SPIDER= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'Spider' OR diff --git a/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test new file mode 100644 index 00000000000..ef5a8026c02 --- /dev/null +++ b/storage/spider/mysql-test/spider/bg/t/spider_fixes_part.test @@ -0,0 +1,645 @@ +# This test tests for Spider's bug fixes +source include/have_log_bin.inc; +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source slave_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source slave_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + +--echo +--echo 2.17 +--echo partition with sort +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 + ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo 2.23 +--echo partition update with moving partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); + UPDATE ta_l2 SET a = 4 WHERE a = 3; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo index merge with partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l_int; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_result_log + } + --disable_query_log + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_2_DROP_TABLES5; + echo CHILD2_2_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES5; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES5; + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_1_DROP_TABLES5; + echo CHILD2_1_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES5; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES5; + --enable_query_log + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; + eval CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; + --enable_query_log + INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); + INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) + WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo 2.26 +--echo auto_increment with partition +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_INCREMENT_TABLES1; + echo CHILD2_1_CREATE_INCREMENT_TABLES1; + echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_1_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_1_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_1_CREATE_INCREMENT_TABLES1; + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_INCREMENT_TABLES1; + echo CHILD2_2_CREATE_INCREMENT_TABLES1; + echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_2_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_2_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_2_CREATE_INCREMENT_TABLES1; + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + --disable_query_log + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; + echo MASTER_1_AUTO_INCREMENT_INCREMENT2; + echo MASTER_1_AUTO_INCREMENT_OFFSET2; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; + eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; + eval $MASTER_1_AUTO_INCREMENT_OFFSET2; + if ($USE_REPLICATION) + { + SET SESSION sql_log_bin= 1; + --connection slave1_1 + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; + --connection master_1 + } + --enable_query_log + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (),(),(),(); + SELECT LAST_INSERT_ID(); + SELECT id FROM t1 ORDER BY id; + SET INSERT_ID=5000; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (10000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (1000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + SELECT id FROM t1 ORDER BY id; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_1_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_2_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source slave_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/bg/t/vp_fixes.test b/storage/spider/mysql-test/spider/bg/t/vp_fixes.test index 46e7b0afc36..90380227040 100644 --- a/storage/spider/mysql-test/spider/bg/t/vp_fixes.test +++ b/storage/spider/mysql-test/spider/bg/t/vp_fixes.test @@ -1,5 +1,4 @@ # This test tests for VP's bug fixes ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/mysql-test/spider/handler/t/basic_sql.test b/storage/spider/mysql-test/spider/handler/t/basic_sql.test index 2264b0e4e37..5bb040047fc 100644 --- a/storage/spider/mysql-test/spider/handler/t/basic_sql.test +++ b/storage/spider/mysql-test/spider/handler/t/basic_sql.test @@ -1,5 +1,4 @@ # This test tests by executing basic SQL ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -351,119 +328,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo create table with partition and select test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - if ($MASTER_1_MERGE) - { - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - } - if (!$MASTER_1_MERGE) - { - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - } - --enable_query_log - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo create no index table if ($USE_CHILD_GROUP2) { @@ -1279,116 +1143,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo select partition using pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo ---echo select partition using index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.a > 0 AND a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo insert --connection master_1 TRUNCATE TABLE ta_l; @@ -2367,126 +2121,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo update partition pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo update partition index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -3000,130 +2634,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo delete partition pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo delete partition index pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo truncate if ($USE_CHILD_GROUP2) { diff --git a/storage/spider/mysql-test/spider/handler/t/basic_sql_part.test b/storage/spider/mysql-test/spider/handler/t/basic_sql_part.test new file mode 100644 index 00000000000..e1638642ab7 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/t/basic_sql_part.test @@ -0,0 +1,571 @@ +# This test tests by executing basic SQL +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'f', '2008-07-01 10:21:39'), + (2, 'g', '2000-02-01 00:00:00'), + (3, 'j', '2007-05-04 20:03:11'), + (4, 'i', '2003-10-30 05:01:03'), + (5, 'h', '2001-10-31 23:59:59'); + +--echo +--echo create table with partition and select test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + if ($MASTER_1_MERGE) + { + --error ER_WRONG_OBJECT + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + } + if (!$MASTER_1_MERGE) + { + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + } + --enable_query_log + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo select partition using pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo select partition using index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.a > 0 AND a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo update partition pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo update partition index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition index pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/handler/t/direct_aggregate.test b/storage/spider/mysql-test/spider/handler/t/direct_aggregate.test index 59c45f3f190..5f17ac402e2 100644 --- a/storage/spider/mysql-test/spider/handler/t/direct_aggregate.test +++ b/storage/spider/mysql-test/spider/handler/t/direct_aggregate.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON=
--disable_warnings
--disable_query_log
--disable_result_log
@@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -181,120 +158,6 @@ if ($USE_CHILD_GROUP2) }
--echo
---echo with partition test
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_TABLES;
- echo CHILD2_2_CREATE_TABLES;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_TABLES;
- --enable_warnings
- eval $CHILD2_2_CREATE_TABLES;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_TABLES2;
- echo CHILD2_1_CREATE_TABLES2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_TABLES2;
- --enable_warnings
- eval $CHILD2_1_CREATE_TABLES2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- --disable_query_log
- echo CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
- eval CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
- INSERT INTO ta_l2 (a, b, c) VALUES
- (1, 'a', '2008-08-01 10:21:39'),
- (2, 'b', '2000-01-01 00:00:00'),
- (3, 'e', '2007-06-04 20:03:11'),
- (4, 'd', '2003-11-30 05:01:03'),
- (5, 'c', '2001-12-31 23:59:59');
- --enable_query_log
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT COUNT(*) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2 WHERE a < 5;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2 WHERE a > 1;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_2_SELECT_TABLES;
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_1_SELECT_TABLES2;
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
---echo
--echo deinit
--disable_warnings
--connection master_1
diff --git a/storage/spider/mysql-test/spider/handler/t/direct_aggregate_part.test b/storage/spider/mysql-test/spider/handler/t/direct_aggregate_part.test new file mode 100644 index 00000000000..2d67e9af32c --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/t/direct_aggregate_part.test @@ -0,0 +1,192 @@ +--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+--echo
+--echo with partition test
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_TABLES;
+ echo CHILD2_2_CREATE_TABLES;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_TABLES;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_TABLES;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_TABLES2;
+ echo CHILD2_1_CREATE_TABLES2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_TABLES2;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_TABLES2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ --disable_query_log
+ echo CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
+ eval CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
+ INSERT INTO ta_l2 (a, b, c) VALUES
+ (1, 'a', '2008-08-01 10:21:39'),
+ (2, 'b', '2000-01-01 00:00:00'),
+ (3, 'e', '2007-06-04 20:03:11'),
+ (4, 'd', '2003-11-30 05:01:03'),
+ (5, 'c', '2001-12-31 23:59:59');
+ --enable_query_log
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT COUNT(*) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2 WHERE a < 5;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2 WHERE a > 1;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_2_SELECT_TABLES;
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_1_SELECT_TABLES2;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/handler/t/direct_update.test b/storage/spider/mysql-test/spider/handler/t/direct_update.test index 1c3ce91ff3f..e0901062201 100644 --- a/storage/spider/mysql-test/spider/handler/t/direct_update.test +++ b/storage/spider/mysql-test/spider/handler/t/direct_update.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -200,139 +177,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo with partition test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - --enable_query_log - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update all rows with function - UPDATE ta_l2 SET c = ADDDATE(c, 1); - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key - UPDATE ta_l2 SET b = 'x' WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by a column without index - UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key with order and limit - UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key with order and limit - DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by a column without index - DELETE FROM ta_l2 WHERE b = 'c'; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key - DELETE FROM ta_l2 WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo deinit --disable_warnings --connection master_1 diff --git a/storage/spider/mysql-test/spider/handler/t/direct_update_part.test b/storage/spider/mysql-test/spider/handler/t/direct_update_part.test new file mode 100644 index 00000000000..95e2e2ab0d5 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/t/direct_update_part.test @@ -0,0 +1,211 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo with partition test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + --enable_query_log + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update all rows with function + UPDATE ta_l2 SET c = ADDDATE(c, 1); + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key + UPDATE ta_l2 SET b = 'x' WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by a column without index + UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key with order and limit + UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key with order and limit + DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by a column without index + DELETE FROM ta_l2 WHERE b = 'c'; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key + DELETE FROM ta_l2 WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/handler/t/function.test b/storage/spider/mysql-test/spider/handler/t/function.test index 2b1b53c8a4f..ec2eeab9c94 100644 --- a/storage/spider/mysql-test/spider/handler/t/function.test +++ b/storage/spider/mysql-test/spider/handler/t/function.test @@ -1,5 +1,4 @@ # This test tests for using functions ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/mysql-test/spider/handler/t/ha.test b/storage/spider/mysql-test/spider/handler/t/ha.test index 319b1793753..c12930e4aed 100644 --- a/storage/spider/mysql-test/spider/handler/t/ha.test +++ b/storage/spider/mysql-test/spider/handler/t/ha.test @@ -1,5 +1,4 @@ # This test tests for ha features ---let $SKIP_REASON= if ($USE_HA_TEST) { --disable_warnings @@ -48,40 +47,6 @@ if ($USE_CHILD_GROUP3) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - --connection child2_3 - DROP DATABASE IF EXISTS auto_test_remote3; - } - if ($USE_CHILD_GROUP3) - { - --connection child3_1 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_2 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_3 - DROP DATABASE IF EXISTS auto_test_local; - } - --disable_query_log - --disable_result_log - --source ha_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -514,455 +479,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_DROP_TABLES; - } - --disable_warnings - eval $CHILD2_3_HA_DROP_TABLES; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_CREATE_TABLES; - } - eval $CHILD2_3_HA_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_COPY_TABLES_P_2_1; - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo active standby test --echo create table test @@ -1327,438 +843,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_DROP_TABLES2; - } - --disable_warnings - eval $CHILD2_1_HA_AS_DROP_TABLES2; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_CREATE_TABLES2; - } - eval $CHILD2_1_HA_AS_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo deinit --disable_warnings diff --git a/storage/spider/mysql-test/spider/handler/t/ha_part.test b/storage/spider/mysql-test/spider/handler/t/ha_part.test new file mode 100644 index 00000000000..72ddcfd1f10 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/t/ha_part.test @@ -0,0 +1,1017 @@ +# This test tests for ha features +if ($USE_HA_TEST) +{ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source ha_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source ha_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; + CREATE DATABASE auto_test_remote3; + USE auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + --connection child2_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +if ($USE_CHILD_GROUP3) +{ + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + SELECT 1; + --connection child3_2 + SELECT 1; + --connection child3_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_DROP_TABLES; + } + --disable_warnings + eval $CHILD2_3_HA_DROP_TABLES; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_CREATE_TABLES; + } + eval $CHILD2_3_HA_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_COPY_TABLES_P_2_1; + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_DROP_TABLES2; + } + --disable_warnings + eval $CHILD2_1_HA_AS_DROP_TABLES2; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_CREATE_TABLES2; + } + eval $CHILD2_1_HA_AS_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; +} +--disable_query_log +--disable_result_log +--source ha_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +} +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test b/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test index 4139f3af955..7530ce97837 100644 --- a/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/handler/t/spider3_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider 3.0's bug fixes
---let $SKIP_REASON=
source include/have_log_bin.inc;
--disable_warnings
--disable_query_log
@@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_REPLICATION)
- {
- --connection slave1_1
- DROP DATABASE IF EXISTS auto_test_local;
- }
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source slave_test_deinit.inc
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -293,255 +264,6 @@ if ($USE_CHILD_GROUP2) }
---echo auto_increment with partition
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_INCREMENT_TABLES1;
- echo CHILD2_1_CREATE_INCREMENT_TABLES1;
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_INCREMENT_TABLES1;
- echo CHILD2_2_CREATE_INCREMENT_TABLES1;
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- --disable_query_log
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
- echo MASTER_1_AUTO_INCREMENT_OFFSET2;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
- if ($USE_REPLICATION)
- {
- SET SESSION sql_log_bin= 1;
- --connection slave1_1
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- --connection master_1
- }
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- TRUNCATE TABLE t1;
- TRUNCATE TABLE t2;
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- SET INSERT_ID=5000;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- INSERT INTO t1 (id) VALUES (10000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 (id) VALUES (1000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- SELECT id FROM t1 ORDER BY id;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
-
--echo
--echo deinit
--disable_warnings
diff --git a/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test new file mode 100644 index 00000000000..f25f000d80c --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/t/spider3_fixes_part.test @@ -0,0 +1,345 @@ +# This test tests for Spider 3.0's bug fixes
+source include/have_log_bin.inc;
+--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--source slave_test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source slave_test_deinit.inc
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+ CREATE DATABASE auto_test_local;
+ USE auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+
+--echo auto_increment with partition
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_INCREMENT_TABLES1;
+ echo CHILD2_1_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_INCREMENT_TABLES1;
+ echo CHILD2_2_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ --disable_query_log
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ echo MASTER_1_AUTO_INCREMENT_OFFSET2;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
+ if ($USE_REPLICATION)
+ {
+ SET SESSION sql_log_bin= 1;
+ --connection slave1_1
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ --connection master_1
+ }
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ TRUNCATE TABLE t1;
+ TRUNCATE TABLE t2;
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ SET INSERT_ID=5000;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ INSERT INTO t1 (id) VALUES (10000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 (id) VALUES (1000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ SELECT id FROM t1 ORDER BY id;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source slave_test_deinit.inc
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/handler/t/spider_fixes.test b/storage/spider/mysql-test/spider/handler/t/spider_fixes.test index b9ff61abcb4..04e806fb612 100644 --- a/storage/spider/mysql-test/spider/handler/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/handler/t/spider_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider's bug fixes ---let $SKIP_REASON= source include/have_log_bin.inc; --disable_warnings --disable_query_log @@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_REPLICATION) - { - --connection slave1_1 - DROP DATABASE IF EXISTS auto_test_local; - } - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source slave_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -760,216 +731,8 @@ if ($USE_CHILD_GROUP2) } } ---echo partition with sort -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 - ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.23 ---echo partition update with moving partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); - UPDATE ta_l2 SET a = 4 WHERE a = 3; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo index merge if ($USE_CHILD_GROUP2) { @@ -1058,121 +821,6 @@ if ($USE_CHILD_GROUP2) } } ---echo index merge with partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l_int; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_result_log - } - --disable_query_log - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_2_DROP_TABLES5; - echo CHILD2_2_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES5; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES5; - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES5; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; - --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; - eval CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; - --enable_query_log - INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); - INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) - WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.24 --echo index scan update without PK @@ -1220,7 +868,7 @@ if (!$MASTER_1_NEEDPK) --enable_query_log SELECT a, b, c FROM ta_l_int ORDER BY a; INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -1515,202 +1163,6 @@ if ($USE_CHILD_GROUP2) --echo ---echo auto_increment with partition -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_INCREMENT_TABLES1; - echo CHILD2_2_CREATE_INCREMENT_TABLES1; - echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_2_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_2_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_2_CREATE_INCREMENT_TABLES1; - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - --disable_query_log - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; - echo MASTER_1_AUTO_INCREMENT_INCREMENT2; - echo MASTER_1_AUTO_INCREMENT_OFFSET2; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; - eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; - eval $MASTER_1_AUTO_INCREMENT_OFFSET2; - if ($USE_REPLICATION) - { - SET SESSION sql_log_bin= 1; - --connection slave1_1 - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; - --connection master_1 - } - --enable_query_log - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (),(),(),(); - SELECT LAST_INSERT_ID(); - SELECT id FROM t1 ORDER BY id; - SET INSERT_ID=5000; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (10000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (1000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - SELECT id FROM t1 ORDER BY id; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_2_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - - ---echo --echo read only let $MASTER_1_ENGINE_IS_SPIDER= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'Spider' OR diff --git a/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test new file mode 100644 index 00000000000..ef5a8026c02 --- /dev/null +++ b/storage/spider/mysql-test/spider/handler/t/spider_fixes_part.test @@ -0,0 +1,645 @@ +# This test tests for Spider's bug fixes +source include/have_log_bin.inc; +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source slave_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source slave_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + +--echo +--echo 2.17 +--echo partition with sort +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 + ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo 2.23 +--echo partition update with moving partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); + UPDATE ta_l2 SET a = 4 WHERE a = 3; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo index merge with partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l_int; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_result_log + } + --disable_query_log + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_2_DROP_TABLES5; + echo CHILD2_2_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES5; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES5; + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_1_DROP_TABLES5; + echo CHILD2_1_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES5; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES5; + --enable_query_log + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; + eval CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; + --enable_query_log + INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); + INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) + WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo 2.26 +--echo auto_increment with partition +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_INCREMENT_TABLES1; + echo CHILD2_1_CREATE_INCREMENT_TABLES1; + echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_1_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_1_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_1_CREATE_INCREMENT_TABLES1; + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_INCREMENT_TABLES1; + echo CHILD2_2_CREATE_INCREMENT_TABLES1; + echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_2_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_2_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_2_CREATE_INCREMENT_TABLES1; + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + --disable_query_log + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; + echo MASTER_1_AUTO_INCREMENT_INCREMENT2; + echo MASTER_1_AUTO_INCREMENT_OFFSET2; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; + eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; + eval $MASTER_1_AUTO_INCREMENT_OFFSET2; + if ($USE_REPLICATION) + { + SET SESSION sql_log_bin= 1; + --connection slave1_1 + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; + --connection master_1 + } + --enable_query_log + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (),(),(),(); + SELECT LAST_INSERT_ID(); + SELECT id FROM t1 ORDER BY id; + SET INSERT_ID=5000; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (10000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (1000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + SELECT id FROM t1 ORDER BY id; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_1_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_2_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source slave_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/handler/t/vp_fixes.test b/storage/spider/mysql-test/spider/handler/t/vp_fixes.test index 46e7b0afc36..90380227040 100644 --- a/storage/spider/mysql-test/spider/handler/t/vp_fixes.test +++ b/storage/spider/mysql-test/spider/handler/t/vp_fixes.test @@ -1,5 +1,4 @@ # This test tests for VP's bug fixes ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/mysql-test/spider/oracle/r/basic_sql.result b/storage/spider/mysql-test/spider/oracle/r/basic_sql.result index e6202327ef6..1e9fe78acea 100644 --- a/storage/spider/mysql-test/spider/oracle/r/basic_sql.result +++ b/storage/spider/mysql-test/spider/oracle/r/basic_sql.result @@ -98,19 +98,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 4 i 2003-10-30 05:01:03 5 h 2001-10-31 23:59:59 -create table with partition and select test -CREATE TABLE ta_l2 ( -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 -SELECT a, b, c FROM tb_l -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - create no index table DROP TABLE IF EXISTS ta_l_no_idx; CREATE TABLE ta_l_no_idx @@ -282,18 +269,6 @@ a.a > 0 AND a.b = 'g' ORDER BY a.a; a b date_format(a.c, '%Y-%m-%d %H:%i:%s') 2 g 2000-02-01 00:00:00 -select partition using pushdown -SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE -a.b = 'g' ORDER BY a.a; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - -select partition using index pushdown -SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE -a.a > 0 AND a.b = 'g' ORDER BY a.a; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - insert TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); @@ -467,26 +442,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 g 2009-03-03 03:03:03 -update partition pushdown -UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 e 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -update partition index pushdown -UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -657,28 +612,6 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 10 j 2008-01-01 23:59:59 -delete partition pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -delete partition index pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - truncate TRUNCATE TABLE ta_l; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; diff --git a/storage/spider/mysql-test/spider/oracle/r/basic_sql_part.result b/storage/spider/mysql-test/spider/oracle/r/basic_sql_part.result new file mode 100644 index 00000000000..9e1201c17c9 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/r/basic_sql_part.result @@ -0,0 +1,121 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'f', '2008-07-01 10:21:39'), +(2, 'g', '2000-02-01 00:00:00'), +(3, 'j', '2007-05-04 20:03:11'), +(4, 'i', '2003-10-30 05:01:03'), +(5, 'h', '2001-10-31 23:59:59'); + +create table with partition and select test +CREATE TABLE ta_l2 ( +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 +SELECT a, b, c FROM tb_l +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +select partition using pushdown +SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE +a.b = 'g' ORDER BY a.a; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +select partition using index pushdown +SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE +a.a > 0 AND a.b = 'g' ORDER BY a.a; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +update partition pushdown +UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 e 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +update partition index pushdown +UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +DELETE FROM ta_l2 WHERE b = 'g'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition index pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle/r/direct_aggregate.result b/storage/spider/mysql-test/spider/oracle/r/direct_aggregate.result index 26860959718..fe5752cff65 100644 --- a/storage/spider/mysql-test/spider/oracle/r/direct_aggregate.result +++ b/storage/spider/mysql-test/spider/oracle/r/direct_aggregate.result @@ -74,47 +74,6 @@ SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; Variable_name Value Spider_direct_aggregate 1 -with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 1 -SELECT COUNT(*) FROM ta_l2; -COUNT(*) -5 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MAX(a) FROM ta_l2; -MAX(a) -5 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MIN(a) FROM ta_l2; -MIN(a) -1 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MAX(a) FROM ta_l2 WHERE a < 5; -MAX(a) -4 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MIN(a) FROM ta_l2 WHERE a > 1; -MIN(a) -2 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/oracle/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/oracle/r/direct_aggregate_part.result new file mode 100644 index 00000000000..9bde4a1746a --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/r/direct_aggregate_part.result @@ -0,0 +1,82 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 + +with partition test +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 0 +SELECT COUNT(*) FROM ta_l2; +COUNT(*) +5 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MAX(a) FROM ta_l2; +MAX(a) +5 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MIN(a) FROM ta_l2; +MIN(a) +1 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MAX(a) FROM ta_l2 WHERE a < 5; +MAX(a) +4 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MIN(a) FROM ta_l2 WHERE a > 1; +MIN(a) +2 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle/r/direct_update.result b/storage/spider/mysql-test/spider/oracle/r/direct_update.result index db6066a6e46..eaaef4b2f23 100644 --- a/storage/spider/mysql-test/spider/oracle/r/direct_update.result +++ b/storage/spider/mysql-test/spider/oracle/r/direct_update.result @@ -121,94 +121,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 4 d 2003-12-01 05:01:03 -with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -update all rows with function -UPDATE ta_l2 SET c = ADDDATE(c, 1); -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 e 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by primary key -UPDATE ta_l2 SET b = 'x' WHERE a = 3; -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by a column without index -UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by primary key with order and limit -UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-03 00:00:00 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by primary key with order and limit -DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; -SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by a column without index -DELETE FROM ta_l2 WHERE b = 'c'; -SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -delete by primary key -DELETE FROM ta_l2 WHERE a = 3; -SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -4 d 2003-12-01 05:01:03 - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/oracle/r/direct_update_part.result b/storage/spider/mysql-test/spider/oracle/r/direct_update_part.result new file mode 100644 index 00000000000..08dd0eb05ed --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/r/direct_update_part.result @@ -0,0 +1,129 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 + +with partition test +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +update all rows with function +UPDATE ta_l2 SET c = ADDDATE(c, 1); +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 e 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by primary key +UPDATE ta_l2 SET b = 'x' WHERE a = 3; +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by a column without index +UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by primary key with order and limit +UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-03 00:00:00 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by primary key with order and limit +DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; +SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by a column without index +DELETE FROM ta_l2 WHERE b = 'c'; +SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +delete by primary key +DELETE FROM ta_l2 WHERE a = 3; +SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +4 d 2003-12-01 05:01:03 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle/r/ha.result b/storage/spider/mysql-test/spider/oracle/r/ha.result index 95b428eb1ff..8ca64dec6df 100644 --- a/storage/spider/mysql-test/spider/oracle/r/ha.result +++ b/storage/spider/mysql-test/spider/oracle/r/ha.result @@ -138,111 +138,6 @@ SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 1 -Spider_mon_table_cache_version_req 2 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'SYSTEM.ta_r4' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 3 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 2 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 2 -SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); -spider_copy_tables('ta_l2#P#pt2', '0', '1') -1 -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - active standby test create table test DROP TABLE IF EXISTS ta_l; @@ -271,7 +166,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') fail-over test SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value -Spider_mon_table_cache_version 2 +Spider_mon_table_cache_version 1 Spider_mon_table_cache_version_req 2 INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); @@ -284,7 +179,6 @@ auto_test_local ta_l 1 1 SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; db_name table_name link_id auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 auto_test_local ta_l 0 SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value @@ -316,91 +210,6 @@ SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 3 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'SYSTEM.ta_r2' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 3 -auto_test_local ta_l2#P#pt2 1 1 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -auto_test_local ta_l 0 -auto_test_local ta_l2#P#pt2 0 -SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 3 -Spider_mon_table_cache_version_req 3 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/oracle/r/ha_part.result b/storage/spider/mysql-test/spider/oracle/r/ha_part.result new file mode 100644 index 00000000000..e11b6f695e0 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/r/ha_part.result @@ -0,0 +1,262 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +DROP DATABASE IF EXISTS auto_test_remote3; +CREATE DATABASE auto_test_remote3; +USE auto_test_remote3; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; + +test select 1 +SELECT 1; +1 +1 + +create table with partition test +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 0 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'SYSTEM.ta_r4' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 3 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 2 +SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); +spider_copy_tables('ta_l2#P#pt2', '0', '1') +1 +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +create table with partition test +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'SYSTEM.ta_r2' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 3 +auto_test_local ta_l2#P#pt2 1 1 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +auto_test_local ta_l2#P#pt2 0 +SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +DROP DATABASE IF EXISTS auto_test_remote3; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle/r/spider3_fixes.result b/storage/spider/mysql-test/spider/oracle/r/spider3_fixes.result index eb0c18da831..418f8bb31a8 100644 --- a/storage/spider/mysql-test/spider/oracle/r/spider3_fixes.result +++ b/storage/spider/mysql-test/spider/oracle/r/spider3_fixes.result @@ -175,155 +175,6 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t2; MAX(id) 10000 -auto_increment with partition -DROP TABLE IF EXISTS t1, t2; -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -CREATE TABLE t2 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') -1 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -777 -SELECT MAX(id) FROM t1; -MAX(id) -777 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -1554 -SELECT MAX(id) FROM t2; -MAX(id) -1554 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -778 -SELECT MAX(id) FROM t1; -MAX(id) -1554 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2331 -SELECT MAX(id) FROM t2; -MAX(id) -2331 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -1555 -SELECT id FROM t1 ORDER BY id; -id -777 -778 -1554 -1555 -2331 -2332 -3109 -3886 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3108 -SELECT id FROM t2 ORDER BY id; -id -777 -778 -1554 -1555 -2331 -2332 -3108 -3109 -3885 -3886 -4662 -5439 -TRUNCATE TABLE t1; -TRUNCATE TABLE t2; -INSERT INTO t1 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -777 -SELECT id FROM t1 ORDER BY id; -id -777 -1554 -2331 -3108 -INSERT INTO t2 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3885 -SELECT id FROM t2 ORDER BY id; -id -777 -1554 -2331 -3108 -3885 -4662 -5439 -6216 -SET INSERT_ID=5000; -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -6216 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6993 -SELECT MAX(id) FROM t2; -MAX(id) -6993 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6993 -SELECT MAX(id) FROM t1; -MAX(id) -10000 -INSERT INTO t2 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6993 -SELECT MAX(id) FROM t2; -MAX(id) -10000 deinit DROP DATABASE IF EXISTS auto_test_local; diff --git a/storage/spider/mysql-test/spider/oracle/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/oracle/r/spider3_fixes_part.result new file mode 100644 index 00000000000..accb4607027 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/r/spider3_fixes_part.result @@ -0,0 +1,192 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +auto_increment with partition +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +CREATE TABLE t2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') +1 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +777 +SELECT MAX(id) FROM t1; +MAX(id) +777 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1554 +SELECT MAX(id) FROM t2; +MAX(id) +1554 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +778 +SELECT MAX(id) FROM t1; +MAX(id) +1554 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2331 +SELECT MAX(id) FROM t2; +MAX(id) +2331 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1555 +SELECT id FROM t1 ORDER BY id; +id +777 +778 +1554 +1555 +2331 +2332 +3109 +3886 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3108 +SELECT id FROM t2 ORDER BY id; +id +777 +778 +1554 +1555 +2331 +2332 +3108 +3109 +3885 +3886 +4662 +5439 +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +INSERT INTO t1 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +777 +SELECT id FROM t1 ORDER BY id; +id +777 +1554 +2331 +3108 +INSERT INTO t2 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3885 +SELECT id FROM t2 ORDER BY id; +id +777 +1554 +2331 +3108 +3885 +4662 +5439 +6216 +SET INSERT_ID=5000; +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +6216 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6993 +SELECT MAX(id) FROM t2; +MAX(id) +6993 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6993 +SELECT MAX(id) FROM t1; +MAX(id) +10000 +INSERT INTO t2 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6993 +SELECT MAX(id) FROM t2; +MAX(id) +10000 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle/r/spider_fixes.result b/storage/spider/mysql-test/spider/oracle/r/spider_fixes.result index 43f0709e2e3..85efde74061 100644 --- a/storage/spider/mysql-test/spider/oracle/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/oracle/r/spider_fixes.result @@ -163,36 +163,8 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 3 e 2007-06-04 20:03:11 4 d 2003-11-30 05:01:03 5 c 2001-12-31 23:59:59 -partition with sort -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 -ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 2.23 -partition update with moving partition -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); -UPDATE ta_l2 SET a = 4 WHERE a = 3; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -4 B 2010-09-26 00:00:00 index merge CREATE TABLE ta_l_int ( a INT AUTO_INCREMENT, @@ -213,27 +185,6 @@ a b c 3 4 5 4 5 6 5 6 7 -index merge with partition -DROP TABLE IF EXISTS ta_l_int; -CREATE TABLE ta_l_int ( -a INT AUTO_INCREMENT, -b INT DEFAULT 10, -c INT DEFAULT 11, -PRIMARY KEY(a), -KEY idx1(b), -KEY idx2(c) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1 -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); -INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; -SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) -WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; -a b c -3 4 5 -4 5 6 -5 6 7 2.24 index scan update without PK @@ -247,29 +198,45 @@ KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1 SELECT a, b, c FROM ta_l_int ORDER BY a; a b c +1 2 3 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); UPDATE ta_l_int SET c = 4 WHERE b = 2; SELECT a, b, c FROM ta_l_int ORDER BY a; a b c 0 2 4 1 2 4 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 +18 2 4 2.25 direct order limit @@ -278,9 +245,9 @@ Variable_name Value Spider_direct_order_limit 0 SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3; a b c +1 2 4 2 3 4 -4 5 6 -6 7 8 +3 4 5 SHOW GLOBAL STATUS LIKE 'Spider_direct_order_limit%'; Variable_name Value Spider_direct_order_limit 0 @@ -389,95 +356,6 @@ SELECT MAX(id) FROM t1; MAX(id) 10000 -auto_increment with partition -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') -1 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -777 -SELECT MAX(id) FROM t1; -MAX(id) -777 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -1554 -SELECT MAX(id) FROM t1; -MAX(id) -1554 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2331 -SELECT MAX(id) FROM t1; -MAX(id) -2331 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3108 -SELECT MAX(id) FROM t1; -MAX(id) -3108 -INSERT INTO t1 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3885 -SELECT id FROM t1 ORDER BY id; -id -777 -1554 -2331 -3108 -3885 -4662 -5439 -6216 -SET INSERT_ID=5000; -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -6216 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -10000 -INSERT INTO t1 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -10000 - read only DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -486,18 +364,22 @@ PRIMARY KEY (id) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1 SELECT id FROM t1 ORDER BY id; id +777 1000 1554 +2331 3108 +3885 4662 5000 +5439 6216 10000 INSERT INTO t1 (id) VALUES (1); ERROR HY000: Table 'auto_test_local.t1' is read only -UPDATE t1 SET id = 4 WHERE id = 1000; +UPDATE t1 SET id = 4 WHERE id = 777; ERROR HY000: Table 'auto_test_local.t1' is read only -DELETE FROM t1 WHERE id = 1000; +DELETE FROM t1 WHERE id = 777; ERROR HY000: Table 'auto_test_local.t1' is read only DELETE FROM t1; ERROR HY000: Table 'auto_test_local.t1' is read only diff --git a/storage/spider/mysql-test/spider/oracle/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/oracle/r/spider_fixes_part.result new file mode 100644 index 00000000000..9abe8558416 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/r/spider_fixes_part.result @@ -0,0 +1,199 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +2.17 +partition with sort +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 +ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +2.23 +partition update with moving partition +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); +UPDATE ta_l2 SET a = 4 WHERE a = 3; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +4 B 2010-09-26 00:00:00 +index merge with partition +DROP TABLE IF EXISTS ta_l_int; +CREATE TABLE ta_l_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1 +INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; +SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) +WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; +a b c +3 4 5 +4 5 6 +5 6 7 + +2.26 +auto_increment with partition +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') +1 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +777 +SELECT MAX(id) FROM t1; +MAX(id) +777 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1554 +SELECT MAX(id) FROM t1; +MAX(id) +1554 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2331 +SELECT MAX(id) FROM t1; +MAX(id) +2331 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3108 +SELECT MAX(id) FROM t1; +MAX(id) +3108 +INSERT INTO t1 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3885 +SELECT id FROM t1 ORDER BY id; +id +777 +1554 +2331 +3108 +3885 +4662 +5439 +6216 +SET INSERT_ID=5000; +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +6216 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +10000 +INSERT INTO t1 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +10000 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle/t/basic_sql.test b/storage/spider/mysql-test/spider/oracle/t/basic_sql.test index 2264b0e4e37..5bb040047fc 100644 --- a/storage/spider/mysql-test/spider/oracle/t/basic_sql.test +++ b/storage/spider/mysql-test/spider/oracle/t/basic_sql.test @@ -1,5 +1,4 @@ # This test tests by executing basic SQL ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -351,119 +328,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo create table with partition and select test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - if ($MASTER_1_MERGE) - { - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - } - if (!$MASTER_1_MERGE) - { - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - } - --enable_query_log - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo create no index table if ($USE_CHILD_GROUP2) { @@ -1279,116 +1143,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo select partition using pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo ---echo select partition using index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.a > 0 AND a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo insert --connection master_1 TRUNCATE TABLE ta_l; @@ -2367,126 +2121,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo update partition pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo update partition index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -3000,130 +2634,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo delete partition pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo delete partition index pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo truncate if ($USE_CHILD_GROUP2) { diff --git a/storage/spider/mysql-test/spider/oracle/t/basic_sql_part.test b/storage/spider/mysql-test/spider/oracle/t/basic_sql_part.test new file mode 100644 index 00000000000..e1638642ab7 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/t/basic_sql_part.test @@ -0,0 +1,571 @@ +# This test tests by executing basic SQL +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'f', '2008-07-01 10:21:39'), + (2, 'g', '2000-02-01 00:00:00'), + (3, 'j', '2007-05-04 20:03:11'), + (4, 'i', '2003-10-30 05:01:03'), + (5, 'h', '2001-10-31 23:59:59'); + +--echo +--echo create table with partition and select test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + if ($MASTER_1_MERGE) + { + --error ER_WRONG_OBJECT + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + } + if (!$MASTER_1_MERGE) + { + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + } + --enable_query_log + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo select partition using pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo select partition using index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.a > 0 AND a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo update partition pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo update partition index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition index pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/oracle/t/direct_aggregate.test b/storage/spider/mysql-test/spider/oracle/t/direct_aggregate.test index 59c45f3f190..5f17ac402e2 100644 --- a/storage/spider/mysql-test/spider/oracle/t/direct_aggregate.test +++ b/storage/spider/mysql-test/spider/oracle/t/direct_aggregate.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON=
--disable_warnings
--disable_query_log
--disable_result_log
@@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -181,120 +158,6 @@ if ($USE_CHILD_GROUP2) }
--echo
---echo with partition test
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_TABLES;
- echo CHILD2_2_CREATE_TABLES;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_TABLES;
- --enable_warnings
- eval $CHILD2_2_CREATE_TABLES;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_TABLES2;
- echo CHILD2_1_CREATE_TABLES2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_TABLES2;
- --enable_warnings
- eval $CHILD2_1_CREATE_TABLES2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- --disable_query_log
- echo CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
- eval CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
- INSERT INTO ta_l2 (a, b, c) VALUES
- (1, 'a', '2008-08-01 10:21:39'),
- (2, 'b', '2000-01-01 00:00:00'),
- (3, 'e', '2007-06-04 20:03:11'),
- (4, 'd', '2003-11-30 05:01:03'),
- (5, 'c', '2001-12-31 23:59:59');
- --enable_query_log
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT COUNT(*) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2 WHERE a < 5;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2 WHERE a > 1;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_2_SELECT_TABLES;
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_1_SELECT_TABLES2;
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
---echo
--echo deinit
--disable_warnings
--connection master_1
diff --git a/storage/spider/mysql-test/spider/oracle/t/direct_aggregate_part.test b/storage/spider/mysql-test/spider/oracle/t/direct_aggregate_part.test new file mode 100644 index 00000000000..2d67e9af32c --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/t/direct_aggregate_part.test @@ -0,0 +1,192 @@ +--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+--echo
+--echo with partition test
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_TABLES;
+ echo CHILD2_2_CREATE_TABLES;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_TABLES;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_TABLES;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_TABLES2;
+ echo CHILD2_1_CREATE_TABLES2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_TABLES2;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_TABLES2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ --disable_query_log
+ echo CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
+ eval CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
+ INSERT INTO ta_l2 (a, b, c) VALUES
+ (1, 'a', '2008-08-01 10:21:39'),
+ (2, 'b', '2000-01-01 00:00:00'),
+ (3, 'e', '2007-06-04 20:03:11'),
+ (4, 'd', '2003-11-30 05:01:03'),
+ (5, 'c', '2001-12-31 23:59:59');
+ --enable_query_log
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT COUNT(*) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2 WHERE a < 5;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2 WHERE a > 1;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_2_SELECT_TABLES;
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_1_SELECT_TABLES2;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/oracle/t/direct_update.test b/storage/spider/mysql-test/spider/oracle/t/direct_update.test index 1c3ce91ff3f..e0901062201 100644 --- a/storage/spider/mysql-test/spider/oracle/t/direct_update.test +++ b/storage/spider/mysql-test/spider/oracle/t/direct_update.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -200,139 +177,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo with partition test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - --enable_query_log - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update all rows with function - UPDATE ta_l2 SET c = ADDDATE(c, 1); - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key - UPDATE ta_l2 SET b = 'x' WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by a column without index - UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key with order and limit - UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key with order and limit - DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by a column without index - DELETE FROM ta_l2 WHERE b = 'c'; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key - DELETE FROM ta_l2 WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo deinit --disable_warnings --connection master_1 diff --git a/storage/spider/mysql-test/spider/oracle/t/direct_update_part.test b/storage/spider/mysql-test/spider/oracle/t/direct_update_part.test new file mode 100644 index 00000000000..95e2e2ab0d5 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/t/direct_update_part.test @@ -0,0 +1,211 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo with partition test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + --enable_query_log + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update all rows with function + UPDATE ta_l2 SET c = ADDDATE(c, 1); + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key + UPDATE ta_l2 SET b = 'x' WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by a column without index + UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key with order and limit + UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key with order and limit + DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by a column without index + DELETE FROM ta_l2 WHERE b = 'c'; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key + DELETE FROM ta_l2 WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/oracle/t/function.test b/storage/spider/mysql-test/spider/oracle/t/function.test index 2b1b53c8a4f..ec2eeab9c94 100644 --- a/storage/spider/mysql-test/spider/oracle/t/function.test +++ b/storage/spider/mysql-test/spider/oracle/t/function.test @@ -1,5 +1,4 @@ # This test tests for using functions ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/mysql-test/spider/oracle/t/ha.test b/storage/spider/mysql-test/spider/oracle/t/ha.test index 319b1793753..c12930e4aed 100644 --- a/storage/spider/mysql-test/spider/oracle/t/ha.test +++ b/storage/spider/mysql-test/spider/oracle/t/ha.test @@ -1,5 +1,4 @@ # This test tests for ha features ---let $SKIP_REASON= if ($USE_HA_TEST) { --disable_warnings @@ -48,40 +47,6 @@ if ($USE_CHILD_GROUP3) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - --connection child2_3 - DROP DATABASE IF EXISTS auto_test_remote3; - } - if ($USE_CHILD_GROUP3) - { - --connection child3_1 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_2 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_3 - DROP DATABASE IF EXISTS auto_test_local; - } - --disable_query_log - --disable_result_log - --source ha_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -514,455 +479,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_DROP_TABLES; - } - --disable_warnings - eval $CHILD2_3_HA_DROP_TABLES; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_CREATE_TABLES; - } - eval $CHILD2_3_HA_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_COPY_TABLES_P_2_1; - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo active standby test --echo create table test @@ -1327,438 +843,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_DROP_TABLES2; - } - --disable_warnings - eval $CHILD2_1_HA_AS_DROP_TABLES2; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_CREATE_TABLES2; - } - eval $CHILD2_1_HA_AS_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo deinit --disable_warnings diff --git a/storage/spider/mysql-test/spider/oracle/t/ha_part.test b/storage/spider/mysql-test/spider/oracle/t/ha_part.test new file mode 100644 index 00000000000..72ddcfd1f10 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/t/ha_part.test @@ -0,0 +1,1017 @@ +# This test tests for ha features +if ($USE_HA_TEST) +{ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source ha_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source ha_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; + CREATE DATABASE auto_test_remote3; + USE auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + --connection child2_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +if ($USE_CHILD_GROUP3) +{ + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + SELECT 1; + --connection child3_2 + SELECT 1; + --connection child3_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_DROP_TABLES; + } + --disable_warnings + eval $CHILD2_3_HA_DROP_TABLES; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_CREATE_TABLES; + } + eval $CHILD2_3_HA_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_COPY_TABLES_P_2_1; + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_DROP_TABLES2; + } + --disable_warnings + eval $CHILD2_1_HA_AS_DROP_TABLES2; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_CREATE_TABLES2; + } + eval $CHILD2_1_HA_AS_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; +} +--disable_query_log +--disable_result_log +--source ha_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +} +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/oracle/t/spider3_fixes.test b/storage/spider/mysql-test/spider/oracle/t/spider3_fixes.test index 4139f3af955..7530ce97837 100644 --- a/storage/spider/mysql-test/spider/oracle/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/oracle/t/spider3_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider 3.0's bug fixes
---let $SKIP_REASON=
source include/have_log_bin.inc;
--disable_warnings
--disable_query_log
@@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_REPLICATION)
- {
- --connection slave1_1
- DROP DATABASE IF EXISTS auto_test_local;
- }
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source slave_test_deinit.inc
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -293,255 +264,6 @@ if ($USE_CHILD_GROUP2) }
---echo auto_increment with partition
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_INCREMENT_TABLES1;
- echo CHILD2_1_CREATE_INCREMENT_TABLES1;
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_INCREMENT_TABLES1;
- echo CHILD2_2_CREATE_INCREMENT_TABLES1;
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- --disable_query_log
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
- echo MASTER_1_AUTO_INCREMENT_OFFSET2;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
- if ($USE_REPLICATION)
- {
- SET SESSION sql_log_bin= 1;
- --connection slave1_1
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- --connection master_1
- }
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- TRUNCATE TABLE t1;
- TRUNCATE TABLE t2;
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- SET INSERT_ID=5000;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- INSERT INTO t1 (id) VALUES (10000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 (id) VALUES (1000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- SELECT id FROM t1 ORDER BY id;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
-
--echo
--echo deinit
--disable_warnings
diff --git a/storage/spider/mysql-test/spider/oracle/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/oracle/t/spider3_fixes_part.test new file mode 100644 index 00000000000..f25f000d80c --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/t/spider3_fixes_part.test @@ -0,0 +1,345 @@ +# This test tests for Spider 3.0's bug fixes
+source include/have_log_bin.inc;
+--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--source slave_test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source slave_test_deinit.inc
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+ CREATE DATABASE auto_test_local;
+ USE auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+
+--echo auto_increment with partition
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_INCREMENT_TABLES1;
+ echo CHILD2_1_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_INCREMENT_TABLES1;
+ echo CHILD2_2_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ --disable_query_log
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ echo MASTER_1_AUTO_INCREMENT_OFFSET2;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
+ if ($USE_REPLICATION)
+ {
+ SET SESSION sql_log_bin= 1;
+ --connection slave1_1
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ --connection master_1
+ }
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ TRUNCATE TABLE t1;
+ TRUNCATE TABLE t2;
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ SET INSERT_ID=5000;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ INSERT INTO t1 (id) VALUES (10000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 (id) VALUES (1000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ SELECT id FROM t1 ORDER BY id;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source slave_test_deinit.inc
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/oracle/t/spider_fixes.test b/storage/spider/mysql-test/spider/oracle/t/spider_fixes.test index b9ff61abcb4..04e806fb612 100644 --- a/storage/spider/mysql-test/spider/oracle/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/oracle/t/spider_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider's bug fixes ---let $SKIP_REASON= source include/have_log_bin.inc; --disable_warnings --disable_query_log @@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_REPLICATION) - { - --connection slave1_1 - DROP DATABASE IF EXISTS auto_test_local; - } - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source slave_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -760,216 +731,8 @@ if ($USE_CHILD_GROUP2) } } ---echo partition with sort -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 - ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.23 ---echo partition update with moving partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); - UPDATE ta_l2 SET a = 4 WHERE a = 3; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo index merge if ($USE_CHILD_GROUP2) { @@ -1058,121 +821,6 @@ if ($USE_CHILD_GROUP2) } } ---echo index merge with partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l_int; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_result_log - } - --disable_query_log - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_2_DROP_TABLES5; - echo CHILD2_2_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES5; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES5; - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES5; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; - --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; - eval CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; - --enable_query_log - INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); - INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) - WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.24 --echo index scan update without PK @@ -1220,7 +868,7 @@ if (!$MASTER_1_NEEDPK) --enable_query_log SELECT a, b, c FROM ta_l_int ORDER BY a; INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -1515,202 +1163,6 @@ if ($USE_CHILD_GROUP2) --echo ---echo auto_increment with partition -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_INCREMENT_TABLES1; - echo CHILD2_2_CREATE_INCREMENT_TABLES1; - echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_2_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_2_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_2_CREATE_INCREMENT_TABLES1; - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - --disable_query_log - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; - echo MASTER_1_AUTO_INCREMENT_INCREMENT2; - echo MASTER_1_AUTO_INCREMENT_OFFSET2; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; - eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; - eval $MASTER_1_AUTO_INCREMENT_OFFSET2; - if ($USE_REPLICATION) - { - SET SESSION sql_log_bin= 1; - --connection slave1_1 - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; - --connection master_1 - } - --enable_query_log - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (),(),(),(); - SELECT LAST_INSERT_ID(); - SELECT id FROM t1 ORDER BY id; - SET INSERT_ID=5000; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (10000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (1000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - SELECT id FROM t1 ORDER BY id; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_2_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - - ---echo --echo read only let $MASTER_1_ENGINE_IS_SPIDER= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'Spider' OR diff --git a/storage/spider/mysql-test/spider/oracle/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/oracle/t/spider_fixes_part.test new file mode 100644 index 00000000000..ef5a8026c02 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle/t/spider_fixes_part.test @@ -0,0 +1,645 @@ +# This test tests for Spider's bug fixes +source include/have_log_bin.inc; +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source slave_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source slave_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + +--echo +--echo 2.17 +--echo partition with sort +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 + ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo 2.23 +--echo partition update with moving partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); + UPDATE ta_l2 SET a = 4 WHERE a = 3; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo index merge with partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l_int; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_result_log + } + --disable_query_log + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_2_DROP_TABLES5; + echo CHILD2_2_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES5; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES5; + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_1_DROP_TABLES5; + echo CHILD2_1_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES5; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES5; + --enable_query_log + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; + eval CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; + --enable_query_log + INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); + INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) + WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo 2.26 +--echo auto_increment with partition +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_INCREMENT_TABLES1; + echo CHILD2_1_CREATE_INCREMENT_TABLES1; + echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_1_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_1_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_1_CREATE_INCREMENT_TABLES1; + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_INCREMENT_TABLES1; + echo CHILD2_2_CREATE_INCREMENT_TABLES1; + echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_2_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_2_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_2_CREATE_INCREMENT_TABLES1; + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + --disable_query_log + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; + echo MASTER_1_AUTO_INCREMENT_INCREMENT2; + echo MASTER_1_AUTO_INCREMENT_OFFSET2; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; + eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; + eval $MASTER_1_AUTO_INCREMENT_OFFSET2; + if ($USE_REPLICATION) + { + SET SESSION sql_log_bin= 1; + --connection slave1_1 + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; + --connection master_1 + } + --enable_query_log + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (),(),(),(); + SELECT LAST_INSERT_ID(); + SELECT id FROM t1 ORDER BY id; + SET INSERT_ID=5000; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (10000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (1000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + SELECT id FROM t1 ORDER BY id; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_1_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_2_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source slave_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/oracle/t/vp_fixes.test b/storage/spider/mysql-test/spider/oracle/t/vp_fixes.test index 46e7b0afc36..90380227040 100644 --- a/storage/spider/mysql-test/spider/oracle/t/vp_fixes.test +++ b/storage/spider/mysql-test/spider/oracle/t/vp_fixes.test @@ -1,5 +1,4 @@ # This test tests for VP's bug fixes ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/mysql-test/spider/oracle2/r/basic_sql.result b/storage/spider/mysql-test/spider/oracle2/r/basic_sql.result index e6202327ef6..1e9fe78acea 100644 --- a/storage/spider/mysql-test/spider/oracle2/r/basic_sql.result +++ b/storage/spider/mysql-test/spider/oracle2/r/basic_sql.result @@ -98,19 +98,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 4 i 2003-10-30 05:01:03 5 h 2001-10-31 23:59:59 -create table with partition and select test -CREATE TABLE ta_l2 ( -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 -SELECT a, b, c FROM tb_l -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - create no index table DROP TABLE IF EXISTS ta_l_no_idx; CREATE TABLE ta_l_no_idx @@ -282,18 +269,6 @@ a.a > 0 AND a.b = 'g' ORDER BY a.a; a b date_format(a.c, '%Y-%m-%d %H:%i:%s') 2 g 2000-02-01 00:00:00 -select partition using pushdown -SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE -a.b = 'g' ORDER BY a.a; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - -select partition using index pushdown -SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE -a.a > 0 AND a.b = 'g' ORDER BY a.a; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - insert TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); @@ -467,26 +442,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 g 2009-03-03 03:03:03 -update partition pushdown -UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 e 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -update partition index pushdown -UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -657,28 +612,6 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 10 j 2008-01-01 23:59:59 -delete partition pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -delete partition index pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - truncate TRUNCATE TABLE ta_l; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; diff --git a/storage/spider/mysql-test/spider/oracle2/r/basic_sql_part.result b/storage/spider/mysql-test/spider/oracle2/r/basic_sql_part.result new file mode 100644 index 00000000000..9e1201c17c9 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/r/basic_sql_part.result @@ -0,0 +1,121 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'f', '2008-07-01 10:21:39'), +(2, 'g', '2000-02-01 00:00:00'), +(3, 'j', '2007-05-04 20:03:11'), +(4, 'i', '2003-10-30 05:01:03'), +(5, 'h', '2001-10-31 23:59:59'); + +create table with partition and select test +CREATE TABLE ta_l2 ( +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 +SELECT a, b, c FROM tb_l +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +select partition using pushdown +SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE +a.b = 'g' ORDER BY a.a; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +select partition using index pushdown +SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE +a.a > 0 AND a.b = 'g' ORDER BY a.a; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +update partition pushdown +UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 e 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +update partition index pushdown +UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +DELETE FROM ta_l2 WHERE b = 'g'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition index pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle2/r/direct_aggregate.result b/storage/spider/mysql-test/spider/oracle2/r/direct_aggregate.result index 26860959718..fe5752cff65 100644 --- a/storage/spider/mysql-test/spider/oracle2/r/direct_aggregate.result +++ b/storage/spider/mysql-test/spider/oracle2/r/direct_aggregate.result @@ -74,47 +74,6 @@ SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; Variable_name Value Spider_direct_aggregate 1 -with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 1 -SELECT COUNT(*) FROM ta_l2; -COUNT(*) -5 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MAX(a) FROM ta_l2; -MAX(a) -5 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MIN(a) FROM ta_l2; -MIN(a) -1 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MAX(a) FROM ta_l2 WHERE a < 5; -MAX(a) -4 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MIN(a) FROM ta_l2 WHERE a > 1; -MIN(a) -2 -SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; -Variable_name Value -Spider_direct_aggregate 3 - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/oracle2/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/oracle2/r/direct_aggregate_part.result new file mode 100644 index 00000000000..9bde4a1746a --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/r/direct_aggregate_part.result @@ -0,0 +1,82 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 + +with partition test +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 0 +SELECT COUNT(*) FROM ta_l2; +COUNT(*) +5 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MAX(a) FROM ta_l2; +MAX(a) +5 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MIN(a) FROM ta_l2; +MIN(a) +1 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MAX(a) FROM ta_l2 WHERE a < 5; +MAX(a) +4 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MIN(a) FROM ta_l2 WHERE a > 1; +MIN(a) +2 +SHOW GLOBAL STATUS LIKE 'Spider_direct_aggregate%'; +Variable_name Value +Spider_direct_aggregate 2 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle2/r/direct_update.result b/storage/spider/mysql-test/spider/oracle2/r/direct_update.result index db6066a6e46..eaaef4b2f23 100644 --- a/storage/spider/mysql-test/spider/oracle2/r/direct_update.result +++ b/storage/spider/mysql-test/spider/oracle2/r/direct_update.result @@ -121,94 +121,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 4 d 2003-12-01 05:01:03 -with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -update all rows with function -UPDATE ta_l2 SET c = ADDDATE(c, 1); -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 e 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by primary key -UPDATE ta_l2 SET b = 'x' WHERE a = 3; -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by a column without index -UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by primary key with order and limit -UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; -SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-03 00:00:00 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by primary key with order and limit -DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; -SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by a column without index -DELETE FROM ta_l2 WHERE b = 'c'; -SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -delete by primary key -DELETE FROM ta_l2 WHERE a = 3; -SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -4 d 2003-12-01 05:01:03 - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/oracle2/r/direct_update_part.result b/storage/spider/mysql-test/spider/oracle2/r/direct_update_part.result new file mode 100644 index 00000000000..08dd0eb05ed --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/r/direct_update_part.result @@ -0,0 +1,129 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 + +with partition test +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +update all rows with function +UPDATE ta_l2 SET c = ADDDATE(c, 1); +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 e 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by primary key +UPDATE ta_l2 SET b = 'x' WHERE a = 3; +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by a column without index +UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by primary key with order and limit +UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; +SHOW GLOBAL STATUS LIKE 'Spider_direct_update%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-03 00:00:00 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by primary key with order and limit +DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; +SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by a column without index +DELETE FROM ta_l2 WHERE b = 'c'; +SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +delete by primary key +DELETE FROM ta_l2 WHERE a = 3; +SHOW GLOBAL STATUS LIKE 'Spider_direct_delete%'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +4 d 2003-12-01 05:01:03 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle2/r/ha.result b/storage/spider/mysql-test/spider/oracle2/r/ha.result index 95b428eb1ff..8ca64dec6df 100644 --- a/storage/spider/mysql-test/spider/oracle2/r/ha.result +++ b/storage/spider/mysql-test/spider/oracle2/r/ha.result @@ -138,111 +138,6 @@ SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 1 -Spider_mon_table_cache_version_req 2 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'SYSTEM.ta_r4' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 3 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 2 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 2 -SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); -spider_copy_tables('ta_l2#P#pt2', '0', '1') -1 -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - active standby test create table test DROP TABLE IF EXISTS ta_l; @@ -271,7 +166,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') fail-over test SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value -Spider_mon_table_cache_version 2 +Spider_mon_table_cache_version 1 Spider_mon_table_cache_version_req 2 INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); @@ -284,7 +179,6 @@ auto_test_local ta_l 1 1 SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; db_name table_name link_id auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 auto_test_local ta_l 0 SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value @@ -316,91 +210,6 @@ SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 3 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'SYSTEM.ta_r2' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 3 -auto_test_local ta_l2#P#pt2 1 1 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -auto_test_local ta_l 0 -auto_test_local ta_l2#P#pt2 0 -SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 3 -Spider_mon_table_cache_version_req 3 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/oracle2/r/ha_part.result b/storage/spider/mysql-test/spider/oracle2/r/ha_part.result new file mode 100644 index 00000000000..e11b6f695e0 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/r/ha_part.result @@ -0,0 +1,262 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +DROP DATABASE IF EXISTS auto_test_remote3; +CREATE DATABASE auto_test_remote3; +USE auto_test_remote3; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; + +test select 1 +SELECT 1; +1 +1 + +create table with partition test +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 0 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'SYSTEM.ta_r4' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 3 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 2 +SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); +spider_copy_tables('ta_l2#P#pt2', '0', '1') +1 +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +create table with partition test +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'SYSTEM.ta_r2' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 3 +auto_test_local ta_l2#P#pt2 1 1 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +auto_test_local ta_l2#P#pt2 0 +SHOW GLOBAL STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +DROP DATABASE IF EXISTS auto_test_remote3; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle2/r/spider3_fixes.result b/storage/spider/mysql-test/spider/oracle2/r/spider3_fixes.result index e7fbceb3933..dd6c8715648 100644 --- a/storage/spider/mysql-test/spider/oracle2/r/spider3_fixes.result +++ b/storage/spider/mysql-test/spider/oracle2/r/spider3_fixes.result @@ -191,171 +191,6 @@ LAST_INSERT_ID() SELECT MAX(id) FROM t2; MAX(id) 94 -auto_increment with partition -DROP TABLE IF EXISTS t1, t2; -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -CREATE TABLE t2 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') -1 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2 -SELECT MAX(id) FROM t1; -MAX(id) -2 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3 -SELECT MAX(id) FROM t2; -MAX(id) -3 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6 -SELECT MAX(id) FROM t1; -MAX(id) -6 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -10 -SELECT MAX(id) FROM t2; -MAX(id) -10 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -7 -SELECT id FROM t1 ORDER BY id; -id -2 -3 -6 -7 -10 -11 -14 -18 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -15 -SELECT id FROM t2 ORDER BY id; -id -2 -3 -6 -7 -10 -11 -14 -15 -18 -19 -22 -26 -TRUNCATE TABLE t1; -TRUNCATE TABLE t2; -INSERT INTO t1 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -23 -SELECT id FROM t1 ORDER BY id; -id -23 -27 -30 -34 -INSERT INTO t2 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -31 -SELECT id FROM t2 ORDER BY id; -id -23 -27 -30 -31 -34 -35 -38 -42 -SET INSERT_ID=5000; -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -46 -SELECT MAX(id) FROM t1; -MAX(id) -46 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -39 -SELECT MAX(id) FROM t2; -MAX(id) -46 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -50 -SELECT MAX(id) FROM t1; -MAX(id) -50 -INSERT INTO t2 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -54 -SELECT MAX(id) FROM t2; -MAX(id) -54 deinit DROP DATABASE IF EXISTS auto_test_local; diff --git a/storage/spider/mysql-test/spider/oracle2/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/oracle2/r/spider3_fixes_part.result new file mode 100644 index 00000000000..38875214eb8 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/r/spider3_fixes_part.result @@ -0,0 +1,208 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +auto_increment with partition +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +CREATE TABLE t2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') +1 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3 +SELECT MAX(id) FROM t1; +MAX(id) +3 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +7 +SELECT MAX(id) FROM t2; +MAX(id) +7 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2 +SELECT MAX(id) FROM t1; +MAX(id) +7 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6 +SELECT MAX(id) FROM t2; +MAX(id) +7 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +10 +SELECT id FROM t1 ORDER BY id; +id +2 +3 +6 +7 +10 +11 +14 +15 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +18 +SELECT id FROM t2 ORDER BY id; +id +2 +3 +6 +7 +10 +11 +14 +15 +18 +19 +22 +23 +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +INSERT INTO t1 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +26 +SELECT id FROM t1 ORDER BY id; +id +26 +27 +30 +31 +INSERT INTO t2 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +34 +SELECT id FROM t2 ORDER BY id; +id +26 +27 +30 +31 +34 +35 +38 +39 +SET INSERT_ID=5000; +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +42 +SELECT MAX(id) FROM t1; +MAX(id) +42 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +43 +SELECT MAX(id) FROM t2; +MAX(id) +43 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +46 +SELECT MAX(id) FROM t1; +MAX(id) +46 +INSERT INTO t2 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +50 +SELECT MAX(id) FROM t2; +MAX(id) +50 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle2/r/spider_fixes.result b/storage/spider/mysql-test/spider/oracle2/r/spider_fixes.result index d23ba9aeec8..5a41603c746 100644 --- a/storage/spider/mysql-test/spider/oracle2/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/oracle2/r/spider_fixes.result @@ -163,36 +163,8 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 3 e 2007-06-04 20:03:11 4 d 2003-11-30 05:01:03 5 c 2001-12-31 23:59:59 -partition with sort -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 -ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 2.23 -partition update with moving partition -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); -UPDATE ta_l2 SET a = 4 WHERE a = 3; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -4 B 2010-09-26 00:00:00 index merge CREATE TABLE ta_l_int ( a INT AUTO_INCREMENT, @@ -213,27 +185,6 @@ a b c 3 4 5 4 5 6 5 6 7 -index merge with partition -DROP TABLE IF EXISTS ta_l_int; -CREATE TABLE ta_l_int ( -a INT AUTO_INCREMENT, -b INT DEFAULT 10, -c INT DEFAULT 11, -PRIMARY KEY(a), -KEY idx1(b), -KEY idx2(c) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1 -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); -INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; -SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) -WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; -a b c -3 4 5 -4 5 6 -5 6 7 2.24 index scan update without PK @@ -247,29 +198,45 @@ KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1 SELECT a, b, c FROM ta_l_int ORDER BY a; a b c +1 2 3 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); UPDATE ta_l_int SET c = 4 WHERE b = 2; SELECT a, b, c FROM ta_l_int ORDER BY a; a b c 0 2 4 1 2 4 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 +18 2 4 2.25 direct order limit @@ -278,9 +245,9 @@ Variable_name Value Spider_direct_order_limit 0 SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3; a b c +1 2 4 2 3 4 -4 5 6 -6 7 8 +3 4 5 SHOW GLOBAL STATUS LIKE 'Spider_direct_order_limit%'; Variable_name Value Spider_direct_order_limit 0 @@ -393,99 +360,6 @@ SELECT MAX(id) FROM t1; MAX(id) 42 -auto_increment with partition -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') -1 -spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') -1 -spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') -1 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2 -SELECT MAX(id) FROM t1; -MAX(id) -2 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3 -SELECT MAX(id) FROM t1; -MAX(id) -3 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6 -SELECT MAX(id) FROM t1; -MAX(id) -6 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -7 -SELECT MAX(id) FROM t1; -MAX(id) -7 -INSERT INTO t1 () VALUES (),(),(),(); -Warnings: -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -10 -SELECT id FROM t1 ORDER BY id; -id -2 -3 -6 -7 -10 -11 -14 -15 -SET INSERT_ID=5000; -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -18 -SELECT MAX(id) FROM t1; -MAX(id) -18 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -22 -SELECT MAX(id) FROM t1; -MAX(id) -22 -INSERT INTO t1 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -26 -SELECT MAX(id) FROM t1; -MAX(id) -26 - read only DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( @@ -501,6 +375,10 @@ id 18 22 26 +30 +34 +38 +42 INSERT INTO t1 (id) VALUES (1); ERROR HY000: Table 'auto_test_local.t1' is read only UPDATE t1 SET id = 4 WHERE id = 2; diff --git a/storage/spider/mysql-test/spider/oracle2/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/oracle2/r/spider_fixes_part.result new file mode 100644 index 00000000000..20a5ca1812b --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/r/spider_fixes_part.result @@ -0,0 +1,203 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +2.17 +partition with sort +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 +ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +2.23 +partition update with moving partition +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); +UPDATE ta_l2 SET a = 4 WHERE a = 3; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +4 B 2010-09-26 00:00:00 +index merge with partition +DROP TABLE IF EXISTS ta_l_int; +CREATE TABLE ta_l_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1 +INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; +SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) +WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; +a b c +3 4 5 +4 5 6 +5 6 7 + +2.26 +auto_increment with partition +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_1"\'; exception when others then null; end;', '', 'srv "s_2_1"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_1" START WITH 2 INCREMENT BY 4', '', 'srv "s_2_1"') +1 +spider_direct_sql('begin execute immediate \'DROP SEQUENCE "seq_t1_2"\'; exception when others then null; end;', '', 'srv "s_2_2"') +1 +spider_direct_sql('CREATE SEQUENCE "seq_t1_2" START WITH 3 INCREMENT BY 4', '', 'srv "s_2_2"') +1 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3 +SELECT MAX(id) FROM t1; +MAX(id) +3 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2 +SELECT MAX(id) FROM t1; +MAX(id) +3 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +7 +SELECT MAX(id) FROM t1; +MAX(id) +7 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6 +SELECT MAX(id) FROM t1; +MAX(id) +7 +INSERT INTO t1 () VALUES (),(),(),(); +Warnings: +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +Note 12520 Binlog's auto-inc value is probably different from linked table's auto-inc value +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +10 +SELECT id FROM t1 ORDER BY id; +id +2 +3 +6 +7 +10 +11 +14 +15 +SET INSERT_ID=5000; +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +18 +SELECT MAX(id) FROM t1; +MAX(id) +18 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +22 +SELECT MAX(id) FROM t1; +MAX(id) +22 +INSERT INTO t1 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +26 +SELECT MAX(id) FROM t1; +MAX(id) +26 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/oracle2/t/basic_sql.test b/storage/spider/mysql-test/spider/oracle2/t/basic_sql.test index 2264b0e4e37..5bb040047fc 100644 --- a/storage/spider/mysql-test/spider/oracle2/t/basic_sql.test +++ b/storage/spider/mysql-test/spider/oracle2/t/basic_sql.test @@ -1,5 +1,4 @@ # This test tests by executing basic SQL ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -351,119 +328,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo create table with partition and select test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - if ($MASTER_1_MERGE) - { - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - } - if (!$MASTER_1_MERGE) - { - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - } - --enable_query_log - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo create no index table if ($USE_CHILD_GROUP2) { @@ -1279,116 +1143,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo select partition using pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo ---echo select partition using index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.a > 0 AND a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo insert --connection master_1 TRUNCATE TABLE ta_l; @@ -2367,126 +2121,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo update partition pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo update partition index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -3000,130 +2634,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo delete partition pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo delete partition index pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo truncate if ($USE_CHILD_GROUP2) { diff --git a/storage/spider/mysql-test/spider/oracle2/t/basic_sql_part.test b/storage/spider/mysql-test/spider/oracle2/t/basic_sql_part.test new file mode 100644 index 00000000000..e1638642ab7 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/t/basic_sql_part.test @@ -0,0 +1,571 @@ +# This test tests by executing basic SQL +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'f', '2008-07-01 10:21:39'), + (2, 'g', '2000-02-01 00:00:00'), + (3, 'j', '2007-05-04 20:03:11'), + (4, 'i', '2003-10-30 05:01:03'), + (5, 'h', '2001-10-31 23:59:59'); + +--echo +--echo create table with partition and select test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + if ($MASTER_1_MERGE) + { + --error ER_WRONG_OBJECT + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + } + if (!$MASTER_1_MERGE) + { + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + } + --enable_query_log + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo select partition using pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo select partition using index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.a > 0 AND a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo update partition pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo update partition index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition index pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/oracle2/t/direct_aggregate.test b/storage/spider/mysql-test/spider/oracle2/t/direct_aggregate.test index 59c45f3f190..5f17ac402e2 100644 --- a/storage/spider/mysql-test/spider/oracle2/t/direct_aggregate.test +++ b/storage/spider/mysql-test/spider/oracle2/t/direct_aggregate.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON=
--disable_warnings
--disable_query_log
--disable_result_log
@@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -181,120 +158,6 @@ if ($USE_CHILD_GROUP2) }
--echo
---echo with partition test
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_TABLES;
- echo CHILD2_2_CREATE_TABLES;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_TABLES;
- --enable_warnings
- eval $CHILD2_2_CREATE_TABLES;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_TABLES2;
- echo CHILD2_1_CREATE_TABLES2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_TABLES2;
- --enable_warnings
- eval $CHILD2_1_CREATE_TABLES2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- --disable_query_log
- echo CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
- eval CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
- INSERT INTO ta_l2 (a, b, c) VALUES
- (1, 'a', '2008-08-01 10:21:39'),
- (2, 'b', '2000-01-01 00:00:00'),
- (3, 'e', '2007-06-04 20:03:11'),
- (4, 'd', '2003-11-30 05:01:03'),
- (5, 'c', '2001-12-31 23:59:59');
- --enable_query_log
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT COUNT(*) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2 WHERE a < 5;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2 WHERE a > 1;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_2_SELECT_TABLES;
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_1_SELECT_TABLES2;
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
---echo
--echo deinit
--disable_warnings
--connection master_1
diff --git a/storage/spider/mysql-test/spider/oracle2/t/direct_aggregate_part.test b/storage/spider/mysql-test/spider/oracle2/t/direct_aggregate_part.test new file mode 100644 index 00000000000..2d67e9af32c --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/t/direct_aggregate_part.test @@ -0,0 +1,192 @@ +--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+--echo
+--echo with partition test
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_TABLES;
+ echo CHILD2_2_CREATE_TABLES;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_TABLES;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_TABLES;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_TABLES2;
+ echo CHILD2_1_CREATE_TABLES2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_TABLES2;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_TABLES2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ --disable_query_log
+ echo CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
+ eval CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
+ INSERT INTO ta_l2 (a, b, c) VALUES
+ (1, 'a', '2008-08-01 10:21:39'),
+ (2, 'b', '2000-01-01 00:00:00'),
+ (3, 'e', '2007-06-04 20:03:11'),
+ (4, 'd', '2003-11-30 05:01:03'),
+ (5, 'c', '2001-12-31 23:59:59');
+ --enable_query_log
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT COUNT(*) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2 WHERE a < 5;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2 WHERE a > 1;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_2_SELECT_TABLES;
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_1_SELECT_TABLES2;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/oracle2/t/direct_update.test b/storage/spider/mysql-test/spider/oracle2/t/direct_update.test index 1c3ce91ff3f..e0901062201 100644 --- a/storage/spider/mysql-test/spider/oracle2/t/direct_update.test +++ b/storage/spider/mysql-test/spider/oracle2/t/direct_update.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -200,139 +177,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo with partition test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - --enable_query_log - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update all rows with function - UPDATE ta_l2 SET c = ADDDATE(c, 1); - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key - UPDATE ta_l2 SET b = 'x' WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by a column without index - UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key with order and limit - UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key with order and limit - DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by a column without index - DELETE FROM ta_l2 WHERE b = 'c'; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key - DELETE FROM ta_l2 WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo deinit --disable_warnings --connection master_1 diff --git a/storage/spider/mysql-test/spider/oracle2/t/direct_update_part.test b/storage/spider/mysql-test/spider/oracle2/t/direct_update_part.test new file mode 100644 index 00000000000..95e2e2ab0d5 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/t/direct_update_part.test @@ -0,0 +1,211 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo with partition test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + --enable_query_log + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update all rows with function + UPDATE ta_l2 SET c = ADDDATE(c, 1); + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key + UPDATE ta_l2 SET b = 'x' WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by a column without index + UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key with order and limit + UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key with order and limit + DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by a column without index + DELETE FROM ta_l2 WHERE b = 'c'; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key + DELETE FROM ta_l2 WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/oracle2/t/function.test b/storage/spider/mysql-test/spider/oracle2/t/function.test index 2b1b53c8a4f..ec2eeab9c94 100644 --- a/storage/spider/mysql-test/spider/oracle2/t/function.test +++ b/storage/spider/mysql-test/spider/oracle2/t/function.test @@ -1,5 +1,4 @@ # This test tests for using functions ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/mysql-test/spider/oracle2/t/ha.test b/storage/spider/mysql-test/spider/oracle2/t/ha.test index 319b1793753..c12930e4aed 100644 --- a/storage/spider/mysql-test/spider/oracle2/t/ha.test +++ b/storage/spider/mysql-test/spider/oracle2/t/ha.test @@ -1,5 +1,4 @@ # This test tests for ha features ---let $SKIP_REASON= if ($USE_HA_TEST) { --disable_warnings @@ -48,40 +47,6 @@ if ($USE_CHILD_GROUP3) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - --connection child2_3 - DROP DATABASE IF EXISTS auto_test_remote3; - } - if ($USE_CHILD_GROUP3) - { - --connection child3_1 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_2 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_3 - DROP DATABASE IF EXISTS auto_test_local; - } - --disable_query_log - --disable_result_log - --source ha_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -514,455 +479,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_DROP_TABLES; - } - --disable_warnings - eval $CHILD2_3_HA_DROP_TABLES; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_CREATE_TABLES; - } - eval $CHILD2_3_HA_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_COPY_TABLES_P_2_1; - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo active standby test --echo create table test @@ -1327,438 +843,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_DROP_TABLES2; - } - --disable_warnings - eval $CHILD2_1_HA_AS_DROP_TABLES2; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_CREATE_TABLES2; - } - eval $CHILD2_1_HA_AS_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo deinit --disable_warnings diff --git a/storage/spider/mysql-test/spider/oracle2/t/ha_part.test b/storage/spider/mysql-test/spider/oracle2/t/ha_part.test new file mode 100644 index 00000000000..72ddcfd1f10 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/t/ha_part.test @@ -0,0 +1,1017 @@ +# This test tests for ha features +if ($USE_HA_TEST) +{ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source ha_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source ha_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; + CREATE DATABASE auto_test_remote3; + USE auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + --connection child2_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +if ($USE_CHILD_GROUP3) +{ + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + SELECT 1; + --connection child3_2 + SELECT 1; + --connection child3_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_DROP_TABLES; + } + --disable_warnings + eval $CHILD2_3_HA_DROP_TABLES; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_CREATE_TABLES; + } + eval $CHILD2_3_HA_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_COPY_TABLES_P_2_1; + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_DROP_TABLES2; + } + --disable_warnings + eval $CHILD2_1_HA_AS_DROP_TABLES2; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_CREATE_TABLES2; + } + eval $CHILD2_1_HA_AS_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; +} +--disable_query_log +--disable_result_log +--source ha_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +} +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/oracle2/t/spider3_fixes.test b/storage/spider/mysql-test/spider/oracle2/t/spider3_fixes.test index 4139f3af955..7530ce97837 100644 --- a/storage/spider/mysql-test/spider/oracle2/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/oracle2/t/spider3_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider 3.0's bug fixes
---let $SKIP_REASON=
source include/have_log_bin.inc;
--disable_warnings
--disable_query_log
@@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_REPLICATION)
- {
- --connection slave1_1
- DROP DATABASE IF EXISTS auto_test_local;
- }
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source slave_test_deinit.inc
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -293,255 +264,6 @@ if ($USE_CHILD_GROUP2) }
---echo auto_increment with partition
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_INCREMENT_TABLES1;
- echo CHILD2_1_CREATE_INCREMENT_TABLES1;
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_INCREMENT_TABLES1;
- echo CHILD2_2_CREATE_INCREMENT_TABLES1;
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- --disable_query_log
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
- echo MASTER_1_AUTO_INCREMENT_OFFSET2;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
- if ($USE_REPLICATION)
- {
- SET SESSION sql_log_bin= 1;
- --connection slave1_1
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- --connection master_1
- }
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- TRUNCATE TABLE t1;
- TRUNCATE TABLE t2;
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- SET INSERT_ID=5000;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- INSERT INTO t1 (id) VALUES (10000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 (id) VALUES (1000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- SELECT id FROM t1 ORDER BY id;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
-
--echo
--echo deinit
--disable_warnings
diff --git a/storage/spider/mysql-test/spider/oracle2/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/oracle2/t/spider3_fixes_part.test new file mode 100644 index 00000000000..f25f000d80c --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/t/spider3_fixes_part.test @@ -0,0 +1,345 @@ +# This test tests for Spider 3.0's bug fixes
+source include/have_log_bin.inc;
+--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--source slave_test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source slave_test_deinit.inc
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+ CREATE DATABASE auto_test_local;
+ USE auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+
+--echo auto_increment with partition
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_INCREMENT_TABLES1;
+ echo CHILD2_1_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_INCREMENT_TABLES1;
+ echo CHILD2_2_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ --disable_query_log
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ echo MASTER_1_AUTO_INCREMENT_OFFSET2;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
+ if ($USE_REPLICATION)
+ {
+ SET SESSION sql_log_bin= 1;
+ --connection slave1_1
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ --connection master_1
+ }
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ TRUNCATE TABLE t1;
+ TRUNCATE TABLE t2;
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ SET INSERT_ID=5000;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ INSERT INTO t1 (id) VALUES (10000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 (id) VALUES (1000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ SELECT id FROM t1 ORDER BY id;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source slave_test_deinit.inc
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/oracle2/t/spider_fixes.test b/storage/spider/mysql-test/spider/oracle2/t/spider_fixes.test index b9ff61abcb4..04e806fb612 100644 --- a/storage/spider/mysql-test/spider/oracle2/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/oracle2/t/spider_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider's bug fixes ---let $SKIP_REASON= source include/have_log_bin.inc; --disable_warnings --disable_query_log @@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_REPLICATION) - { - --connection slave1_1 - DROP DATABASE IF EXISTS auto_test_local; - } - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source slave_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -760,216 +731,8 @@ if ($USE_CHILD_GROUP2) } } ---echo partition with sort -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 - ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.23 ---echo partition update with moving partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); - UPDATE ta_l2 SET a = 4 WHERE a = 3; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo index merge if ($USE_CHILD_GROUP2) { @@ -1058,121 +821,6 @@ if ($USE_CHILD_GROUP2) } } ---echo index merge with partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l_int; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_result_log - } - --disable_query_log - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_2_DROP_TABLES5; - echo CHILD2_2_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES5; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES5; - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES5; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; - --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; - eval CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; - --enable_query_log - INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); - INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) - WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.24 --echo index scan update without PK @@ -1220,7 +868,7 @@ if (!$MASTER_1_NEEDPK) --enable_query_log SELECT a, b, c FROM ta_l_int ORDER BY a; INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -1515,202 +1163,6 @@ if ($USE_CHILD_GROUP2) --echo ---echo auto_increment with partition -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_INCREMENT_TABLES1; - echo CHILD2_2_CREATE_INCREMENT_TABLES1; - echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_2_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_2_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_2_CREATE_INCREMENT_TABLES1; - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - --disable_query_log - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; - echo MASTER_1_AUTO_INCREMENT_INCREMENT2; - echo MASTER_1_AUTO_INCREMENT_OFFSET2; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; - eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; - eval $MASTER_1_AUTO_INCREMENT_OFFSET2; - if ($USE_REPLICATION) - { - SET SESSION sql_log_bin= 1; - --connection slave1_1 - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; - --connection master_1 - } - --enable_query_log - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (),(),(),(); - SELECT LAST_INSERT_ID(); - SELECT id FROM t1 ORDER BY id; - SET INSERT_ID=5000; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (10000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (1000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - SELECT id FROM t1 ORDER BY id; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_2_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - - ---echo --echo read only let $MASTER_1_ENGINE_IS_SPIDER= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'Spider' OR diff --git a/storage/spider/mysql-test/spider/oracle2/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/oracle2/t/spider_fixes_part.test new file mode 100644 index 00000000000..ef5a8026c02 --- /dev/null +++ b/storage/spider/mysql-test/spider/oracle2/t/spider_fixes_part.test @@ -0,0 +1,645 @@ +# This test tests for Spider's bug fixes +source include/have_log_bin.inc; +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source slave_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source slave_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + +--echo +--echo 2.17 +--echo partition with sort +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 + ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo 2.23 +--echo partition update with moving partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); + UPDATE ta_l2 SET a = 4 WHERE a = 3; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo index merge with partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l_int; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_result_log + } + --disable_query_log + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_2_DROP_TABLES5; + echo CHILD2_2_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES5; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES5; + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_1_DROP_TABLES5; + echo CHILD2_1_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES5; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES5; + --enable_query_log + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; + eval CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; + --enable_query_log + INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); + INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) + WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo 2.26 +--echo auto_increment with partition +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_INCREMENT_TABLES1; + echo CHILD2_1_CREATE_INCREMENT_TABLES1; + echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_1_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_1_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_1_CREATE_INCREMENT_TABLES1; + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_INCREMENT_TABLES1; + echo CHILD2_2_CREATE_INCREMENT_TABLES1; + echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_2_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_2_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_2_CREATE_INCREMENT_TABLES1; + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + --disable_query_log + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; + echo MASTER_1_AUTO_INCREMENT_INCREMENT2; + echo MASTER_1_AUTO_INCREMENT_OFFSET2; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; + eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; + eval $MASTER_1_AUTO_INCREMENT_OFFSET2; + if ($USE_REPLICATION) + { + SET SESSION sql_log_bin= 1; + --connection slave1_1 + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; + --connection master_1 + } + --enable_query_log + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (),(),(),(); + SELECT LAST_INSERT_ID(); + SELECT id FROM t1 ORDER BY id; + SET INSERT_ID=5000; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (10000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (1000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + SELECT id FROM t1 ORDER BY id; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_1_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_2_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source slave_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/oracle2/t/vp_fixes.test b/storage/spider/mysql-test/spider/oracle2/t/vp_fixes.test index 46e7b0afc36..90380227040 100644 --- a/storage/spider/mysql-test/spider/oracle2/t/vp_fixes.test +++ b/storage/spider/mysql-test/spider/oracle2/t/vp_fixes.test @@ -1,5 +1,4 @@ # This test tests for VP's bug fixes ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/mysql-test/spider/r/basic_sql.result b/storage/spider/mysql-test/spider/r/basic_sql.result index e6202327ef6..1e9fe78acea 100644 --- a/storage/spider/mysql-test/spider/r/basic_sql.result +++ b/storage/spider/mysql-test/spider/r/basic_sql.result @@ -98,19 +98,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 4 i 2003-10-30 05:01:03 5 h 2001-10-31 23:59:59 -create table with partition and select test -CREATE TABLE ta_l2 ( -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 -SELECT a, b, c FROM tb_l -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - create no index table DROP TABLE IF EXISTS ta_l_no_idx; CREATE TABLE ta_l_no_idx @@ -282,18 +269,6 @@ a.a > 0 AND a.b = 'g' ORDER BY a.a; a b date_format(a.c, '%Y-%m-%d %H:%i:%s') 2 g 2000-02-01 00:00:00 -select partition using pushdown -SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE -a.b = 'g' ORDER BY a.a; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - -select partition using index pushdown -SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE -a.a > 0 AND a.b = 'g' ORDER BY a.a; -a b date_format(a.c, '%Y-%m-%d %H:%i:%s') -2 g 2000-02-01 00:00:00 - insert TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59'); @@ -467,26 +442,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 g 2009-03-03 03:03:03 2 g 2009-03-03 03:03:03 -update partition pushdown -UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 e 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -update partition index pushdown -UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -2 g 2000-02-01 00:00:00 -3 j 2009-03-03 03:03:03 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -657,28 +612,6 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; a b date_format(c, '%Y-%m-%d %H:%i:%s') 10 j 2008-01-01 23:59:59 -delete partition pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - -delete partition index pushdown -TRUNCATE TABLE ta_l2; -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 f 2008-07-01 10:21:39 -3 j 2007-05-04 20:03:11 -4 i 2003-10-30 05:01:03 -5 h 2001-10-31 23:59:59 - truncate TRUNCATE TABLE ta_l; SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; diff --git a/storage/spider/mysql-test/spider/r/basic_sql_part.result b/storage/spider/mysql-test/spider/r/basic_sql_part.result new file mode 100644 index 00000000000..9e1201c17c9 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/basic_sql_part.result @@ -0,0 +1,121 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'f', '2008-07-01 10:21:39'), +(2, 'g', '2000-02-01 00:00:00'), +(3, 'j', '2007-05-04 20:03:11'), +(4, 'i', '2003-10-30 05:01:03'), +(5, 'h', '2001-10-31 23:59:59'); + +create table with partition and select test +CREATE TABLE ta_l2 ( +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 +SELECT a, b, c FROM tb_l +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +select partition using pushdown +SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE +a.b = 'g' ORDER BY a.a; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +select partition using index pushdown +SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE +a.a > 0 AND a.b = 'g' ORDER BY a.a; +a b date_format(a.c, '%Y-%m-%d %H:%i:%s') +2 g 2000-02-01 00:00:00 + +update partition pushdown +UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 e 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +update partition index pushdown +UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +2 g 2000-02-01 00:00:00 +3 j 2009-03-03 03:03:03 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +DELETE FROM ta_l2 WHERE b = 'g'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +delete partition index pushdown +TRUNCATE TABLE ta_l2; +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 f 2008-07-01 10:21:39 +3 j 2007-05-04 20:03:11 +4 i 2003-10-30 05:01:03 +5 h 2001-10-31 23:59:59 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/r/direct_aggregate.result b/storage/spider/mysql-test/spider/r/direct_aggregate.result index 7bf1cb4aea7..5cc5760257d 100644 --- a/storage/spider/mysql-test/spider/r/direct_aggregate.result +++ b/storage/spider/mysql-test/spider/r/direct_aggregate.result @@ -74,47 +74,6 @@ SHOW STATUS LIKE 'Spider_direct_aggregate'; Variable_name Value Spider_direct_aggregate 1 -with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 1 -SELECT COUNT(*) FROM ta_l2; -COUNT(*) -5 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MAX(a) FROM ta_l2; -MAX(a) -5 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MIN(a) FROM ta_l2; -MIN(a) -1 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MAX(a) FROM ta_l2 WHERE a < 5; -MAX(a) -4 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 -SELECT MIN(a) FROM ta_l2 WHERE a > 1; -MIN(a) -2 -SHOW STATUS LIKE 'Spider_direct_aggregate'; -Variable_name Value -Spider_direct_aggregate 3 - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/r/direct_aggregate_part.result new file mode 100644 index 00000000000..9625519a53f --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_aggregate_part.result @@ -0,0 +1,82 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 + +with partition test +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 0 +SELECT COUNT(*) FROM ta_l2; +COUNT(*) +5 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MAX(a) FROM ta_l2; +MAX(a) +5 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MIN(a) FROM ta_l2; +MIN(a) +1 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MAX(a) FROM ta_l2 WHERE a < 5; +MAX(a) +4 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 +SELECT MIN(a) FROM ta_l2 WHERE a > 1; +MIN(a) +2 +SHOW STATUS LIKE 'Spider_direct_aggregate'; +Variable_name Value +Spider_direct_aggregate 2 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/r/direct_update.result b/storage/spider/mysql-test/spider/r/direct_update.result index 135734641c1..517491253e9 100644 --- a/storage/spider/mysql-test/spider/r/direct_update.result +++ b/storage/spider/mysql-test/spider/r/direct_update.result @@ -121,94 +121,6 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 1 a 2008-08-02 10:21:39 4 d 2003-12-01 05:01:03 -with partition test -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -update all rows with function -UPDATE ta_l2 SET c = ADDDATE(c, 1); -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 e 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by primary key -UPDATE ta_l2 SET b = 'x' WHERE a = 3; -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2007-06-05 20:03:11 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by a column without index -UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2011-10-17 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -update by primary key with order and limit -UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; -SHOW STATUS LIKE 'Spider_direct_update'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -2 b 2000-01-02 00:00:00 -3 x 2011-10-18 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by primary key with order and limit -DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; -SHOW STATUS LIKE 'Spider_direct_delete'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-18 00:00:00 -4 d 2003-12-01 05:01:03 -5 c 2002-01-01 23:59:59 -delete by a column without index -DELETE FROM ta_l2 WHERE b = 'c'; -SHOW STATUS LIKE 'Spider_direct_delete'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -3 x 2011-10-18 00:00:00 -4 d 2003-12-01 05:01:03 -delete by primary key -DELETE FROM ta_l2 WHERE a = 3; -SHOW STATUS LIKE 'Spider_direct_delete'; -Variable_name Value -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-02 10:21:39 -4 d 2003-12-01 05:01:03 - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/r/direct_update_part.result b/storage/spider/mysql-test/spider/r/direct_update_part.result new file mode 100644 index 00000000000..bd8f1b89f69 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/direct_update_part.result @@ -0,0 +1,129 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 + +with partition test +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +update all rows with function +UPDATE ta_l2 SET c = ADDDATE(c, 1); +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 e 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by primary key +UPDATE ta_l2 SET b = 'x' WHERE a = 3; +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2007-06-05 20:03:11 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by a column without index +UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2011-10-17 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +update by primary key with order and limit +UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; +SHOW STATUS LIKE 'Spider_direct_update'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +2 b 2000-01-02 00:00:00 +3 x 2011-10-18 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by primary key with order and limit +DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; +SHOW STATUS LIKE 'Spider_direct_delete'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-18 00:00:00 +4 d 2003-12-01 05:01:03 +5 c 2002-01-01 23:59:59 +delete by a column without index +DELETE FROM ta_l2 WHERE b = 'c'; +SHOW STATUS LIKE 'Spider_direct_delete'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +3 x 2011-10-18 00:00:00 +4 d 2003-12-01 05:01:03 +delete by primary key +DELETE FROM ta_l2 WHERE a = 3; +SHOW STATUS LIKE 'Spider_direct_delete'; +Variable_name Value +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-02 10:21:39 +4 d 2003-12-01 05:01:03 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/r/ha.result b/storage/spider/mysql-test/spider/r/ha.result index e05ecb32e1b..9837faebd87 100644 --- a/storage/spider/mysql-test/spider/r/ha.result +++ b/storage/spider/mysql-test/spider/r/ha.result @@ -138,111 +138,6 @@ SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 1 -Spider_mon_table_cache_version_req 2 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'auto_test_remote3.ta_r4' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 3 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 2 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 2"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 2 -SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); -spider_copy_tables('ta_l2#P#pt2', '0', '1') -1 -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "0 1"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - active standby test create table test DROP TABLE IF EXISTS ta_l; @@ -271,7 +166,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') fail-over test SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value -Spider_mon_table_cache_version 2 +Spider_mon_table_cache_version 1 Spider_mon_table_cache_version_req 2 INSERT INTO ta_l (a, b, c) VALUES (6, 'e', '2011-05-05 20:04:05'); @@ -284,7 +179,6 @@ auto_test_local ta_l 1 1 SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; db_name table_name link_id auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 auto_test_local ta_l 0 SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; Variable_name Value @@ -316,91 +210,6 @@ SELECT spider_flush_table_mon_cache(); spider_flush_table_mon_cache() 1 -create table with partition test -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES -(1, 'a', '2008-08-01 10:21:39'), -(2, 'b', '2000-01-01 00:00:00'), -(3, 'e', '2007-06-04 20:03:11'), -(4, 'd', '2003-11-30 05:01:03'), -(5, 'c', '2001-12-31 23:59:59'); - -select test -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 - -fail-over test -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 2 -Spider_mon_table_cache_version_req 3 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -ERROR HY000: Table 'auto_test_remote.ta_r2' get a problem -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 3 -auto_test_local ta_l2#P#pt2 1 1 -SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; -db_name table_name link_id -auto_test_local ta_l 1 -auto_test_local ta_l2#P#pt2 1 -auto_test_local ta_l 0 -auto_test_local ta_l2#P#pt2 0 -SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; -Variable_name Value -Spider_mon_table_cache_version 3 -Spider_mon_table_cache_version_req 3 -INSERT INTO ta_l2 (a, b, c) VALUES -(6, 'e', '2011-05-05 20:04:05'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -6 e 2011-05-05 20:04:05 - -recovery test -ALTER TABLE ta_l2 -PARTITION BY KEY(a) ( -PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", - priority "1000"', -PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", - priority "1000001", lst "1 0"' - ); -SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables -ORDER BY db_name, table_name, link_id; -db_name table_name link_id link_status -auto_test_local ta_l2#P#pt1 0 1 -auto_test_local ta_l2#P#pt1 1 1 -auto_test_local ta_l2#P#pt2 0 1 -auto_test_local ta_l2#P#pt2 1 1 -INSERT INTO ta_l2 (a, b, c) VALUES -(8, 'g', '2011-05-05 21:33:30'), -(9, 'h', '2011-05-05 22:32:10'); -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -1 a 2008-08-01 10:21:39 -3 e 2007-06-04 20:03:11 -5 c 2001-12-31 23:59:59 -8 g 2011-05-05 21:33:30 -9 h 2011-05-05 22:32:10 -DROP TABLE ta_l2; - deinit DROP DATABASE IF EXISTS auto_test_local; DROP DATABASE IF EXISTS auto_test_remote; diff --git a/storage/spider/mysql-test/spider/r/ha_part.result b/storage/spider/mysql-test/spider/r/ha_part.result new file mode 100644 index 00000000000..8c0300ba5a5 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/ha_part.result @@ -0,0 +1,262 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; +DROP DATABASE IF EXISTS auto_test_remote3; +CREATE DATABASE auto_test_remote3; +USE auto_test_remote3; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; + +test select 1 +SELECT 1; +1 +1 + +create table with partition test +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 0 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'auto_test_remote3.ta_r4' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 3 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 2"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 2 +SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1'); +spider_copy_tables('ta_l2#P#pt2', '0', '1') +1 +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "0 1"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +create table with partition test +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +select test +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +fail-over test +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +ERROR HY000: Table 'auto_test_remote.ta_r2' get a problem +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 3 +auto_test_local ta_l2#P#pt2 1 1 +SELECT db_name, table_name, link_id FROM mysql.spider_link_failed_log; +db_name table_name link_id +auto_test_local ta_l2#P#pt2 1 +auto_test_local ta_l2#P#pt2 0 +SHOW STATUS LIKE 'Spider_mon_table_cache_version%'; +Variable_name Value +Spider_mon_table_cache_version 1 +Spider_mon_table_cache_version_req 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(6, 'e', '2011-05-05 20:04:05'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +6 e 2011-05-05 20:04:05 + +recovery test +ALTER TABLE ta_l2 +PARTITION BY KEY(a) ( +PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3", + priority "1000"', +PARTITION pt2 COMMENT='srv "s_2_1 s_2_3", tbl "ta_r2 ta_r4", + priority "1000001", lst "1 0"' + ); +SELECT db_name, table_name, link_id, link_status FROM mysql.spider_tables +ORDER BY db_name, table_name, link_id; +db_name table_name link_id link_status +auto_test_local ta_l2#P#pt1 0 1 +auto_test_local ta_l2#P#pt1 1 1 +auto_test_local ta_l2#P#pt2 0 1 +auto_test_local ta_l2#P#pt2 1 1 +INSERT INTO ta_l2 (a, b, c) VALUES +(8, 'g', '2011-05-05 21:33:30'), +(9, 'h', '2011-05-05 22:32:10'); +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +1 a 2008-08-01 10:21:39 +3 e 2007-06-04 20:03:11 +5 c 2001-12-31 23:59:59 +8 g 2011-05-05 21:33:30 +9 h 2011-05-05 22:32:10 +DROP TABLE ta_l2; + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +DROP DATABASE IF EXISTS auto_test_remote3; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/r/spider3_fixes.result b/storage/spider/mysql-test/spider/r/spider3_fixes.result index 34a8f3cf933..cb62468d3ae 100644 --- a/storage/spider/mysql-test/spider/r/spider3_fixes.result +++ b/storage/spider/mysql-test/spider/r/spider3_fixes.result @@ -190,167 +190,6 @@ id 3108 5000 10000 -auto_increment with partition -DROP TABLE IF EXISTS t1, t2; -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -CREATE TABLE t2 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_1"') -1 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_2"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', -'srv "s_2_1"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', -'srv "s_2_2"') -1 -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 -CREATE TABLE t2 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -777 -SELECT MAX(id) FROM t1; -MAX(id) -777 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -1554 -SELECT MAX(id) FROM t2; -MAX(id) -1554 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -778 -SELECT MAX(id) FROM t1; -MAX(id) -1554 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2331 -SELECT MAX(id) FROM t2; -MAX(id) -2331 -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -1555 -SELECT id FROM t1 ORDER BY id; -id -777 -778 -1554 -1555 -2331 -2332 -3109 -3886 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3108 -SELECT id FROM t2 ORDER BY id; -id -777 -778 -1554 -1555 -2331 -2332 -3108 -3109 -3885 -3886 -4662 -5439 -TRUNCATE TABLE t1; -TRUNCATE TABLE t2; -INSERT INTO t1 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -777 -SELECT id FROM t1 ORDER BY id; -id -777 -1554 -2331 -3108 -INSERT INTO t2 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3885 -SELECT id FROM t2 ORDER BY id; -id -777 -1554 -2331 -3108 -3885 -4662 -5439 -6216 -SET INSERT_ID=5000; -MASTER_1_AUTO_INCREMENT_OFFSET3 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -6216 -MASTER_1_AUTO_INCREMENT_OFFSET4 -INSERT INTO t2 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6993 -SELECT MAX(id) FROM t2; -MAX(id) -6993 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6993 -SELECT MAX(id) FROM t1; -MAX(id) -10000 -INSERT INTO t2 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -6993 -SELECT MAX(id) FROM t2; -MAX(id) -10000 -SELECT id FROM t1 ORDER BY id; -id -777 -1554 -2331 -3108 -5000 -10000 deinit DROP DATABASE IF EXISTS auto_test_local; diff --git a/storage/spider/mysql-test/spider/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/r/spider3_fixes_part.result new file mode 100644 index 00000000000..12f43ef09b2 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/spider3_fixes_part.result @@ -0,0 +1,208 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +auto_increment with partition +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +CREATE TABLE t2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') +1 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"') +1 +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 +CREATE TABLE t2 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +777 +SELECT MAX(id) FROM t1; +MAX(id) +777 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1554 +SELECT MAX(id) FROM t2; +MAX(id) +1554 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +778 +SELECT MAX(id) FROM t1; +MAX(id) +1554 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2331 +SELECT MAX(id) FROM t2; +MAX(id) +2331 +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1555 +SELECT id FROM t1 ORDER BY id; +id +777 +778 +1554 +1555 +2331 +2332 +3109 +3886 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3108 +SELECT id FROM t2 ORDER BY id; +id +777 +778 +1554 +1555 +2331 +2332 +3108 +3109 +3885 +3886 +4662 +5439 +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +INSERT INTO t1 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +777 +SELECT id FROM t1 ORDER BY id; +id +777 +1554 +2331 +3108 +INSERT INTO t2 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3885 +SELECT id FROM t2 ORDER BY id; +id +777 +1554 +2331 +3108 +3885 +4662 +5439 +6216 +SET INSERT_ID=5000; +MASTER_1_AUTO_INCREMENT_OFFSET3 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +6216 +MASTER_1_AUTO_INCREMENT_OFFSET4 +INSERT INTO t2 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6993 +SELECT MAX(id) FROM t2; +MAX(id) +6993 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6993 +SELECT MAX(id) FROM t1; +MAX(id) +10000 +INSERT INTO t2 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +6993 +SELECT MAX(id) FROM t2; +MAX(id) +10000 +SELECT id FROM t1 ORDER BY id; +id +777 +1554 +2331 +3108 +5000 +10000 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/r/spider_fixes.result b/storage/spider/mysql-test/spider/r/spider_fixes.result index aedde01e178..2673c633f77 100644 --- a/storage/spider/mysql-test/spider/r/spider_fixes.result +++ b/storage/spider/mysql-test/spider/r/spider_fixes.result @@ -166,36 +166,8 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 3 e 2007-06-04 20:03:11 4 d 2003-11-30 05:01:03 5 c 2001-12-31 23:59:59 -partition with sort -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 -ORDER BY a; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -2 b 2000-01-01 00:00:00 -3 e 2007-06-04 20:03:11 -4 d 2003-11-30 05:01:03 -5 c 2001-12-31 23:59:59 2.23 -partition update with moving partition -DROP TABLE IF EXISTS ta_l2; -CREATE TABLE ta_l2 ( -a INT, -b CHAR(1), -c DATETIME, -PRIMARY KEY(a) -) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 -INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); -UPDATE ta_l2 SET a = 4 WHERE a = 3; -SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; -a b date_format(c, '%Y-%m-%d %H:%i:%s') -4 B 2010-09-26 00:00:00 index merge CREATE TABLE ta_l_int ( a INT AUTO_INCREMENT, @@ -216,27 +188,6 @@ a b c 3 4 5 4 5 6 5 6 7 -index merge with partition -DROP TABLE IF EXISTS ta_l_int; -CREATE TABLE ta_l_int ( -a INT AUTO_INCREMENT, -b INT DEFAULT 10, -c INT DEFAULT 11, -PRIMARY KEY(a), -KEY idx1(b), -KEY idx2(c) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1 -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); -INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; -INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; -SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) -WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; -a b c -3 4 5 -4 5 6 -5 6 7 2.24 index scan update without PK @@ -250,29 +201,45 @@ KEY idx2(c) ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1 SELECT a, b, c FROM ta_l_int ORDER BY a; a b c +1 2 3 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); UPDATE ta_l_int SET c = 4 WHERE b = 2; SELECT a, b, c FROM ta_l_int ORDER BY a; a b c 1 2 4 2 3 4 +3 4 5 4 5 6 +5 6 7 6 7 8 +7 8 9 8 9 10 +9 10 11 10 11 12 +11 12 13 12 13 14 +13 14 15 14 15 16 +15 16 17 16 17 18 17 2 4 +18 2 4 2.25 direct order limit @@ -283,7 +250,7 @@ SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3; a b c 1 2 4 2 3 4 -4 5 6 +3 4 5 SHOW STATUS LIKE 'Spider_direct_order_limit'; Variable_name Value Spider_direct_order_limit 0 @@ -405,94 +372,12 @@ id 6216 10000 -auto_increment with partition +read only DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 -MASTER_1_AUTO_INCREMENT_INCREMENT2 -MASTER_1_AUTO_INCREMENT_OFFSET2 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_1"') -1 -spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', -'srv "s_2_2"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', -'srv "s_2_1"') -1 -spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', -'srv "s_2_2"') -1 -CREATE TABLE t1 ( -id int(11) NOT NULL AUTO_INCREMENT, +id int(11) NOT NULL, PRIMARY KEY (id) -) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -777 -SELECT MAX(id) FROM t1; -MAX(id) -777 -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -1554 -SELECT MAX(id) FROM t1; -MAX(id) -1554 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -2331 -SELECT MAX(id) FROM t1; -MAX(id) -2331 -INSERT INTO t1 (id) VALUES (null); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3108 -SELECT MAX(id) FROM t1; -MAX(id) -3108 -INSERT INTO t1 () VALUES (),(),(),(); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -3885 -SELECT id FROM t1 ORDER BY id; -id -777 -1554 -2331 -3108 -3885 -4662 -5439 -6216 -SET INSERT_ID=5000; -INSERT INTO t1 () VALUES (); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -6216 -INSERT INTO t1 (id) VALUES (10000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -10000 -INSERT INTO t1 (id) VALUES (1000); -SELECT LAST_INSERT_ID(); -LAST_INSERT_ID() -5000 -SELECT MAX(id) FROM t1; -MAX(id) -10000 +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1 SELECT id FROM t1 ORDER BY id; id 777 @@ -506,27 +391,11 @@ id 5439 6216 10000 - -read only -DROP TABLE IF EXISTS t1; -CREATE TABLE t1 ( -id int(11) NOT NULL, -PRIMARY KEY (id) -) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_READONLY1_1 -SELECT id FROM t1 ORDER BY id; -id -1000 -1554 -3108 -4662 -5000 -6216 -10000 INSERT INTO t1 (id) VALUES (1); ERROR HY000: Table 'auto_test_local.t1' is read only -UPDATE t1 SET id = 4 WHERE id = 1000; +UPDATE t1 SET id = 4 WHERE id = 777; ERROR HY000: Table 'auto_test_local.t1' is read only -DELETE FROM t1 WHERE id = 1000; +DELETE FROM t1 WHERE id = 777; ERROR HY000: Table 'auto_test_local.t1' is read only DELETE FROM t1; ERROR HY000: Table 'auto_test_local.t1' is read only diff --git a/storage/spider/mysql-test/spider/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/r/spider_fixes_part.result new file mode 100644 index 00000000000..104ba971df9 --- /dev/null +++ b/storage/spider/mysql-test/spider/r/spider_fixes_part.result @@ -0,0 +1,216 @@ +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 +for slave1_1 + +drop and create databases +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +CREATE DATABASE auto_test_remote; +USE auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +CREATE DATABASE auto_test_remote2; +USE auto_test_remote2; + +test select 1 +SELECT 1; +1 +1 +DROP TABLE IF EXISTS tb_l; +CREATE TABLE tb_l ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2 +INSERT INTO tb_l (a, b, c) VALUES +(1, 'a', '2008-08-01 10:21:39'), +(2, 'b', '2000-01-01 00:00:00'), +(3, 'e', '2007-06-04 20:03:11'), +(4, 'd', '2003-11-30 05:01:03'), +(5, 'c', '2001-12-31 23:59:59'); + +2.17 +partition with sort +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 +ORDER BY a; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +2 b 2000-01-01 00:00:00 +3 e 2007-06-04 20:03:11 +4 d 2003-11-30 05:01:03 +5 c 2001-12-31 23:59:59 + +2.23 +partition update with moving partition +DROP TABLE IF EXISTS ta_l2; +CREATE TABLE ta_l2 ( +a INT, +b CHAR(1), +c DATETIME, +PRIMARY KEY(a) +) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1 +INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); +UPDATE ta_l2 SET a = 4 WHERE a = 3; +SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; +a b date_format(c, '%Y-%m-%d %H:%i:%s') +4 B 2010-09-26 00:00:00 +index merge with partition +DROP TABLE IF EXISTS ta_l_int; +CREATE TABLE ta_l_int ( +a INT AUTO_INCREMENT, +b INT DEFAULT 10, +c INT DEFAULT 11, +PRIMARY KEY(a), +KEY idx1(b), +KEY idx2(c) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1 +INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; +INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; +SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) +WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; +a b c +3 4 5 +4 5 6 +5 6 7 + +2.26 +auto_increment with partition +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1 +MASTER_1_AUTO_INCREMENT_INCREMENT2 +MASTER_1_AUTO_INCREMENT_OFFSET2 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_1"') +1 +spider_direct_sql('SET SESSION AUTO_INCREMENT_INCREMENT = 4', '', +'srv "s_2_2"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 2', '', +'srv "s_2_1"') +1 +spider_bg_direct_sql('SET SESSION AUTO_INCREMENT_OFFSET = 3', '', +'srv "s_2_2"') +1 +CREATE TABLE t1 ( +id int(11) NOT NULL AUTO_INCREMENT, +PRIMARY KEY (id) +) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +777 +SELECT MAX(id) FROM t1; +MAX(id) +777 +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +1554 +SELECT MAX(id) FROM t1; +MAX(id) +1554 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +2331 +SELECT MAX(id) FROM t1; +MAX(id) +2331 +INSERT INTO t1 (id) VALUES (null); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3108 +SELECT MAX(id) FROM t1; +MAX(id) +3108 +INSERT INTO t1 () VALUES (),(),(),(); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +3885 +SELECT id FROM t1 ORDER BY id; +id +777 +1554 +2331 +3108 +3885 +4662 +5439 +6216 +SET INSERT_ID=5000; +INSERT INTO t1 () VALUES (); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +6216 +INSERT INTO t1 (id) VALUES (10000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +10000 +INSERT INTO t1 (id) VALUES (1000); +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +5000 +SELECT MAX(id) FROM t1; +MAX(id) +10000 +SELECT id FROM t1 ORDER BY id; +id +777 +1000 +1554 +2331 +3108 +3885 +4662 +5000 +5439 +6216 +10000 + +deinit +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_local; +DROP DATABASE IF EXISTS auto_test_remote; +DROP DATABASE IF EXISTS auto_test_remote2; +for slave1_1 +for master_1 +for child2 +child2_1 +child2_2 +child2_3 +for child3 +child3_1 +child3_2 +child3_3 + +end of test diff --git a/storage/spider/mysql-test/spider/t/basic_sql.test b/storage/spider/mysql-test/spider/t/basic_sql.test index 2264b0e4e37..5bb040047fc 100644 --- a/storage/spider/mysql-test/spider/t/basic_sql.test +++ b/storage/spider/mysql-test/spider/t/basic_sql.test @@ -1,5 +1,4 @@ # This test tests by executing basic SQL ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -351,119 +328,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo create table with partition and select test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - if ($MASTER_1_MERGE) - { - --error ER_WRONG_OBJECT - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - } - if (!$MASTER_1_MERGE) - { - eval CREATE TABLE ta_l2 ( - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 - SELECT a, b, c FROM tb_l; - } - --enable_query_log - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo create no index table if ($USE_CHILD_GROUP2) { @@ -1279,116 +1143,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo select partition using pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo ---echo select partition using index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE - a.a > 0 AND a.b = 'g' ORDER BY a.a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo insert --connection master_1 TRUNCATE TABLE ta_l; @@ -2367,126 +2121,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo update partition pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo update partition index pushdown -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo delete TRUNCATE TABLE ta_l; INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'), @@ -3000,130 +2634,6 @@ if ($USE_CHILD_GROUP2) SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a; --echo ---echo delete partition pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo ---echo delete partition index pushdown -if ($HAVE_PARTITION) -{ - TRUNCATE TABLE ta_l2; - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; -} - ---echo --echo truncate if ($USE_CHILD_GROUP2) { diff --git a/storage/spider/mysql-test/spider/t/basic_sql_part.test b/storage/spider/mysql-test/spider/t/basic_sql_part.test new file mode 100644 index 00000000000..e1638642ab7 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/basic_sql_part.test @@ -0,0 +1,571 @@ +# This test tests by executing basic SQL +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'f', '2008-07-01 10:21:39'), + (2, 'g', '2000-02-01 00:00:00'), + (3, 'j', '2007-05-04 20:03:11'), + (4, 'i', '2003-10-30 05:01:03'), + (5, 'h', '2001-10-31 23:59:59'); + +--echo +--echo create table with partition and select test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + if ($MASTER_1_MERGE) + { + --error ER_WRONG_OBJECT + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + } + if (!$MASTER_1_MERGE) + { + eval CREATE TABLE ta_l2 ( + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1 + SELECT a, b, c FROM tb_l; + } + --enable_query_log + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo select partition using pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo select partition using index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE + a.a > 0 AND a.b = 'g' ORDER BY a.a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo update partition pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo update partition index pushdown +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'update %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo delete partition index pushdown +if ($HAVE_PARTITION) +{ + TRUNCATE TABLE ta_l2; + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + DELETE FROM ta_l2 WHERE a > 0 AND b = 'g'; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE 'delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/direct_aggregate.test b/storage/spider/mysql-test/spider/t/direct_aggregate.test index 59c45f3f190..5f17ac402e2 100644 --- a/storage/spider/mysql-test/spider/t/direct_aggregate.test +++ b/storage/spider/mysql-test/spider/t/direct_aggregate.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON=
--disable_warnings
--disable_query_log
--disable_result_log
@@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -181,120 +158,6 @@ if ($USE_CHILD_GROUP2) }
--echo
---echo with partition test
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_TABLES;
- echo CHILD2_2_CREATE_TABLES;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_TABLES;
- --enable_warnings
- eval $CHILD2_2_CREATE_TABLES;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_TABLES2;
- echo CHILD2_1_CREATE_TABLES2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_TABLES2;
- --enable_warnings
- eval $CHILD2_1_CREATE_TABLES2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- --disable_query_log
- echo CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
- eval CREATE TABLE ta_l2 (
- a INT,
- b CHAR(1),
- c DATETIME,
- PRIMARY KEY(a)
- ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
- INSERT INTO ta_l2 (a, b, c) VALUES
- (1, 'a', '2008-08-01 10:21:39'),
- (2, 'b', '2000-01-01 00:00:00'),
- (3, 'e', '2007-06-04 20:03:11'),
- (4, 'd', '2003-11-30 05:01:03'),
- (5, 'c', '2001-12-31 23:59:59');
- --enable_query_log
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT COUNT(*) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MAX(a) FROM ta_l2 WHERE a < 5;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- SELECT MIN(a) FROM ta_l2 WHERE a > 1;
- eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_2_SELECT_TABLES;
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
- }
- eval $CHILD2_1_SELECT_TABLES2;
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
---echo
--echo deinit
--disable_warnings
--connection master_1
diff --git a/storage/spider/mysql-test/spider/t/direct_aggregate_part.test b/storage/spider/mysql-test/spider/t/direct_aggregate_part.test new file mode 100644 index 00000000000..2d67e9af32c --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_aggregate_part.test @@ -0,0 +1,192 @@ +--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+--echo
+--echo with partition test
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_TABLES;
+ echo CHILD2_2_CREATE_TABLES;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_TABLES;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_TABLES;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_TABLES2;
+ echo CHILD2_1_CREATE_TABLES2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_TABLES2;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_TABLES2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ --disable_query_log
+ echo CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1;
+ eval CREATE TABLE ta_l2 (
+ a INT,
+ b CHAR(1),
+ c DATETIME,
+ PRIMARY KEY(a)
+ ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1;
+ INSERT INTO ta_l2 (a, b, c) VALUES
+ (1, 'a', '2008-08-01 10:21:39'),
+ (2, 'b', '2000-01-01 00:00:00'),
+ (3, 'e', '2007-06-04 20:03:11'),
+ (4, 'd', '2003-11-30 05:01:03'),
+ (5, 'c', '2001-12-31 23:59:59');
+ --enable_query_log
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT COUNT(*) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MAX(a) FROM ta_l2 WHERE a < 5;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ SELECT MIN(a) FROM ta_l2 WHERE a > 1;
+ eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_2_SELECT_TABLES;
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %';
+ }
+ eval $CHILD2_1_SELECT_TABLES2;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/t/direct_update.test b/storage/spider/mysql-test/spider/t/direct_update.test index 1c3ce91ff3f..e0901062201 100644 --- a/storage/spider/mysql-test/spider/t/direct_update.test +++ b/storage/spider/mysql-test/spider/t/direct_update.test @@ -1,4 +1,3 @@ ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -25,28 +24,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -200,139 +177,6 @@ if ($USE_CHILD_GROUP2) } --echo ---echo with partition test -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - --enable_query_log - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update all rows with function - UPDATE ta_l2 SET c = ADDDATE(c, 1); - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key - UPDATE ta_l2 SET b = 'x' WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by a column without index - UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo update by primary key with order and limit - UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key with order and limit - DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by a column without index - DELETE FROM ta_l2 WHERE b = 'c'; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - --echo delete by primary key - DELETE FROM ta_l2 WHERE a = 3; - eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - ---echo --echo deinit --disable_warnings --connection master_1 diff --git a/storage/spider/mysql-test/spider/t/direct_update_part.test b/storage/spider/mysql-test/spider/t/direct_update_part.test new file mode 100644 index 00000000000..95e2e2ab0d5 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/direct_update_part.test @@ -0,0 +1,211 @@ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--echo +--echo with partition test +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + --enable_query_log + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update all rows with function + UPDATE ta_l2 SET c = ADDDATE(c, 1); + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key + UPDATE ta_l2 SET b = 'x' WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by a column without index + UPDATE ta_l2 SET c = '2011-10-17' WHERE b = 'x'; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo update by primary key with order and limit + UPDATE ta_l2 SET c = ADDDATE(c, 1) WHERE a < 4 ORDER BY b DESC LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_UPDATE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key with order and limit + DELETE FROM ta_l2 WHERE a < 4 ORDER BY c LIMIT 1; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by a column without index + DELETE FROM ta_l2 WHERE b = 'c'; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + --echo delete by primary key + DELETE FROM ta_l2 WHERE a = 3; + eval $MASTER_1_CHECK_DIRECT_DELETE_STATUS; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%handler %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/function.test b/storage/spider/mysql-test/spider/t/function.test index 2b1b53c8a4f..ec2eeab9c94 100644 --- a/storage/spider/mysql-test/spider/t/function.test +++ b/storage/spider/mysql-test/spider/t/function.test @@ -1,5 +1,4 @@ # This test tests for using functions ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/mysql-test/spider/t/ha.test b/storage/spider/mysql-test/spider/t/ha.test index 319b1793753..c12930e4aed 100644 --- a/storage/spider/mysql-test/spider/t/ha.test +++ b/storage/spider/mysql-test/spider/t/ha.test @@ -1,5 +1,4 @@ # This test tests for ha features ---let $SKIP_REASON= if ($USE_HA_TEST) { --disable_warnings @@ -48,40 +47,6 @@ if ($USE_CHILD_GROUP3) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - --connection child2_3 - DROP DATABASE IF EXISTS auto_test_remote3; - } - if ($USE_CHILD_GROUP3) - { - --connection child3_1 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_2 - DROP DATABASE IF EXISTS auto_test_local; - --connection child3_3 - DROP DATABASE IF EXISTS auto_test_local; - } - --disable_query_log - --disable_result_log - --source ha_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -514,455 +479,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_DROP_TABLES; - } - --disable_warnings - eval $CHILD2_3_HA_DROP_TABLES; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_HA_CREATE_TABLES; - } - eval $CHILD2_3_HA_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_COPY_TABLES_P_2_1; - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo active standby test --echo create table test @@ -1327,438 +843,6 @@ if ($USE_CHILD_GROUP3) --connection master_1 eval $MASTER_1_CHANGE_HA_MON; -if ($HAVE_PARTITION) -{ - --echo - --echo create table with partition test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES; - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES; - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES; - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_3_DROP_TABLES; - echo CHILD2_3_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_3_DROP_TABLES; - --enable_warnings - eval $CHILD2_3_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES - (1, 'a', '2008-08-01 10:21:39'), - (2, 'b', '2000-01-01 00:00:00'), - (3, 'e', '2007-06-04 20:03:11'), - (4, 'd', '2003-11-30 05:01:03'), - (5, 'c', '2001-12-31 23:59:59'); - - --echo - --echo select test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo fail-over test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_DROP_TABLES2; - } - --disable_warnings - eval $CHILD2_1_HA_AS_DROP_TABLES2; - --enable_warnings - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_CHECK_HA_STATUS; - --error 12511 - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - eval $MASTER_1_CHECK_LINK_STATUS; - eval $MASTER_1_CHECK_LINK_FAILED_LOG; - eval $MASTER_1_CHECK_HA_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (6, 'e', '2011-05-05 20:04:05'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_CHECK_LINK_STATUS; - eval $CHILD3_1_CHECK_LINK_FAILED_LOG; - --connection child3_2 - eval $CHILD3_2_CHECK_LINK_STATUS; - eval $CHILD3_2_CHECK_LINK_FAILED_LOG; - --connection child3_3 - eval $CHILD3_3_CHECK_LINK_STATUS; - eval $CHILD3_3_CHECK_LINK_FAILED_LOG; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - - --echo - --echo recovery test - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_HA_AS_CREATE_TABLES2; - } - eval $CHILD2_1_HA_AS_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_3 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_1_CHECK_LINK_STATUS; - --connection child3_2 - eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_2_CHECK_LINK_STATUS; - --connection child3_3 - eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; - eval $CHILD3_3_CHECK_LINK_STATUS; - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; - eval $MASTER_1_CHECK_LINK_STATUS; - INSERT INTO ta_l2 (a, b, c) VALUES - (8, 'g', '2011-05-05 21:33:30'), - (9, 'h', '2011-05-05 22:32:10'); - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; - DROP TABLE ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES; - eval $CHILD2_1_SELECT_TABLES2; - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_3 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_3_SELECT_TABLES; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - if ($USE_CHILD_GROUP3) - { - if (!$OUTPUT_CHILD_GROUP3) - { - --disable_query_log - --disable_result_log - } - --connection child3_1 - --disable_warnings - eval $CHILD3_1_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_2 - --disable_warnings - eval $CHILD3_2_DROP_TABLES_HA_P_2_1; - --enable_warnings - --connection child3_3 - --disable_warnings - eval $CHILD3_3_DROP_TABLES_HA_P_2_1; - --enable_warnings - if (!$OUTPUT_CHILD_GROUP3) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo deinit --disable_warnings diff --git a/storage/spider/mysql-test/spider/t/ha_part.test b/storage/spider/mysql-test/spider/t/ha_part.test new file mode 100644 index 00000000000..72ddcfd1f10 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/ha_part.test @@ -0,0 +1,1017 @@ +# This test tests for ha features +if ($USE_HA_TEST) +{ +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source ha_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source ha_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; + CREATE DATABASE auto_test_remote3; + USE auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + --connection child2_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} +if ($USE_CHILD_GROUP3) +{ + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + SELECT 1; + --connection child3_2 + SELECT 1; + --connection child3_3 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_DROP_TABLES; + } + --disable_warnings + eval $CHILD2_3_HA_DROP_TABLES; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_HA_CREATE_TABLES; + } + eval $CHILD2_3_HA_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_RECOVERY_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_COPY_TABLES_P_2_1; + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +if ($HAVE_PARTITION) +{ + --echo + --echo create table with partition test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES; + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES; + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES; + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_3_DROP_TABLES; + echo CHILD2_3_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_3_DROP_TABLES; + --enable_warnings + eval $CHILD2_3_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_1_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_2_CREATE_TABLES_HA_AS_P_2_1; + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + eval $CHILD3_3_CREATE_TABLES_HA_AS_P_2_1; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_HA_AS_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_HA_AS_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + + --echo + --echo select test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo fail-over test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_DROP_TABLES2; + } + --disable_warnings + eval $CHILD2_1_HA_AS_DROP_TABLES2; + --enable_warnings + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_CHECK_HA_STATUS; + --error 12511 + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + eval $MASTER_1_CHECK_LINK_STATUS; + eval $MASTER_1_CHECK_LINK_FAILED_LOG; + eval $MASTER_1_CHECK_HA_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (6, 'e', '2011-05-05 20:04:05'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_CHECK_LINK_STATUS; + eval $CHILD3_1_CHECK_LINK_FAILED_LOG; + --connection child3_2 + eval $CHILD3_2_CHECK_LINK_STATUS; + eval $CHILD3_2_CHECK_LINK_FAILED_LOG; + --connection child3_3 + eval $CHILD3_3_CHECK_LINK_STATUS; + eval $CHILD3_3_CHECK_LINK_FAILED_LOG; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + + --echo + --echo recovery test + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_HA_AS_CREATE_TABLES2; + } + eval $CHILD2_1_HA_AS_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_3 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + eval $CHILD3_1_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_1_CHECK_LINK_STATUS; + --connection child3_2 + eval $CHILD3_2_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_2_CHECK_LINK_STATUS; + --connection child3_3 + eval $CHILD3_3_SET_OK_STATUS_AS_P_2_1; + eval $CHILD3_3_CHECK_LINK_STATUS; + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + eval $MASTER_1_SET_OK_STATUS_AS_P_2_1; + eval $MASTER_1_CHECK_LINK_STATUS; + INSERT INTO ta_l2 (a, b, c) VALUES + (8, 'g', '2011-05-05 21:33:30'), + (9, 'h', '2011-05-05 22:32:10'); + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a; + DROP TABLE ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES; + eval $CHILD2_1_SELECT_TABLES2; + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_3 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_3_SELECT_TABLES; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + if ($USE_CHILD_GROUP3) + { + if (!$OUTPUT_CHILD_GROUP3) + { + --disable_query_log + --disable_result_log + } + --connection child3_1 + --disable_warnings + eval $CHILD3_1_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_2 + --disable_warnings + eval $CHILD3_2_DROP_TABLES_HA_P_2_1; + --enable_warnings + --connection child3_3 + --disable_warnings + eval $CHILD3_3_DROP_TABLES_HA_P_2_1; + --enable_warnings + if (!$OUTPUT_CHILD_GROUP3) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + --connection child2_3 + DROP DATABASE IF EXISTS auto_test_remote3; +} +if ($USE_CHILD_GROUP3) +{ + --connection child3_1 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_2 + DROP DATABASE IF EXISTS auto_test_local; + --connection child3_3 + DROP DATABASE IF EXISTS auto_test_local; +} +--disable_query_log +--disable_result_log +--source ha_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +} +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/spider3_fixes.test b/storage/spider/mysql-test/spider/t/spider3_fixes.test index 4139f3af955..7530ce97837 100644 --- a/storage/spider/mysql-test/spider/t/spider3_fixes.test +++ b/storage/spider/mysql-test/spider/t/spider3_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider 3.0's bug fixes
---let $SKIP_REASON=
source include/have_log_bin.inc;
--disable_warnings
--disable_query_log
@@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) }
--enable_warnings
-if ($SKIP_REASON)
-{
- --echo deinit
- --disable_warnings
- --connection master_1
- DROP DATABASE IF EXISTS auto_test_local;
- if ($USE_REPLICATION)
- {
- --connection slave1_1
- DROP DATABASE IF EXISTS auto_test_local;
- }
- if ($USE_CHILD_GROUP2)
- {
- --connection child2_1
- DROP DATABASE IF EXISTS auto_test_remote;
- --connection child2_2
- DROP DATABASE IF EXISTS auto_test_remote2;
- }
- --disable_query_log
- --disable_result_log
- --source slave_test_deinit.inc
- --source test_deinit.inc
- --enable_result_log
- --enable_query_log
- --enable_warnings
- --skip $SKIP_REASON
-}
-
--echo
--echo test select 1
--connection master_1
@@ -293,255 +264,6 @@ if ($USE_CHILD_GROUP2) }
---echo auto_increment with partition
-if ($HAVE_PARTITION)
-{
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_DROP_INCREMENT_TABLES1;
- echo CHILD2_1_CREATE_INCREMENT_TABLES1;
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_1_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- --connection child2_2
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_DROP_INCREMENT_TABLES1;
- echo CHILD2_2_CREATE_INCREMENT_TABLES1;
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
- }
- --disable_warnings
- eval $CHILD2_2_DROP_INCREMENT_TABLES1;
- --enable_warnings
- eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if ($USE_GENERAL_LOG)
- {
- TRUNCATE TABLE mysql.general_log;
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
- --connection master_1
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- --disable_query_log
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
- echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
- echo MASTER_1_AUTO_INCREMENT_OFFSET2;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
- eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
- if ($USE_REPLICATION)
- {
- SET SESSION sql_log_bin= 1;
- --connection slave1_1
- --disable_warnings
- DROP TABLE IF EXISTS t1, t2;
- --enable_warnings
- echo CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- echo CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t1 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- eval CREATE TABLE t2 (
- id int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (id)
- ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
- --connection master_1
- }
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 (id) VALUES (null);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- TRUNCATE TABLE t1;
- TRUNCATE TABLE t2;
- INSERT INTO t1 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t1 ORDER BY id;
- INSERT INTO t2 () VALUES (),(),(),();
- SELECT LAST_INSERT_ID();
- SELECT id FROM t2 ORDER BY id;
- SET INSERT_ID=5000;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET3;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
- --enable_query_log
- INSERT INTO t1 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- --disable_query_log
- echo MASTER_1_AUTO_INCREMENT_OFFSET4;
- eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
- --enable_query_log
- INSERT INTO t2 () VALUES ();
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- INSERT INTO t1 (id) VALUES (10000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t1;
- INSERT INTO t2 (id) VALUES (1000);
- SELECT LAST_INSERT_ID();
- SELECT MAX(id) FROM t2;
- if ($USE_REPLICATION)
- {
- save_master_pos;
- --connection slave1_1
- sync_with_master;
- SELECT id FROM t1 ORDER BY id;
- --connection master_1
- --disable_query_log
- SET SESSION sql_log_bin= 0;
- --enable_query_log
- }
- if ($USE_CHILD_GROUP2)
- {
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- --disable_result_log
- }
- --connection child2_1
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- --connection child2_2
- if ($USE_GENERAL_LOG)
- {
- SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
- }
- eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --disable_query_log
- echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
- }
- eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
- eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
- if ($OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- }
- if (!$OUTPUT_CHILD_GROUP2)
- {
- --enable_query_log
- --enable_result_log
- }
- }
-}
-
-
--echo
--echo deinit
--disable_warnings
diff --git a/storage/spider/mysql-test/spider/t/spider3_fixes_part.test b/storage/spider/mysql-test/spider/t/spider3_fixes_part.test new file mode 100644 index 00000000000..f25f000d80c --- /dev/null +++ b/storage/spider/mysql-test/spider/t/spider3_fixes_part.test @@ -0,0 +1,345 @@ +# This test tests for Spider 3.0's bug fixes
+source include/have_log_bin.inc;
+--disable_warnings
+--disable_query_log
+--disable_result_log
+--source test_init.inc
+--source slave_test_init.inc
+--enable_result_log
+--enable_query_log
+if (!$HAVE_PARTITION)
+{
+ --disable_query_log
+ --disable_result_log
+ --source slave_test_deinit.inc
+ --source test_deinit.inc
+ --enable_result_log
+ --enable_query_log
+ --enable_warnings
+ skip Test requires partitioning;
+}
+
+--echo
+--echo drop and create databases
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+CREATE DATABASE auto_test_local;
+USE auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+ CREATE DATABASE auto_test_local;
+ USE auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ CREATE DATABASE auto_test_remote;
+ USE auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+ CREATE DATABASE auto_test_remote2;
+ USE auto_test_remote2;
+}
+--enable_warnings
+
+--echo
+--echo test select 1
+--connection master_1
+SELECT 1;
+if ($USE_CHILD_GROUP2)
+{
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ SELECT 1;
+ --connection child2_2
+ SELECT 1;
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+}
+
+
+--echo auto_increment with partition
+if ($HAVE_PARTITION)
+{
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_DROP_INCREMENT_TABLES1;
+ echo CHILD2_1_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_1_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_1_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ --connection child2_2
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_DROP_INCREMENT_TABLES1;
+ echo CHILD2_2_CREATE_INCREMENT_TABLES1;
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ }
+ --disable_warnings
+ eval $CHILD2_2_DROP_INCREMENT_TABLES1;
+ --enable_warnings
+ eval $CHILD2_2_CREATE_INCREMENT_TABLES1;
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET2;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if ($USE_GENERAL_LOG)
+ {
+ TRUNCATE TABLE mysql.general_log;
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+ --connection master_1
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ --disable_query_log
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1;
+ echo MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ echo MASTER_1_AUTO_INCREMENT_OFFSET2;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1;
+ eval $MASTER_1_AUTO_INCREMENT_INCREMENT2;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET2;
+ if ($USE_REPLICATION)
+ {
+ SET SESSION sql_log_bin= 1;
+ --connection slave1_1
+ --disable_warnings
+ DROP TABLE IF EXISTS t1, t2;
+ --enable_warnings
+ echo CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ echo CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t1 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ eval CREATE TABLE t2 (
+ id int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (id)
+ ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1;
+ --connection master_1
+ }
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 (id) VALUES (null);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ TRUNCATE TABLE t1;
+ TRUNCATE TABLE t2;
+ INSERT INTO t1 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t1 ORDER BY id;
+ INSERT INTO t2 () VALUES (),(),(),();
+ SELECT LAST_INSERT_ID();
+ SELECT id FROM t2 ORDER BY id;
+ SET INSERT_ID=5000;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET3;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET3;
+ --enable_query_log
+ INSERT INTO t1 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ --disable_query_log
+ echo MASTER_1_AUTO_INCREMENT_OFFSET4;
+ eval $MASTER_1_AUTO_INCREMENT_OFFSET4;
+ --enable_query_log
+ INSERT INTO t2 () VALUES ();
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ INSERT INTO t1 (id) VALUES (10000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t1;
+ INSERT INTO t2 (id) VALUES (1000);
+ SELECT LAST_INSERT_ID();
+ SELECT MAX(id) FROM t2;
+ if ($USE_REPLICATION)
+ {
+ save_master_pos;
+ --connection slave1_1
+ sync_with_master;
+ SELECT id FROM t1 ORDER BY id;
+ --connection master_1
+ --disable_query_log
+ SET SESSION sql_log_bin= 0;
+ --enable_query_log
+ }
+ if ($USE_CHILD_GROUP2)
+ {
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ --disable_result_log
+ }
+ --connection child2_1
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_1_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_1_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ --connection child2_2
+ if ($USE_GENERAL_LOG)
+ {
+ SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %';
+ }
+ eval $CHILD2_2_SELECT_INCREMENT_TABLES1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --disable_query_log
+ echo CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ echo CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ }
+ eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1;
+ eval $CHILD2_2_AUTO_INCREMENT_OFFSET1;
+ if ($OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ }
+ if (!$OUTPUT_CHILD_GROUP2)
+ {
+ --enable_query_log
+ --enable_result_log
+ }
+ }
+}
+
+
+--echo
+--echo deinit
+--disable_warnings
+--connection master_1
+DROP DATABASE IF EXISTS auto_test_local;
+if ($USE_REPLICATION)
+{
+ --connection slave1_1
+ DROP DATABASE IF EXISTS auto_test_local;
+}
+if ($USE_CHILD_GROUP2)
+{
+ --connection child2_1
+ DROP DATABASE IF EXISTS auto_test_remote;
+ --connection child2_2
+ DROP DATABASE IF EXISTS auto_test_remote2;
+}
+--disable_query_log
+--disable_result_log
+--source slave_test_deinit.inc
+--source test_deinit.inc
+--enable_result_log
+--enable_query_log
+--enable_warnings
+--echo
+--echo end of test
diff --git a/storage/spider/mysql-test/spider/t/spider_fixes.test b/storage/spider/mysql-test/spider/t/spider_fixes.test index b9ff61abcb4..04e806fb612 100644 --- a/storage/spider/mysql-test/spider/t/spider_fixes.test +++ b/storage/spider/mysql-test/spider/t/spider_fixes.test @@ -1,5 +1,4 @@ # This test tests for Spider's bug fixes ---let $SKIP_REASON= source include/have_log_bin.inc; --disable_warnings --disable_query_log @@ -35,34 +34,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_REPLICATION) - { - --connection slave1_1 - DROP DATABASE IF EXISTS auto_test_local; - } - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source slave_test_deinit.inc - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 @@ -760,216 +731,8 @@ if ($USE_CHILD_GROUP2) } } ---echo partition with sort -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 - ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.23 ---echo partition update with moving partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l2; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_TABLES; - echo CHILD2_2_CREATE_TABLES; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_TABLES2; - echo CHILD2_1_CREATE_TABLES2; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES2; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; - eval CREATE TABLE ta_l2 ( - a INT, - b CHAR(1), - c DATETIME, - PRIMARY KEY(a) - ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; - --enable_query_log - INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); - UPDATE ta_l2 SET a = 4 WHERE a = 3; - SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_2_SELECT_TABLES; - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; - SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; - } - eval $CHILD2_1_SELECT_TABLES2; - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo index merge if ($USE_CHILD_GROUP2) { @@ -1058,121 +821,6 @@ if ($USE_CHILD_GROUP2) } } ---echo index merge with partition -if ($HAVE_PARTITION) -{ - --connection master_1 - --disable_warnings - DROP TABLE IF EXISTS ta_l_int; - --enable_warnings - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_result_log - } - --disable_query_log - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_2_DROP_TABLES5; - echo CHILD2_2_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_2_DROP_TABLES5; - --enable_warnings - eval $CHILD2_2_CREATE_TABLES5; - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - echo CHILD2_1_DROP_TABLES5; - echo CHILD2_1_CREATE_TABLES5; - } - --disable_warnings - eval $CHILD2_1_DROP_TABLES5; - --enable_warnings - eval $CHILD2_1_CREATE_TABLES5; - --enable_query_log - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_result_log - } - } - --connection master_1 - --disable_query_log - echo CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; - eval CREATE TABLE ta_l_int ( - a INT AUTO_INCREMENT, - b INT DEFAULT 10, - c INT DEFAULT 11, - PRIMARY KEY(a), - KEY idx1(b), - KEY idx2(c) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; - --enable_query_log - INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); - INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; - INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) - WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - --echo --echo 2.24 --echo index scan update without PK @@ -1220,7 +868,7 @@ if (!$MASTER_1_NEEDPK) --enable_query_log SELECT a, b, c FROM ta_l_int ORDER BY a; INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3); -INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); +INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3); if ($USE_CHILD_GROUP2) { if (!$OUTPUT_CHILD_GROUP2) @@ -1515,202 +1163,6 @@ if ($USE_CHILD_GROUP2) --echo ---echo auto_increment with partition -if ($HAVE_PARTITION) -{ - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_DROP_INCREMENT_TABLES1; - echo CHILD2_1_CREATE_INCREMENT_TABLES1; - echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_1_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_1_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_1_CREATE_INCREMENT_TABLES1; - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - --connection child2_2 - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_DROP_INCREMENT_TABLES1; - echo CHILD2_2_CREATE_INCREMENT_TABLES1; - echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; - echo CHILD2_2_AUTO_INCREMENT_OFFSET2; - } - --disable_warnings - eval $CHILD2_2_DROP_INCREMENT_TABLES1; - --enable_warnings - eval $CHILD2_2_CREATE_INCREMENT_TABLES1; - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if ($USE_GENERAL_LOG) - { - TRUNCATE TABLE mysql.general_log; - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } - --connection master_1 - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - --disable_query_log - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; - echo MASTER_1_AUTO_INCREMENT_INCREMENT2; - echo MASTER_1_AUTO_INCREMENT_OFFSET2; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; - eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; - eval $MASTER_1_AUTO_INCREMENT_OFFSET2; - if ($USE_REPLICATION) - { - SET SESSION sql_log_bin= 1; - --connection slave1_1 - --disable_warnings - DROP TABLE IF EXISTS t1; - --enable_warnings - echo CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; - eval CREATE TABLE t1 ( - id int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (id) - ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; - --connection master_1 - } - --enable_query_log - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (null); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 () VALUES (),(),(),(); - SELECT LAST_INSERT_ID(); - SELECT id FROM t1 ORDER BY id; - SET INSERT_ID=5000; - INSERT INTO t1 () VALUES (); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (10000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - INSERT INTO t1 (id) VALUES (1000); - SELECT LAST_INSERT_ID(); - SELECT MAX(id) FROM t1; - if ($USE_REPLICATION) - { - save_master_pos; - --connection slave1_1 - sync_with_master; - SELECT id FROM t1 ORDER BY id; - --connection master_1 - --disable_query_log - SET SESSION sql_log_bin= 0; - --enable_query_log - } - if ($USE_CHILD_GROUP2) - { - if (!$OUTPUT_CHILD_GROUP2) - { - --disable_query_log - --disable_result_log - } - --connection child2_1 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_1_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_1_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - --connection child2_2 - if ($USE_GENERAL_LOG) - { - SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; - } - eval $CHILD2_2_SELECT_INCREMENT_TABLES1; - if ($OUTPUT_CHILD_GROUP2) - { - --disable_query_log - echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; - echo CHILD2_2_AUTO_INCREMENT_OFFSET1; - } - eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; - eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; - if ($OUTPUT_CHILD_GROUP2) - { - --enable_query_log - } - if (!$OUTPUT_CHILD_GROUP2) - { - --enable_query_log - --enable_result_log - } - } -} - - ---echo --echo read only let $MASTER_1_ENGINE_IS_SPIDER= `SELECT IF('$MASTER_1_ENGINE_TYPE' = 'Spider' OR diff --git a/storage/spider/mysql-test/spider/t/spider_fixes_part.test b/storage/spider/mysql-test/spider/t/spider_fixes_part.test new file mode 100644 index 00000000000..ef5a8026c02 --- /dev/null +++ b/storage/spider/mysql-test/spider/t/spider_fixes_part.test @@ -0,0 +1,645 @@ +# This test tests for Spider's bug fixes +source include/have_log_bin.inc; +--disable_warnings +--disable_query_log +--disable_result_log +--source test_init.inc +--source slave_test_init.inc +--enable_result_log +--enable_query_log +if (!$HAVE_PARTITION) +{ + --disable_query_log + --disable_result_log + --source slave_test_deinit.inc + --source test_deinit.inc + --enable_result_log + --enable_query_log + --enable_warnings + skip Test requires partitioning; +} + +--echo +--echo drop and create databases +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +CREATE DATABASE auto_test_local; +USE auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; + CREATE DATABASE auto_test_local; + USE auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + CREATE DATABASE auto_test_remote; + USE auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; + CREATE DATABASE auto_test_remote2; + USE auto_test_remote2; +} +--enable_warnings + +--echo +--echo test select 1 +--connection master_1 +SELECT 1; +if ($USE_CHILD_GROUP2) +{ + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + SELECT 1; + --connection child2_2 + SELECT 1; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } +} + +--connection master_1 +--disable_warnings +DROP TABLE IF EXISTS tb_l; +--enable_warnings +--disable_query_log +echo CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) MASTER_1_ENGINE2 MASTER_1_CHARSET2; +eval CREATE TABLE tb_l ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) +) $MASTER_1_ENGINE2 $MASTER_1_CHARSET2; +--enable_query_log +INSERT INTO tb_l (a, b, c) VALUES + (1, 'a', '2008-08-01 10:21:39'), + (2, 'b', '2000-01-01 00:00:00'), + (3, 'e', '2007-06-04 20:03:11'), + (4, 'd', '2003-11-30 05:01:03'), + (5, 'c', '2001-12-31 23:59:59'); + +--echo +--echo 2.17 +--echo partition with sort +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 SELECT a, b, c FROM tb_l; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 WHERE a > 1 + ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo +--echo 2.23 +--echo partition update with moving partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l2; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_TABLES; + echo CHILD2_2_CREATE_TABLES; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_TABLES2; + echo CHILD2_1_CREATE_TABLES2; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES2; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) MASTER_1_ENGINE MASTER_1_COMMENT2_P_2_1; + eval CREATE TABLE ta_l2 ( + a INT, + b CHAR(1), + c DATETIME, + PRIMARY KEY(a) + ) $MASTER_1_ENGINE $MASTER_1_COMMENT2_P_2_1; + --enable_query_log + INSERT INTO ta_l2 (a, b, c) VALUES (3, 'B', '2010-09-26 00:00:00'); + UPDATE ta_l2 SET a = 4 WHERE a = 3; + SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_2_SELECT_TABLES; + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%update %'; + SELECT argument FROM mysql.general_log WHERE argument LIKE '%delete %'; + } + eval $CHILD2_1_SELECT_TABLES2; + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + +--echo index merge with partition +if ($HAVE_PARTITION) +{ + --connection master_1 + --disable_warnings + DROP TABLE IF EXISTS ta_l_int; + --enable_warnings + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_result_log + } + --disable_query_log + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_2_DROP_TABLES5; + echo CHILD2_2_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_2_DROP_TABLES5; + --enable_warnings + eval $CHILD2_2_CREATE_TABLES5; + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + echo CHILD2_1_DROP_TABLES5; + echo CHILD2_1_CREATE_TABLES5; + } + --disable_warnings + eval $CHILD2_1_DROP_TABLES5; + --enable_warnings + eval $CHILD2_1_CREATE_TABLES5; + --enable_query_log + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_result_log + } + } + --connection master_1 + --disable_query_log + echo CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT3_P_2_1; + eval CREATE TABLE ta_l_int ( + a INT AUTO_INCREMENT, + b INT DEFAULT 10, + c INT DEFAULT 11, + PRIMARY KEY(a), + KEY idx1(b), + KEY idx2(c) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT3_P_2_1; + --enable_query_log + INSERT INTO ta_l_int (a, b, c) VALUES (1, 2, 3); + INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int; + INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2) + WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a; + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo 2.26 +--echo auto_increment with partition +if ($HAVE_PARTITION) +{ + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_DROP_INCREMENT_TABLES1; + echo CHILD2_1_CREATE_INCREMENT_TABLES1; + echo CHILD2_1_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_1_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_1_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_1_CREATE_INCREMENT_TABLES1; + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + --connection child2_2 + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_DROP_INCREMENT_TABLES1; + echo CHILD2_2_CREATE_INCREMENT_TABLES1; + echo CHILD2_2_AUTO_INCREMENT_INCREMENT2; + echo CHILD2_2_AUTO_INCREMENT_OFFSET2; + } + --disable_warnings + eval $CHILD2_2_DROP_INCREMENT_TABLES1; + --enable_warnings + eval $CHILD2_2_CREATE_INCREMENT_TABLES1; + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT2; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET2; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if ($USE_GENERAL_LOG) + { + TRUNCATE TABLE mysql.general_log; + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } + --connection master_1 + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + --disable_query_log + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_INCREMENT1_P_1; + echo MASTER_1_AUTO_INCREMENT_INCREMENT2; + echo MASTER_1_AUTO_INCREMENT_OFFSET2; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_INCREMENT1_P_1; + eval $MASTER_1_AUTO_INCREMENT_INCREMENT2; + eval $MASTER_1_AUTO_INCREMENT_OFFSET2; + if ($USE_REPLICATION) + { + SET SESSION sql_log_bin= 1; + --connection slave1_1 + --disable_warnings + DROP TABLE IF EXISTS t1; + --enable_warnings + echo CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) SLAVE1_1_ENGINE SLAVE1_1_CHARSET SLAVE1_1_COMMENT_INCREMENT1_P_1; + eval CREATE TABLE t1 ( + id int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (id) + ) $SLAVE1_1_ENGINE $SLAVE1_1_CHARSET $SLAVE1_1_COMMENT_INCREMENT1_P_1; + --connection master_1 + } + --enable_query_log + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (null); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 () VALUES (),(),(),(); + SELECT LAST_INSERT_ID(); + SELECT id FROM t1 ORDER BY id; + SET INSERT_ID=5000; + INSERT INTO t1 () VALUES (); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (10000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + INSERT INTO t1 (id) VALUES (1000); + SELECT LAST_INSERT_ID(); + SELECT MAX(id) FROM t1; + if ($USE_REPLICATION) + { + save_master_pos; + --connection slave1_1 + sync_with_master; + SELECT id FROM t1 ORDER BY id; + --connection master_1 + --disable_query_log + SET SESSION sql_log_bin= 0; + --enable_query_log + } + if ($USE_CHILD_GROUP2) + { + if (!$OUTPUT_CHILD_GROUP2) + { + --disable_query_log + --disable_result_log + } + --connection child2_1 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_1_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_1_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_1_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_1_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_1_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + --connection child2_2 + if ($USE_GENERAL_LOG) + { + SELECT argument FROM mysql.general_log WHERE argument LIKE '%insert %'; + } + eval $CHILD2_2_SELECT_INCREMENT_TABLES1; + if ($OUTPUT_CHILD_GROUP2) + { + --disable_query_log + echo CHILD2_2_AUTO_INCREMENT_INCREMENT1; + echo CHILD2_2_AUTO_INCREMENT_OFFSET1; + } + eval $CHILD2_2_AUTO_INCREMENT_INCREMENT1; + eval $CHILD2_2_AUTO_INCREMENT_OFFSET1; + if ($OUTPUT_CHILD_GROUP2) + { + --enable_query_log + } + if (!$OUTPUT_CHILD_GROUP2) + { + --enable_query_log + --enable_result_log + } + } +} + + +--echo +--echo deinit +--disable_warnings +--connection master_1 +DROP DATABASE IF EXISTS auto_test_local; +if ($USE_REPLICATION) +{ + --connection slave1_1 + DROP DATABASE IF EXISTS auto_test_local; +} +if ($USE_CHILD_GROUP2) +{ + --connection child2_1 + DROP DATABASE IF EXISTS auto_test_remote; + --connection child2_2 + DROP DATABASE IF EXISTS auto_test_remote2; +} +--disable_query_log +--disable_result_log +--source slave_test_deinit.inc +--source test_deinit.inc +--enable_result_log +--enable_query_log +--enable_warnings +--echo +--echo end of test diff --git a/storage/spider/mysql-test/spider/t/vp_fixes.test b/storage/spider/mysql-test/spider/t/vp_fixes.test index 46e7b0afc36..90380227040 100644 --- a/storage/spider/mysql-test/spider/t/vp_fixes.test +++ b/storage/spider/mysql-test/spider/t/vp_fixes.test @@ -1,5 +1,4 @@ # This test tests for VP's bug fixes ---let $SKIP_REASON= --disable_warnings --disable_query_log --disable_result_log @@ -26,28 +25,6 @@ if ($USE_CHILD_GROUP2) } --enable_warnings -if ($SKIP_REASON) -{ - --echo deinit - --disable_warnings - --connection master_1 - DROP DATABASE IF EXISTS auto_test_local; - if ($USE_CHILD_GROUP2) - { - --connection child2_1 - DROP DATABASE IF EXISTS auto_test_remote; - --connection child2_2 - DROP DATABASE IF EXISTS auto_test_remote2; - } - --disable_query_log - --disable_result_log - --source test_deinit.inc - --enable_result_log - --enable_query_log - --enable_warnings - --skip $SKIP_REASON -} - --echo --echo test select 1 --connection master_1 diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index bb94928bfe3..3f67d1f5edf 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -1696,13 +1696,13 @@ int spider_parse_connect_info( partition_element *sub_elem; #endif DBUG_ENTER("spider_parse_connect_info"); +#ifdef WITH_PARTITION_STORAGE_ENGINE #if MYSQL_VERSION_ID < 50500 DBUG_PRINT("info",("spider partition_info=%s", table_share->partition_info)); #else DBUG_PRINT("info",("spider partition_info=%s", table_share->partition_info_str)); #endif -#ifdef WITH_PARTITION_STORAGE_ENGINE DBUG_PRINT("info",("spider part_info=%p", part_info)); #endif DBUG_PRINT("info",("spider s->db=%s", table_share->db.str)); |