Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä 2019-02-05 12:48:02 +02:00
commit e80bcd7f64
126 changed files with 6707 additions and 1109 deletions

View File

@ -5963,6 +5963,7 @@ void do_connect(struct st_command *command)
int read_timeout= 0;
int write_timeout= 0;
int connect_timeout= 0;
char *csname=0;
struct st_connection* con_slot;
static DYNAMIC_STRING ds_connection_name;
@ -6065,6 +6066,11 @@ void do_connect(struct st_command *command)
{
connect_timeout= atoi(con_options + sizeof("connect_timeout=")-1);
}
else if (strncasecmp(con_options, "CHARSET=",
sizeof("CHARSET=") - 1) == 0)
{
csname= strdup(con_options + sizeof("CHARSET=") - 1);
}
else
die("Illegal option to connect: %.*s",
(int) (end - con_options), con_options);
@ -6102,7 +6108,7 @@ void do_connect(struct st_command *command)
mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
mysql_options(con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
csname?csname: charset_info->csname);
if (opt_charsets_dir)
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_DIR,
opt_charsets_dir);
@ -6194,6 +6200,7 @@ void do_connect(struct st_command *command)
dynstr_free(&ds_sock);
dynstr_free(&ds_options);
dynstr_free(&ds_default_auth);
free(csname);
DBUG_VOID_RETURN;
}

View File

