1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '10.6' into 10.9

This commit is contained in:
Oleksandr Byelkin
2023-08-04 08:01:06 +02:00
858 changed files with 12277 additions and 6177 deletions

View File

@@ -889,7 +889,9 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT found_rows();
--enable_ps2_protocol
--echo
--echo select high_priority

View File

@@ -126,6 +126,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT COUNT(*) FROM ta_l;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
@@ -137,6 +138,7 @@ SELECT MAX(a) FROM ta_l WHERE a < 5;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MIN(a) FROM ta_l WHERE a > 1;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)

View File

@@ -132,6 +132,7 @@ if ($HAVE_PARTITION)
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
--enable_query_log
--disable_ps2_protocol
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT COUNT(*) FROM ta_l2;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
@@ -143,6 +144,7 @@ if ($HAVE_PARTITION)
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MIN(a) FROM ta_l2 WHERE a > 1;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)

View File

@@ -477,7 +477,9 @@ if ($USE_CHILD_GROUP3)
}
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHANGE_HA_MON;
--enable_ps2_protocol
--echo
--echo active standby test
@@ -841,7 +843,9 @@ if ($USE_CHILD_GROUP3)
}
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHANGE_HA_MON;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -152,8 +152,10 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a < 5 ORDER BY a DESC LIMIT 3;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -194,8 +196,10 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a <= 5 ORDER BY a DESC LIMIT 3;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -917,7 +921,9 @@ SELECT a, b, c FROM ta_l_int ORDER BY a;
--echo direct order limit
--connection master_1
eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS;
--disable_ps2_protocol
SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3;
--enable_ps2_protocol
eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS;

View File

@@ -1 +1,2 @@
wait_timeout : MDEV-26045
mdev_29904 : MDEV-31101

View File

@@ -85,9 +85,7 @@ DROP FUNCTION spider_copy_tables;
DROP FUNCTION spider_ping_table;
DROP FUNCTION spider_bg_direct_sql;
DROP FUNCTION spider_direct_sql;
UNINSTALL PLUGIN spider_wrapper_protocols;
UNINSTALL PLUGIN spider_alloc_mem;
UNINSTALL PLUGIN spider;
UNINSTALL SONAME IF EXISTS "ha_spider";
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
DROP TABLE IF EXISTS mysql.spider_xa;

View File

@@ -1,14 +1,13 @@
#
# MDEV-26541 Undefined symbol: _ZTI12ha_partition when attempting to use ha_spider.so in UBSAN builds
#
INSTALL PLUGIN spider SONAME 'ha_spider.so';
INSTALL SONAME 'ha_spider.so';
DROP FUNCTION spider_flush_table_mon_cache;
DROP FUNCTION spider_copy_tables;
DROP FUNCTION spider_ping_table;
DROP FUNCTION spider_bg_direct_sql;
DROP FUNCTION spider_direct_sql;
UNINSTALL PLUGIN spider_alloc_mem;
UNINSTALL PLUGIN spider;
UNINSTALL SONAME IF EXISTS "ha_spider";
DROP TABLE IF EXISTS mysql.spider_xa;
DROP TABLE IF EXISTS mysql.spider_xa_member;
DROP TABLE IF EXISTS mysql.spider_xa_failed_log;

View File

@@ -0,0 +1,33 @@
#
# MDEV-29447 SIGSEGV in spider_db_open_item_field and SIGSEGV spider_db_print_item_type, on SELECT
#
for master_1
for child2
child2_1
child2_2
child2_3
for child3
connection child2_1;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
CREATE TABLE tbl_a (
a INT
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
SELECT TRIM(LEADING 'c' FROM a) FROM tbl_a;
TRIM(LEADING 'c' FROM a)
connection child2_1;
DROP DATABASE auto_test_remote;
connection master_1;
DROP DATABASE auto_test_local;
for master_1
for child2
child2_1
child2_2
child2_3
for child3

View File

@@ -0,0 +1,12 @@
#
# MDEV-30981 Spider UBSAN: null pointer passed as argument 2, which is declared to never be null in spider_create_trx_alter_table on ALTER
#
for master_1
for child2
for child3
CREATE TABLE t (c INT) ENGINE=Spider PARTITION BY LIST (c) (PARTITION p VALUES IN (1,2));
ALTER TABLE t ENGINE=InnoDB;
drop table t;
for master_1
for child2
for child3

View File

@@ -0,0 +1,15 @@
#
# MDEV-31338 UBSAN: runtime error: member access within null pointer of type 'struct SPIDER_FIELD_CHAIN' and SIGSEGV in spider_db_open_item_ident on SELECT
#
for master_1
for child2
for child3
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (c BLOB) ENGINE=InnoDB;
CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
SELECT TRIM(BOTH ' ' FROM c) FROM ts ORDER BY c;
TRIM(BOTH ' ' FROM c)
drop table t, ts;
for master_1
for child2
for child3

View File

@@ -0,0 +1,50 @@
MDEV-31524 Spider variables that double as table params overriding mechanism is buggy
for master_1
for child2
for child3
SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
set session spider_read_only_mode = default;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 1 */ insert into t1 values (42);
drop table t1, t2;
set session spider_read_only_mode = 1;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 2 */ insert into t1 values (42);
ERROR HY000: Table 'test.t1' is read only
drop table t1, t2;
set session spider_read_only_mode = -1;
Warnings:
Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 3 */ insert into t1 values (42);
drop table t1, t2;
SET session spider_read_only_mode = default;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 4 */ insert into t1 values (42);
ERROR HY000: Table 'test.t1' is read only
drop table t1, t2;
set session spider_read_only_mode = 1;
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "0", WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 5 */ insert into t1 values (42);
drop table t1, t2;
SET session spider_read_only_mode = -1;
Warnings:
Warning 138 The option value -1 (use table value) is deprecated and will be removed in a future release
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "srv_mdev_31524",TABLE "t2"';
/* 6 */ insert into t1 values (42);
ERROR HY000: Table 'test.t1' is read only
drop table t1, t2;
drop server srv_mdev_31524;
SET session spider_read_only_mode = @old_spider_read_only_mode;
for master_1
for child2
for child3

View File

@@ -50,7 +50,7 @@ pkey
connection child2_1;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%sql_mode%';
argument
set session transaction isolation level repeatable read;set session autocommit = 1;set session sql_log_off = 0;set session wait_timeout = 604800;set session sql_mode = 'real_as_float,ignore_bad_table_options,no_unsigned_subtraction,no_dir_in_create,no_auto_value_on_zero,strict_trans_tables,strict_all_tables,no_zero_in_date,no_zero_date,allow_invalid_dates,error_for_division_by_zero,no_auto_create_user,high_not_precedence,no_engine_substitution,pad_char_to_full_length,empty_string_is_null,simultaneous_assignment,time_round_fractional';set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-';start transaction
set session transaction isolation level repeatable read;set session autocommit = 1;set session sql_log_off = 0;set session wait_timeout = 604800;set session sql_mode = 'real_as_float,ignore_bad_table_options,no_unsigned_subtraction,no_dir_in_create,no_auto_value_on_zero,strict_trans_tables,strict_all_tables,no_zero_in_date,no_zero_date,allow_invalid_dates,error_for_division_by_zero,no_auto_create_user,high_not_precedence,no_engine_substitution,pad_char_to_full_length,empty_string_is_null,simultaneous_assignment,time_round_fractional';set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-'
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%sql_mode%'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey

View File

@@ -50,7 +50,7 @@ pkey
connection child2_1;
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%sql_mode%';
argument
set session transaction isolation level repeatable read;set session autocommit = 1;set session sql_log_off = 0;set session wait_timeout = 604800;set session sql_mode = 'real_as_float,ignore_bad_table_options,no_unsigned_subtraction,no_dir_in_create,no_auto_value_on_zero,strict_trans_tables,strict_all_tables,no_zero_in_date,no_zero_date,allow_invalid_dates,error_for_division_by_zero,no_auto_create_user,high_not_precedence,no_engine_substitution,pad_char_to_full_length';set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-';start transaction
set session transaction isolation level repeatable read;set session autocommit = 1;set session sql_log_off = 0;set session wait_timeout = 604800;set session sql_mode = 'real_as_float,ignore_bad_table_options,no_unsigned_subtraction,no_dir_in_create,no_auto_value_on_zero,strict_trans_tables,strict_all_tables,no_zero_in_date,no_zero_date,allow_invalid_dates,error_for_division_by_zero,no_auto_create_user,high_not_precedence,no_engine_substitution,pad_char_to_full_length';set session time_zone = '+00:00';set @`spider_lc_./auto_test_remote/tbl_a` = '-xxxxxxxxxxxx-xxxxx-./auto_test_local/tbl_a-'
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%sql_mode%'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey

View File

@@ -52,7 +52,9 @@ TRUNCATE TABLE mysql.general_log;
CHECKSUM TABLE tbl_a EXTENDED;
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--echo

View File

@@ -59,7 +59,9 @@ SET NAMES utf8;
--connection child2_1
SET NAMES cp932;
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
SET NAMES utf8;

View File

@@ -78,7 +78,9 @@ sync_with_master;
SET SESSION sql_log_bin= 0;
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--connection slave1_1

View File

@@ -19,7 +19,9 @@ eval CREATE TEMPORARY TABLE tmp_a (
) $MASTER_1_ENGINE2;
--enable_query_log
--disable_ps2_protocol
eval $DIRECT_SQL_COMMAND;
--enable_ps2_protocol
SELECT pkey FROM tmp_a;
--echo

View File

@@ -19,7 +19,9 @@ eval CREATE TEMPORARY TABLE tmp_a (
) $MASTER_1_ENGINE2;
--enable_query_log
--disable_ps2_protocol
eval $DIRECT_SQL_COMMAND;
--enable_ps2_protocol
SELECT pkey FROM tmp_a;
--echo

View File

@@ -66,6 +66,7 @@ TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SELECT skey, count(*) cnt FROM tbl_a GROUP BY skey ORDER BY cnt DESC, skey DESC LIMIT 5;
@@ -76,6 +77,7 @@ eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -79,7 +79,9 @@ INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FRO
INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FROM tbl_a WHERE skey = 5 AND dt > DATE_ADD('2012-12-01', INTERVAL -10 DAY));
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--echo