@ -153,7 +153,7 @@ xb_mysql_connect()
return(NULL);
}
xb_mysql_query(connection, "SET SESSION wait_timeout=2147483",
xb_mysql_query(connection, "SET SESSION wait_timeout=2147483, max_statement_time=0",
false, true);
return(connection);

View File

@ -3090,7 +3090,16 @@ xb_load_single_table_tablespace(
die("Can't open datafile %s", name);
}
err = file->validate_first_page(&flush_lsn);
for (int i = 0; i < 10; i++) {
err = file->validate_first_page(&flush_lsn);
if (err != DB_CORRUPTION) {
break;
}
my_sleep(1000);
}
bool is_empty_file = file->exists() && file->is_empty_file();
if (err == DB_SUCCESS && file->space_id() != SRV_TMP_SPACE_ID) {
os_offset_t node_size = os_file_get_size(file->handle());
@ -3122,9 +3131,7 @@ xb_load_single_table_tablespace(
delete file;
if (err != DB_SUCCESS && err != DB_CORRUPTION && xtrabackup_backup) {
/* allow corrupted first page for xtrabackup, it could be just
zero-filled page, which we restore from redo log later */
if (err != DB_SUCCESS && xtrabackup_backup && !is_empty_file) {
die("Failed to not validate first page of the file %s, error %d",name, (int)err);
}
}

View File

@ -35,6 +35,7 @@ BEGIN
AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP'
AND variable_name not like 'GTID%POS'
AND variable_name != 'GTID_BINLOG_STATE'
AND variable_name != 'AUTO_INCREMENT_INCREMENT'
ORDER BY variable_name;
-- Dump all databases, there should be none

View File

@ -127,3 +127,7 @@ Database (mysql_TE%)
mysql_test
drop database mysql_TEST;
End of 10.0 tests
create database db1;
create table t1 (a int);
drop database db1;
drop table t1;

View File

@ -118,3 +118,15 @@ show databases like "mysql_TE%";
drop database mysql_TEST;
--echo End of 10.0 tests
#
# MDEV-17148 DROP DATABASE throw "Directory not empty" after changed lower_case_table_names.
#
let $datadir=`select @@datadir`;
create database db1;
create table t1 (a int);
copy_file $datadir/test/t1.frm $datadir/db1/T1.frm;
drop database db1;
drop table t1;

View File

@ -5,3 +5,23 @@ Com_select 10
SHOW local STATUS LIKE 'com_select';
Variable_name Value
Com_select 0
# Test if charset changes after reset (utf8)
connect utf8_conn,localhost,root,,,,,CHARSET=utf8;
connection utf8_conn;
SELECT IF(@@character_set_client='utf8','OK', 'FAIL') AS RESULT;
RESULT
OK
SELECT IF(@@character_set_client='utf8','OK', 'FAIL') AS RESULT;
RESULT
OK
disconnect utf8_conn;
# Test if charset changes after reset (latin1)
connect latin1_conn,localhost,root,,,,,CHARSET=latin1;
connection latin1_conn;
SELECT IF(@@character_set_client='latin1','OK', 'FAIL') AS RESULT;
RESULT
OK
SELECT IF(@@character_set_client='latin1','OK', 'FAIL') AS RESULT;
RESULT
OK
disconnect latin1_conn;

View File

@ -23,3 +23,18 @@ SHOW local STATUS LIKE 'com_select';
SHOW local STATUS LIKE 'com_select';
--echo # Test if charset changes after reset (utf8)
connect(utf8_conn,localhost,root,,,,,CHARSET=utf8);
connection utf8_conn;
SELECT IF(@@character_set_client='utf8','OK', 'FAIL') AS RESULT;
--reset_connection
SELECT IF(@@character_set_client='utf8','OK', 'FAIL') AS RESULT;
disconnect utf8_conn;
--echo # Test if charset changes after reset (latin1)
connect(latin1_conn,localhost,root,,,,,CHARSET=latin1);
connection latin1_conn;
SELECT IF(@@character_set_client='latin1','OK', 'FAIL') AS RESULT;
--reset_connection
SELECT IF(@@character_set_client='latin1','OK', 'FAIL') AS RESULT;
disconnect latin1_conn;

View File

@ -197,7 +197,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'AUTO_INCREMENT_INCREMENT' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.routines;
@ -209,7 +209,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'AUTO_INCREMENT_INCREMENT' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
connect testuser3, localhost, testuser3, , test;
SELECT * FROM information_schema.routines;
@ -221,7 +221,7 @@ sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NUL
SELECT * FROM db_datadict_2.res_6_408002_2;
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' AND variable_name != 'AUTO_INCREMENT_INCREMENT' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA ORDER BY BINARY SCHEMA_NAME; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema') ORDER BY BINARY SCHEMA_NAME; SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, character_octet_length, numeric_precision, numeric_scale, character_set_name, collation_name, column_type, column_key, extra, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.global_priv; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0, SQL_SAFE_UPDATES=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
connection default;
disconnect testuser1;

View File

@ -50,7 +50,6 @@ galera.galera_encrypt_tmp_files : Get error failed to enable encryption of tempo
galera.galera_var_reject_queries : assertion in inline_mysql_socket_send
query_cache : MDEV-18137: Galera test failure on query_cache
galera.galera_autoinc_sst_mariabackup : MDEV-18177 Galera test failure on galera_autoinc_sst_mariabackup
galera_gcache_recover_manytrx : MDEV-15740
galera.galera_ist_mariabackup : Leaves port open
galera.galera_sst_rsync2 : MDEV-18178 Galera test failure on galera_sst_rsync2
galera.galera_kill_largechanges : MDEV-18179 Galera test failure on galera.galera_kill_largechanges

View File

@ -70,28 +70,55 @@ WHILE 1 DO
INSERT INTO t1 (f2) VALUES (REPEAT('x', 1024 * 1024 * 10));
END WHILE;
END|
connect node_1_insert_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect node_1_insert_multi, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect node_1_insert_transaction, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect node_1_update_simple, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect node_1_insert_1k, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect node_1_insert_1m, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connect node_1_insert_10m, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1_insert_simple;
CALL insert_simple();;
connection node_1_insert_multi;
CALL insert_multi();;
connection node_1_insert_transaction;
CALL insert_transaction ();;
connection node_1_update_simple;
CALL update_simple ();;
connection node_1_insert_1k;
CALL insert_1k ();;
connection node_1_insert_1m;
CALL insert_1m ();;
connection node_1_insert_10m;
CALL insert_10m ();;
connection node_2;
SET SESSION wsrep_sync_wait = 0;
Killing server ...
connection node_1;
Killing server ...
connection node_1_insert_simple;
ERROR HY000: Lost connection to MySQL server during query
connection node_1_insert_multi;
ERROR HY000: Lost connection to MySQL server during query
connection node_1_insert_transaction;
ERROR HY000: Lost connection to MySQL server during query
connection node_1_update_simple;
ERROR HY000: Lost connection to MySQL server during query
connection node_1_insert_1k;
ERROR HY000: Lost connection to MySQL server during query
connection node_1_insert_1m;
ERROR HY000: Lost connection to MySQL server during query
connection node_1_insert_10m;
ERROR HY000: Lost connection to MySQL server during query
connection node_1;
Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ...
connection node_2;
Performing --wsrep-recover ...
Using --wsrep-start-position when starting mysqld ...
connection node_1;
include/diff_servers.inc [servers=1 2]
connection node_1;
DROP TABLE t1;
DROP TABLE ten;
DROP PROCEDURE insert_simple;
@ -100,8 +127,10 @@ DROP PROCEDURE insert_transaction;
DROP PROCEDURE update_simple;
DROP PROCEDURE insert_1k;
DROP PROCEDURE insert_1m;
connection node_1;
CALL mtr.add_suppression("conflict state 7 after post commit");
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [async IST sender starting to serve]
connection node_2;
CALL mtr.add_suppression("Skipped GCache ring buffer recovery");
include/assert_grep.inc [Recovering GCache ring buffer: found gapless sequence]

View File

@ -25,4 +25,5 @@ COUNT(*) = 1
DROP TABLE t1;
connection node_3;
Resuming node ...
connection node_3;
CALL mtr.add_suppression("WSREP: gcs_caused() returned -1 \\(Operation not permitted\\)");

View File

@ -3,6 +3,7 @@ connection node_1;
connection node_1;
connection node_2;
connection node_3;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
INSERT INTO t1 VALUES (01), (02), (03), (04), (05);
connection node_2;

View File

@ -34,10 +34,20 @@ connection node_1;
connection node_2;
connection node_3;
connection node_2;
CALL mtr.add_suppression("WSREP: no nodes coming from prim view, prim not possible");
CALL mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster from this node");
CALL mtr.add_suppression("WSREP: wsrep::connect(.*) failed: 7");
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("WSREP: moving position backwards: [0-9]+ -> 0");
CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
CALL mtr.add_suppression("It may not be safe to bootstrap the cluster from this node");
CALL mtr.add_suppression("Aborting");
connection node_3;
CALL mtr.add_suppression("WSREP: no nodes coming from prim view, prim not possible");
CALL mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster from this node");
CALL mtr.add_suppression("WSREP: wsrep::connect(.*) failed: 7");
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("WSREP: moving position backwards: [0-9]+ -> 0");
CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
CALL mtr.add_suppression("It may not be safe to bootstrap the cluster from this node");
CALL mtr.add_suppression("Aborting");

View File

@ -56,8 +56,8 @@ DROP TABLE t1;
# Reconnect node #3 so that MTR's end-of-test checks can run
--connection node_3
--source include/galera_resume.inc
--connection node_3
--source include/wait_until_connected_again.inc
--disable_query_log

View File

@ -29,7 +29,9 @@
--source include/wait_condition.inc
--echo Starting garbd ...
--exec `dirname $WSREP_PROVIDER`/garb/garbd --address "gcomm://127.0.0.1:$NODE_GALERAPORT_1" --group my_wsrep_cluster --options 'base_port=$NODE_GALERAPORT_3' > $MYSQL_TMP_DIR/garbd.log 2>&1 &
--let $gp1 = `SELECT SUBSTR(@@wsrep_provider_options, LOCATE('base_port =', @@wsrep_provider_options) + LENGTH('base_port = '))`
--let $galera_port_1 = `SELECT SUBSTR('$gp1', 1, LOCATE(';', '$gp1') - 1)`
--exec `dirname $WSREP_PROVIDER`/../../bin/garb/garbd --address "gcomm://127.0.0.1:$galera_port_1" --group my_wsrep_cluster --options 'base_port=$galera_port_3' > $MYSQL_TMP_DIR/garbd.log 2>&1 &
--sleep 5

View File

@ -1,11 +1,11 @@
!include ../galera_3nodes.cnf
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true;gcache.size=1M'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.ignore_sb=true;gcache.size=1M'
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true;gcache.size=1M'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.ignore_sb=true;gcache.size=1M'
[mysqld.3]
wsrep_provider_options='base_port=@mysqld.3.#galera_port;pc.ignore_sb=true;gcache.size=1M'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;pc.ignore_sb=true;gcache.size=1M'

View File

@ -23,6 +23,7 @@
--let $node_3=node_3
--source ../galera/include/auto_increment_offset_save.inc
--connection node_1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY);
INSERT INTO t1 VALUES (01), (02), (03), (04), (05);

View File

@ -1,7 +1,6 @@
#
# Test the safe_to_bootstrap in grastate.dat
#
--source include/galera_cluster.inc
#
@ -144,9 +143,9 @@ SET SESSION wsrep_on = OFF;
#
--error 1
--exec $MYSQLD --defaults-group-suffix=.2 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster'
--exec $MYSQLD --defaults-group-suffix=.2 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster --wsrep-cluster-address='gcomm://' | grep 'This node is not safe to bootstrap the cluster'
--error 1
--exec $MYSQLD --defaults-group-suffix=.3 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster | grep 'This node is not safe to bootstrap the cluster'
--exec $MYSQLD --defaults-group-suffix=.3 --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-new-cluster --wsrep-cluster-address='gcomm://' | grep 'This node is not safe to bootstrap the cluster'
#
# Attempt to bootstrap starting from node #1, should succeed
@ -169,11 +168,21 @@ SET SESSION wsrep_on = OFF;
--source include/wait_condition.inc
--connection node_2
CALL mtr.add_suppression("WSREP: no nodes coming from prim view, prim not possible");
CALL mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster from this node");
CALL mtr.add_suppression("WSREP: wsrep::connect(.*) failed: 7");
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("WSREP: moving position backwards: [0-9]+ -> 0");
CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
CALL mtr.add_suppression("It may not be safe to bootstrap the cluster from this node");
CALL mtr.add_suppression("Aborting");
--connection node_3
CALL mtr.add_suppression("WSREP: no nodes coming from prim view, prim not possible");
CALL mtr.add_suppression("WSREP: It may not be safe to bootstrap the cluster from this node");
CALL mtr.add_suppression("WSREP: wsrep::connect(.*) failed: 7");
CALL mtr.add_suppression("Aborting");
CALL mtr.add_suppression("WSREP: moving position backwards: [0-9]+ -> 0");
CALL mtr.add_suppression("Failed to prepare for incremental state transfer");
CALL mtr.add_suppression("It may not be safe to bootstrap the cluster from this node");
CALL mtr.add_suppression("Aborting");

View File

@ -0,0 +1,459 @@
CREATE PROCEDURE get_index_id(IN tbl_id INT, IN idx_name char(100), OUT idx_id INT)
BEGIN
SELECT index_id into idx_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE
NAME=idx_name and TABLE_ID=tbl_id;
END|
CREATE PROCEDURE get_table_id(IN tbl_name char(100), OUT tbl_id INT)
BEGIN
SELECT table_id into tbl_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE
NAME = tbl_name;
END|
SET @tbl_id = 0;
SET @tbl1_id = 0;
SET @idx_id = 0;
SET @idx1_id = 0;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) NOT NULL,
PRIMARY KEY (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
KEY `idx` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100), f3 VARCHAR(100),
INDEX idx(f2, f3), index idx1(f3, f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), MODIFY f3 VARCHAR(150);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
`f3` varchar(150) DEFAULT NULL,
KEY `idx` (`f2`,`f3`),
KEY `idx1` (`f3`,`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100),
INDEX idx(f2(40)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
KEY `idx` (`f2`(40))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100), FULLTEXT idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
FULLTEXT KEY `idx` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
f3 VARCHAR(50) as (f2) VIRTUAL,
INDEX idx(f3))ENGINE=InnoDB;
INSERT INTO t1(f1, f2) VALUES(1, repeat('a', 40));
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(100);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(100) DEFAULT NULL,
`f3` varchar(50) GENERATED ALWAYS AS (`f2`) VIRTUAL,
KEY `idx` (`f3`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)),
INDEX idx1(f1))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx1;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
KEY `idx` (`f2`(10))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(10));
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
KEY `idx` (`f2`(10))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(50));
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
KEY `idx` (`f2`(50))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(100)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD INDEX idx1(f1);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
KEY `idx` (`f2`),
KEY `idx1` (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(6));
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
KEY `idx` (`f2`(6))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
`f3` int(11) DEFAULT NULL,
KEY `idx` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) NOT NULL,
`f3` int(11) DEFAULT NULL,
PRIMARY KEY (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100))ENGINE=INNODB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD FULLTEXT idx(f2);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) DEFAULT NULL,
FULLTEXT KEY `idx` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 CHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 CHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` char(200) NOT NULL,
PRIMARY KEY (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)),
INDEX idx1(f1))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(50);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(50) DEFAULT NULL,
KEY `idx` (`f2`(10)),
KEY `idx1` (`f1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)),
INDEX idx1(f1))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(5), DROP INDEX idx1;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(5) DEFAULT NULL,
KEY `idx` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100), FULLTEXT idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(50);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
0
SELECT @idx1_id = @idx_id;
@idx1_id = @idx_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(50) DEFAULT NULL,
FULLTEXT KEY `idx` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 CHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` char(200) DEFAULT NULL,
KEY `idx` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(40)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 TEXT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` text DEFAULT NULL,
KEY `idx` (`f2`(40))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(40)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(300);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(300) DEFAULT NULL,
KEY `idx` (`f2`(40))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(40)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200) CHARACTER SET UTF16;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
@tbl1_id = @tbl_id
0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(200) CHARACTER SET utf16 DEFAULT NULL,
KEY `idx` (`f2`(40))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
f3 VARCHAR(50) as (f2) VIRTUAL,
INDEX idx(f3))ENGINE=InnoDB;
# If varchar virtual column extension is allowed in the future then
# InnoDB must rebuild the index
ALTER TABLE t1 MODIFY f3 VARCHAR(100);
ERROR HY000: This is not yet supported for generated columns
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` varchar(100) DEFAULT NULL,
`f3` varchar(50) GENERATED ALWAYS AS (`f2`) VIRTUAL,
KEY `idx` (`f3`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP PROCEDURE get_index_id;
DROP PROCEDURE get_table_id;

View File

@ -0,0 +1,336 @@
--source include/have_innodb.inc
DELIMITER |;
CREATE PROCEDURE get_index_id(IN tbl_id INT, IN idx_name char(100), OUT idx_id INT)
BEGIN
SELECT index_id into idx_id FROM INFORMATION_SCHEMA.INNODB_SYS_INDEXES WHERE
NAME=idx_name and TABLE_ID=tbl_id;
END|
CREATE PROCEDURE get_table_id(IN tbl_name char(100), OUT tbl_id INT)
BEGIN
SELECT table_id into tbl_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE
NAME = tbl_name;
END|
DELIMITER ;|
SET @tbl_id = 0;
SET @tbl1_id = 0;
SET @idx_id = 0;
SET @idx1_id = 0;
# Table should avoid rebuild for the following varchar change.
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
# Index should avoid rebuild
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100), f3 VARCHAR(100),
INDEX idx(f2, f3), index idx1(f3, f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), MODIFY f3 VARCHAR(150);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100),
INDEX idx(f2(40)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100), FULLTEXT idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
f3 VARCHAR(50) as (f2) VIRTUAL,
INDEX idx(f3))ENGINE=InnoDB;
INSERT INTO t1(f1, f2) VALUES(1, repeat('a', 40));
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(100);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)),
INDEX idx1(f1))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx1;
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(10));
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(50));
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
# Newly added index should built
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(100)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD INDEX idx1(f1);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), DROP INDEX idx, ADD INDEX idx(f2(6));
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
# Table should rebuild
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD COLUMN f3 INT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL, f2 VARCHAR(100))ENGINE=INNODB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200), ADD FULLTEXT idx(f2);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 CHAR(100) PRIMARY KEY)ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 CHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)),
INDEX idx1(f1))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(50);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(10)),
INDEX idx1(f1))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(5), DROP INDEX idx1;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100), FULLTEXT idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
CALL get_index_id(@tbl_id, "idx", @idx_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(50);
CALL get_table_id("test/t1", @tbl1_id);
CALL get_index_id(@tbl1_id, "idx", @idx1_id);
SELECT @tbl1_id = @tbl_id;
SELECT @idx1_id = @idx_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 CHAR(200);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(40)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 TEXT;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(40)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(300);
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
INDEX idx(f2(40)))ENGINE=InnoDB;
CALL get_table_id("test/t1", @tbl_id);
ALTER TABLE t1 MODIFY f2 VARCHAR(200) CHARACTER SET UTF16;
CALL get_table_id("test/t1", @tbl1_id);
SELECT @tbl1_id = @tbl_id;
SHOW CREATE TABLE t1;
DROP TABLE t1;
# Show error when virtual varchar column got changed
CREATE TABLE t1(f1 INT NOT NULL,
f2 VARCHAR(100),
f3 VARCHAR(50) as (f2) VIRTUAL,
INDEX idx(f3))ENGINE=InnoDB;
--echo # If varchar virtual column extension is allowed in the future then
--echo # InnoDB must rebuild the index
--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
ALTER TABLE t1 MODIFY f3 VARCHAR(100);
SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP PROCEDURE get_index_id;
DROP PROCEDURE get_table_id;