View File

@@ -63,6 +63,7 @@ TRUNCATE TABLE mysql.general_log;
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_ps2_protocol
SELECT * FROM tbl_a;
SELECT * FROM tbl_a WHERE pkey = 1;
SELECT * FROM tbl_a;
@@ -76,6 +77,7 @@ eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -57,6 +57,7 @@ INSERT INTO tbl_a (a, b, c) VALUES
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_ps2_protocol
SELECT a, b, c FROM tbl_a PARTITION (pt2) WHERE b = 'c';
SELECT a, b, c FROM tbl_a PARTITION (pt1,pt2);
SELECT a, b, c FROM tbl_a PARTITION (pt3) WHERE b = 'c';
@@ -65,9 +66,12 @@ SELECT a, b, c FROM tbl_a PARTITION (pt1) WHERE b = 'c';
SELECT a, b, c FROM tbl_a PARTITION (pt1,pt3);
SELECT a, b, c FROM tbl_a PARTITION (pt1) WHERE b = 'c';
SELECT a, b, c FROM tbl_a PARTITION (pt2,pt3);
--enable_ps2_protocol
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
--disable_ps_protocol
eval $CHILD2_1_SELECT_TABLES;
--enable_ps_protocol

View File

@@ -47,6 +47,7 @@ INSERT INTO tbl_a (val) VALUES (1);
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SELECT id, 0 AS const, val FROM tbl_a;
SELECT 1+2, id, 0 AS const, val, val+10, (SELECT tbl_a.val+1 FROM tbl_a) AS sq
@@ -60,6 +61,7 @@ FROM tbl_a GROUP BY val;
--connection child2_1
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -75,11 +75,15 @@ INSERT INTO tb_l (a, b, c) VALUES
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_ps2_protocol
SELECT STRAIGHT_JOIN b.a, b.b FROM tb_l a, tbl_a b WHERE a.a = b.a;
--enable_ps2_protocol
--connection child2_1
SET NAMES utf8;
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
--disable_ps_protocol
eval $CHILD2_1_SELECT_TABLES;
--enable_ps_protocol

View File

@@ -2,14 +2,14 @@
--echo # MDEV-26541 Undefined symbol: _ZTI12ha_partition when attempting to use ha_spider.so in UBSAN builds
--echo #
if (`select not(count(*)) from information_schema.system_variables where variable_name='have_sanitizer' and global_value="UBSAN"`)
if (`select not(count(*)) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "%UBSAN%"`)
{
--skip test needs to be run with UBSAN
}
# init spider
INSTALL PLUGIN spider SONAME 'ha_spider.so';
INSTALL SONAME 'ha_spider.so';
let $PLUGIN_NAME= spider_flush_table_mon_cache;
let $PLUGIN_EXIST=
@@ -20,21 +20,4 @@ while (!$PLUGIN_EXIST)
`SELECT COUNT(*) FROM mysql.func WHERE name = '$PLUGIN_NAME'`;
}
# deinit spider
DROP FUNCTION spider_flush_table_mon_cache;
DROP FUNCTION spider_copy_tables;
DROP FUNCTION spider_ping_table;
DROP FUNCTION spider_bg_direct_sql;
DROP FUNCTION spider_direct_sql;
UNINSTALL PLUGIN spider_alloc_mem;
UNINSTALL PLUGIN spider;
DROP TABLE IF EXISTS mysql.spider_xa;
DROP TABLE IF EXISTS mysql.spider_xa_member;
DROP TABLE IF EXISTS mysql.spider_xa_failed_log;
DROP TABLE IF EXISTS mysql.spider_tables;
DROP TABLE IF EXISTS mysql.spider_link_mon_servers;
DROP TABLE IF EXISTS mysql.spider_link_failed_log;
DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery;
DROP TABLE IF EXISTS mysql.spider_table_sts;
DROP TABLE IF EXISTS mysql.spider_table_crd;
--source ../../include/clean_up_spider.inc

View File

@@ -48,6 +48,7 @@ eval CREATE TABLE tbl_a (
KEY k (greeting)
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
--disable_ps2_protocol
INSERT INTO tbl_a VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
SELECT * FROM tbl_a WHERE greeting = "Aloha!"
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH
@@ -76,6 +77,7 @@ SELECT * FROM tbl_c WHERE greeting = "Aloha!"
--connection child2_1
SELECT argument FROM mysql.general_log WHERE argument LIKE 'select `id`,`greeting` from %';
--enable_ps2_protocol
--connection child2_1
SET @@global.general_log = @general_log_backup;

View File

@@ -0,0 +1,3 @@
!include include/default_mysqld.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf

View File

@@ -0,0 +1,37 @@
--echo #
--echo # MDEV-29447 SIGSEGV in spider_db_open_item_field and SIGSEGV spider_db_print_item_type, on SELECT
--echo #
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
--connection child2_1
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
eval CREATE TABLE tbl_a (
a INT
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
--connection master_1
CREATE DATABASE auto_test_local;
USE auto_test_local;
eval CREATE TABLE tbl_a (
a INT
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
SELECT TRIM(LEADING 'c' FROM a) FROM tbl_a;
--connection child2_1
DROP DATABASE auto_test_remote;
--connection master_1
DROP DATABASE auto_test_local;
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_query_log
--enable_result_log

View File

@@ -1,3 +1,4 @@
--source include/have_wsrep.inc
--echo #
--echo # MDEV-30370 mariadbd hangs when running with --wsrep-recover and --plugin-load-add=ha_spider.so
--echo #

View File

@@ -0,0 +1,24 @@
--echo #
--echo # MDEV-30981 Spider UBSAN: null pointer passed as argument 2, which is declared to never be null in spider_create_trx_alter_table on ALTER
--echo #
if (`select not(count(*)) from information_schema.system_variables where variable_name='have_sanitizer' and global_value like "%UBSAN%"`)
{
--skip test needs to be run with UBSAN
}
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
CREATE TABLE t (c INT) ENGINE=Spider PARTITION BY LIST (c) (PARTITION p VALUES IN (1,2));
ALTER TABLE t ENGINE=InnoDB;
drop table t;
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_query_log
--enable_result_log

View File

@@ -0,0 +1,22 @@
--echo #
--echo # MDEV-31338 UBSAN: runtime error: member access within null pointer of type 'struct SPIDER_FIELD_CHAIN' and SIGSEGV in spider_db_open_item_ident on SELECT
--echo #
--source include/have_innodb.inc
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (c BLOB) ENGINE=InnoDB;
CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';
SELECT TRIM(BOTH ' ' FROM c) FROM ts ORDER BY c;
drop table t, ts;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log

View File

@@ -0,0 +1,73 @@
--echo
--echo MDEV-31524 Spider variables that double as table params overriding mechanism is buggy
--echo
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
--let $srv=srv_mdev_31524
SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
# when the user does not set var nor the table option, the default
# value (0 in this case) takes effect.
set session spider_read_only_mode = default;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "t2"';
/* 1 */ insert into t1 values (42);
drop table t1, t2;
# when the user sets var but not the table option, the var should be
# take effect.
set session spider_read_only_mode = 1;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "t2"';
--error 12518
/* 2 */ insert into t1 values (42);
drop table t1, t2;
# when the user sets var to -1 and does not set the table option, the
# default value takes effect.
set session spider_read_only_mode = -1;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "$srv",TABLE "t2"';
/* 3 */ insert into t1 values (42);
drop table t1, t2;
# when the user does not set the var, but sets the table option, the
# table option should take effect
SET session spider_read_only_mode = default;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "$srv",TABLE "t2"';
--error 12518
/* 4 */ insert into t1 values (42);
drop table t1, t2;
# when the user sets both var and table option, the table option
# should take precedence
set session spider_read_only_mode = 1;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "0", WRAPPER "mysql", srv "$srv",TABLE "t2"';
/* 5 */ insert into t1 values (42);
drop table t1, t2;
# when the user sets the var to -1 and sets the table option, the
# table option should take effect
SET session spider_read_only_mode = -1;
create table t2 (c int);
eval create table t1 (c int) ENGINE=Spider COMMENT='read_only_mode "1", WRAPPER "mysql", srv "$srv",TABLE "t2"';
--error 12518
/* 6 */ insert into t1 values (42);
drop table t1, t2;
eval drop server $srv;
SET session spider_read_only_mode = @old_spider_read_only_mode;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log

View File

@@ -73,6 +73,7 @@ TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
@@ -135,6 +136,7 @@ eval $CHILD2_1_SELECT_TABLES;
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -73,6 +73,7 @@ TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
@@ -135,6 +136,7 @@ eval $CHILD2_1_SELECT_TABLES;
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -73,6 +73,7 @@ TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
@@ -135,6 +136,7 @@ eval $CHILD2_1_SELECT_TABLES;
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -74,6 +74,7 @@ TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
@@ -136,6 +137,7 @@ eval $CHILD2_1_SELECT_TABLES;
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -56,7 +56,9 @@ exec $MYSQL -v -v -u root -h localhost -P $MASTER_1_MYPORT -S $MASTER_1_MYSOCK -
--enable_query_log
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
TRUNCATE TABLE mysql.general_log;
@@ -67,7 +69,9 @@ exec $MYSQL -v -v -u root -h localhost -P $MASTER_1_MYPORT -S $MASTER_1_MYSOCK -
--enable_query_log
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
TRUNCATE TABLE mysql.general_log;
@@ -78,7 +82,9 @@ exec $MYSQL -v -v -u root -h localhost -P $MASTER_1_MYPORT -S $MASTER_1_MYSOCK -
--enable_query_log
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--echo

View File

@@ -58,7 +58,9 @@ exec $MYSQL -v -v -u root -h localhost --default-character-set=latin1 -P $MASTER
--enable_query_log
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--echo

View File

@@ -52,7 +52,9 @@ TRUNCATE TABLE mysql.general_log;
SELECT pkey FROM tbl_a WHERE NULL;
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--echo

View File

@@ -48,6 +48,7 @@ FLUSH TABLES;
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SET NAMES utf8;
SELECT `pkey`, LEFT(`txt_utf8`, 4) FROM `auto_test_local`.`tbl_a` ORDER BY LEFT(`txt_utf8`, 4) LIMIT 3;
@@ -56,6 +57,7 @@ SELECT `pkey`, LEFT(`txt_utf8`, 4) FROM `auto_test_local`.`tbl_a` ORDER BY LEFT(
SET NAMES utf8;
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -70,8 +70,11 @@ sync_with_master;
SET SESSION sql_log_bin= 0;
--connection child2_1
--disable_ps2_protocol
--replace_regex /-[0-9a-f]{12}-[0-9a-f]+-/-xxxxxxxxxxxx-xxxxx-/
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--connection slave1_1

View File

@@ -44,6 +44,7 @@ INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SELECT * FROM tbl_a ORDER BY pkey;
@@ -51,6 +52,7 @@ SELECT * FROM tbl_a ORDER BY pkey;
--replace_regex /-[0-9a-f]{12}-[0-9a-f]+-/-xxxxxxxxxxxx-xxxxx-/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -68,14 +68,20 @@ TRUNCATE TABLE mysql.general_log;
--connection master_1
FLUSH TABLES;
--disable_ps2_protocol
SELECT count(pkey) cnt, skey FROM tbl_a;
--enable_ps2_protocol
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--disable_ps2_protocol
eval $CHILD2_2_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_2_SELECT_TABLES;
--echo

View File

@@ -45,6 +45,7 @@ INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SELECT * FROM tbl_a ORDER BY pkey;
@@ -53,6 +54,7 @@ SELECT * FROM tbl_a ORDER BY pkey;
replace_regex /order by t0.`pkey`/order by `pkey`/;
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -49,7 +49,9 @@ XA PREPARE 'test';
XA COMMIT 'test';
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--echo

View File

@@ -60,6 +60,7 @@ INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29
--echo
--echo select test 1
--disable_ps2_protocol
--connection child2_1
TRUNCATE TABLE mysql.general_log;
LOCK TABLE tbl_a WRITE;
@@ -88,6 +89,7 @@ eval $CHILD2_2_SELECT_TABLES;
--connection master_1
reap;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -889,7 +889,9 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT found_rows();
--enable_ps2_protocol
--echo
--echo select high_priority

View File

@@ -126,6 +126,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT COUNT(*) FROM ta_l;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
@@ -137,6 +138,7 @@ SELECT MAX(a) FROM ta_l WHERE a < 5;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MIN(a) FROM ta_l WHERE a > 1;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)

View File

@@ -132,6 +132,7 @@ if ($HAVE_PARTITION)
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
--enable_query_log
--disable_ps2_protocol
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT COUNT(*) FROM ta_l2;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
@@ -143,6 +144,7 @@ if ($HAVE_PARTITION)
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MIN(a) FROM ta_l2 WHERE a > 1;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)

View File

@@ -477,7 +477,9 @@ if ($USE_CHILD_GROUP3)
}
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHANGE_HA_MON;
--enable_ps2_protocol
--echo
--echo active standby test
@@ -841,7 +843,9 @@ if ($USE_CHILD_GROUP3)
}
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHANGE_HA_MON;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -152,8 +152,10 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a < 5 ORDER BY a DESC LIMIT 3;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -194,8 +196,10 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a <= 5 ORDER BY a DESC LIMIT 3;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -916,10 +920,11 @@ SELECT a, b, c FROM ta_l_int ORDER BY a;
--echo 2.25
--echo direct order limit
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS;
SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3;
eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS;
--enable_ps2_protocol
--echo
--echo 2.26