View File

@ -1388,7 +1388,7 @@ ALTER TABLE worklog5743 ADD PRIMARY KEY `pk_idx` (col_1_varchar(3000));
ERROR 23000: Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' for key 'PRIMARY'
DROP TABLE worklog5743;
set global innodb_large_prefix=0;
ERROR HY000: Unknown system variable 'innodb_large_prefix'
ERROR HY000: Variable 'innodb_large_prefix' is a read only variable
CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
PRIMARY KEY (col_1_varchar(3072))

View File

@ -1300,7 +1300,7 @@ ALTER TABLE worklog5743 ADD PRIMARY KEY `pk_idx` (col_1_varchar(3000));
DROP TABLE worklog5743;
# -----------------------------------------------------------------------------
--error ER_UNKNOWN_SYSTEM_VARIABLE
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_large_prefix=0;
CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,

View File

@ -0,0 +1,32 @@
call mtr.add_suppression("InnoDB: New log files created");
CREATE TABLE t1(i INT) ENGINE INNODB;
CREATE TABLE t2(i INT PRIMARY KEY) ENGINE INNODB;
CREATE TABLE t3(i INT) ENGINE INNODB;
# Create full backup , modify table, then create incremental/differential backup
create table t4(f1 int not null, f2 int not null)engine=innodb;
insert into t4 values(1, 2), (2, 2), (3, 3), (5, 5), (6, 6), (4, 4), (9, 9);
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
rename table t4 to t7;
select count(*) from t7;
count(*)
7168
# XTRABACKUP INCREMENTAL
# XTRABACKUP PREPARE
# XTRABACKUP INCREMENTAL PREPARE
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
select count(*) from t7;
count(*)
7168
drop table t1, t2, t7, t3;

View File

@ -0,0 +1,50 @@
--source include/have_debug.inc
call mtr.add_suppression("InnoDB: New log files created");
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
CREATE TABLE t1(i INT) ENGINE INNODB;
CREATE TABLE t2(i INT PRIMARY KEY) ENGINE INNODB;
CREATE TABLE t3(i INT) ENGINE INNODB;
echo # Create full backup , modify table, then create incremental/differential backup;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
--enable_result_log
create table t4(f1 int not null, f2 int not null)engine=innodb;
insert into t4 values(1, 2), (2, 2), (3, 3), (5, 5), (6, 6), (4, 4), (9, 9);
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
insert into t4 select * from t4;
rename table t4 to t7;
select count(*) from t7;
--echo # XTRABACKUP INCREMENTAL
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
--echo # XTRABACKUP PREPARE
exec $XTRABACKUP --apply-log-only --prepare --target-dir=$basedir;
--echo # XTRABACKUP INCREMENTAL PREPARE
exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir;
let $targetdir=$basedir;
-- source include/restart_and_restore.inc
--enable_result_log
select count(*) from t7;
drop table t1, t2, t7, t3;
# Cleanup
rmdir $basedir;
rmdir $incremental_dir;

View File

@ -7,6 +7,7 @@ COMMIT;
SELECT count(*) FROM t;
count(*)
100000
FOUND 1 /Checksum mismatch in datafile/ in backup.log
# Prepare full backup, apply incremental one
# Restore and check results
# shutdown server

View File

@ -1,3 +1,4 @@
--source include/have_debug.inc
call mtr.add_suppression("InnoDB: New log files created");
let $basedir=$MYSQLTEST_VARDIR/tmp/backup;
@ -9,16 +10,26 @@ echo # Create full backup , modify table, then create incremental/differential b
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir;
--enable_result_log
BEGIN;
INSERT INTO t select uuid(), uuid(), uuid(), uuid() from seq_1_to_100000;
COMMIT;
SELECT count(*) FROM t;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir;
let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir --dbug=+d,page_intermittent_checksum_mismatch 2> $backuplog;
--let SEARCH_RANGE = 10000000
--let SEARCH_PATTERN=Checksum mismatch in datafile
--let SEARCH_FILE=$backuplog
--source include/search_pattern_in_file.inc
remove_file $backuplog;
--disable_result_log
echo # Prepare full backup, apply incremental one;
exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir;
exec $XTRABACKUP --prepare --verbose --apply-log-only --target-dir=$basedir --incremental-dir=$incremental_dir ;
echo # Restore and check results;
@ -36,7 +47,6 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=
echo # restart server;
--source include/start_mysqld.inc
--enable_result_log
SELECT count(*) FROM t;
DROP TABLE t;

View File

@ -904,6 +904,20 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_FILE_FORMAT
SESSION_VALUE NULL
GLOBAL_VALUE
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_FILE_PER_TABLE
SESSION_VALUE NULL
GLOBAL_VALUE ON
@ -1296,6 +1310,20 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_LARGE_PREFIX
SESSION_VALUE NULL
GLOBAL_VALUE
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Deprecated parameter with no effect.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG
SESSION_VALUE NULL
GLOBAL_VALUE 0

View File

@ -0,0 +1,17 @@
--- r/wsrep-recover-v25.result 2019-02-05 12:33:42.681586950 +0200
+++ r/wsrep-recover-v25.reject 2019-02-05 12:34:41.661752903 +0200
@@ -18,11 +18,10 @@
connection default;
SET DEBUG_SYNC = "now WAIT_FOR after_prepare_reached";
# Kill the server
-Expect seqno 7
-7
-Expect 5 7
+Expect seqno 6
+6
+Expect 5
SELECT * FROM t1;
f1
5
-7
DROP TABLE t1;

View File

@ -0,0 +1,28 @@
# Kill the server
Expect seqno 1
1
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
# Kill the server
Expect seqno 3
3
INSERT INTO t1 VALUES (5);
# Kill the server
Expect seqno 5
5
SELECT VARIABLE_VALUE `expect 6` FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed';
expect 6
6
connect con1, localhost, root;
SET DEBUG_SYNC = "ha_commit_trans_after_prepare SIGNAL after_prepare_reached WAIT_FOR continue";
INSERT INTO t1 VALUES (7);
connection default;
SET DEBUG_SYNC = "now WAIT_FOR after_prepare_reached";
# Kill the server
Expect seqno 7
7
Expect 5 7
SELECT * FROM t1;
f1
5
7
DROP TABLE t1;

View File

@ -0,0 +1,7 @@
!include ../my.cnf
[mysqld.1]
wsrep-on=ON
wsrep-cluster-address=gcomm://
wsrep-provider=@ENV.WSREP_PROVIDER
binlog-format=ROW

View File

@ -0,0 +1,4 @@
[binlogon]
log-bin
[binlogoff]

View File