View File

@@ -0,0 +1,15 @@
DROP FUNCTION spider_flush_table_mon_cache;
DROP FUNCTION spider_copy_tables;
DROP FUNCTION spider_ping_table;
DROP FUNCTION spider_bg_direct_sql;
DROP FUNCTION spider_direct_sql;
UNINSTALL SONAME IF EXISTS "ha_spider";
DROP TABLE IF EXISTS mysql.spider_xa;
DROP TABLE IF EXISTS mysql.spider_xa_member;
DROP TABLE IF EXISTS mysql.spider_xa_failed_log;
DROP TABLE IF EXISTS mysql.spider_tables;
DROP TABLE IF EXISTS mysql.spider_link_mon_servers;
DROP TABLE IF EXISTS mysql.spider_link_failed_log;
DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery;
DROP TABLE IF EXISTS mysql.spider_table_sts;
DROP TABLE IF EXISTS mysql.spider_table_crd;

View File

@@ -28,23 +28,7 @@ if (`SELECT IF($PLUGIN_VERSION = 3, 1, 0)`)
DROP TABLE IF EXISTS mysql.spider_rewritten_tables;
}
}
DROP FUNCTION spider_flush_table_mon_cache;
DROP FUNCTION spider_copy_tables;
DROP FUNCTION spider_ping_table;
DROP FUNCTION spider_bg_direct_sql;
DROP FUNCTION spider_direct_sql;
UNINSTALL PLUGIN spider_wrapper_protocols;
UNINSTALL PLUGIN spider_alloc_mem;
UNINSTALL PLUGIN spider;
DROP TABLE IF EXISTS mysql.spider_xa;
DROP TABLE IF EXISTS mysql.spider_xa_member;
DROP TABLE IF EXISTS mysql.spider_xa_failed_log;
DROP TABLE IF EXISTS mysql.spider_tables;
DROP TABLE IF EXISTS mysql.spider_link_mon_servers;
DROP TABLE IF EXISTS mysql.spider_link_failed_log;
DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery;
DROP TABLE IF EXISTS mysql.spider_table_sts;
DROP TABLE IF EXISTS mysql.spider_table_crd;
--source clean_up_spider.inc
if ($VERSION_COMPILE_OS_WIN)
{
if ($MASTER_1_MYPORT)

View File

@@ -49,7 +49,7 @@ Warnings:
Warning 1287 '@@spider_udf_ds_bulk_insert_rows' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE "spider_udf_ds_bulk_insert_rows";
Variable_name Value
spider_udf_ds_bulk_insert_rows -1
spider_udf_ds_bulk_insert_rows 3000
SET spider_udf_ds_table_loop_mode = 1;
Warnings:
Warning 1287 '@@spider_udf_ds_table_loop_mode' is deprecated and will be removed in a future release

View File

@@ -61,7 +61,9 @@ INSERT INTO tbl_b (bkey,akey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,4),(6,3),(
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_ps2_protocol
SELECT a.val, a.akey FROM tbl_a a, tbl_b b WHERE a.akey = b.akey AND b.bkey = 5;
--enable_ps2_protocol
--connection child2_1
--disable_ps_protocol

View File

@@ -61,7 +61,9 @@ INSERT INTO tbl_b (bkey,akey) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,4),(6,3),(
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_ps2_protocol
SELECT a.val, a.akey FROM tbl_a a, tbl_b b WHERE a.akey = b.akey AND b.bkey = 5;
--enable_ps2_protocol
--connection child2_1
--disable_ps_protocol

View File

@@ -41,7 +41,9 @@ eval CREATE TABLE tbl_a (
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
--disable_query_log
--echo SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
--disable_ps2_protocol
eval SELECT pkey,val INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
--enable_ps2_protocol
--enable_query_log
eval $COMMAND_BEFORE_LOAD_DATA;
@@ -54,12 +56,16 @@ TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_query_log
--echo LOAD DATA $OPTION_LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' $OPTION_WORD INTO TABLE tbl_a;
--disable_ps2_protocol
eval LOAD DATA $OPTION_LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' $OPTION_WORD INTO TABLE tbl_a;
--enable_ps2_protocol
--enable_query_log
--remove_file $MYSQLTEST_VARDIR/tmp/spider_outfile.tsv
--connection child2_1
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
--echo

View File

@@ -66,6 +66,7 @@ TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--disable_ps2_protocol
--connection master_1
SELECT skey, count(*) cnt FROM tbl_a GROUP BY skey ORDER BY cnt DESC, skey DESC LIMIT 5;
@@ -76,6 +77,7 @@ eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -54,7 +54,9 @@ eval CREATE TABLE tbl_a (
INSERT INTO tbl_a (pkey,val) VALUES (0,0),(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
--disable_query_log
--echo SELECT pkey,val INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
--disable_ps_protocol
eval SELECT pkey,val INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' FROM tbl_a ORDER BY pkey;
--enable_ps2_protocol
--enable_query_log
eval $COMMAND_BEFORE_LOAD_DATA;
@@ -70,10 +72,13 @@ TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_query_log
--echo LOAD DATA $OPTION_LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' $OPTION_WORD INTO TABLE tbl_a;
--disable_ps2_protocol
eval LOAD DATA $OPTION_LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/spider_outfile.tsv' $OPTION_WORD INTO TABLE tbl_a;
--enable_ps2_protocol
--enable_query_log
--remove_file $MYSQLTEST_VARDIR/tmp/spider_outfile.tsv
--disable_ps2_protocol
--connection child2_1
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
@@ -81,6 +86,7 @@ eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -144,6 +144,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT * FROM tbl_a;
if ($USE_CHILD_GROUP2)
{
@@ -164,6 +165,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -889,7 +889,9 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT found_rows();
--enable_ps2_protocol
--echo
--echo select high_priority

View File

@@ -96,7 +96,9 @@ if ($USE_CHILD_GROUP2)
--connection child2_1
if ($USE_GENERAL_LOG)
{
--disable_ps2_protocol
eval $CHILD2_1_SELECT_ARGUMENT1;
--enable_ps2_protocol
}
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)

View File

@@ -126,6 +126,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT COUNT(*) FROM ta_l;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
@@ -137,6 +138,7 @@ SELECT MAX(a) FROM ta_l WHERE a < 5;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MIN(a) FROM ta_l WHERE a > 1;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)

View File

@@ -132,6 +132,7 @@ if ($HAVE_PARTITION)
(4, 'd', '2003-11-30 05:01:03'),
(5, 'c', '2001-12-31 23:59:59');
--enable_query_log
--disable_ps2_protocol
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT COUNT(*) FROM ta_l2;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
@@ -143,6 +144,7 @@ if ($HAVE_PARTITION)
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
SELECT MIN(a) FROM ta_l2 WHERE a > 1;
eval $MASTER_1_CHECK_DIRECT_AGGREGATE_STATUS;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)

View File

@@ -155,6 +155,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c FROM tbl_a a, tbl_b b, tbl_c c WHERE a.a = b.a and a.a = c.a ORDER BY a.b DESC LIMIT 1,2;
if ($USE_CHILD_GROUP2)
@@ -176,6 +177,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo Test JOIN on a constant table.
@@ -301,6 +303,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT count(0) FROM tbl_person tp INNER JOIN tbl_ncd_cm_person tncp ON tp.id = tncp.person_id WHERE 1 = 1 AND tp.hr_status != "99" AND tp.hr_status != "2" AND tp.region_code LIKE CONCAT(CONCAT('%', '51041110620301', '%')) AND tp.id = '24FC3F0A5119432BAE13DD65AABAA39C' AND tncp.diseaseKind_id = '52A0328740914BCE86ED10A4D2521816' AND tp.region = 510411;
if ($USE_CHILD_GROUP2)
{
@@ -322,6 +325,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -155,6 +155,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c FROM tbl_a a join tbl_b b using(a) join tbl_c c using(a) ORDER BY a.b DESC;
if ($USE_CHILD_GROUP2)
@@ -176,6 +177,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -155,6 +155,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on a.a = c.a ORDER BY a.b DESC;
if ($USE_CHILD_GROUP2)
@@ -176,6 +177,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -170,6 +170,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c, d.a FROM tbl_d a left join tbl_c b on a.a = b.a left join tbl_b c on b.c = c.c left join tbl_a d on c.b = d.b ORDER BY a.a DESC;
if ($USE_CHILD_GROUP2)
@@ -191,6 +192,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -170,6 +170,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
@@ -191,6 +192,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -170,6 +170,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c, d.a FROM tbl_a a left join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
@@ -191,6 +192,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -155,6 +155,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on a.a = c.a ORDER BY a.b DESC;
if ($USE_CHILD_GROUP2)
@@ -176,6 +177,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -170,6 +170,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
@@ -191,6 +192,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -170,6 +170,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a right join tbl_c c on b.c = c.c left join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
@@ -191,6 +192,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -170,6 +170,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
SELECT a.a, c.b, c.c, d.a FROM tbl_a a right join tbl_b b on a.a = b.a left join tbl_c c on b.c = c.c right join tbl_d d on c.b = d.b ORDER BY d.a DESC;
if ($USE_CHILD_GROUP2)
@@ -191,6 +192,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -477,7 +477,9 @@ if ($USE_CHILD_GROUP3)
}
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHANGE_HA_MON;
--enable_ps2_protocol
--echo
--echo active standby test
@@ -841,7 +843,9 @@ if ($USE_CHILD_GROUP3)
}
--connection master_1
--disable_ps2_protocol
eval $MASTER_1_CHANGE_HA_MON;
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -154,6 +154,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT value FROM tbl_a WHERE value < 100;
if ($USE_CHILD_GROUP2)
{
@@ -186,6 +187,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -158,6 +158,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT pkey, words FROM tbl_a WHERE match(words) against('+ghi' in boolean mode);
if ($USE_CHILD_GROUP2)
{
@@ -190,6 +191,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -156,6 +156,7 @@ insert into tbl_a values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
insert into tbl_b values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
--connection master_1
--disable_ps2_protocol
SELECT sum(a.value), count(b.value2) FROM tbl_a a, tbl_b b WHERE a.value = b.value2 AND a.value = 5;
SELECT sum(a.value), count(b.value2) FROM tbl_a a, tbl_b b WHERE a.value = 5 and b.value2 = 5;
if ($USE_CHILD_GROUP2)
@@ -189,6 +190,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -168,6 +168,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -203,6 +204,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -104,6 +104,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
--disable_ps2_protocol
select * from ta_l where b not like 'a%';
if ($USE_CHILD_GROUP2)
{
@@ -113,7 +114,7 @@ if ($USE_CHILD_GROUP2)
SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select%';
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -123,6 +123,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -151,6 +152,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_6;
@@ -181,6 +183,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -209,6 +212,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_0;
@@ -239,6 +243,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -267,6 +272,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -123,6 +123,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -151,6 +152,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_6;
@@ -181,6 +183,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -209,6 +212,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_0;
@@ -239,6 +243,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -267,6 +272,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -123,6 +123,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -151,6 +152,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_6;
@@ -181,6 +183,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -209,6 +212,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_0;
@@ -239,6 +243,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -267,6 +272,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -123,6 +123,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -151,6 +152,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_6;
@@ -181,6 +183,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -209,6 +212,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_0;
@@ -239,6 +243,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
if ($USE_CHILD_GROUP2)
{
@@ -267,6 +272,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo deinit

View File

@@ -106,11 +106,13 @@ if ($USE_CHILD_GROUP2)
--disable_result_log
}
--connection child2_1
--disable_ps2_protocol
if ($USE_GENERAL_LOG)
{
--replace_regex /-[0-9a-f]{12}-[0-9a-f]+-/-xxxxxxxxxxxx-xxxxx-/
eval $CHILD2_1_SELECT_ARGUMENT1;
}
--enable_ps2_protocol
eval $CHILD2_1_SELECT_TABLES;
if (!$OUTPUT_CHILD_GROUP2)
{

View File

@@ -152,8 +152,10 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a < 5 ORDER BY a DESC LIMIT 3;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -194,8 +196,10 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a <= 5 ORDER BY a DESC LIMIT 3;
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -917,7 +921,9 @@ SELECT a, b, c FROM ta_l_int ORDER BY a;
--echo direct order limit
--connection master_1
eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS;
--disable_ps2_protocol
SELECT a, b, c FROM ta_l_int ORDER BY a LIMIT 3;
--enable_ps2_protocol
eval $MASTER_1_CHECK_DIRECT_ORDER_LIMIT_STATUS;

View File

@@ -171,6 +171,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT *, unix_timestamp(col_ts) FROM tbl_a;
if ($USE_CHILD_GROUP2)
{
@@ -191,6 +192,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo DELETEs
@@ -214,6 +216,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
DELETE FROM tbl_a WHERE col_ts='1970-01-01 01:00:01';
--disable_ps2_protocol
SELECT *, unix_timestamp(col_ts) FROM tbl_a;
if ($USE_CHILD_GROUP2)
{
@@ -234,6 +237,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{
if (!$OUTPUT_CHILD_GROUP2)
@@ -256,6 +260,7 @@ if ($USE_CHILD_GROUP2)
SET @@timestamp=1;
INSERT INTO tbl_a VALUES (1, now(), now());
SET @@timestamp=0;
--disable_ps2_protocol
SELECT *, unix_timestamp(col_ts) FROM tbl_a;
if ($USE_CHILD_GROUP2)
{
@@ -276,6 +281,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo UPDATEs
@@ -299,6 +305,7 @@ if ($USE_CHILD_GROUP2)
}
--connection master_1
UPDATE tbl_a SET col_ts=col_dt;
--disable_ps2_protocol
SELECT *, unix_timestamp(col_ts) FROM tbl_a;
if ($USE_CHILD_GROUP2)
{
@@ -319,6 +326,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo Lookups
@@ -341,6 +349,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > '2018-01-01';
SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts < '2018-10-28 02:30:00';
SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE '2018-10-28 02:30:00' > col_ts;
@@ -367,6 +376,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo Drop the index on the timestamp column
@@ -419,6 +429,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts > '2018-01-01';
SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE col_ts < '2018-10-28 02:30:00';
SELECT *, unix_timestamp(col_ts) FROM tbl_a WHERE '2018-10-28 02:30:00' > col_ts;
@@ -445,6 +456,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo Test the TIMESTAMP function
@@ -471,6 +483,7 @@ if ($USE_CHILD_GROUP2)
}
}
--connection master_1
--disable_ps2_protocol
SELECT * FROM tbl_f;
SELECT TIMESTAMP(col_d, col_t) FROM tbl_f;
SELECT TIMESTAMP('2018-06-25', col_t) FROM tbl_f;
@@ -495,6 +508,7 @@ if ($USE_CHILD_GROUP2)
--enable_result_log
}
}
--enable_ps2_protocol
--echo
--echo Restore Time Zone settings

View File

@@ -1,8 +1,10 @@
--echo
--echo ##### test SELECTs #####
--connection master_1
--disable_ps2_protocol
SELECT * FROM ta_l WHERE id = plusone(1);
SELECT * FROM ta_l WHERE id IN (plusone(1), plusone(2)) AND a = plusone(32);
--enable_ps2_protocol
if ($USE_CHILD_GROUP2)
{