@ -0,0 +1,121 @@
#
# Verify that the wsrep XID gets updated in InnoDB rollback segment
# properly and can be recovered with --wsrep-recover
#
# The test runs the following scenarios:
#
# 1) The server is started but no SQL is run
# 2) DDL is executed
# 3) INSERT is executed
# 4) Two INSERTs are executed so that the first one in order will be
# blocked after certification and the second one before entering
# commit order critical section.
# 5) Two DMLs are executed so that the prepare step is run out of order.
# Both transactions are blocked before commit order critical section.
#
# After each scenario server is killed and the recovered position
# is validated.
#
--source include/have_wsrep.inc
--source include/have_innodb.inc
--source include/have_wsrep_provider.inc
--source include/have_debug_sync.inc
#
# Binlog option for recovery run. This must be set in the test because
# combinations file causes log-bin option to be set from command line,
# not via my.cnf.
#
--let $log_bin = `SELECT @@log_bin`
if ($log_bin) {
--let $wsrep_recover_binlog_opt = --log-bin
}
#
# Scenario 1
# The expected recovered seqno is 1 corresponding to initial cluster
# configuration change.
#
--source include/kill_mysqld.inc
--source wsrep-recover-step.inc
--echo Expect seqno 1
--echo $wsrep_recover_start_position_seqno
--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno
--source include/start_mysqld.inc
--source include/wait_wsrep_ready.inc
#
# Senario 2
# The expected recovered seqno is 3 corresponding to two configuration
# changes and CREATE TABLE
#
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
--source include/kill_mysqld.inc
--source wsrep-recover-step.inc
--echo Expect seqno 3
--echo $wsrep_recover_start_position_seqno
--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno
--source include/start_mysqld.inc
--source include/wait_wsrep_ready.inc
#
# Scenario 3
# The expected recovered seqno is 5 corresponding to three configuration
# changes, CREATE TABLE and INSERT.
#
# The expected wsrep_last_committed after the server is restarted is 6.
#
INSERT INTO t1 VALUES (5);
--source include/kill_mysqld.inc
--source wsrep-recover-step.inc
--echo Expect seqno 5
--echo $wsrep_recover_start_position_seqno
--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno
--source include/start_mysqld.inc
--source include/wait_wsrep_ready.inc
SELECT VARIABLE_VALUE `expect 6` FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed';
#
# Scenario 4
#
# The INSERT gets prepared but not committed.
#
# If binlog is off, the expected outcome is that the INSERT gets committed
# since it is already committed in the cluster. If binlog is on, the INSERT
# should be rolled back during recovery phase since it has not yet
# been logged into binlog.
#
--connect con1, localhost, root
SET DEBUG_SYNC = "ha_commit_trans_after_prepare SIGNAL after_prepare_reached WAIT_FOR continue";
--send INSERT INTO t1 VALUES (7)
--connection default
SET DEBUG_SYNC = "now WAIT_FOR after_prepare_reached";
--source include/kill_mysqld.inc
--source wsrep-recover-step.inc
if ($log_bin) {
--echo Expect seqno 6
}
if (!$log_bin) {
--echo Expect seqno 7
}
--echo $wsrep_recover_start_position_seqno
--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno
--source include/start_mysqld.inc
--source include/wait_wsrep_ready.inc
if ($log_bin) {
--echo Expect 5
}
if (!$log_bin) {
--echo Expect 5 7
}
SELECT * FROM t1;
DROP TABLE t1;

View File

@ -2112,7 +2112,10 @@ static my_bool xarecover_handlerton(THD *unused, plugin_ref plugin,
info->found_foreign_xids++;
continue;
}
if (info->dry_run)
if (IF_WSREP(!(wsrep_emulate_bin_log &&
wsrep_is_wsrep_xid(info->list + i) &&
x <= wsrep_limit) && info->dry_run,
info->dry_run))
{
info->found_my_xids++;
continue;

View File

@ -736,6 +736,11 @@ typedef ulonglong alter_table_operations;
*/
#define ALTER_PARTITIONED (1ULL << 59)
/**
Change in index length such that it doesn't require index rebuild.
*/
#define ALTER_COLUMN_INDEX_LENGTH (1ULL << 60)
/*
Flags set in partition_flags when altering partitions
*/

View File

@ -1589,7 +1589,7 @@ static my_bool kill_all_threads_once_again(THD *thd, void *)
*/
THD *save_thd= current_thd;
set_current_thd(thd);
close_connection(thd, ER_SERVER_SHUTDOWN);
close_connection(thd);
set_current_thd(save_thd);
}
#endif

View File

@ -857,6 +857,7 @@ THD::THD(my_thread_id id, bool is_wsrep_applier, bool skip_global_sys_var_lock)
prepare_derived_at_open= FALSE;
create_tmp_table_for_derived= FALSE;
save_prep_leaf_list= FALSE;
org_charset= 0;
/* Restore THR_THD */
set_current_thd(old_THR_THD);
}

View File

@ -2380,6 +2380,9 @@ public:
uint dbug_sentry; // watch out for memory corruption
#endif
struct st_my_thread_var *mysys_var;
/* Original charset number from the first client packet, or COM_CHANGE_USER*/
CHARSET_INFO *org_charset;
private:
/*
Type of current query: COM_STMT_PREPARE, COM_QUERY, etc. Set from

View File

@ -800,6 +800,7 @@ bool thd_init_client_charset(THD *thd, uint cs_number)
cs->csname);
return true;
}
thd->org_charset= cs;
thd->update_charset(cs,cs,cs);
}
return false;

View File

@ -1089,8 +1089,12 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp,
table_list->table_name= *table;
table_list->open_type= OT_BASE_ONLY;
/* To be able to correctly look up the table in the table cache. */
if (lower_case_table_names)
/*
On the case-insensitive file systems table is opened
with the lowercased file name. So we should lowercase
as well to look up the cache properly.
*/
if (lower_case_file_system)
table_list->table_name.length= my_casedn_str(files_charset_info,
(char*) table_list->table_name.str);

View File

@ -1653,6 +1653,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->status_var.com_other++;
thd->change_user();
thd->clear_error(); // if errors from rollback
/* Restore original charset from client authentication packet.*/
if(thd->org_charset)
thd->update_charset(thd->org_charset,thd->org_charset,thd->org_charset);
my_ok(thd, 0, 0, 0);
break;
}

View File

@ -6474,7 +6474,7 @@ static bool fill_alter_inplace_info(THD *thd,
bool varchar,
Alter_inplace_info *ha_alter_info)
{
Field **f_ptr, *field;
Field **f_ptr, *field, *old_field;
List_iterator_fast<Create_field> new_field_it;
Create_field *new_field;
KEY_PART_INFO *key_part, *new_part;
@ -6773,6 +6773,7 @@ static bool fill_alter_inplace_info(THD *thd,
Go through keys and check if the original ones are compatible
with new table.
*/
uint old_field_len= 0;
KEY *table_key;
KEY *table_key_end= table->key_info + table->s->keys;
KEY *new_key;
@ -6838,17 +6839,34 @@ static bool fill_alter_inplace_info(THD *thd,
key_part < end;
key_part++, new_part++)
{
/*
Key definition has changed if we are using a different field or
if the used key part length is different. It makes sense to
check lengths first as in case when fields differ it is likely
that lengths differ too and checking fields is more expensive
in general case.
*/
if (key_part->length != new_part->length)
goto index_changed;
new_field= get_field_by_index(alter_info, new_part->fieldnr);
old_field= table->field[key_part->fieldnr - 1];
/*
If there is a change in index length due to column expansion
like varchar(X) changed to varchar(X + N) and has a compatible
packed data representation, we mark it for fast/INPLACE change
in index definition. InnoDB supports INPLACE for this cases
Key definition has changed if we are using a different field or
if the user key part length is different.
*/
old_field_len= old_field->pack_length();
if (old_field->type() == MYSQL_TYPE_VARCHAR)
{
old_field_len= (old_field->pack_length()
- ((Field_varstring*) old_field)->length_bytes);
}
if (key_part->length == old_field_len &&
key_part->length < new_part->length &&
(key_part->field->is_equal((Create_field*) new_field)
== IS_EQUAL_PACK_LENGTH))
{
ha_alter_info->handler_flags |= ALTER_COLUMN_INDEX_LENGTH;
}
else if (key_part->length != new_part->length)
goto index_changed;
/*
For prefix keys KEY_PART_INFO::field points to cloned Field

View File

@ -1064,6 +1064,13 @@ buf_page_is_corrupted(
if (srv_checksum_algorithm
== SRV_CHECKSUM_ALGORITHM_CRC32) {
DBUG_EXECUTE_IF(
"page_intermittent_checksum_mismatch", {
static int page_counter;
if (page_counter++ == 2) {
checksum_field2++;
}
});
crc32 = buf_calc_page_crc32(read_buf);
crc32_inited = true;

View File

@ -910,7 +910,7 @@ fil_space_extend_must_retry(
we have set the node->being_extended flag. */
mutex_exit(&fil_system.mutex);
ut_ad(size > space->size);
ut_ad(size >= space->size);
ulint last_page_no = space->size;
const ulint file_start_page_no = last_page_no - node->size;

View File

@ -190,6 +190,11 @@ static char* innobase_reset_all_monitor_counter;
static ulong innodb_flush_method;
/** Deprecated; no effect other than issuing a deprecation warning. */
static char* innodb_file_format;
/** Deprecated; no effect other than issuing a deprecation warning. */
static char* innodb_large_prefix;
/* This variable can be set in the server configure file, specifying
stopword table to be used */
static char* innobase_server_stopword_table;
@ -3689,6 +3694,17 @@ static int innodb_init_params()
char *default_path;
ulong num_pll_degree;
if (innodb_large_prefix || innodb_file_format) {
const char* p = innodb_file_format
? "file_format"
: "large_prefix";
sql_print_warning("The parameter innodb_%s is deprecated"
" and has no effect."
" It may be removed in future releases."
" See https://mariadb.com/kb/en/library/"
"xtradbinnodb-file-format/", p);
}
/* Check that values don't overflow on 32-bit systems. */
if (sizeof(ulint) == 4) {
if (innobase_buffer_pool_size > UINT_MAX32) {
@ -18859,6 +18875,13 @@ static MYSQL_SYSVAR_ENUM(flush_method, innodb_flush_method,
NULL, NULL, IF_WIN(SRV_ALL_O_DIRECT_FSYNC, SRV_FSYNC),
&innodb_flush_method_typelib);
static MYSQL_SYSVAR_STR(file_format, innodb_file_format,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Deprecated parameter with no effect.", NULL, NULL, NULL);
static MYSQL_SYSVAR_STR(large_prefix, innodb_large_prefix,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Deprecated parameter with no effect.", NULL, NULL, NULL);
static MYSQL_SYSVAR_BOOL(force_load_corrupted, srv_load_corrupted,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Force InnoDB to load metadata of corrupted table.",
@ -19903,6 +19926,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(read_io_threads),
MYSQL_SYSVAR(write_io_threads),
MYSQL_SYSVAR(file_per_table),
MYSQL_SYSVAR(file_format), /* deprecated in MariaDB 10.2; no effect */
MYSQL_SYSVAR(flush_log_at_timeout),
MYSQL_SYSVAR(flush_log_at_trx_commit),
MYSQL_SYSVAR(flush_method),
@ -19916,6 +19940,7 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(ft_min_token_size),
MYSQL_SYSVAR(ft_num_word_optimize),
MYSQL_SYSVAR(ft_sort_pll_degree),
MYSQL_SYSVAR(large_prefix), /* deprecated in MariaDB 10.2; no effect */
MYSQL_SYSVAR(force_load_corrupted),
MYSQL_SYSVAR(lock_schedule_algorithm),
MYSQL_SYSVAR(locks_unsafe_for_binlog),

View File

@ -106,7 +106,8 @@ static const alter_table_operations INNOBASE_INPLACE_IGNORE
| ALTER_COLUMN_STORAGE_TYPE
| ALTER_VIRTUAL_GCOL_EXPR
| ALTER_DROP_CHECK_CONSTRAINT
| ALTER_RENAME;
| ALTER_RENAME
| ALTER_COLUMN_INDEX_LENGTH;
/** Operations on foreign key definitions (changing the schema only) */
static const alter_table_operations INNOBASE_FOREIGN_OPERATIONS

View File

@ -314,6 +314,25 @@ public:
return(m_last_os_error);
}
/** Check whether the file is empty.
@return true if file is empty */
bool is_empty_file() const
{
#ifdef _WIN32
os_offset_t offset =
(os_offset_t) m_file_info.nFileSizeLow
| ((os_offset_t) m_file_info.nFileSizeHigh << 32);
return (offset == 0);
#else
return (m_file_info.st_size == 0);
#endif
}
/** Check if the file exist.
@return true if file exists. */
bool exists() const { return m_exists; }
/** Test if the filepath provided looks the same as this filepath
by string comparison. If they are two different paths to the same
file, same_as() will be used to show that after the files are opened.

View File

@ -151,9 +151,13 @@ struct file_name_t {
/** Status of the tablespace */
fil_status status;
/** FSP_SIZE of tablespace */
ulint size;
/** Constructor */
file_name_t(std::string name_, bool deleted) :
name(name_), space(NULL), status(deleted ? DELETED: NORMAL) {}
name(name_), space(NULL), status(deleted ? DELETED: NORMAL),
size(0) {}
};
/** Map of dirty tablespaces during recovery */
@ -321,6 +325,11 @@ fil_name_process(
ut_ad(space != NULL);
if (f.space == NULL || f.space == space) {
if (f.size && f.space == NULL) {
fil_space_set_recv_size(space->id, f.size);
}
f.name = fname.name;
f.space = space;
f.status = file_name_t::NORMAL;
@ -2249,11 +2258,24 @@ recv_parse_log_rec(
}
if (*page_no == 0 && *type == MLOG_4BYTES
&& apply
&& mach_read_from_2(old_ptr) == FSP_HEADER_OFFSET + FSP_SIZE) {
old_ptr += 2;
fil_space_set_recv_size(*space,
mach_parse_compressed(&old_ptr,
end_ptr));
ulint size = mach_parse_compressed(&old_ptr, end_ptr);
recv_spaces_t::iterator it = recv_spaces.find(*space);
ut_ad(!recv_sys->mlog_checkpoint_lsn
|| *space == TRX_SYS_SPACE
|| srv_is_undo_tablespace(*space)
|| it != recv_spaces.end());
if (it != recv_spaces.end() && !it->second.space) {
it->second.size = size;
}
fil_space_set_recv_size(*space, size);
}
return ulint(new_ptr - ptr);

View File

@ -18,7 +18,7 @@ SET(SPIDER_SOURCES
spd_table.cc spd_direct_sql.cc spd_udf.cc spd_ping_table.cc
spd_copy_tables.cc spd_i_s.cc spd_malloc.cc ha_spider.cc spd_udf.def
spd_db_mysql.cc spd_db_handlersocket.cc spd_db_oracle.cc
spd_group_by_handler.cc
spd_group_by_handler.cc spd_db_include.cc
hs_client/config.cpp hs_client/escape.cpp hs_client/fatal.cpp
hs_client/hstcpcli.cpp hs_client/socket.cpp hs_client/string_util.cpp
)

View File

@ -0,0 +1,14 @@
--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP
--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP
--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP
--connection master_1
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings

View File

@ -0,0 +1,29 @@
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1
let $MASTER_1_COMMENT_2_1=
COMMENT='table "tbl_a", srv "s_2_1"';
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES
let $CHILD2_1_DROP_TABLES=
DROP TABLE IF EXISTS tbl_a;
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES
let $CHILD2_1_CREATE_TABLES=
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES
let $CHILD2_1_SELECT_TABLES=
SELECT pkey FROM tbl_a ORDER BY pkey;
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--connection master_1
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 3;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;

View File

@ -0,0 +1,7 @@
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings

View File

@ -0,0 +1,9 @@
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
let $DIRECT_SQL_COMMAND=
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"');

View File

@ -0,0 +1,19 @@
--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP
--let $MASTER_1_COMMENT_2_2= $MASTER_1_COMMENT_2_2_BACKUP
--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP
--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP
--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP
--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP
--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP
--connection master_1
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
set session spider_quick_page_byte= @old_spider_quick_page_byte;
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings

View File

@ -0,0 +1,51 @@
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1
let $MASTER_1_COMMENT_2_1=
COMMENT='table "tbl_a", srv "s_2_1"';
--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2
let $MASTER_1_COMMENT_2_2=
COMMENT='table "tbl_b", srv "s_2_2"';
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES
let $CHILD2_1_DROP_TABLES=
DROP TABLE IF EXISTS tbl_a;
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES
let $CHILD2_1_CREATE_TABLES=
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES
let $CHILD2_1_SELECT_TABLES=
SELECT pkey FROM tbl_a ORDER BY pkey;
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES
let $CHILD2_2_DROP_TABLES=
DROP TABLE IF EXISTS tbl_b;
--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES
let $CHILD2_2_CREATE_TABLES=
CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES
let $CHILD2_2_SELECT_TABLES=
SELECT pkey FROM tbl_b ORDER BY pkey;
let $CHILD2_2_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--connection master_1
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 0;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;
set @old_spider_quick_page_byte= @@spider_quick_page_byte;
let $MASTER_1_SET_QUICK_PAGE_BYTE_6=
set session spider_quick_page_byte= 6;
let $MASTER_1_SET_QUICK_PAGE_BYTE_0=
set session spider_quick_page_byte= 0;

View File

@ -0,0 +1,19 @@
--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP
--let $MASTER_1_COMMENT_2_2= $MASTER_1_COMMENT_2_2_BACKUP
--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP
--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP
--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP
--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP
--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP
--connection master_1
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
set session spider_quick_page_byte= @old_spider_quick_page_byte;
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings

View File

@ -0,0 +1,51 @@
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1
let $MASTER_1_COMMENT_2_1=
COMMENT='table "tbl_a", srv "s_2_1"';
--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2
let $MASTER_1_COMMENT_2_2=
COMMENT='table "tbl_b", srv "s_2_2"';
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES
let $CHILD2_1_DROP_TABLES=
DROP TABLE IF EXISTS tbl_a;
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES
let $CHILD2_1_CREATE_TABLES=
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES
let $CHILD2_1_SELECT_TABLES=
SELECT pkey FROM tbl_a ORDER BY pkey;
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES
let $CHILD2_2_DROP_TABLES=
DROP TABLE IF EXISTS tbl_b;
--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES
let $CHILD2_2_CREATE_TABLES=
CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES
let $CHILD2_2_SELECT_TABLES=
SELECT pkey FROM tbl_b ORDER BY pkey;
let $CHILD2_2_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--connection master_1
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 1;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;
set @old_spider_quick_page_byte= @@spider_quick_page_byte;
let $MASTER_1_SET_QUICK_PAGE_BYTE_6=
set session spider_quick_page_byte= 6;
let $MASTER_1_SET_QUICK_PAGE_BYTE_0=
set session spider_quick_page_byte= 0;

View File

@ -0,0 +1,19 @@
--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP
--let $MASTER_1_COMMENT_2_2= $MASTER_1_COMMENT_2_2_BACKUP
--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP
--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP
--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP
--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP
--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP
--connection master_1
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
set session spider_quick_page_byte= @old_spider_quick_page_byte;
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings

View File

@ -0,0 +1,51 @@
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1
let $MASTER_1_COMMENT_2_1=
COMMENT='table "tbl_a", srv "s_2_1"';
--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2
let $MASTER_1_COMMENT_2_2=
COMMENT='table "tbl_b", srv "s_2_2"';
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES
let $CHILD2_1_DROP_TABLES=
DROP TABLE IF EXISTS tbl_a;
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES
let $CHILD2_1_CREATE_TABLES=
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES
let $CHILD2_1_SELECT_TABLES=
SELECT pkey FROM tbl_a ORDER BY pkey;
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES
let $CHILD2_2_DROP_TABLES=
DROP TABLE IF EXISTS tbl_b;
--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES
let $CHILD2_2_CREATE_TABLES=
CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES
let $CHILD2_2_SELECT_TABLES=
SELECT pkey FROM tbl_b ORDER BY pkey;
let $CHILD2_2_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--connection master_1
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 2;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;
set @old_spider_quick_page_byte= @@spider_quick_page_byte;
let $MASTER_1_SET_QUICK_PAGE_BYTE_6=
set session spider_quick_page_byte= 6;
let $MASTER_1_SET_QUICK_PAGE_BYTE_0=
set session spider_quick_page_byte= 0;

View File

@ -0,0 +1,19 @@
--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP
--let $MASTER_1_COMMENT_2_2= $MASTER_1_COMMENT_2_2_BACKUP
--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP
--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP
--let $CHILD2_2_DROP_TABLES= $CHILD2_2_DROP_TABLES_BACKUP
--let $CHILD2_2_CREATE_TABLES= $CHILD2_2_CREATE_TABLES_BACKUP
--let $CHILD2_2_SELECT_TABLES= $CHILD2_2_SELECT_TABLES_BACKUP
--connection master_1
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
set session spider_quick_page_byte= @old_spider_quick_page_byte;
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings

View File

@ -0,0 +1,51 @@
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1
let $MASTER_1_COMMENT_2_1=
COMMENT='table "tbl_a", srv "s_2_1"';
--let $MASTER_1_COMMENT_2_2_BACKUP= $MASTER_1_COMMENT_2_2
let $MASTER_1_COMMENT_2_2=
COMMENT='table "tbl_b", srv "s_2_2"';
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES
let $CHILD2_1_DROP_TABLES=
DROP TABLE IF EXISTS tbl_a;
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES
let $CHILD2_1_CREATE_TABLES=
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES
let $CHILD2_1_SELECT_TABLES=
SELECT pkey FROM tbl_a ORDER BY pkey;
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--let $CHILD2_2_DROP_TABLES_BACKUP= $CHILD2_2_DROP_TABLES
let $CHILD2_2_DROP_TABLES=
DROP TABLE IF EXISTS tbl_b;
--let $CHILD2_2_CREATE_TABLES_BACKUP= $CHILD2_2_CREATE_TABLES
let $CHILD2_2_CREATE_TABLES=
CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_2_ENGINE $CHILD2_2_CHARSET;
--let $CHILD2_2_SELECT_TABLES_BACKUP= $CHILD2_2_SELECT_TABLES
let $CHILD2_2_SELECT_TABLES=
SELECT pkey FROM tbl_b ORDER BY pkey;
let $CHILD2_2_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
--connection master_1
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 3;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;
set @old_spider_quick_page_byte= @@spider_quick_page_byte;
let $MASTER_1_SET_QUICK_PAGE_BYTE_6=
set session spider_quick_page_byte= 6;
let $MASTER_1_SET_QUICK_PAGE_BYTE_0=
set session spider_quick_page_byte= 0;

View File

@ -0,0 +1,15 @@
--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP
--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP
--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP
--connection slave1_1
set global spider_slave_trx_isolation= @old_spider_slave_trx_isolation;
--disable_warnings
--disable_query_log
--disable_result_log
--source ../include/deinit_spider.inc
--source ../t/slave_test_deinit.inc
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings

View File

@ -0,0 +1,35 @@
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--source ../t/slave_test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1
let $MASTER_1_COMMENT_2_1=
COMMENT='table "tbl_a", srv "s_2_1"';
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES
let $CHILD2_1_DROP_TABLES=
DROP TABLE IF EXISTS tbl_a;
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES
let $CHILD2_1_CREATE_TABLES=
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES
let $CHILD2_1_SELECT_TABLES=
SELECT pkey FROM tbl_a ORDER BY pkey;
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %';
--connection slave1_1
--disable_warnings
--disable_query_log
--disable_result_log
--source ../include/init_spider.inc
--enable_result_log
--enable_query_log
--enable_warnings
set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation;
set global spider_slave_trx_isolation= 1;

View File

@ -0,0 +1,11 @@
--let $MASTER_1_COMMENT_2_1= $MASTER_1_COMMENT_2_1_BACKUP
--let $CHILD2_1_DROP_TABLES= $CHILD2_1_DROP_TABLES_BACKUP
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP
--let $CHILD2_1_SELECT_TABLES= $CHILD2_1_SELECT_TABLES_BACKUP
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_deinit.inc
--enable_result_log
--enable_query_log
--enable_warnings

View File

@ -0,0 +1,24 @@
--disable_warnings
--disable_query_log
--disable_result_log
--source ../t/test_init.inc
--enable_result_log
--enable_query_log
--enable_warnings
--let $MASTER_1_COMMENT_2_1_BACKUP= $MASTER_1_COMMENT_2_1
let $MASTER_1_COMMENT_2_1=
COMMENT='table "tbl_a", srv "s_2_1", wrapper "mariadb"';
--let $CHILD2_1_DROP_TABLES_BACKUP= $CHILD2_1_DROP_TABLES
let $CHILD2_1_DROP_TABLES=
DROP TABLE IF EXISTS tbl_a;
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES
let $CHILD2_1_CREATE_TABLES=
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET;
--let $CHILD2_1_SELECT_TABLES_BACKUP= $CHILD2_1_SELECT_TABLES
let $CHILD2_1_SELECT_TABLES=
SELECT pkey FROM tbl_a ORDER BY pkey;
let $CHILD2_1_SELECT_ARGUMENT1=
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';

View File

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

View File

@ -0,0 +1,44 @@
[mysqld.1.1]
log-bin= master-bin
loose_handlersocket_port= 20000
loose_handlersocket_port_wr= 20001
loose_handlersocket_threads= 2
loose_handlersocket_threads_wr= 1
loose_handlersocket_support_merge_table= 0
loose_handlersocket_direct_update_mode= 2
loose_handlersocket_unlimited_boundary= 65536
loose_handlersocket_bulk_insert= 0
loose_handlersocket_bulk_insert_timeout= 0
loose_handlersocket_general_log= 1
loose_handlersocket_timeout= 30
loose_handlersocket_close_table_interval=2
open_files_limit= 4096
loose_partition= 1
[ENV]
USE_GEOMETRY_TEST= 1
USE_FULLTEXT_TEST= 1
USE_HA_TEST= 1
USE_GENERAL_LOG= 1
USE_REPLICATION= 1
MASTER_1_MYPORT= @mysqld.1.1.port
MASTER_1_HSRPORT= 20000
MASTER_1_HSWPORT= 20001
MASTER_1_MYSOCK= @mysqld.1.1.socket
MASTER_1_ENGINE_TYPE= Spider
#MASTER_1_ENGINE_TYPE= MyISAM
MASTER_1_ENGINE= ENGINE=Spider
MASTER_1_CHARSET= DEFAULT CHARSET=utf8
MASTER_1_ENGINE2= ENGINE=MyISAM
MASTER_1_CHARSET2= DEFAULT CHARSET=utf8
MASTER_1_CHARSET3= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
STR_SEMICOLON= ;
#The followings are set in include/init_xxx.inc files
# MASTER_1_COMMENT_2_1
# MASTER_1_COMMENT2_2_1
# MASTER_1_COMMENT3_2_1
# MASTER_1_COMMENT4_2_1
# MASTER_1_COMMENT5_2_1
# MASTER_1_COMMENT_P_2_1

View File

@ -0,0 +1,56 @@
[mysqld.2.1]
loose_handlersocket_port= 20002
loose_handlersocket_port_wr= 20003
loose_handlersocket_threads= 2
loose_handlersocket_threads_wr= 1
loose_handlersocket_support_merge_table= 0
loose_handlersocket_direct_update_mode= 2
loose_handlersocket_unlimited_boundary= 65536
loose_handlersocket_bulk_insert= 0
loose_handlersocket_bulk_insert_timeout= 0
loose_handlersocket_general_log= 1
loose_handlersocket_timeout= 30
loose_handlersocket_close_table_interval=2
open_files_limit= 4096
[ENV]
USE_CHILD_GROUP2= 1
OUTPUT_CHILD_GROUP2= 0
CHILD2_1_MYPORT= @mysqld.2.1.port
CHILD2_1_HSRPORT= 20002
CHILD2_1_HSWPORT= 20003
CHILD2_1_MYSOCK= @mysqld.2.1.socket
CHILD2_1_ENGINE_TYPE= InnoDB
CHILD2_1_ENGINE= ENGINE=InnoDB
CHILD2_1_CHARSET= DEFAULT CHARSET=utf8
CHILD2_1_CHARSET2= DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
CHILD2_1_FT_MYPORT= @mysqld.2.1.port
CHILD2_1_FT_MYSOCK= @mysqld.2.1.socket
CHILD2_1_FT_ENGINE_TYPE= MyISAM
CHILD2_1_FT_ENGINE= ENGINE=MyISAM
CHILD2_1_FT_CHARSET= DEFAULT CHARSET=utf8
CHILD2_1_GM_MYPORT= @mysqld.2.1.port
CHILD2_1_GM_MYSOCK= @mysqld.2.1.socket
CHILD2_1_GM_ENGINE_TYPE= MyISAM
CHILD2_1_GM_ENGINE= ENGINE=MyISAM
CHILD2_1_GM_CHARSET= DEFAULT CHARSET=utf8
#The followings are set in include/init_xxx.inc files
# CHILD2_1_DROP_TABLES
# CHILD2_1_CREATE_TABLES
# CHILD2_1_SELECT_TABLES
# CHILD2_1_DROP_TABLES2
# CHILD2_1_CREATE_TABLES2
# CHILD2_1_SELECT_TABLES2
# CHILD2_1_DROP_TABLES3
# CHILD2_1_CREATE_TABLES3
# CHILD2_1_SELECT_TABLES3
# CHILD2_1_DROP_TABLES4
# CHILD2_1_CREATE_TABLES4
# CHILD2_1_SELECT_TABLES4
# CHILD2_1_DROP_TABLES5
# CHILD2_1_CREATE_TABLES5
# CHILD2_1_SELECT_TABLES5
# CHILD2_1_DROP_TABLES6
# CHILD2_1_CREATE_TABLES6
# CHILD2_1_SELECT_TABLES6

View File

@ -0,0 +1,38 @@
[mysqld.2.2]
loose_handlersocket_port= 20004
loose_handlersocket_port_wr= 20005
loose_handlersocket_threads= 2
loose_handlersocket_threads_wr= 1
loose_handlersocket_support_merge_table= 0
loose_handlersocket_direct_update_mode= 2
loose_handlersocket_unlimited_boundary= 65536
loose_handlersocket_bulk_insert= 0
loose_handlersocket_bulk_insert_timeout= 0
loose_handlersocket_general_log= 1
loose_handlersocket_timeout= 30
loose_handlersocket_close_table_interval=2
open_files_limit= 4096
[ENV]
CHILD2_2_MYPORT= @mysqld.2.2.port
CHILD2_2_HSRPORT= 20004
CHILD2_2_HSWPORT= 20005
CHILD2_2_MYSOCK= @mysqld.2.2.socket
CHILD2_2_ENGINE_TYPE= InnoDB
CHILD2_2_ENGINE= ENGINE=InnoDB
CHILD2_2_CHARSET= DEFAULT CHARSET=utf8
CHILD2_2_FT_MYPORT= @mysqld.2.2.port
CHILD2_2_FT_MYSOCK= @mysqld.2.2.socket
CHILD2_2_FT_ENGINE_TYPE= MyISAM
CHILD2_2_FT_ENGINE= ENGINE=MyISAM
CHILD2_2_FT_CHARSET= DEFAULT CHARSET=utf8
CHILD2_2_GM_MYPORT= @mysqld.2.2.port
CHILD2_2_GM_MYSOCK= @mysqld.2.2.socket
CHILD2_2_GM_ENGINE_TYPE= MyISAM
CHILD2_2_GM_ENGINE= ENGINE=MyISAM
CHILD2_2_GM_CHARSET= DEFAULT CHARSET=utf8
#The followings are set in include/init_xxx.inc files
# CHILD2_2_DROP_TABLES
# CHILD2_2_CREATE_TABLES
# CHILD2_2_SELECT_TABLES

View File

@ -0,0 +1,8 @@
[mysqld.2.3]
[ENV]
CHILD2_3_MYPORT= @mysqld.2.3.port
CHILD2_3_MYSOCK= @mysqld.2.3.socket
CHILD2_3_ENGINE_TYPE= InnoDB
CHILD2_3_ENGINE= ENGINE=InnoDB
CHILD2_3_CHARSET= DEFAULT CHARSET=utf8

View File

@ -0,0 +1,11 @@
[mysqld.3.1]
loose_partition= 1
[ENV]
USE_CHILD_GROUP3= 1
OUTPUT_CHILD_GROUP3= 0
CHILD3_1_MYPORT= @mysqld.3.1.port
CHILD3_1_MYSOCK= @mysqld.3.1.socket
CHILD3_1_ENGINE_TYPE= InnoDB
CHILD3_1_ENGINE= ENGINE=InnoDB
CHILD3_1_CHARSET= DEFAULT CHARSET=utf8

View File

@ -0,0 +1,9 @@
[mysqld.3.2]
loose_partition= 1
[ENV]
CHILD3_2_MYPORT= @mysqld.3.2.port
CHILD3_2_MYSOCK= @mysqld.3.2.socket
CHILD3_2_ENGINE_TYPE= InnoDB
CHILD3_2_ENGINE= ENGINE=InnoDB
CHILD3_2_CHARSET= DEFAULT CHARSET=utf8

View File

@ -0,0 +1,9 @@
[mysqld.3.3]
loose_partition= 1
[ENV]
CHILD3_3_MYPORT= @mysqld.3.3.port
CHILD3_3_MYSOCK= @mysqld.3.3.socket
CHILD3_3_ENGINE_TYPE= InnoDB
CHILD3_3_ENGINE= ENGINE=InnoDB
CHILD3_3_CHARSET= DEFAULT CHARSET=utf8

View File

@ -0,0 +1,9 @@
[mysqld.4.1]
loose_partition= 1
[ENV]
SLAVE1_1_MYPORT= @mysqld.4.1.port
SLAVE1_1_MYSOCK= @mysqld.4.1.socket
SLAVE1_1_ENGINE_TYPE= MyISAM
SLAVE1_1_ENGINE= ENGINE=MyISAM
SLAVE1_1_CHARSET= DEFAULT CHARSET=utf8

View File

@ -0,0 +1,100 @@
for master_1
for child2
child2_1
child2_2
child2_3
for child3
connection master_1;
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 3;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;
this test is for MDEV-16279
drop and create databases
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
create table and insert
connection child2_1;
CHILD2_1_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection master_1;
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
FLUSH TABLES;
select test 1
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
CHECKSUM TABLE tbl_a EXTENDED;
Table Checksum
auto_test_local.tbl_a 1061386331
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
connection master_1;
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
end of test

View File

@ -0,0 +1,33 @@
for master_1
for child2
child2_1
child2_2
child2_3
for child3
drop and create databases
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TEMPORARY TABLE tmp_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE2
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"');
spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"')
1
SELECT pkey FROM tmp_a;
pkey
22
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
end of test

View File

@ -0,0 +1,504 @@
for master_1
for child2
child2_1
child2_2
child2_3
for child3
connection master_1;
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 0;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;
set @old_spider_quick_page_byte= @@spider_quick_page_byte;
this test is for MDEV-16520
drop and create databases
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
create table and insert
connection child2_1;
CHILD2_1_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection child2_2;
CHILD2_2_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection master_1;
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
select test 1
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection master_1;
set session spider_quick_page_byte= 6;
select test 2
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection master_1;
set session spider_quick_page_byte= 0;
select test 3
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
SET GLOBAL log_output = @old_log_output;
connection master_1;
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
set session spider_quick_page_byte= @old_spider_quick_page_byte;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
end of test

View File

@ -0,0 +1,504 @@
for master_1
for child2
child2_1
child2_2
child2_3
for child3
connection master_1;
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 1;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;
set @old_spider_quick_page_byte= @@spider_quick_page_byte;
this test is for MDEV-16520
drop and create databases
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
create table and insert
connection child2_1;
CHILD2_1_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection child2_2;
CHILD2_2_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection master_1;
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
select test 1
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection master_1;
set session spider_quick_page_byte= 6;
select test 2
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection master_1;
set session spider_quick_page_byte= 0;
select test 3
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
SET GLOBAL log_output = @old_log_output;
connection master_1;
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
set session spider_quick_page_byte= @old_spider_quick_page_byte;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
end of test

View File

@ -0,0 +1,504 @@
for master_1
for child2
child2_1
child2_2
child2_3
for child3
connection master_1;
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 2;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;
set @old_spider_quick_page_byte= @@spider_quick_page_byte;
this test is for MDEV-16520
drop and create databases
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
create table and insert
connection child2_1;
CHILD2_1_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection child2_2;
CHILD2_2_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection master_1;
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
select test 1
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection master_1;
set session spider_quick_page_byte= 6;
select test 2
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection master_1;
set session spider_quick_page_byte= 0;
select test 3
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
SET GLOBAL log_output = @old_log_output;
connection master_1;
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
set session spider_quick_page_byte= @old_spider_quick_page_byte;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
end of test

View File

@ -0,0 +1,504 @@
for master_1
for child2
child2_1
child2_2
child2_3
for child3
connection master_1;
set @old_spider_quick_mode= @@spider_quick_mode;
set session spider_quick_mode= 3;
set @old_spider_quick_page_size= @@spider_quick_page_size;
set session spider_quick_page_size= 3;
set @old_spider_quick_page_byte= @@spider_quick_page_byte;
this test is for MDEV-16520
drop and create databases
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
connection child2_2;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
create table and insert
connection child2_1;
CHILD2_1_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection child2_2;
CHILD2_2_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection master_1;
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
select test 1
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection master_1;
set session spider_quick_page_byte= 6;
select test 2
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection master_1;
set session spider_quick_page_byte= 0;
select test 3
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection child2_2;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
connection child2_2;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 0
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 1
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 2
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 3
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 4
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 5
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 6
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 7
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 8
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 9
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 10
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 11
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 12
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 13
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 14
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 15
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 16
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 17
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 18
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 19
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 20
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 21
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 22
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 23
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 24
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 25
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 26
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 27
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 28
select `pkey` from `auto_test_remote2`.`tbl_b` where `pkey` = 29
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_b ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
SET GLOBAL log_output = @old_log_output;
connection master_1;
set session spider_quick_mode= @old_spider_quick_mode;
set session spider_quick_page_size= @old_spider_quick_page_size;
set session spider_quick_page_byte= @old_spider_quick_page_byte;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
end of test

View File

@ -0,0 +1,99 @@
for master_1
for child2
child2_1
child2_2
child2_3
for child3
for slave1_1
connection slave1_1;
set @old_spider_slave_trx_isolation= @@spider_slave_trx_isolation;
set global spider_slave_trx_isolation= 1;
drop and create databases
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection slave1_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
create table and insert
connection child2_1;
CHILD2_1_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection master_1;
connection slave1_1;
connection master_1;
SET SESSION sql_log_bin= 0;
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1
SET SESSION sql_log_bin= 1;
connection slave1_1;
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
connection master_1;
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
connection slave1_1;
connection master_1;
SET SESSION sql_log_bin= 0;
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %';
argument
set session time_zone = '+00:00'
SET NAMES utf8
set session transaction isolation level read committed;set session autocommit = 1;start transaction
SELECT argument FROM mysql.general_log WHERE argument LIKE '%set %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
connection slave1_1;
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
connection slave1_1;
set global spider_slave_trx_isolation= @old_spider_slave_trx_isolation;
for slave1_1
for master_1
for child2
child2_1
child2_2
child2_3
for child3
end of test

View File

@ -0,0 +1,78 @@
for master_1
for child2
child2_1
child2_2
child2_3
for child3
this test is for MDEV-18313
drop and create databases
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
connection child2_1;
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
create table and insert
connection child2_1;
CHILD2_1_CREATE_TABLES
TRUNCATE TABLE mysql.general_log;
connection master_1;
CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
select test
connection child2_1;
TRUNCATE TABLE mysql.general_log;
connection master_1;
SELECT * FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
connection child2_1;
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
argument
select t0.`pkey` `pkey` from `auto_test_remote`.`tbl_a` t0 order by `pkey`
SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
SELECT pkey FROM tbl_a ORDER BY pkey;
pkey
0
1
2
3
4
5
6
7
8
9
deinit
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
for master_1
for child2
child2_1
child2_2
child2_3
for child3
end of test

View File

@ -0,0 +1 @@
--loose-innodb --loose-skip-performance-schema

View File

@ -0,0 +1,12 @@
package My::Suite::Spider;
@ISA = qw(My::Suite);
return "No Spider engine" unless $ENV{HA_SPIDER_SO};
return "Not run for embedded server" if $::opt_embedded_server;
return "Test needs --big-test" unless $::opt_big_test;
sub is_default { 1 }
bless { };

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,72 @@
--source ../include/checksum_table_with_quick_mode_3_init.inc
--echo
--echo this test is for MDEV-16279
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
CREATE DATABASE auto_test_local;
USE auto_test_local;
--connection child2_1
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
--enable_warnings
--echo
--echo create table and insert
--connection child2_1
--disable_query_log
echo CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_query_log
echo CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
FLUSH TABLES;
--echo
--echo select test 1
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection master_1
CHECKSUM TABLE tbl_a EXTENDED;
--connection child2_1
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
--enable_warnings
--source ../include/checksum_table_with_quick_mode_3_deinit.inc
--echo
--echo end of test

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,35 @@
--source ../include/direct_sql_with_tmp_table_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
CREATE DATABASE auto_test_local;
USE auto_test_local;
--enable_warnings
--disable_query_log
echo CREATE TEMPORARY TABLE tmp_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE2;
eval CREATE TEMPORARY TABLE tmp_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE2;
--enable_query_log
eval $DIRECT_SQL_COMMAND;
SELECT pkey FROM tmp_a;
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
--enable_warnings
--source ../include/direct_sql_with_tmp_table_deinit.inc
--echo
--echo end of test

View File

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

View File

@ -0,0 +1,156 @@
--source ../include/quick_mode_0_init.inc
--echo
--echo this test is for MDEV-16520
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
CREATE DATABASE auto_test_local;
USE auto_test_local;
--connection child2_1
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
--connection child2_2
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
--enable_warnings
--echo
--echo create table and insert
--connection child2_1
--disable_query_log
echo CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection child2_2
--disable_query_log
echo CHILD2_2_CREATE_TABLES;
eval $CHILD2_2_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_query_log
echo CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2;
eval CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
--echo
--echo select test 1
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_6;
--echo
--echo select test 2
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_0;
--echo
--echo select test 3
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
--connection child2_2
DROP DATABASE IF EXISTS auto_test_remote2;
SET GLOBAL log_output = @old_log_output;
--enable_warnings
--source ../include/quick_mode_0_deinit.inc
--echo
--echo end of test

View File

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

View File

@ -0,0 +1,156 @@
--source ../include/quick_mode_1_init.inc
--echo
--echo this test is for MDEV-16520
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
CREATE DATABASE auto_test_local;
USE auto_test_local;
--connection child2_1
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
--connection child2_2
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
--enable_warnings
--echo
--echo create table and insert
--connection child2_1
--disable_query_log
echo CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection child2_2
--disable_query_log
echo CHILD2_2_CREATE_TABLES;
eval $CHILD2_2_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_query_log
echo CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2;
eval CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
--echo
--echo select test 1
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_6;
--echo
--echo select test 2
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_0;
--echo
--echo select test 3
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
--connection child2_2
DROP DATABASE IF EXISTS auto_test_remote2;
SET GLOBAL log_output = @old_log_output;
--enable_warnings
--source ../include/quick_mode_1_deinit.inc
--echo
--echo end of test

View File

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

View File

@ -0,0 +1,156 @@
--source ../include/quick_mode_2_init.inc
--echo
--echo this test is for MDEV-16520
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
CREATE DATABASE auto_test_local;
USE auto_test_local;
--connection child2_1
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
--connection child2_2
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
--enable_warnings
--echo
--echo create table and insert
--connection child2_1
--disable_query_log
echo CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection child2_2
--disable_query_log
echo CHILD2_2_CREATE_TABLES;
eval $CHILD2_2_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_query_log
echo CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2;
eval CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
--echo
--echo select test 1
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_6;
--echo
--echo select test 2
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_0;
--echo
--echo select test 3
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
--connection child2_2
DROP DATABASE IF EXISTS auto_test_remote2;
SET GLOBAL log_output = @old_log_output;
--enable_warnings
--source ../include/quick_mode_2_deinit.inc
--echo
--echo end of test

View File

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

View File

@ -0,0 +1,157 @@
--source ../include/quick_mode_3_init.inc
--echo
--echo this test is for MDEV-16520
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
CREATE DATABASE auto_test_local;
USE auto_test_local;
--connection child2_1
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
--connection child2_2
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
--enable_warnings
--echo
--echo create table and insert
--connection child2_1
--disable_query_log
echo CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection child2_2
--disable_query_log
echo CHILD2_2_CREATE_TABLES;
eval $CHILD2_2_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection master_1
--disable_query_log
echo CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
echo CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_2;
eval CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_b (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_2;
--enable_query_log
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_a (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_a (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
INSERT INTO tbl_b (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO tbl_b (pkey) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19);
INSERT INTO tbl_b (pkey) VALUES (20),(21),(22),(23),(24),(25),(26),(27),(28),(29);
--echo
--echo select test 1
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_6;
--echo
--echo select test 2
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--connection master_1
eval $MASTER_1_SET_QUICK_PAGE_BYTE_0;
--echo
--echo select test 3
--connection child2_1
TRUNCATE TABLE mysql.general_log;
--connection child2_2
TRUNCATE TABLE mysql.general_log;
--connection master_1
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
--connection child2_1
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection child2_2
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
eval $CHILD2_2_SELECT_ARGUMENT1;
eval $CHILD2_2_SELECT_TABLES;
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
--connection child2_2
DROP DATABASE IF EXISTS auto_test_remote2;
SET GLOBAL log_output = @old_log_output;
--enable_warnings
--source ../include/quick_mode_3_deinit.inc
--echo
--echo end of test

View File

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

View File

@ -0,0 +1,95 @@
--source ../include/slave_trx_isolation_init.inc
--echo
--echo drop and create databases
--connection master_1
--disable_warnings
CREATE DATABASE auto_test_local;
USE auto_test_local;
--connection slave1_1
CREATE DATABASE auto_test_local;
USE auto_test_local;
--connection child2_1
SET @old_log_output = @@global.log_output;
SET GLOBAL log_output = 'TABLE,FILE';
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
--enable_warnings
--echo
--echo create table and insert
--connection child2_1
--disable_query_log
echo CHILD2_1_CREATE_TABLES;
eval $CHILD2_1_CREATE_TABLES;
--enable_query_log
TRUNCATE TABLE mysql.general_log;
--connection master_1
save_master_pos;
--connection slave1_1
sync_with_master;
--connection master_1
SET SESSION sql_log_bin= 0;
--disable_query_log
echo CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE2 MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE2 $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
SET SESSION sql_log_bin= 1;
--connection slave1_1
--disable_query_log
echo CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1;
eval CREATE TABLE tbl_a (
pkey int NOT NULL,
PRIMARY KEY (pkey)
) $MASTER_1_ENGINE $MASTER_1_CHARSET $MASTER_1_COMMENT_2_1;
--enable_query_log
--connection master_1
INSERT INTO tbl_a (pkey) VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
save_master_pos;
--connection slave1_1
sync_with_master;
--connection master_1
SET SESSION sql_log_bin= 0;
--connection child2_1
eval $CHILD2_1_SELECT_ARGUMENT1;
eval $CHILD2_1_SELECT_TABLES;
--connection slave1_1
SELECT pkey FROM tbl_a ORDER BY pkey;
--echo
--echo deinit
--disable_warnings
--connection master_1
DROP DATABASE IF EXISTS auto_test_local;
--connection slave1_1
DROP DATABASE IF EXISTS auto_test_local;
--connection child2_1
DROP DATABASE IF EXISTS auto_test_remote;
SET GLOBAL log_output = @old_log_output;
--enable_warnings
--source ../include/slave_trx_isolation_deinit.inc
--echo
--echo end of test

View File

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

Some files were not shown because too many files have changed in this diff Show More