mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.6' into '10.11'
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
|
||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8...3.12)
|
||||||
|
|
||||||
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
IF(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
# Setting build type to RelWithDebInfo as none was specified.
|
# Setting build type to RelWithDebInfo as none was specified.
|
||||||
|
@@ -2997,5 +2997,79 @@ UPDATE t1 SET c=1 ORDER BY (SELECT c);
|
|||||||
ERROR 42S22: Reference 'c' not supported (forward reference in item list)
|
ERROR 42S22: Reference 'c' not supported (forward reference in item list)
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
|
# MDEV-35238: Wrong results from a tables with a single record and an aggregate
|
||||||
|
#
|
||||||
|
CREATE OR REPLACE TABLE t1 (a int) ENGINE=myisam;
|
||||||
|
SELECT 1+0, min(1) FROM t1 WHERE if(uuid_short(), a,1);
|
||||||
|
1+0 min(1)
|
||||||
|
1 NULL
|
||||||
|
explain format=json SELECT 1+0, min(1) FROM t1 WHERE if(uuid_short(), a,1);
|
||||||
|
EXPLAIN
|
||||||
|
{
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 1,
|
||||||
|
"table": {
|
||||||
|
"message": "Impossible WHERE noticed after reading const tables"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
INSERT INTO t1 VALUES (NULL);
|
||||||
|
SELECT 1+0, min(1) FROM t1 WHERE if(uuid_short(), a,1);
|
||||||
|
1+0 min(1)
|
||||||
|
1 NULL
|
||||||
|
explain format=json SELECT 1+0, min(1) FROM t1 WHERE if(uuid_short(), a,1);
|
||||||
|
EXPLAIN
|
||||||
|
{
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 1,
|
||||||
|
"pseudo_bits_condition": "if(uuid_short(),NULL,1)",
|
||||||
|
"nested_loop": [
|
||||||
|
{
|
||||||
|
"table": {
|
||||||
|
"table_name": "t1",
|
||||||
|
"access_type": "system",
|
||||||
|
"rows": 1,
|
||||||
|
"filtered": 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=myisam;
|
||||||
|
INSERT INTO t1 VALUES (1);
|
||||||
|
CREATE TABLE t2 (a int NOT NULL) ENGINE=myisam;
|
||||||
|
INSERT INTO t2 VALUES (10);
|
||||||
|
SELECT 1+0, MIN(t1.a) FROM t1,t2 WHERE t2.a = rand();
|
||||||
|
1+0 MIN(t1.a)
|
||||||
|
1 1
|
||||||
|
explain format=json SELECT 1+0, MIN(t1.a) FROM t1,t2 WHERE t2.a = rand();
|
||||||
|
EXPLAIN
|
||||||
|
{
|
||||||
|
"query_block": {
|
||||||
|
"select_id": 1,
|
||||||
|
"pseudo_bits_condition": "10 = rand()",
|
||||||
|
"nested_loop": [
|
||||||
|
{
|
||||||
|
"table": {
|
||||||
|
"table_name": "t1",
|
||||||
|
"access_type": "system",
|
||||||
|
"rows": 1,
|
||||||
|
"filtered": 100
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"table": {
|
||||||
|
"table_name": "t2",
|
||||||
|
"access_type": "system",
|
||||||
|
"rows": 1,
|
||||||
|
"filtered": 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DROP TABLE t1,t2;
|
||||||
|
#
|
||||||
# End of 10.5 tests
|
# End of 10.5 tests
|
||||||
#
|
#
|
||||||
|
@@ -2152,6 +2152,28 @@ UPDATE t1 SET c=1 ORDER BY (SELECT c);
|
|||||||
UPDATE t1 SET c=1 ORDER BY (SELECT c);
|
UPDATE t1 SET c=1 ORDER BY (SELECT c);
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-35238: Wrong results from a tables with a single record and an aggregate
|
||||||
|
--echo #
|
||||||
|
CREATE OR REPLACE TABLE t1 (a int) ENGINE=myisam;
|
||||||
|
SELECT 1+0, min(1) FROM t1 WHERE if(uuid_short(), a,1);
|
||||||
|
explain format=json SELECT 1+0, min(1) FROM t1 WHERE if(uuid_short(), a,1);
|
||||||
|
INSERT INTO t1 VALUES (NULL);
|
||||||
|
SELECT 1+0, min(1) FROM t1 WHERE if(uuid_short(), a,1);
|
||||||
|
explain format=json SELECT 1+0, min(1) FROM t1 WHERE if(uuid_short(), a,1);
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=myisam;
|
||||||
|
INSERT INTO t1 VALUES (1);
|
||||||
|
|
||||||
|
CREATE TABLE t2 (a int NOT NULL) ENGINE=myisam;
|
||||||
|
INSERT INTO t2 VALUES (10);
|
||||||
|
|
||||||
|
SELECT 1+0, MIN(t1.a) FROM t1,t2 WHERE t2.a = rand();
|
||||||
|
explain format=json SELECT 1+0, MIN(t1.a) FROM t1,t2 WHERE t2.a = rand();
|
||||||
|
|
||||||
|
DROP TABLE t1,t2;
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # End of 10.5 tests
|
--echo # End of 10.5 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
--source include/big_test.inc
|
--source include/big_test.inc
|
||||||
# Valgrind is to slow for this test
|
# Valgrind and msan is to slow for this test
|
||||||
--source include/not_valgrind.inc
|
--source include/not_valgrind.inc
|
||||||
|
--source include/not_msan.inc
|
||||||
--source include/have_archive.inc
|
--source include/have_archive.inc
|
||||||
CREATE TABLE t1(a BLOB) ENGINE=ARCHIVE;
|
CREATE TABLE t1(a BLOB) ENGINE=ARCHIVE;
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
|
@@ -7,9 +7,6 @@ connection default;
|
|||||||
|
|
||||||
set global federated_pushdown=1;
|
set global federated_pushdown=1;
|
||||||
|
|
||||||
#Enable after fix MDEV-31846 or in v. 10.5 and later
|
|
||||||
--disable_cursor_protocol
|
|
||||||
|
|
||||||
connection slave;
|
connection slave;
|
||||||
|
|
||||||
DROP TABLE IF EXISTS federated.t1;
|
DROP TABLE IF EXISTS federated.t1;
|
||||||
@@ -168,11 +165,13 @@ insert into federated.t4 select * from federated.t1;
|
|||||||
--sorted_result
|
--sorted_result
|
||||||
select * from federated.t4;
|
select * from federated.t4;
|
||||||
|
|
||||||
|
--disable_cursor_protocol
|
||||||
select name into @var from federated.t1 where id=3 limit 1 ;
|
select name into @var from federated.t1 where id=3 limit 1 ;
|
||||||
select @var;
|
select @var;
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
select name into outfile 'tmp.txt' from federated.t1;
|
select name into outfile 'tmp.txt' from federated.t1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_cursor_protocol
|
||||||
|
|
||||||
let $path=`select concat(@@datadir, 'test/tmp.txt')`;
|
let $path=`select concat(@@datadir, 'test/tmp.txt')`;
|
||||||
remove_file $path;
|
remove_file $path;
|
||||||
@@ -439,7 +438,5 @@ DEALLOCATE PREPARE stmt;
|
|||||||
|
|
||||||
set global federated_pushdown=0;
|
set global federated_pushdown=0;
|
||||||
|
|
||||||
--enable_cursor_protocol
|
|
||||||
|
|
||||||
source include/federated_cleanup.inc;
|
source include/federated_cleanup.inc;
|
||||||
|
|
||||||
|
112
mysql-test/suite/galera/r/galera_vote_during_ist.result
Normal file
112
mysql-test/suite/galera/r/galera_vote_during_ist.result
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
connection node_4;
|
||||||
|
connection node_3;
|
||||||
|
connection node_2;
|
||||||
|
connection node_1;
|
||||||
|
# Correct Galera library found
|
||||||
|
connection node_1;
|
||||||
|
connection node_2;
|
||||||
|
connection node_3;
|
||||||
|
connection node_4;
|
||||||
|
connection node_1;
|
||||||
|
CREATE TABLE t1(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
CREATE PROCEDURE p1(IN max INT)
|
||||||
|
BEGIN
|
||||||
|
DECLARE i INT;
|
||||||
|
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
|
||||||
|
SET i = 0;
|
||||||
|
WHILE i < max DO
|
||||||
|
INSERT IGNORE INTO t1 VALUES (DEFAULT);
|
||||||
|
SET i = i + 1;
|
||||||
|
END WHILE;
|
||||||
|
END|
|
||||||
|
CALL p1(130);
|
||||||
|
connection node_4;
|
||||||
|
Shutting down server 4...
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_2;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_3;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
Server 4 left the cluster
|
||||||
|
connection node_1;
|
||||||
|
CALL p1(130);
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
connection node_2;
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
connection node_3;
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
INSERT INTO t2 VALUES (DEFAULT);
|
||||||
|
CALL p1(130);
|
||||||
|
connection node_1;
|
||||||
|
SET GLOBAL debug = "+d,sync.wsrep_sst_donor_after_donation";
|
||||||
|
Restarting server 4
|
||||||
|
Wait for server 1 to become a donor
|
||||||
|
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_sst_donor_after_donation_reached";
|
||||||
|
Server 1 got SST request from server 4
|
||||||
|
SET SESSION DEBUG_SYNC = "now SIGNAL signal.wsrep_sst_donor_after_donation_continue";
|
||||||
|
SET GLOBAL debug = "";
|
||||||
|
SET DEBUG_SYNC='RESET';
|
||||||
|
Waiting for server 4 to leave the cluster
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_2;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_3;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_4;
|
||||||
|
Server 4 left the cluster, killing it...
|
||||||
|
Killed server 4...
|
||||||
|
Restarting server 4...
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_1;
|
||||||
|
SELECT count(*) AS expect1_390 FROM t1;
|
||||||
|
expect1_390
|
||||||
|
390
|
||||||
|
SELECT count(*) AS expect1_1 FROM t2;
|
||||||
|
expect1_1
|
||||||
|
1
|
||||||
|
connection node_2;
|
||||||
|
SELECT count(*) AS expect2_390 FROM t1;
|
||||||
|
expect2_390
|
||||||
|
390
|
||||||
|
SELECT count(*) AS expect2_1 FROM t2;
|
||||||
|
expect2_1
|
||||||
|
1
|
||||||
|
connection node_3;
|
||||||
|
SELECT count(*) AS expect3_390 FROM t1;
|
||||||
|
expect3_390
|
||||||
|
390
|
||||||
|
SELECT count(*) AS expect3_1 FROM t2;
|
||||||
|
expect3_1
|
||||||
|
1
|
||||||
|
connection node_4;
|
||||||
|
SELECT count(*) AS expect4_390 FROM t1;
|
||||||
|
expect4_390
|
||||||
|
390
|
||||||
|
SELECT count(*) AS expect4_1 FROM t2;
|
||||||
|
expect4_1
|
||||||
|
1
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
||||||
|
CALL mtr.add_suppression("Inconsistency detected: Failed on preordered");
|
||||||
|
CALL mtr.add_suppression("Failed to apply write set");
|
||||||
|
CALL mtr.add_suppression("Sending JOIN failed: -103");
|
||||||
|
CALL mtr.add_suppression("Failed to JOIN the cluster after SST");
|
94
mysql-test/suite/galera/r/galera_vote_joined_apply.result
Normal file
94
mysql-test/suite/galera/r/galera_vote_joined_apply.result
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
connection node_4;
|
||||||
|
connection node_3;
|
||||||
|
connection node_2;
|
||||||
|
connection node_1;
|
||||||
|
# Correct Galera library found
|
||||||
|
connection node_1;
|
||||||
|
connection node_2;
|
||||||
|
connection node_3;
|
||||||
|
connection node_4;
|
||||||
|
connection node_1;
|
||||||
|
CREATE TABLE t1(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
CREATE PROCEDURE p1(IN max INT)
|
||||||
|
BEGIN
|
||||||
|
DECLARE i INT;
|
||||||
|
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
|
||||||
|
SET i = 0;
|
||||||
|
WHILE i < max DO
|
||||||
|
INSERT IGNORE INTO t1 VALUES (DEFAULT);
|
||||||
|
SET i = i + 1;
|
||||||
|
END WHILE;
|
||||||
|
END|
|
||||||
|
CALL p1(130);
|
||||||
|
connection node_4;
|
||||||
|
Shutting down server 4...
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
SET GLOBAL debug = "+d,sync.wsrep_donor_state";
|
||||||
|
connection node_4;
|
||||||
|
Restarting server 4...
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_donor_state_reached";
|
||||||
|
Tables on server 1 flushed and locked for SST to server 4
|
||||||
|
SET SESSION DEBUG_SYNC = "now SIGNAL signal.wsrep_donor_state";
|
||||||
|
SET GLOBAL debug = "";
|
||||||
|
SET DEBUG_SYNC='RESET';
|
||||||
|
Wait for the state snapshot to be copied to server 4
|
||||||
|
SST script unlocked server 1
|
||||||
|
connection node_1;
|
||||||
|
CALL p1(130);
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
connection node_2;
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
connection node_3;
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
INSERT INTO t2 VALUES (DEFAULT);
|
||||||
|
CALL p1(130);
|
||||||
|
Waiting for server 4 to leave the cluster
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_2;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_4;
|
||||||
|
Server 4 left the cluster, killing it...
|
||||||
|
Killed server 4...
|
||||||
|
Restarting server 4...
|
||||||
|
DROP TABLE t2;
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_1;
|
||||||
|
SELECT count(*) AS expect1_390 FROM t1;
|
||||||
|
expect1_390
|
||||||
|
390
|
||||||
|
connection node_2;
|
||||||
|
SELECT count(*) AS expect2_390 FROM t1;
|
||||||
|
expect2_390
|
||||||
|
390
|
||||||
|
connection node_3;
|
||||||
|
SELECT count(*) AS expect3_390 FROM t1;
|
||||||
|
expect3_390
|
||||||
|
390
|
||||||
|
connection node_4;
|
||||||
|
SELECT count(*) AS expect4_390 FROM t1;
|
||||||
|
expect4_390
|
||||||
|
390
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
connection node_4;
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
||||||
|
CALL mtr.add_suppression("Inconsistency detected: Inconsistent by consensus");
|
||||||
|
CALL mtr.add_suppression("Failed to apply write set: gtid:");
|
102
mysql-test/suite/galera/r/galera_vote_joined_skip.result
Normal file
102
mysql-test/suite/galera/r/galera_vote_joined_skip.result
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
connection node_4;
|
||||||
|
connection node_3;
|
||||||
|
connection node_2;
|
||||||
|
connection node_1;
|
||||||
|
# Correct Galera library found
|
||||||
|
connection node_1;
|
||||||
|
connection node_2;
|
||||||
|
connection node_3;
|
||||||
|
connection node_4;
|
||||||
|
connection node_1;
|
||||||
|
CREATE TABLE t1(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
CREATE PROCEDURE p1(IN max INT)
|
||||||
|
BEGIN
|
||||||
|
DECLARE i INT;
|
||||||
|
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
|
||||||
|
SET i = 0;
|
||||||
|
WHILE i < max DO
|
||||||
|
INSERT IGNORE INTO t1 VALUES (DEFAULT);
|
||||||
|
SET i = i + 1;
|
||||||
|
END WHILE;
|
||||||
|
END|
|
||||||
|
CALL p1(130);
|
||||||
|
connection node_4;
|
||||||
|
Shutting down server 4...
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
SET GLOBAL debug = "+d,sync.wsrep_donor_state";
|
||||||
|
connection node_4;
|
||||||
|
Restarting server 4...
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_donor_state_reached";
|
||||||
|
Tables on server 1 flushed and locked for SST to server 4
|
||||||
|
SET SESSION DEBUG_SYNC = "now SIGNAL signal.wsrep_donor_state";
|
||||||
|
SET GLOBAL debug = "";
|
||||||
|
SET DEBUG_SYNC='RESET';
|
||||||
|
Wait for the state snapshot to be copied to server 4
|
||||||
|
SST script unlocked server 1
|
||||||
|
connection node_1;
|
||||||
|
CALL p1(130);
|
||||||
|
connection node_3;
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
INSERT INTO t2 VALUES (DEFAULT);
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
connection node_1;
|
||||||
|
CALL p1(130);
|
||||||
|
Waiting for server 3 to leave the cluster
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_2;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_4;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_3;
|
||||||
|
Server 3 left the cluster, killing it...
|
||||||
|
Killed server 3.
|
||||||
|
Restarting server 3...
|
||||||
|
Waiting for server 3 to rejoin the cluster
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_3;
|
||||||
|
sleeping for 20
|
||||||
|
Waiting ready
|
||||||
|
Server 3 restarted.
|
||||||
|
connection node_1;
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
SET SESSION wsrep_sync_wait = 15;
|
||||||
|
connection node_1;
|
||||||
|
SELECT count(*) AS expect1_390 FROM t1;
|
||||||
|
expect1_390
|
||||||
|
390
|
||||||
|
connection node_2;
|
||||||
|
SELECT count(*) AS expect2_390 FROM t1;
|
||||||
|
expect2_390
|
||||||
|
390
|
||||||
|
connection node_3;
|
||||||
|
SELECT count(*) AS expect3_390 FROM t1;
|
||||||
|
expect3_390
|
||||||
|
390
|
||||||
|
connection node_4;
|
||||||
|
SELECT count(*) AS expect4_390 FROM t1;
|
||||||
|
expect4_390
|
||||||
|
390
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
connection node_1;
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
||||||
|
connection node_2;
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
||||||
|
connection node_3;
|
||||||
|
CALL mtr.add_suppression("Vote 0 \\(success\\) on .+ is inconsistent with group");
|
||||||
|
connection node_4;
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
20
mysql-test/suite/galera/t/galera_vote_during_ist.cnf
Normal file
20
mysql-test/suite/galera/t/galera_vote_during_ist.cnf
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
!include ../galera_4nodes.cnf
|
||||||
|
|
||||||
|
[mysqld]
|
||||||
|
wsrep-ignore-apply-errors=0
|
||||||
|
|
||||||
|
[mysqld.1]
|
||||||
|
wsrep_node_name='node_1'
|
||||||
|
|
||||||
|
[mysqld.2]
|
||||||
|
wsrep_node_name='node_2'
|
||||||
|
|
||||||
|
[mysqld.3]
|
||||||
|
wsrep_node_name='node_3'
|
||||||
|
|
||||||
|
[mysqld.4]
|
||||||
|
wsrep_node_name='node_4'
|
||||||
|
wsrep_sst_donor='node_1'
|
||||||
|
|
||||||
|
[ENV]
|
||||||
|
galera_cluster_size=4
|
165
mysql-test/suite/galera/t/galera_vote_during_ist.test
Normal file
165
mysql-test/suite/galera/t/galera_vote_during_ist.test
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
#
|
||||||
|
# Test a case where a joiner encounters an error during IST
|
||||||
|
# Instead of voting it should assume error and bail out.
|
||||||
|
#
|
||||||
|
|
||||||
|
--source include/galera_cluster.inc
|
||||||
|
--source include/big_test.inc
|
||||||
|
--source include/have_debug.inc
|
||||||
|
--source include/have_debug_sync.inc
|
||||||
|
|
||||||
|
# Make sure that the test is operating on the right version of galera library.
|
||||||
|
--let $galera_version=26.4.19
|
||||||
|
source ../wsrep/include/check_galera_version.inc;
|
||||||
|
|
||||||
|
--let $node_1=node_1
|
||||||
|
--let $node_2=node_2
|
||||||
|
--let $node_3=node_3
|
||||||
|
--let $node_4=node_4
|
||||||
|
--source ../include/auto_increment_offset_save.inc
|
||||||
|
|
||||||
|
# create table t1 and procedure p1 to generate wirtesets
|
||||||
|
--connection node_1
|
||||||
|
CREATE TABLE t1(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
|
||||||
|
DELIMITER |;
|
||||||
|
CREATE PROCEDURE p1(IN max INT)
|
||||||
|
BEGIN
|
||||||
|
DECLARE i INT;
|
||||||
|
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
|
||||||
|
|
||||||
|
SET i = 0;
|
||||||
|
WHILE i < max DO
|
||||||
|
INSERT IGNORE INTO t1 VALUES (DEFAULT);
|
||||||
|
SET i = i + 1;
|
||||||
|
END WHILE;
|
||||||
|
END|
|
||||||
|
DELIMITER ;|
|
||||||
|
|
||||||
|
CALL p1(130);
|
||||||
|
|
||||||
|
--connection node_4
|
||||||
|
--echo Shutting down server 4...
|
||||||
|
--let $node_4_server_id= `SELECT @@server_id`
|
||||||
|
--let $node_4_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$node_4_server_id.expect
|
||||||
|
--let $node_4_pid_file= `SELECT @@pid_file`
|
||||||
|
--source include/shutdown_mysqld.inc
|
||||||
|
|
||||||
|
# Wait for node #4 to leave cluster
|
||||||
|
--let $members = 3
|
||||||
|
--connection node_1
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
--connection node_2
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
--connection node_3
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
--echo Server 4 left the cluster
|
||||||
|
|
||||||
|
# Create some writesets for IST
|
||||||
|
--connection node_1
|
||||||
|
CALL p1(130);
|
||||||
|
|
||||||
|
# Create a writeset that node 4 won't be able to apply by creating a table
|
||||||
|
# that won't be present in the replication stream
|
||||||
|
--connection node_1
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
|
||||||
|
--connection node_2
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
|
||||||
|
--connection node_3
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
|
||||||
|
# This should cause error during IST
|
||||||
|
INSERT INTO t2 VALUES (DEFAULT);
|
||||||
|
|
||||||
|
# make sure nodes 1,2,3 progress far enough for commit cut update
|
||||||
|
CALL p1(130);
|
||||||
|
|
||||||
|
--connection node_1
|
||||||
|
# prepare to stop SST donor thread when it receives a request from starting node #4
|
||||||
|
SET GLOBAL debug = "+d,sync.wsrep_sst_donor_after_donation";
|
||||||
|
|
||||||
|
--echo Restarting server 4
|
||||||
|
# Need to use this form instead of start_mysqld.inc because the latter is blocking
|
||||||
|
--exec echo "restart:$start_mysqld_params" > $node_4_expect_file_name
|
||||||
|
|
||||||
|
--echo Wait for server 1 to become a donor
|
||||||
|
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_sst_donor_after_donation_reached";
|
||||||
|
--echo Server 1 got SST request from server 4
|
||||||
|
SET SESSION DEBUG_SYNC = "now SIGNAL signal.wsrep_sst_donor_after_donation_continue";
|
||||||
|
SET GLOBAL debug = "";
|
||||||
|
SET DEBUG_SYNC='RESET';
|
||||||
|
|
||||||
|
#
|
||||||
|
# After this point node #4 shall proceed to IST and bail out
|
||||||
|
#
|
||||||
|
|
||||||
|
--echo Waiting for server 4 to leave the cluster
|
||||||
|
--let $members = 3
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
--connection node_2
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
--connection node_3
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
|
||||||
|
--connection node_4
|
||||||
|
--echo Server 4 left the cluster, killing it...
|
||||||
|
|
||||||
|
# Kill the connected server
|
||||||
|
--exec echo "wait" > $node_4_expect_file_name
|
||||||
|
--let KILL_NODE_PIDFILE = $node_4_pid_file
|
||||||
|
--perl
|
||||||
|
my $pid_filename = $ENV{'KILL_NODE_PIDFILE'};
|
||||||
|
my $mysqld_pid = `cat $pid_filename`;
|
||||||
|
chomp($mysqld_pid);
|
||||||
|
system("kill -9 $mysqld_pid");
|
||||||
|
exit(0);
|
||||||
|
EOF
|
||||||
|
--echo Killed server 4...
|
||||||
|
--source include/wait_until_disconnected.inc
|
||||||
|
--echo Restarting server 4...
|
||||||
|
--source include/start_mysqld.inc
|
||||||
|
--source include/galera_wait_ready.inc
|
||||||
|
|
||||||
|
# Confirm node #4 has rejoined
|
||||||
|
--connection node_1
|
||||||
|
--let $members = 4
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
|
||||||
|
# Confirm that all is good and all nodes have identical data
|
||||||
|
|
||||||
|
--connection node_1
|
||||||
|
SELECT count(*) AS expect1_390 FROM t1;
|
||||||
|
SELECT count(*) AS expect1_1 FROM t2;
|
||||||
|
|
||||||
|
--connection node_2
|
||||||
|
SELECT count(*) AS expect2_390 FROM t1;
|
||||||
|
SELECT count(*) AS expect2_1 FROM t2;
|
||||||
|
|
||||||
|
--connection node_3
|
||||||
|
SELECT count(*) AS expect3_390 FROM t1;
|
||||||
|
SELECT count(*) AS expect3_1 FROM t2;
|
||||||
|
|
||||||
|
--connection node_4
|
||||||
|
SELECT count(*) AS expect4_390 FROM t1;
|
||||||
|
SELECT count(*) AS expect4_1 FROM t2;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
||||||
|
CALL mtr.add_suppression("Inconsistency detected: Failed on preordered");
|
||||||
|
CALL mtr.add_suppression("Failed to apply write set");
|
||||||
|
CALL mtr.add_suppression("Sending JOIN failed: -103");
|
||||||
|
CALL mtr.add_suppression("Failed to JOIN the cluster after SST");
|
||||||
|
|
||||||
|
--source ../include/auto_increment_offset_restore.inc
|
21
mysql-test/suite/galera/t/galera_vote_joined_apply.cnf
Normal file
21
mysql-test/suite/galera/t/galera_vote_joined_apply.cnf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
!include ../galera_4nodes.cnf
|
||||||
|
|
||||||
|
[mysqld]
|
||||||
|
wsrep-ignore-apply-errors=0
|
||||||
|
|
||||||
|
[mysqld.1]
|
||||||
|
wsrep_node_name='node_1'
|
||||||
|
|
||||||
|
[mysqld.2]
|
||||||
|
wsrep_node_name='node_2'
|
||||||
|
|
||||||
|
[mysqld.3]
|
||||||
|
wsrep_node_name='node_3'
|
||||||
|
|
||||||
|
[mysqld.4]
|
||||||
|
wsrep_node_name='node_4'
|
||||||
|
wsrep_sst_donor='node_1'
|
||||||
|
|
||||||
|
[ENV]
|
||||||
|
galera_cluster_size=4
|
||||||
|
MTR_SST_JOINER_DELAY=20
|
73
mysql-test/suite/galera/t/galera_vote_joined_apply.test
Normal file
73
mysql-test/suite/galera/t/galera_vote_joined_apply.test
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
#
|
||||||
|
# Test a case where a vote happens in JOINED state after SST on a writeset
|
||||||
|
# that should be applied.
|
||||||
|
#
|
||||||
|
|
||||||
|
--source galera_vote_joined_begin.inc
|
||||||
|
#
|
||||||
|
# At this point state snapshot has been copied, node 1 is operational and
|
||||||
|
# we have about 10 seconds while everything we do will go into the replication
|
||||||
|
# queue on node 4 which it will have to apply on top of the snapshot.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Increase replication queue on node_4
|
||||||
|
--connection node_1
|
||||||
|
CALL p1(130);
|
||||||
|
|
||||||
|
# Create a writeset that node 4 won't be able to apply by creating a table
|
||||||
|
# that won't be present in the replication stream
|
||||||
|
--connection node_1
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
|
||||||
|
--connection node_2
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
|
||||||
|
--connection node_3
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
|
||||||
|
# This should cause node #4 to initiate a vote and leave the cluster
|
||||||
|
INSERT INTO t2 VALUES (DEFAULT);
|
||||||
|
|
||||||
|
# make sure nodes 1,2,3 progress far enough for commit cut update
|
||||||
|
CALL p1(130);
|
||||||
|
|
||||||
|
--echo Waiting for server 4 to leave the cluster
|
||||||
|
--let $members = 3
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
--connection node_2
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
--connection node_1
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
|
||||||
|
--connection node_4
|
||||||
|
--echo Server 4 left the cluster, killing it...
|
||||||
|
# Kill the connected server
|
||||||
|
--exec echo "wait" > $node_4_expect_file_name
|
||||||
|
--let KILL_NODE_PIDFILE = $node_4_pid_file
|
||||||
|
--perl
|
||||||
|
my $pid_filename = $ENV{'KILL_NODE_PIDFILE'};
|
||||||
|
my $mysqld_pid = `cat $pid_filename`;
|
||||||
|
chomp($mysqld_pid);
|
||||||
|
system("kill -9 $mysqld_pid");
|
||||||
|
exit(0);
|
||||||
|
EOF
|
||||||
|
--echo Killed server 4...
|
||||||
|
--source include/wait_until_disconnected.inc
|
||||||
|
--echo Restarting server 4...
|
||||||
|
--source include/start_mysqld.inc
|
||||||
|
--source include/galera_wait_ready.inc
|
||||||
|
DROP TABLE t2;
|
||||||
|
|
||||||
|
--source galera_vote_joined_end.inc
|
||||||
|
|
||||||
|
--connection node_4
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
||||||
|
CALL mtr.add_suppression("Inconsistency detected: Inconsistent by consensus");
|
||||||
|
CALL mtr.add_suppression("Failed to apply write set: gtid:");
|
79
mysql-test/suite/galera/t/galera_vote_joined_begin.inc
Normal file
79
mysql-test/suite/galera/t/galera_vote_joined_begin.inc
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
# This file purpose is to set up node 4 to require SST which is artificaially
|
||||||
|
# prolonged and as a result accumulate sufficient relication queue.
|
||||||
|
# The contents of the qeuee are controlled in the sourcing test files.
|
||||||
|
|
||||||
|
--source include/galera_cluster.inc
|
||||||
|
--source include/big_test.inc
|
||||||
|
--source include/have_debug.inc
|
||||||
|
--source include/have_debug_sync.inc
|
||||||
|
|
||||||
|
# Make sure that the test is operating on the right version of galera library.
|
||||||
|
--let $galera_version=26.4.19
|
||||||
|
source ../wsrep/include/check_galera_version.inc;
|
||||||
|
|
||||||
|
--let $node_1=node_1
|
||||||
|
--let $node_2=node_2
|
||||||
|
--let $node_3=node_3
|
||||||
|
--let $node_4=node_4
|
||||||
|
--source ../include/auto_increment_offset_save.inc
|
||||||
|
|
||||||
|
# create table t1 and procedure p1 to generate wirtesets
|
||||||
|
--connection node_1
|
||||||
|
CREATE TABLE t1(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
|
||||||
|
DELIMITER |;
|
||||||
|
CREATE PROCEDURE p1(IN max INT)
|
||||||
|
BEGIN
|
||||||
|
DECLARE i INT;
|
||||||
|
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
|
||||||
|
|
||||||
|
SET i = 0;
|
||||||
|
WHILE i < max DO
|
||||||
|
INSERT IGNORE INTO t1 VALUES (DEFAULT);
|
||||||
|
SET i = i + 1;
|
||||||
|
END WHILE;
|
||||||
|
END|
|
||||||
|
DELIMITER ;|
|
||||||
|
|
||||||
|
# 130 events move the commit cut, it is essential in voting
|
||||||
|
CALL p1(130);
|
||||||
|
|
||||||
|
--connection node_4
|
||||||
|
--echo Shutting down server 4...
|
||||||
|
--let $node_4_server_id= `SELECT @@server_id`
|
||||||
|
--let $node_4_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$node_4_server_id.expect
|
||||||
|
--let $node_4_pid_file= `SELECT @@pid_file`
|
||||||
|
--source include/shutdown_mysqld.inc
|
||||||
|
# enforce SST
|
||||||
|
--exec rm -rf $MYSQLTEST_VARDIR/mysqld.4/data/grastate.dat
|
||||||
|
|
||||||
|
# Wait for node #4 to leave cluster
|
||||||
|
--connection node_1
|
||||||
|
--let $members = 3
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
|
||||||
|
# prepare to stop SST donor thread when node is in donor state
|
||||||
|
SET GLOBAL debug = "+d,sync.wsrep_donor_state";
|
||||||
|
|
||||||
|
--connection node_4
|
||||||
|
--echo Restarting server 4...
|
||||||
|
# Need to use this form instead of start_mysqld.inc because the latter is blocking
|
||||||
|
--exec echo "restart:$start_mysqld_params" > $node_4_expect_file_name
|
||||||
|
|
||||||
|
# Wait for node #1 to become a donor
|
||||||
|
--connection node_1
|
||||||
|
SET SESSION DEBUG_SYNC = "now WAIT_FOR sync.wsrep_donor_state_reached";
|
||||||
|
--echo Tables on server 1 flushed and locked for SST to server 4
|
||||||
|
SET SESSION DEBUG_SYNC = "now SIGNAL signal.wsrep_donor_state";
|
||||||
|
SET GLOBAL debug = "";
|
||||||
|
SET DEBUG_SYNC='RESET';
|
||||||
|
|
||||||
|
--echo Wait for the state snapshot to be copied to server 4
|
||||||
|
--source include/galera_wait_ready.inc
|
||||||
|
--echo SST script unlocked server 1
|
||||||
|
|
||||||
|
#
|
||||||
|
# At this point state snapshot has been copied, node 1 is operational and
|
||||||
|
# we have about 20 seconds while everything we do will go into the replication
|
||||||
|
# queue on node 4 which it will have to apply on top of the snapshot.
|
||||||
|
#
|
33
mysql-test/suite/galera/t/galera_vote_joined_end.inc
Normal file
33
mysql-test/suite/galera/t/galera_vote_joined_end.inc
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
# Confirm node #4 has rejoined
|
||||||
|
--connection node_1
|
||||||
|
--let $members = 4
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
#DROP TABLE IF EXISTS t2;
|
||||||
|
|
||||||
|
# Confirm that all is good and all nodes have identical data
|
||||||
|
|
||||||
|
--connection node_1
|
||||||
|
SELECT count(*) AS expect1_390 FROM t1;
|
||||||
|
|
||||||
|
#CALL mtr.add_suppression("Replica SQL: Could not execute Delete_rows");
|
||||||
|
#CALL mtr.add_suppression("Event 3 Delete_rows apply failed: 120, seqno [0-9]+");
|
||||||
|
|
||||||
|
--connection node_2
|
||||||
|
SELECT count(*) AS expect2_390 FROM t1;
|
||||||
|
|
||||||
|
#CALL mtr.add_suppression("mysqld: Can't find record in 't1'");
|
||||||
|
#CALL mtr.add_suppression("Replica SQL: Could not execute Delete_rows");
|
||||||
|
#CALL mtr.add_suppression("Event 3 Delete_rows apply failed: 120, seqno seqno [0-9]+");
|
||||||
|
|
||||||
|
--connection node_3
|
||||||
|
SELECT count(*) AS expect3_390 FROM t1;
|
||||||
|
|
||||||
|
--connection node_4
|
||||||
|
SELECT count(*) AS expect4_390 FROM t1;
|
||||||
|
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP PROCEDURE p1;
|
||||||
|
|
||||||
|
#CALL mtr.add_suppression("inconsistent with group");
|
||||||
|
|
||||||
|
--source ../include/auto_increment_offset_restore.inc
|
21
mysql-test/suite/galera/t/galera_vote_joined_skip.cnf
Normal file
21
mysql-test/suite/galera/t/galera_vote_joined_skip.cnf
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
!include ../galera_4nodes.cnf
|
||||||
|
|
||||||
|
[mysqld]
|
||||||
|
wsrep-ignore-apply-errors=0
|
||||||
|
|
||||||
|
[mysqld.1]
|
||||||
|
wsrep_node_name='node_1'
|
||||||
|
|
||||||
|
[mysqld.2]
|
||||||
|
wsrep_node_name='node_2'
|
||||||
|
|
||||||
|
[mysqld.3]
|
||||||
|
wsrep_node_name='node_3'
|
||||||
|
|
||||||
|
[mysqld.4]
|
||||||
|
wsrep_node_name='node_4'
|
||||||
|
wsrep_sst_donor='node_1'
|
||||||
|
|
||||||
|
[ENV]
|
||||||
|
galera_cluster_size=4
|
||||||
|
MTR_SST_JOINER_DELAY=20
|
100
mysql-test/suite/galera/t/galera_vote_joined_skip.test
Normal file
100
mysql-test/suite/galera/t/galera_vote_joined_skip.test
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
#
|
||||||
|
# Test a case where a vote happens in JOINED state after SST on a writeset
|
||||||
|
# that should be skipped. I.e. JOINED node should continue operation.
|
||||||
|
#
|
||||||
|
|
||||||
|
--source galera_vote_joined_begin.inc
|
||||||
|
#
|
||||||
|
# At this point state snapshot has been copied, node 1 is operational and
|
||||||
|
# we have about 10 seconds while everything we do will go into the replication
|
||||||
|
# queue on node 4 which it will have to apply on top of the snapshot.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Increase replication queue on node_4
|
||||||
|
--connection node_1
|
||||||
|
CALL p1(130);
|
||||||
|
|
||||||
|
#
|
||||||
|
# Create a writeset that node 4 won't be able to apply by making node 3
|
||||||
|
# inconsisitent
|
||||||
|
#
|
||||||
|
--connection node_3
|
||||||
|
--let $node_3_server_id= `SELECT @@server_id`
|
||||||
|
--let $node_3_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$node_3_server_id.expect
|
||||||
|
--let $node_3_pid_file= `SELECT @@pid_file`
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
CREATE TABLE t2(pk INT AUTO_INCREMENT PRIMARY KEY);
|
||||||
|
SET SESSION wsrep_on = ON;
|
||||||
|
|
||||||
|
# This should cause nodes #1 and #2 to initiate a vote and kick node #3
|
||||||
|
# out of the cluster, node #4 should recover the vote when fails to apply
|
||||||
|
# the event and continue
|
||||||
|
INSERT INTO t2 VALUES (DEFAULT);
|
||||||
|
SET SESSION wsrep_on = OFF;
|
||||||
|
|
||||||
|
# make sure nodes 1,2 progress far enough for commit cut update
|
||||||
|
--connection node_1
|
||||||
|
CALL p1(130);
|
||||||
|
|
||||||
|
--let $members = 3
|
||||||
|
--echo Waiting for server 3 to leave the cluster
|
||||||
|
--connection node_1
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
--connection node_2
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
--connection node_4
|
||||||
|
# need to wait for extra SST delay on joiner
|
||||||
|
--sleep $MTR_SST_JOINER_DELAY
|
||||||
|
--sleep $MTR_SST_JOINER_DELAY
|
||||||
|
--enable_reconnect
|
||||||
|
--let $wait_timeout = 60
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
|
||||||
|
--connection node_3
|
||||||
|
--echo Server 3 left the cluster, killing it...
|
||||||
|
# Kill the connected server
|
||||||
|
--exec echo "wait" > $node_3_expect_file_name
|
||||||
|
--let KILL_NODE_PIDFILE = $node_3_pid_file
|
||||||
|
--perl
|
||||||
|
my $pid_filename = $ENV{'KILL_NODE_PIDFILE'};
|
||||||
|
my $mysqld_pid = `cat $pid_filename`;
|
||||||
|
chomp($mysqld_pid);
|
||||||
|
system("kill -9 $mysqld_pid");
|
||||||
|
exit(0);
|
||||||
|
EOF
|
||||||
|
--echo Killed server 3.
|
||||||
|
--source include/wait_until_disconnected.inc
|
||||||
|
--echo Restarting server 3...
|
||||||
|
--exec echo "restart:$start_mysqld_params" > $node_3_expect_file_name
|
||||||
|
|
||||||
|
--echo Waiting for server 3 to rejoin the cluster
|
||||||
|
--connection node_1
|
||||||
|
--let $members = 3
|
||||||
|
--source include/wsrep_wait_membership.inc
|
||||||
|
|
||||||
|
--connection node_3
|
||||||
|
--echo sleeping for $MTR_SST_JOINER_DELAY
|
||||||
|
# need to wait for extra SST delay on joiner
|
||||||
|
--sleep $MTR_SST_JOINER_DELAY
|
||||||
|
--sleep $MTR_SST_JOINER_DELAY
|
||||||
|
--echo Waiting ready
|
||||||
|
--enable_reconnect
|
||||||
|
--source include/galera_wait_ready.inc
|
||||||
|
--echo Server 3 restarted.
|
||||||
|
|
||||||
|
--source galera_vote_joined_end.inc
|
||||||
|
|
||||||
|
--connection node_1
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
||||||
|
|
||||||
|
--connection node_2
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
||||||
|
|
||||||
|
--connection node_3
|
||||||
|
CALL mtr.add_suppression("Vote 0 \\(success\\) on .+ is inconsistent with group");
|
||||||
|
|
||||||
|
--connection node_4
|
||||||
|
CALL mtr.add_suppression("BF applier thread=.+ failed to open_and_lock_tables for Table ");
|
||||||
|
CALL mtr.add_suppression("Event 3 Write_rows_v1 apply failed: 1146");
|
@@ -77,6 +77,8 @@ select @@gtid_binlog_state;
|
|||||||
|
|
||||||
--echo cluster 2 node 1
|
--echo cluster 2 node 1
|
||||||
--connection node_4
|
--connection node_4
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 1 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
insert into t1 values (2, 21, 1);
|
insert into t1 values (2, 21, 1);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
@@ -85,11 +87,16 @@ select @@gtid_binlog_state;
|
|||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_4
|
--connection node_4
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
|
|
||||||
--echo cluster 1 node 2
|
--echo cluster 1 node 2
|
||||||
--connection node_2
|
--connection node_2
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
insert into t1 values (1, 12, 3);
|
insert into t1 values (1, 12, 3);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
@@ -99,10 +106,14 @@ select @@gtid_binlog_state;
|
|||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_4
|
--connection node_4
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo cluster 1 node 3
|
--echo cluster 1 node 3
|
||||||
--connection node_3
|
--connection node_3
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
insert into t1 values (1, 13, 4);
|
insert into t1 values (1, 13, 4);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
@@ -112,10 +123,14 @@ select @@gtid_binlog_state;
|
|||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_4
|
--connection node_4
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo cluster 2 node 2
|
--echo cluster 2 node 2
|
||||||
--connection node_5
|
--connection node_5
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
insert into t1 values (2, 22, 2);
|
insert into t1 values (2, 22, 2);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
@@ -125,37 +140,55 @@ select @@gtid_binlog_state;
|
|||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_1
|
--connection node_1
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo cluster 2 node 3
|
--echo cluster 2 node 3
|
||||||
--connection node_6
|
--connection node_6
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
insert into t1 values (2, 23, 3);
|
insert into t1 values (2, 23, 3);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
|
|
||||||
--echo #wait for sync cluster 2 and 1
|
--echo #wait for sync cluster 2 and 1
|
||||||
--connection node_4
|
--connection node_4
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_1
|
--connection node_1
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo # check other nodes are consistent
|
--echo # check other nodes are consistent
|
||||||
--connection node_2
|
--connection node_2
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
--connection node_3
|
--connection node_3
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
--connection node_5
|
--connection node_5
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
--connection node_6
|
--connection node_6
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo cluster 1 node 1
|
--echo cluster 1 node 1
|
||||||
--connection node_1
|
--connection node_1
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
stop slave;
|
stop slave;
|
||||||
@@ -250,6 +283,8 @@ select @@gtid_binlog_state;
|
|||||||
--sleep 2
|
--sleep 2
|
||||||
--echo cluster 2 node 1
|
--echo cluster 2 node 1
|
||||||
--connection node_4
|
--connection node_4
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 1 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
insert into t1 values (2, 21, 1);
|
insert into t1 values (2, 21, 1);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
|
|
||||||
@@ -258,11 +293,16 @@ select @@gtid_binlog_state;
|
|||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_4
|
--connection node_4
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
|
|
||||||
--echo cluster 1 node 2
|
--echo cluster 1 node 2
|
||||||
--connection node_2
|
--connection node_2
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 2 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
insert into t1 values (1, 12, 3);
|
insert into t1 values (1, 12, 3);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
@@ -272,10 +312,14 @@ select @@gtid_binlog_state;
|
|||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_4
|
--connection node_4
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo cluster 1 node 3
|
--echo cluster 1 node 3
|
||||||
--connection node_3
|
--connection node_3
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 3 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
insert into t1 values (1, 13, 4);
|
insert into t1 values (1, 13, 4);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
@@ -285,10 +329,14 @@ select @@gtid_binlog_state;
|
|||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_4
|
--connection node_4
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo cluster 2 node 2
|
--echo cluster 2 node 2
|
||||||
--connection node_5
|
--connection node_5
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 4 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
insert into t1 values (2, 22, 2);
|
insert into t1 values (2, 22, 2);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
@@ -298,10 +346,14 @@ select @@gtid_binlog_state;
|
|||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_1
|
--connection node_1
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo cluster 2 node 3
|
--echo cluster 2 node 3
|
||||||
--connection node_6
|
--connection node_6
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 5 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
insert into t1 values (2, 23, 3);
|
insert into t1 values (2, 23, 3);
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
@@ -311,24 +363,36 @@ select @@gtid_binlog_state;
|
|||||||
--source include/save_master_gtid.inc
|
--source include/save_master_gtid.inc
|
||||||
--connection node_1
|
--connection node_1
|
||||||
--source include/sync_with_master_gtid.inc
|
--source include/sync_with_master_gtid.inc
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo # check other nodes are consistent
|
--echo # check other nodes are consistent
|
||||||
--connection node_2
|
--connection node_2
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
--connection node_3
|
--connection node_3
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
--connection node_5
|
--connection node_5
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
--connection node_6
|
--connection node_6
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
select * from t1 order by 1, 2, 3;
|
select * from t1 order by 1, 2, 3;
|
||||||
|
|
||||||
--echo cluster 1 node 1
|
--echo cluster 1 node 1
|
||||||
--connection node_1
|
--connection node_1
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 6 FROM test.t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select @@gtid_binlog_state;
|
select @@gtid_binlog_state;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
stop slave;
|
stop slave;
|
||||||
|
@@ -155,7 +155,6 @@ INSERT INTO parent SET a=0;
|
|||||||
FLUSH TABLES;
|
FLUSH TABLES;
|
||||||
# restart
|
# restart
|
||||||
disconnect incomplete;
|
disconnect incomplete;
|
||||||
SET @save_stats_persistent = @@GLOBAL.innodb_stats_persistent;
|
|
||||||
SET GLOBAL innodb_stats_persistent = 0;
|
SET GLOBAL innodb_stats_persistent = 0;
|
||||||
INSERT INTO child SET a=0;
|
INSERT INTO child SET a=0;
|
||||||
INSERT INTO child SET a=1;
|
INSERT INTO child SET a=1;
|
||||||
@@ -1182,6 +1181,25 @@ ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fail
|
|||||||
ALTER TABLE t2 ADD KEY(b), ALGORITHM=NOCOPY;
|
ALTER TABLE t2 ADD KEY(b), ALGORITHM=NOCOPY;
|
||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
DROP TABLE t2, t1;
|
DROP TABLE t2, t1;
|
||||||
|
#
|
||||||
|
# MDEV-33167 ASAN errors after failing to load foreign key
|
||||||
|
# relation for the table
|
||||||
|
#
|
||||||
|
call mtr.add_suppression("InnoDB: Load table `test`.`t3` failed, the table has missing foreign key indexes. Turn off 'foreign_key_checks' and try again.");
|
||||||
|
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
|
||||||
|
CREATE TABLE t1(f1 VARCHAR(8),
|
||||||
|
FOREIGN KEY(f1) REFERENCES test.t3(f1))ENGINE=InnoDB;
|
||||||
|
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
|
||||||
|
CREATE TABLE t2(f1 VARCHAR(8),
|
||||||
|
FOREIGN KEY(f1) REFERENCES test.t3(f1))
|
||||||
|
ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
||||||
|
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
|
||||||
|
CREATE TABLE t3(f1 VARCHAR(8) PRIMARY KEY)
|
||||||
|
ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
set GLOBAL innodb_fast_shutdown=0;
|
||||||
|
# restart
|
||||||
|
ALTER TABLE t2 FORCE;
|
||||||
|
DROP TABLE t2, t1, t3;
|
||||||
# End of 10.6 tests
|
# End of 10.6 tests
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
(
|
(
|
||||||
@@ -1204,5 +1222,4 @@ ALTER TABLE t2 ADD FOREIGN KEY (f2) REFERENCES t2 (f2),
|
|||||||
ADD UNIQUE INDEX(f3);
|
ADD UNIQUE INDEX(f3);
|
||||||
ERROR HY000: Cannot delete rows from table which is parent in a foreign key constraint 't1_ibfk_1' of table 't1'
|
ERROR HY000: Cannot delete rows from table which is parent in a foreign key constraint 't1_ibfk_1' of table 't1'
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
|
||||||
# End of 10.11 tests
|
# End of 10.11 tests
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
|
SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
|
||||||
|
SET GLOBAL innodb_lock_wait_timeout=1;
|
||||||
set session transaction isolation level read committed;
|
set session transaction isolation level read committed;
|
||||||
create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
|
create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
|
||||||
(what, id)) engine=innodb;
|
(what, id)) engine=innodb;
|
||||||
insert into innodb_bug52663 values ('total', 0, 0);
|
insert into innodb_bug52663 values ('total', 0, 0);
|
||||||
begin;
|
begin;
|
||||||
connect addconroot, localhost, root,,;
|
connect addconroot, localhost, root,,;
|
||||||
connection addconroot;
|
|
||||||
set session transaction isolation level read committed;
|
set session transaction isolation level read committed;
|
||||||
begin;
|
begin;
|
||||||
connection default;
|
connection default;
|
||||||
@@ -31,3 +32,4 @@ select * from innodb_bug52663;
|
|||||||
what id count
|
what id count
|
||||||
total 0 2
|
total 0 2
|
||||||
drop table innodb_bug52663;
|
drop table innodb_bug52663;
|
||||||
|
SET GLOBAL innodb_lock_wait_timeout=@save_innodb_timeout;
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
@@ -527,6 +527,6 @@
|
@@ -576,7 +576,7 @@
|
||||||
FROM information_schema.global_status
|
FROM information_schema.global_status
|
||||||
WHERE variable_name = 'innodb_instant_alter_column';
|
WHERE variable_name = 'innodb_instant_alter_column';
|
||||||
instants
|
instants
|
||||||
-37
|
-37
|
||||||
+38
|
+38
|
||||||
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
CREATE TABLE t1(f1 INT, f2 TEXT)ENGINE=InnoDB;
|
||||||
# End of 10.6 tests
|
INSERT INTO t1 VALUES(1, 'a');
|
||||||
|
ALTER TABLE t1 ADD COLUMN f3 TEXT FIRST;
|
||||||
|
@@ -575,5 +575,16 @@ FROM information_schema.global_status
|
|||||||
WHERE variable_name = 'innodb_instant_alter_column';
|
WHERE variable_name = 'innodb_instant_alter_column';
|
||||||
instants
|
instants
|
||||||
37
|
37
|
||||||
|
CREATE TABLE t1(f1 INT, f2 TEXT)ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES(1, 'a');
|
||||||
|
ALTER TABLE t1 ADD COLUMN f3 TEXT FIRST;
|
||||||
|
SET STATEMENT DEBUG_DBUG="+d,instant_insert_fail" FOR
|
||||||
|
ALTER TABLE t1 DROP COLUMN f1;
|
||||||
|
ERROR HY000: Internal error: InnoDB: Insert into SYS_COLUMNS failed
|
||||||
|
ALTER TABLE t1 DROP COLUMN f1;
|
||||||
|
CHECK TABLE t1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 check status OK
|
||||||
|
DROP TABLE t1;
|
||||||
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
||||||
# End of 10.6 tests
|
# End of 10.6 tests
|
||||||
|
@@ -133,7 +133,6 @@ FLUSH TABLES;
|
|||||||
--let $shutdown_timeout=
|
--let $shutdown_timeout=
|
||||||
disconnect incomplete;
|
disconnect incomplete;
|
||||||
|
|
||||||
SET @save_stats_persistent = @@GLOBAL.innodb_stats_persistent;
|
|
||||||
SET GLOBAL innodb_stats_persistent = 0;
|
SET GLOBAL innodb_stats_persistent = 0;
|
||||||
|
|
||||||
INSERT INTO child SET a=0;
|
INSERT INTO child SET a=0;
|
||||||
@@ -1245,6 +1244,33 @@ ALTER TABLE t2 ADD KEY(b), ALGORITHM=NOCOPY;
|
|||||||
DELETE FROM t1;
|
DELETE FROM t1;
|
||||||
DROP TABLE t2, t1;
|
DROP TABLE t2, t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-33167 ASAN errors after failing to load foreign key
|
||||||
|
--echo # relation for the table
|
||||||
|
--echo #
|
||||||
|
call mtr.add_suppression("InnoDB: Load table `test`.`t3` failed, the table has missing foreign key indexes. Turn off 'foreign_key_checks' and try again.");
|
||||||
|
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
|
||||||
|
CREATE TABLE t1(f1 VARCHAR(8),
|
||||||
|
FOREIGN KEY(f1) REFERENCES test.t3(f1))ENGINE=InnoDB;
|
||||||
|
|
||||||
|
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
|
||||||
|
CREATE TABLE t2(f1 VARCHAR(8),
|
||||||
|
FOREIGN KEY(f1) REFERENCES test.t3(f1))
|
||||||
|
ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
||||||
|
|
||||||
|
SET STATEMENT FOREIGN_KEY_CHECKS = 0 FOR
|
||||||
|
CREATE TABLE t3(f1 VARCHAR(8) PRIMARY KEY)
|
||||||
|
ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
|
|
||||||
|
set GLOBAL innodb_fast_shutdown=0;
|
||||||
|
--let $shutdown_timeout=
|
||||||
|
--source include/restart_mysqld.inc
|
||||||
|
# Error encountered while loading the foreign key
|
||||||
|
# constraint for t3. t1 wasn't loaded into memory yet
|
||||||
|
# t2 failed to find index for foreign key relation
|
||||||
|
ALTER TABLE t2 FORCE;
|
||||||
|
DROP TABLE t2, t1, t3;
|
||||||
|
|
||||||
--echo # End of 10.6 tests
|
--echo # End of 10.6 tests
|
||||||
|
|
||||||
CREATE TABLE t1
|
CREATE TABLE t1
|
||||||
@@ -1270,7 +1296,5 @@ ALTER TABLE t1 ADD FOREIGN KEY (f1) REFERENCES t2 (f2);
|
|||||||
ALTER TABLE t2 ADD FOREIGN KEY (f2) REFERENCES t2 (f2),
|
ALTER TABLE t2 ADD FOREIGN KEY (f2) REFERENCES t2 (f2),
|
||||||
ADD UNIQUE INDEX(f3);
|
ADD UNIQUE INDEX(f3);
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
|
||||||
|
|
||||||
--echo # End of 10.11 tests
|
--echo # End of 10.11 tests
|
||||||
--source include/wait_until_count_sessions.inc
|
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
--source include/long_test.inc
|
|
||||||
--source include/have_innodb.inc
|
--source include/have_innodb.inc
|
||||||
|
|
||||||
|
SET @save_innodb_timeout=@@innodb_lock_wait_timeout;
|
||||||
|
SET GLOBAL innodb_lock_wait_timeout=1;
|
||||||
set session transaction isolation level read committed;
|
set session transaction isolation level read committed;
|
||||||
|
|
||||||
create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
|
create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
|
||||||
@@ -9,7 +10,6 @@ insert into innodb_bug52663 values ('total', 0, 0);
|
|||||||
begin;
|
begin;
|
||||||
|
|
||||||
connect (addconroot, localhost, root,,);
|
connect (addconroot, localhost, root,,);
|
||||||
connection addconroot;
|
|
||||||
set session transaction isolation level read committed;
|
set session transaction isolation level read committed;
|
||||||
begin;
|
begin;
|
||||||
|
|
||||||
@@ -33,3 +33,4 @@ select * from innodb_bug52663;
|
|||||||
connection default;
|
connection default;
|
||||||
select * from innodb_bug52663;
|
select * from innodb_bug52663;
|
||||||
drop table innodb_bug52663;
|
drop table innodb_bug52663;
|
||||||
|
SET GLOBAL innodb_lock_wait_timeout=@save_innodb_timeout;
|
||||||
|
@@ -657,11 +657,19 @@ DROP TABLE t1;
|
|||||||
SET DEBUG_SYNC=RESET;
|
SET DEBUG_SYNC=RESET;
|
||||||
|
|
||||||
--echo # End of 10.5 tests
|
--echo # End of 10.5 tests
|
||||||
|
|
||||||
SELECT variable_value-@old_instant instants
|
SELECT variable_value-@old_instant instants
|
||||||
FROM information_schema.global_status
|
FROM information_schema.global_status
|
||||||
WHERE variable_name = 'innodb_instant_alter_column';
|
WHERE variable_name = 'innodb_instant_alter_column';
|
||||||
|
|
||||||
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
CREATE TABLE t1(f1 INT, f2 TEXT)ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 VALUES(1, 'a');
|
||||||
|
ALTER TABLE t1 ADD COLUMN f3 TEXT FIRST;
|
||||||
|
--error ER_INTERNAL_ERROR
|
||||||
|
SET STATEMENT DEBUG_DBUG="+d,instant_insert_fail" FOR
|
||||||
|
ALTER TABLE t1 DROP COLUMN f1;
|
||||||
|
ALTER TABLE t1 DROP COLUMN f1;
|
||||||
|
CHECK TABLE t1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
SET GLOBAL innodb_stats_persistent = @save_stats_persistent;
|
||||||
--echo # End of 10.6 tests
|
--echo # End of 10.6 tests
|
||||||
|
@@ -56,6 +56,10 @@ struct st_mysql_auth
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* function-type-mismatch ignore */
|
||||||
|
#if defined(__clang__)
|
||||||
|
__attribute__((no_sanitize("undefined")))
|
||||||
|
#endif
|
||||||
static int do_auth_0x0100(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
|
static int do_auth_0x0100(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
|
||||||
{
|
{
|
||||||
info->password_used= 1;
|
info->password_used= 1;
|
||||||
|
@@ -36,3 +36,16 @@ SELECT * FROM t1 WHERE a=CAST('::ff' AS INET6);
|
|||||||
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=CAST('::ff' AS INET6);
|
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=CAST('::ff' AS INET6);
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-34922: Assertion `value.length() == FbtImpl::binary_length()' failed in
|
||||||
|
--echo # Type_handler_fbt<FbtImpl, TypeCollectionImpl>::Field_fbt::store_native,
|
||||||
|
--echo # Assertion `item->null_value' failed in Type_handler::Item_send_str
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a datetime);
|
||||||
|
INSERT INTO t1 VALUES (NULL);
|
||||||
|
SELECT * FROM (SELECT cast('::' AS INET6),min(1) FROM t1 WHERE if(uuid_short(), a,1)) dt;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo # End of 10.5 tests
|
||||||
|
@@ -88,6 +88,18 @@ Warnings:
|
|||||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = INET6'::ff'
|
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = INET6'::ff'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
|
# MDEV-34922: Assertion `value.length() == FbtImpl::binary_length()' failed in
|
||||||
|
# Type_handler_fbt<FbtImpl, TypeCollectionImpl>::Field_fbt::store_native,
|
||||||
|
# Assertion `item->null_value' failed in Type_handler::Item_send_str
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a datetime);
|
||||||
|
INSERT INTO t1 VALUES (NULL);
|
||||||
|
SELECT * FROM (SELECT cast('::' AS INET6),min(1) FROM t1 WHERE if(uuid_short(), a,1)) dt;
|
||||||
|
cast('::' AS INET6) min(1)
|
||||||
|
:: NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
# End of 10.5 tests
|
||||||
|
#
|
||||||
# MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
|
# MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
|
||||||
#
|
#
|
||||||
CREATE TABLE t1 (pk inet6, c text) engine=myisam;
|
CREATE TABLE t1 (pk inet6, c text) engine=myisam;
|
||||||
|
@@ -155,5 +155,17 @@ Warnings:
|
|||||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = INET6'::ff'
|
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = INET6'::ff'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
|
# MDEV-34922: Assertion `value.length() == FbtImpl::binary_length()' failed in
|
||||||
|
# Type_handler_fbt<FbtImpl, TypeCollectionImpl>::Field_fbt::store_native,
|
||||||
|
# Assertion `item->null_value' failed in Type_handler::Item_send_str
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a datetime);
|
||||||
|
INSERT INTO t1 VALUES (NULL);
|
||||||
|
SELECT * FROM (SELECT cast('::' AS INET6),min(1) FROM t1 WHERE if(uuid_short(), a,1)) dt;
|
||||||
|
cast('::' AS INET6) min(1)
|
||||||
|
:: NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
# End of 10.5 tests
|
||||||
|
#
|
||||||
# End of 10.5 tests
|
# End of 10.5 tests
|
||||||
#
|
#
|
||||||
|
@@ -88,6 +88,18 @@ Warnings:
|
|||||||
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = INET6'::ff'
|
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = INET6'::ff'
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
#
|
#
|
||||||
|
# MDEV-34922: Assertion `value.length() == FbtImpl::binary_length()' failed in
|
||||||
|
# Type_handler_fbt<FbtImpl, TypeCollectionImpl>::Field_fbt::store_native,
|
||||||
|
# Assertion `item->null_value' failed in Type_handler::Item_send_str
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a datetime);
|
||||||
|
INSERT INTO t1 VALUES (NULL);
|
||||||
|
SELECT * FROM (SELECT cast('::' AS INET6),min(1) FROM t1 WHERE if(uuid_short(), a,1)) dt;
|
||||||
|
cast('::' AS INET6) min(1)
|
||||||
|
:: NULL
|
||||||
|
DROP TABLE t1;
|
||||||
|
# End of 10.5 tests
|
||||||
|
#
|
||||||
# MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
|
# MDEV-26742 Assertion `field->type_handler() == this' failed in FixedBinTypeBundle<NATIVE_LEN, MAX_CHAR_LEN>::Type_handler_fbt::stored_field_cmp_to_item
|
||||||
#
|
#
|
||||||
CREATE TABLE t1 (c varchar(64), key(c)) engine=myisam;
|
CREATE TABLE t1 (c varchar(64), key(c)) engine=myisam;
|
||||||
|
@@ -1910,4 +1910,17 @@ create_data
|
|||||||
|
|
||||||
SST_PID="$DATA/wsrep_sst.pid"
|
SST_PID="$DATA/wsrep_sst.pid"
|
||||||
|
|
||||||
|
if [ -n "${MTR_SST_JOINER_DELAY:-}" ]; then
|
||||||
|
MTR_SST_JOINER_DELAY=$(trim_string "$MTR_SST_JOINER_DELAY")
|
||||||
|
fi
|
||||||
|
|
||||||
|
simulate_long_sst()
|
||||||
|
{
|
||||||
|
# Delay for MTR tests if needed to simulate long SST/IST:
|
||||||
|
if [ ${MTR_SST_JOINER_DELAY:-0} -gt 0 ]; then
|
||||||
|
wsrep_log_info "Sleeping $MTR_SST_JOINER_DELAY seconds for MTR test"
|
||||||
|
sleep $MTR_SST_JOINER_DELAY
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
wsrep_log_info "$WSREP_METHOD $WSREP_TRANSFER_TYPE started on $WSREP_SST_OPT_ROLE"
|
wsrep_log_info "$WSREP_METHOD $WSREP_TRANSFER_TYPE started on $WSREP_SST_OPT_ROLE"
|
||||||
|
@@ -1513,6 +1513,8 @@ else # joiner
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
simulate_long_sst
|
||||||
|
|
||||||
# use donor magic file, if present
|
# use donor magic file, if present
|
||||||
# if IST was used, donor magic file was not created
|
# if IST was used, donor magic file was not created
|
||||||
# Remove special tags from the magic file, and from the output:
|
# Remove special tags from the magic file, and from the output:
|
||||||
|
@@ -184,5 +184,9 @@ else
|
|||||||
echo "$SET_START_POSITION" | $MYSQL || exit $?
|
echo "$SET_START_POSITION" | $MYSQL || exit $?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$WSREP_SST_OPT_ROLE" = 'joiner' ]; then
|
||||||
|
simulate_long_sst
|
||||||
|
fi
|
||||||
|
|
||||||
wsrep_log_info "$WSREP_METHOD $WSREP_TRANSFER_TYPE completed on $WSREP_SST_OPT_ROLE"
|
wsrep_log_info "$WSREP_METHOD $WSREP_TRANSFER_TYPE completed on $WSREP_SST_OPT_ROLE"
|
||||||
exit 0
|
exit 0
|
||||||
|
@@ -915,6 +915,8 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
simulate_long_sst
|
||||||
|
|
||||||
# Remove special tags from the magic file, and from the output:
|
# Remove special tags from the magic file, and from the output:
|
||||||
coords=$(head -n1 "$MAGIC_FILE")
|
coords=$(head -n1 "$MAGIC_FILE")
|
||||||
wsrep_log_info "Galera co-ords from recovery: $coords"
|
wsrep_log_info "Galera co-ords from recovery: $coords"
|
||||||
|
@@ -643,19 +643,8 @@ static uchar *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count,
|
|||||||
|
|
||||||
static char dbug_row_print_buf[4096];
|
static char dbug_row_print_buf[4096];
|
||||||
|
|
||||||
/*
|
|
||||||
Print table's current row into a buffer and return a pointer to it.
|
|
||||||
|
|
||||||
This is intended to be used from gdb:
|
String dbug_format_row(TABLE *table, const uchar *rec, bool print_names)
|
||||||
|
|
||||||
(gdb) p dbug_print_table_row(table)
|
|
||||||
$33 = "SUBQUERY2_t1(col_int_key,col_varchar_nokey)=(7,c)"
|
|
||||||
(gdb)
|
|
||||||
|
|
||||||
Only columns in table->read_set are printed
|
|
||||||
*/
|
|
||||||
|
|
||||||
const char* dbug_print_row(TABLE *table, const uchar *rec, bool print_names)
|
|
||||||
{
|
{
|
||||||
Field **pfield;
|
Field **pfield;
|
||||||
char row_buff_tmp[512];
|
char row_buff_tmp[512];
|
||||||
@@ -724,13 +713,36 @@ const char* dbug_print_row(TABLE *table, const uchar *rec, bool print_names)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
output.append(')');
|
output.append(')');
|
||||||
if (output.c_ptr() == dbug_row_print_buf)
|
|
||||||
return dbug_row_print_buf;
|
return output;
|
||||||
else
|
|
||||||
return "Couldn't fit into buffer";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
A function to display a row in debugger.
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
(gdb) p dbug_print_row(table, table->record[1])
|
||||||
|
*/
|
||||||
|
const char *dbug_print_row(TABLE *table, const uchar *rec)
|
||||||
|
{
|
||||||
|
String row= dbug_format_row(table, table->record[0]);
|
||||||
|
if (row.length() > sizeof dbug_row_print_buf - 1)
|
||||||
|
return "Couldn't fit into buffer";
|
||||||
|
memcpy(dbug_row_print_buf, row.c_ptr(), row.length());
|
||||||
|
return dbug_row_print_buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Print table's current row into a buffer and return a pointer to it.
|
||||||
|
|
||||||
|
This is intended to be used from gdb:
|
||||||
|
|
||||||
|
(gdb) p dbug_print_table_row(table)
|
||||||
|
$33 = "SUBQUERY2_t1(col_int_key,col_varchar_nokey)=(7,c)"
|
||||||
|
(gdb)
|
||||||
|
|
||||||
|
Only columns in table->read_set are printed
|
||||||
|
*/
|
||||||
const char* dbug_print_table_row(TABLE *table)
|
const char* dbug_print_table_row(TABLE *table)
|
||||||
{
|
{
|
||||||
return dbug_print_row(table, table->record[0]);
|
return dbug_print_row(table, table->record[0]);
|
||||||
|
@@ -7764,7 +7764,8 @@ int handler::ha_write_row(const uchar *buf)
|
|||||||
|
|
||||||
TABLE_IO_WAIT(tracker, PSI_TABLE_WRITE_ROW, MAX_KEY, error,
|
TABLE_IO_WAIT(tracker, PSI_TABLE_WRITE_ROW, MAX_KEY, error,
|
||||||
{ error= write_row(buf); })
|
{ error= write_row(buf); })
|
||||||
DBUG_PRINT("dml", ("INSERT: %s = %d", dbug_print_row(table, buf, false), error));
|
DBUG_PRINT("dml", ("INSERT: %s = %d",
|
||||||
|
dbug_format_row(table, buf, false).c_ptr_safe(), error));
|
||||||
|
|
||||||
MYSQL_INSERT_ROW_DONE(error);
|
MYSQL_INSERT_ROW_DONE(error);
|
||||||
if (likely(!error))
|
if (likely(!error))
|
||||||
@@ -7824,8 +7825,10 @@ int handler::ha_update_row(const uchar *old_data, const uchar *new_data)
|
|||||||
|
|
||||||
TABLE_IO_WAIT(tracker, PSI_TABLE_UPDATE_ROW, active_index, 0,
|
TABLE_IO_WAIT(tracker, PSI_TABLE_UPDATE_ROW, active_index, 0,
|
||||||
{ error= update_row(old_data, new_data);})
|
{ error= update_row(old_data, new_data);})
|
||||||
DBUG_PRINT("dml", ("UPDATE: %s => %s = %d", dbug_print_row(table, old_data, false),
|
DBUG_PRINT("dml", ("UPDATE: %s => %s = %d",
|
||||||
dbug_print_row(table, new_data, false), error));
|
dbug_format_row(table, old_data, false).c_ptr_safe(),
|
||||||
|
dbug_format_row(table, new_data, false).c_ptr_safe(),
|
||||||
|
error));
|
||||||
|
|
||||||
MYSQL_UPDATE_ROW_DONE(error);
|
MYSQL_UPDATE_ROW_DONE(error);
|
||||||
if (likely(!error))
|
if (likely(!error))
|
||||||
@@ -7905,7 +7908,8 @@ int handler::ha_delete_row(const uchar *buf)
|
|||||||
|
|
||||||
TABLE_IO_WAIT(tracker, PSI_TABLE_DELETE_ROW, active_index, error,
|
TABLE_IO_WAIT(tracker, PSI_TABLE_DELETE_ROW, active_index, error,
|
||||||
{ error= delete_row(buf);})
|
{ error= delete_row(buf);})
|
||||||
DBUG_PRINT("dml", ("DELETE: %s = %d", dbug_print_row(table, buf, false), error));
|
DBUG_PRINT("dml", ("DELETE: %s = %d",
|
||||||
|
dbug_format_row(table, buf, false).c_ptr_safe(), error));
|
||||||
MYSQL_DELETE_ROW_DONE(error);
|
MYSQL_DELETE_ROW_DONE(error);
|
||||||
if (likely(!error))
|
if (likely(!error))
|
||||||
{
|
{
|
||||||
|
@@ -5444,6 +5444,6 @@ int get_select_field_pos(Alter_info *alter_info, int select_field_count,
|
|||||||
bool versioned);
|
bool versioned);
|
||||||
|
|
||||||
#ifndef DBUG_OFF
|
#ifndef DBUG_OFF
|
||||||
const char* dbug_print_row(TABLE *table, const uchar *rec, bool print_names= true);
|
String dbug_format_row(TABLE *table, const uchar *rec, bool print_names= true);
|
||||||
#endif /* DBUG_OFF */
|
#endif /* DBUG_OFF */
|
||||||
#endif /* HANDLER_INCLUDED */
|
#endif /* HANDLER_INCLUDED */
|
||||||
|
@@ -5321,6 +5321,7 @@ bool Item_param::assign_default(Field *field)
|
|||||||
|
|
||||||
double Item_copy_string::val_real()
|
double Item_copy_string::val_real()
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
int err_not_used;
|
int err_not_used;
|
||||||
char *end_not_used;
|
char *end_not_used;
|
||||||
return (null_value ? 0.0 :
|
return (null_value ? 0.0 :
|
||||||
@@ -5331,6 +5332,7 @@ double Item_copy_string::val_real()
|
|||||||
|
|
||||||
longlong Item_copy_string::val_int()
|
longlong Item_copy_string::val_int()
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
int err;
|
int err;
|
||||||
return null_value ? 0 : str_value.charset()->strntoll(str_value.ptr(),
|
return null_value ? 0 : str_value.charset()->strntoll(str_value.ptr(),
|
||||||
str_value.length(), 10,
|
str_value.length(), 10,
|
||||||
@@ -5340,6 +5342,7 @@ longlong Item_copy_string::val_int()
|
|||||||
|
|
||||||
int Item_copy_string::save_in_field(Field *field, bool no_conversions)
|
int Item_copy_string::save_in_field(Field *field, bool no_conversions)
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
return save_str_value_in_field(field, &str_value);
|
return save_str_value_in_field(field, &str_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5350,11 +5353,15 @@ void Item_copy_string::copy()
|
|||||||
if (res && res != &str_value)
|
if (res && res != &str_value)
|
||||||
str_value.copy(*res);
|
str_value.copy(*res);
|
||||||
null_value=item->null_value;
|
null_value=item->null_value;
|
||||||
|
#ifndef DBUG_OFF
|
||||||
|
copied_in= 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
String *Item_copy_string::val_str(String *str)
|
String *Item_copy_string::val_str(String *str)
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
// Item_copy_string is used without fix_fields call
|
// Item_copy_string is used without fix_fields call
|
||||||
if (null_value)
|
if (null_value)
|
||||||
return (String*) 0;
|
return (String*) 0;
|
||||||
@@ -5364,6 +5371,7 @@ String *Item_copy_string::val_str(String *str)
|
|||||||
|
|
||||||
my_decimal *Item_copy_string::val_decimal(my_decimal *decimal_value)
|
my_decimal *Item_copy_string::val_decimal(my_decimal *decimal_value)
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
// Item_copy_string is used without fix_fields call
|
// Item_copy_string is used without fix_fields call
|
||||||
if (null_value)
|
if (null_value)
|
||||||
return (my_decimal *) 0;
|
return (my_decimal *) 0;
|
||||||
|
22
sql/item.h
22
sql/item.h
@@ -6673,8 +6673,15 @@ protected:
|
|||||||
Type_std_attributes::set(item);
|
Type_std_attributes::set(item);
|
||||||
name= item->name;
|
name= item->name;
|
||||||
set_handler(item->type_handler());
|
set_handler(item->type_handler());
|
||||||
|
#ifndef DBUG_OFF
|
||||||
|
copied_in= 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef DBUG_OFF
|
||||||
|
bool copied_in;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6740,7 +6747,10 @@ public:
|
|||||||
double val_real() override;
|
double val_real() override;
|
||||||
longlong val_int() override;
|
longlong val_int() override;
|
||||||
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
|
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
|
||||||
{ return get_date_from_string(thd, ltime, fuzzydate); }
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
|
return get_date_from_string(thd, ltime, fuzzydate);
|
||||||
|
}
|
||||||
void copy() override;
|
void copy() override;
|
||||||
int save_in_field(Field *field, bool no_conversions) override;
|
int save_in_field(Field *field, bool no_conversions) override;
|
||||||
Item *do_get_copy(THD *thd) const override
|
Item *do_get_copy(THD *thd) const override
|
||||||
@@ -6770,9 +6780,13 @@ public:
|
|||||||
null_value= tmp.is_null();
|
null_value= tmp.is_null();
|
||||||
m_value= tmp.is_null() ? Timestamp_or_zero_datetime() :
|
m_value= tmp.is_null() ? Timestamp_or_zero_datetime() :
|
||||||
Timestamp_or_zero_datetime(tmp);
|
Timestamp_or_zero_datetime(tmp);
|
||||||
|
#ifndef DBUG_OFF
|
||||||
|
copied_in=1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
int save_in_field(Field *field, bool) override
|
int save_in_field(Field *field, bool) override
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
DBUG_ASSERT(sane());
|
DBUG_ASSERT(sane());
|
||||||
if (null_value)
|
if (null_value)
|
||||||
return set_field_to_null(field);
|
return set_field_to_null(field);
|
||||||
@@ -6781,30 +6795,35 @@ public:
|
|||||||
}
|
}
|
||||||
longlong val_int() override
|
longlong val_int() override
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
DBUG_ASSERT(sane());
|
DBUG_ASSERT(sane());
|
||||||
return null_value ? 0 :
|
return null_value ? 0 :
|
||||||
m_value.to_datetime(current_thd).to_longlong();
|
m_value.to_datetime(current_thd).to_longlong();
|
||||||
}
|
}
|
||||||
double val_real() override
|
double val_real() override
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
DBUG_ASSERT(sane());
|
DBUG_ASSERT(sane());
|
||||||
return null_value ? 0e0 :
|
return null_value ? 0e0 :
|
||||||
m_value.to_datetime(current_thd).to_double();
|
m_value.to_datetime(current_thd).to_double();
|
||||||
}
|
}
|
||||||
String *val_str(String *to) override
|
String *val_str(String *to) override
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
DBUG_ASSERT(sane());
|
DBUG_ASSERT(sane());
|
||||||
return null_value ? NULL :
|
return null_value ? NULL :
|
||||||
m_value.to_datetime(current_thd).to_string(to, decimals);
|
m_value.to_datetime(current_thd).to_string(to, decimals);
|
||||||
}
|
}
|
||||||
my_decimal *val_decimal(my_decimal *to) override
|
my_decimal *val_decimal(my_decimal *to) override
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
DBUG_ASSERT(sane());
|
DBUG_ASSERT(sane());
|
||||||
return null_value ? NULL :
|
return null_value ? NULL :
|
||||||
m_value.to_datetime(current_thd).to_decimal(to);
|
m_value.to_datetime(current_thd).to_decimal(to);
|
||||||
}
|
}
|
||||||
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
|
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
DBUG_ASSERT(sane());
|
DBUG_ASSERT(sane());
|
||||||
bool res= m_value.to_TIME(thd, ltime, fuzzydate);
|
bool res= m_value.to_TIME(thd, ltime, fuzzydate);
|
||||||
DBUG_ASSERT(!res);
|
DBUG_ASSERT(!res);
|
||||||
@@ -6812,6 +6831,7 @@ public:
|
|||||||
}
|
}
|
||||||
bool val_native(THD *thd, Native *to) override
|
bool val_native(THD *thd, Native *to) override
|
||||||
{
|
{
|
||||||
|
DBUG_ASSERT(copied_in);
|
||||||
DBUG_ASSERT(sane());
|
DBUG_ASSERT(sane());
|
||||||
return null_value || m_value.to_native(to, decimals);
|
return null_value || m_value.to_native(to, decimals);
|
||||||
}
|
}
|
||||||
|
@@ -146,7 +146,6 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
transaction() : m_thd(NULL) { }
|
transaction() : m_thd(NULL) { }
|
||||||
transaction(transaction const&);
|
|
||||||
~transaction();
|
~transaction();
|
||||||
|
|
||||||
/* Clear transaction, i.e., make calls to 'good()' return false. */
|
/* Clear transaction, i.e., make calls to 'good()' return false. */
|
||||||
|
@@ -8899,14 +8899,15 @@ static bool vers_update_or_validate_fields(TABLE *table)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void unwind_stored_field_offsets(const List<Item> &fields, Field *end)
|
static void unwind_stored_field_offsets(const List<Item> &fields, Item_field *end)
|
||||||
{
|
{
|
||||||
for (Item &item_field: fields)
|
for (Item &item: fields)
|
||||||
{
|
{
|
||||||
Field *f= item_field.field_for_view_update()->field;
|
Item_field *item_field= item.field_for_view_update();
|
||||||
if (f == end)
|
if (item_field == end)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Field *f= item_field->field;
|
||||||
if (f->stored_in_db())
|
if (f->stored_in_db())
|
||||||
{
|
{
|
||||||
TABLE *table= f->table;
|
TABLE *table= f->table;
|
||||||
@@ -8950,7 +8951,7 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
|
|||||||
{
|
{
|
||||||
List_iterator_fast<Item> f(fields),v(values);
|
List_iterator_fast<Item> f(fields),v(values);
|
||||||
Item *value, *fld;
|
Item *value, *fld;
|
||||||
Item_field *field;
|
Item_field *field= NULL;
|
||||||
Field *rfield;
|
Field *rfield;
|
||||||
TABLE *table;
|
TABLE *table;
|
||||||
bool only_unvers_fields= update && table_arg->versioned();
|
bool only_unvers_fields= update && table_arg->versioned();
|
||||||
@@ -8968,11 +8969,8 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
|
|||||||
|
|
||||||
while ((fld= f++))
|
while ((fld= f++))
|
||||||
{
|
{
|
||||||
if (!(field= fld->field_for_view_update()))
|
field= fld->field_for_view_update();
|
||||||
{
|
DBUG_ASSERT(field); // ensured by check_fields or check_view_insertability.
|
||||||
my_error(ER_NONUPDATEABLE_COLUMN, MYF(0), fld->name.str);
|
|
||||||
goto err_unwind_fields;
|
|
||||||
}
|
|
||||||
value=v++;
|
value=v++;
|
||||||
DBUG_ASSERT(value);
|
DBUG_ASSERT(value);
|
||||||
rfield= field->field;
|
rfield= field->field;
|
||||||
@@ -9040,7 +9038,7 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
|
|||||||
DBUG_RETURN(thd->is_error());
|
DBUG_RETURN(thd->is_error());
|
||||||
err_unwind_fields:
|
err_unwind_fields:
|
||||||
if (update && thd->variables.sql_mode & MODE_SIMULTANEOUS_ASSIGNMENT)
|
if (update && thd->variables.sql_mode & MODE_SIMULTANEOUS_ASSIGNMENT)
|
||||||
unwind_stored_field_offsets(fields, rfield);
|
unwind_stored_field_offsets(fields, field);
|
||||||
err:
|
err:
|
||||||
DBUG_PRINT("error",("got error"));
|
DBUG_PRINT("error",("got error"));
|
||||||
thd->abort_on_warning= save_abort_on_warning;
|
thd->abort_on_warning= save_abort_on_warning;
|
||||||
|
@@ -22488,6 +22488,8 @@ do_select(JOIN *join, Procedure *procedure)
|
|||||||
*/
|
*/
|
||||||
clear_tables(join, &cleared_tables);
|
clear_tables(join, &cleared_tables);
|
||||||
}
|
}
|
||||||
|
if (join->tmp_table_param.copy_funcs.elements)
|
||||||
|
copy_fields(&join->tmp_table_param);
|
||||||
if (!join->having || join->having->val_bool())
|
if (!join->having || join->having->val_bool())
|
||||||
{
|
{
|
||||||
List<Item> *columns_list= (procedure ? &join->procedure_fields_list :
|
List<Item> *columns_list= (procedure ? &join->procedure_fields_list :
|
||||||
|
@@ -909,6 +909,8 @@ public:
|
|||||||
:Charset(cs), Binary_string(str, len)
|
:Charset(cs), Binary_string(str, len)
|
||||||
{ }
|
{ }
|
||||||
String(const String &str) = default;
|
String(const String &str) = default;
|
||||||
|
String(String &&str) noexcept
|
||||||
|
:Charset(std::move(str)), Binary_string(std::move(str)){}
|
||||||
|
|
||||||
void set(String &str,size_t offset,size_t arg_length)
|
void set(String &str,size_t offset,size_t arg_length)
|
||||||
{
|
{
|
||||||
|
@@ -2572,7 +2572,7 @@ struct TABLE_LIST
|
|||||||
List<TABLE_LIST> *view_tables;
|
List<TABLE_LIST> *view_tables;
|
||||||
/* most upper view this table belongs to */
|
/* most upper view this table belongs to */
|
||||||
TABLE_LIST *belong_to_view;
|
TABLE_LIST *belong_to_view;
|
||||||
/* A derived table this table belongs to */
|
/* A merged derived table this table belongs to */
|
||||||
TABLE_LIST *belong_to_derived;
|
TABLE_LIST *belong_to_derived;
|
||||||
/*
|
/*
|
||||||
The view directly referencing this table
|
The view directly referencing this table
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* Dual XML implementation base classes defines. */
|
/* Dual XML implementation base classes defines. */
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
#if !defined(BASE_BUFFER_SIZE)
|
#ifndef LIBXML2_SUPPORT
|
||||||
enum ElementType { // libxml2
|
enum ElementType { // libxml2
|
||||||
XML_ELEMENT_NODE = 1,
|
XML_ELEMENT_NODE = 1,
|
||||||
XML_ATTRIBUTE_NODE = 2,
|
XML_ATTRIBUTE_NODE = 2,
|
||||||
@@ -28,7 +28,7 @@ enum ElementType { // libxml2
|
|||||||
XML_XINCLUDE_START = 19,
|
XML_XINCLUDE_START = 19,
|
||||||
XML_XINCLUDE_END = 20,
|
XML_XINCLUDE_END = 20,
|
||||||
XML_DOCB_DOCUMENT_NODE = 21};
|
XML_DOCB_DOCUMENT_NODE = 21};
|
||||||
#endif // !BASE_BUFFER_SIZE
|
#endif
|
||||||
|
|
||||||
//#if !defined(NODE_TYPE_LIST)
|
//#if !defined(NODE_TYPE_LIST)
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
|
@@ -25,6 +25,9 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
//#include <ctype.h>
|
//#include <ctype.h>
|
||||||
|
#ifdef LIBXML2_SUPPORT
|
||||||
|
#include <libxml/tree.h>
|
||||||
|
#endif
|
||||||
#include "osutil.h"
|
#include "osutil.h"
|
||||||
#define _O_RDONLY O_RDONLY
|
#define _O_RDONLY O_RDONLY
|
||||||
#endif // !_WIN32
|
#endif // !_WIN32
|
||||||
|
@@ -1484,20 +1484,20 @@ static void fill_server(MEM_ROOT *mem_root, FEDERATEDX_SERVER *server,
|
|||||||
sizeof(int) + 8);
|
sizeof(int) + 8);
|
||||||
key.append(scheme);
|
key.append(scheme);
|
||||||
key.q_append('\0');
|
key.q_append('\0');
|
||||||
server->hostname= (const char *) (intptr) key.length();
|
size_t hostname_pos= key.length();
|
||||||
key.append(hostname);
|
key.append(hostname);
|
||||||
key.q_append('\0');
|
key.q_append('\0');
|
||||||
server->database= (const char *) (intptr) key.length();
|
size_t database_pos= key.length();
|
||||||
key.append(database);
|
key.append(database);
|
||||||
key.q_append('\0');
|
key.q_append('\0');
|
||||||
key.q_append((uint32) share->port);
|
key.q_append((uint32) share->port);
|
||||||
server->socket= (const char *) (intptr) key.length();
|
size_t socket_pos= key.length();
|
||||||
key.append(socket);
|
key.append(socket);
|
||||||
key.q_append('\0');
|
key.q_append('\0');
|
||||||
server->username= (const char *) (intptr) key.length();
|
size_t username_pos= key.length();
|
||||||
key.append(username);
|
key.append(username);
|
||||||
key.q_append('\0');
|
key.q_append('\0');
|
||||||
server->password= (const char *) (intptr) key.length();
|
size_t password_pos= key.length();
|
||||||
key.append(password);
|
key.append(password);
|
||||||
key.c_ptr_safe(); // Ensure we have end \0
|
key.c_ptr_safe(); // Ensure we have end \0
|
||||||
|
|
||||||
@@ -1505,13 +1505,12 @@ static void fill_server(MEM_ROOT *mem_root, FEDERATEDX_SERVER *server,
|
|||||||
/* Copy and add end \0 */
|
/* Copy and add end \0 */
|
||||||
server->key= (uchar *) strmake_root(mem_root, key.ptr(), key.length());
|
server->key= (uchar *) strmake_root(mem_root, key.ptr(), key.length());
|
||||||
|
|
||||||
/* pointer magic */
|
server->scheme= (const char *)server->key;
|
||||||
server->scheme+= (intptr) server->key;
|
server->hostname= (const char *)server->key + hostname_pos;
|
||||||
server->hostname+= (intptr) server->key;
|
server->database= (const char *)server->key + database_pos;
|
||||||
server->database+= (intptr) server->key;
|
server->username= (const char *)server->key + username_pos;
|
||||||
server->username+= (intptr) server->key;
|
server->password= (const char *)server->key + password_pos;
|
||||||
server->password+= (intptr) server->key;
|
server->socket= (const char*)server->key + socket_pos;
|
||||||
server->socket+= (intptr) server->key;
|
|
||||||
server->port= share->port;
|
server->port= share->port;
|
||||||
|
|
||||||
if (!share->socket)
|
if (!share->socket)
|
||||||
|
@@ -2513,10 +2513,12 @@ corrupted:
|
|||||||
if (!table->is_readable()) {
|
if (!table->is_readable()) {
|
||||||
/* Don't attempt to load the indexes from disk. */
|
/* Don't attempt to load the indexes from disk. */
|
||||||
} else if (err == DB_SUCCESS) {
|
} else if (err == DB_SUCCESS) {
|
||||||
|
auto i = fk_tables.size();
|
||||||
err = dict_load_foreigns(table->name.m_name, nullptr,
|
err = dict_load_foreigns(table->name.m_name, nullptr,
|
||||||
0, true, ignore_err, fk_tables);
|
0, true, ignore_err, fk_tables);
|
||||||
|
|
||||||
if (err != DB_SUCCESS) {
|
if (err != DB_SUCCESS) {
|
||||||
|
fk_tables.erase(fk_tables.begin() + i, fk_tables.end());
|
||||||
ib::warn() << "Load table " << table->name
|
ib::warn() << "Load table " << table->name
|
||||||
<< " failed, the table has missing"
|
<< " failed, the table has missing"
|
||||||
" foreign key indexes. Turn off"
|
" foreign key indexes. Turn off"
|
||||||
|
@@ -621,6 +621,16 @@ inline bool dict_table_t::instant_column(const dict_table_t& table,
|
|||||||
}
|
}
|
||||||
|
|
||||||
dict_index_t* index = dict_table_get_first_index(this);
|
dict_index_t* index = dict_table_get_first_index(this);
|
||||||
|
if (instant) {
|
||||||
|
instant->field_map= static_cast<field_map_element_t*>(
|
||||||
|
mem_heap_dup(heap, instant->field_map,
|
||||||
|
(index->n_fields -
|
||||||
|
index->first_user_field()) *
|
||||||
|
sizeof *instant->field_map));
|
||||||
|
instant= static_cast<dict_instant_t*>(
|
||||||
|
mem_heap_dup(heap, instant, sizeof *instant));
|
||||||
|
}
|
||||||
|
|
||||||
bool metadata_changed;
|
bool metadata_changed;
|
||||||
{
|
{
|
||||||
const dict_index_t& i = *dict_table_get_first_index(&table);
|
const dict_index_t& i = *dict_table_get_first_index(&table);
|
||||||
@@ -5531,6 +5541,11 @@ static bool innodb_insert_sys_columns(
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DBUG_EXECUTE_IF("instant_insert_fail",
|
||||||
|
my_error(ER_INTERNAL_ERROR, MYF(0),
|
||||||
|
"InnoDB: Insert into SYS_COLUMNS failed");
|
||||||
|
return true;);
|
||||||
|
|
||||||
if (DB_SUCCESS != que_eval_sql(
|
if (DB_SUCCESS != que_eval_sql(
|
||||||
info,
|
info,
|
||||||
"PROCEDURE ADD_COL () IS\n"
|
"PROCEDURE ADD_COL () IS\n"
|
||||||
|
@@ -277,7 +277,6 @@ public:
|
|||||||
|
|
||||||
#ifdef UNIV_PFS_MEMORY
|
#ifdef UNIV_PFS_MEMORY
|
||||||
/** Default constructor. */
|
/** Default constructor. */
|
||||||
explicit
|
|
||||||
ut_allocator(PSI_memory_key key = PSI_NOT_INSTRUMENTED)
|
ut_allocator(PSI_memory_key key = PSI_NOT_INSTRUMENTED)
|
||||||
: m_key(key)
|
: m_key(key)
|
||||||
{
|
{
|
||||||
|
@@ -7108,10 +7108,6 @@ and less modified rows. Bit 0 is used to prefer orig_trx in case of a tie.
|
|||||||
victim->lock.was_chosen_as_deadlock_victim= true;
|
victim->lock.was_chosen_as_deadlock_victim= true;
|
||||||
DEBUG_SYNC_C("deadlock_report_before_lock_releasing");
|
DEBUG_SYNC_C("deadlock_report_before_lock_releasing");
|
||||||
lock_cancel_waiting_and_release<true>(victim->lock.wait_lock);
|
lock_cancel_waiting_and_release<true>(victim->lock.wait_lock);
|
||||||
#ifdef WITH_WSREP
|
|
||||||
if (victim->is_wsrep() && wsrep_thd_is_SR(victim->mysql_thd))
|
|
||||||
wsrep_handle_SR_rollback(trx->mysql_thd, victim->mysql_thd);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func_exit:
|
func_exit:
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
# License along with this library; if not, write to the Free Software
|
# License along with this library; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 2.8...3.12)
|
||||||
project(mroonga)
|
project(mroonga)
|
||||||
|
|
||||||
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
# https://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/5263/steps/compile/logs/stdio
|
# https://buildbot.askmonty.org/buildbot/builders/work-amd64-valgrind/builds/5263/steps/compile/logs/stdio
|
||||||
# says CMake 2.6.2... We want to drop old software support...
|
# says CMake 2.6.2... We want to drop old software support...
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 2.8...3.12)
|
||||||
# cmake_minimum_required(VERSION 2.6.4) # CentOS 5
|
# cmake_minimum_required(VERSION 2.6.4) # CentOS 5
|
||||||
set(GRN_PROJECT_NAME "groonga")
|
set(GRN_PROJECT_NAME "groonga")
|
||||||
set(GRN_PROJECT_LABEL "Groonga")
|
set(GRN_PROJECT_LABEL "Groonga")
|
||||||
|
4
storage/mroonga/vendor/groonga/lib/db.c
vendored
4
storage/mroonga/vendor/groonga/lib/db.c
vendored
@@ -969,8 +969,8 @@ calc_rec_size(grn_table_flags flags, uint32_t max_n_subrecs, uint32_t range_size
|
|||||||
*subrec_size = range_size + sizeof(uint32_t) + sizeof(uint32_t);
|
*subrec_size = range_size + sizeof(uint32_t) + sizeof(uint32_t);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*value_size = (uintptr_t)GRN_RSET_SUBRECS_NTH((((grn_rset_recinfo *)0)->subrecs),
|
*value_size = (uintptr_t) GRN_RSET_SUBRECS_NTH(offsetof(grn_rset_recinfo, subrecs),
|
||||||
*subrec_size, max_n_subrecs);
|
*subrec_size, max_n_subrecs);
|
||||||
} else {
|
} else {
|
||||||
*value_size = range_size;
|
*value_size = range_size;
|
||||||
}
|
}
|
||||||
|
14
storage/mroonga/vendor/groonga/lib/hash.c
vendored
14
storage/mroonga/vendor/groonga/lib/hash.c
vendored
@@ -1727,15 +1727,15 @@ grn_io_hash_calculate_entry_size(uint32_t key_size, uint32_t value_size,
|
|||||||
{
|
{
|
||||||
if (flags & GRN_OBJ_KEY_VAR_SIZE) {
|
if (flags & GRN_OBJ_KEY_VAR_SIZE) {
|
||||||
if (flags & GRN_OBJ_KEY_LARGE) {
|
if (flags & GRN_OBJ_KEY_LARGE) {
|
||||||
return (uintptr_t)((grn_io_hash_entry_large *)0)->value + value_size;
|
return offsetof(grn_io_hash_entry_large, value) + value_size;
|
||||||
} else {
|
} else {
|
||||||
return (uintptr_t)((grn_io_hash_entry_normal *)0)->value + value_size;
|
return offsetof(grn_io_hash_entry_normal, value) + value_size;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (key_size == sizeof(uint32_t)) {
|
if (key_size == sizeof(uint32_t)) {
|
||||||
return (uintptr_t)((grn_plain_hash_entry *)0)->value + value_size;
|
return offsetof(grn_plain_hash_entry, value) + value_size;
|
||||||
} else {
|
} else {
|
||||||
return (uintptr_t)((grn_rich_hash_entry *)0)->key_and_value
|
return offsetof(grn_rich_hash_entry, key_and_value)
|
||||||
+ key_size + value_size;
|
+ key_size + value_size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1865,12 +1865,12 @@ grn_tiny_hash_calculate_entry_size(uint32_t key_size, uint32_t value_size,
|
|||||||
{
|
{
|
||||||
uint32_t entry_size;
|
uint32_t entry_size;
|
||||||
if (flags & GRN_OBJ_KEY_VAR_SIZE) {
|
if (flags & GRN_OBJ_KEY_VAR_SIZE) {
|
||||||
entry_size = (uintptr_t)((grn_tiny_hash_entry *)0)->value + value_size;
|
entry_size = offsetof(grn_tiny_hash_entry, value) + value_size;
|
||||||
} else {
|
} else {
|
||||||
if (key_size == sizeof(uint32_t)) {
|
if (key_size == sizeof(uint32_t)) {
|
||||||
entry_size = (uintptr_t)((grn_plain_hash_entry *)0)->value + value_size;
|
entry_size = offsetof(grn_plain_hash_entry, value) + value_size;
|
||||||
} else {
|
} else {
|
||||||
entry_size = (uintptr_t)((grn_rich_hash_entry *)0)->key_and_value
|
entry_size = offsetof(grn_rich_hash_entry, key_and_value)
|
||||||
+ key_size + value_size;
|
+ key_size + value_size;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
storage/mroonga/vendor/groonga/lib/ii.c
vendored
4
storage/mroonga/vendor/groonga/lib/ii.c
vendored
@@ -2049,7 +2049,7 @@ grn_p_decv(grn_ctx *ctx, uint8_t *data, uint32_t data_size, datavec *dv, uint32_
|
|||||||
if ((df & 1)) {
|
if ((df & 1)) {
|
||||||
df >>= 1;
|
df >>= 1;
|
||||||
size = nreq == dvlen ? data_size : df * nreq;
|
size = nreq == dvlen ? data_size : df * nreq;
|
||||||
if (dv[dvlen].data < dv[0].data + size) {
|
if (!dv[0].data || dv[dvlen].data < dv[0].data + size) {
|
||||||
if (dv[0].data) { GRN_FREE(dv[0].data); }
|
if (dv[0].data) { GRN_FREE(dv[0].data); }
|
||||||
if (!(rp = GRN_MALLOC(size * sizeof(uint32_t)))) { return 0; }
|
if (!(rp = GRN_MALLOC(size * sizeof(uint32_t)))) { return 0; }
|
||||||
dv[dvlen].data = rp + size;
|
dv[dvlen].data = rp + size;
|
||||||
@@ -10653,7 +10653,7 @@ grn_ii_builder_options_fix(grn_ii_builder_options *options)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define GRN_II_BUILDER_TERM_INPLACE_SIZE\
|
#define GRN_II_BUILDER_TERM_INPLACE_SIZE\
|
||||||
(sizeof(grn_ii_builder_term) - (uintptr_t)&((grn_ii_builder_term *)0)->dummy)
|
(sizeof(grn_ii_builder_term) - offsetof(grn_ii_builder_term, dummy))
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
grn_id rid; /* Last record ID */
|
grn_id rid; /* Last record ID */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||||
# MA 02110-1335 USA
|
# MA 02110-1335 USA
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 2.8.12)
|
cmake_minimum_required(VERSION 2.8...3.12)
|
||||||
if(NOT DEFINED GROONGA_NORMALIZER_MYSQL_PROJECT_NAME)
|
if(NOT DEFINED GROONGA_NORMALIZER_MYSQL_PROJECT_NAME)
|
||||||
set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql")
|
set(GROONGA_NORMALIZER_MYSQL_PROJECT_NAME "groonga-normalizer-mysql")
|
||||||
endif()
|
endif()
|
||||||
|
@@ -395,7 +395,9 @@ if ($USE_CHILD_GROUP3)
|
|||||||
--connection master_1
|
--connection master_1
|
||||||
eval $MASTER_1_SET_RECOVERY_STATUS_2_1;
|
eval $MASTER_1_SET_RECOVERY_STATUS_2_1;
|
||||||
eval $MASTER_1_CHECK_LINK_STATUS;
|
eval $MASTER_1_CHECK_LINK_STATUS;
|
||||||
|
--disable_view_protocol
|
||||||
eval $MASTER_1_COPY_TABLES_2_1;
|
eval $MASTER_1_COPY_TABLES_2_1;
|
||||||
|
--enable_view_protocol
|
||||||
if ($USE_CHILD_GROUP3)
|
if ($USE_CHILD_GROUP3)
|
||||||
{
|
{
|
||||||
if (!$OUTPUT_CHILD_GROUP3)
|
if (!$OUTPUT_CHILD_GROUP3)
|
||||||
|
@@ -460,7 +460,9 @@ if ($HAVE_PARTITION)
|
|||||||
--connection master_1
|
--connection master_1
|
||||||
eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1;
|
eval $MASTER_1_SET_RECOVERY_STATUS_P_2_1;
|
||||||
eval $MASTER_1_CHECK_LINK_STATUS;
|
eval $MASTER_1_CHECK_LINK_STATUS;
|
||||||
|
--disable_view_protocol
|
||||||
eval $MASTER_1_COPY_TABLES_P_2_1;
|
eval $MASTER_1_COPY_TABLES_P_2_1;
|
||||||
|
--enable_view_protocol
|
||||||
if ($USE_CHILD_GROUP3)
|
if ($USE_CHILD_GROUP3)
|
||||||
{
|
{
|
||||||
if (!$OUTPUT_CHILD_GROUP3)
|
if (!$OUTPUT_CHILD_GROUP3)
|
||||||
|
@@ -6,6 +6,6 @@
|
|||||||
--enable_query_log
|
--enable_query_log
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
let $DIRECT_SQL_COMMAND=
|
let $DIRECT_SQL_COMMAND=
|
||||||
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test", password "pass,1234", user "tu"');
|
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test", password "pass,1234", user "tu"') as exp;
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
GRANT ALL ON *.* TO tu@'%' IDENTIFIED BY 'pass,1234';
|
GRANT ALL ON *.* TO tu@'%' IDENTIFIED BY 'pass,1234';
|
||||||
|
@@ -6,4 +6,4 @@
|
|||||||
--enable_query_log
|
--enable_query_log
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
let $DIRECT_SQL_COMMAND=
|
let $DIRECT_SQL_COMMAND=
|
||||||
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"');
|
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"') as exp;
|
||||||
|
@@ -15,8 +15,8 @@ CREATE TEMPORARY TABLE tmp_a (
|
|||||||
pkey int NOT NULL,
|
pkey int NOT NULL,
|
||||||
PRIMARY KEY (pkey)
|
PRIMARY KEY (pkey)
|
||||||
) MASTER_1_ENGINE2
|
) MASTER_1_ENGINE2
|
||||||
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test", password "pass,1234", user "tu"');
|
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test", password "pass,1234", user "tu"') as exp;
|
||||||
spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test", password "pass,1234", user "tu"')
|
exp
|
||||||
1
|
1
|
||||||
SELECT pkey FROM tmp_a;
|
SELECT pkey FROM tmp_a;
|
||||||
pkey
|
pkey
|
||||||
|
@@ -13,8 +13,8 @@ CREATE TEMPORARY TABLE tmp_a (
|
|||||||
pkey int NOT NULL,
|
pkey int NOT NULL,
|
||||||
PRIMARY KEY (pkey)
|
PRIMARY KEY (pkey)
|
||||||
) MASTER_1_ENGINE2
|
) MASTER_1_ENGINE2
|
||||||
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"');
|
SELECT spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"') as exp;
|
||||||
spider_direct_sql('SELECT 22', 'tmp_a', 'srv "s_2_1", database "test"')
|
exp
|
||||||
1
|
1
|
||||||
SELECT pkey FROM tmp_a;
|
SELECT pkey FROM tmp_a;
|
||||||
pkey
|
pkey
|
||||||
|
@@ -15,6 +15,9 @@ insert into t1 VALUES (1,4), (1,2), (2,11);
|
|||||||
SELECT MIN(b), a FROM t1 WHERE a=1;
|
SELECT MIN(b), a FROM t1 WHERE a=1;
|
||||||
MIN(b) a
|
MIN(b) a
|
||||||
2 1
|
2 1
|
||||||
|
select * from (SELECT MIN(b), a FROM t1 WHERE a=1) as v;
|
||||||
|
MIN(b) a
|
||||||
|
2 1
|
||||||
SELECT MAX(b), a FROM t1 WHERE a<3;
|
SELECT MAX(b), a FROM t1 WHERE a<3;
|
||||||
MAX(b) a
|
MAX(b) a
|
||||||
11 1
|
11 1
|
||||||
|
@@ -31,8 +31,8 @@ CREATE TABLE tbl_a (
|
|||||||
a INT
|
a INT
|
||||||
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
|
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
|
||||||
create temporary table results (a int);
|
create temporary table results (a int);
|
||||||
SELECT SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"');
|
SELECT SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"') as exp;
|
||||||
SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"')
|
exp
|
||||||
1
|
1
|
||||||
select * from results;
|
select * from results;
|
||||||
a
|
a
|
||||||
|
@@ -31,8 +31,8 @@ CREATE TABLE tbl_a (
|
|||||||
a INT
|
a INT
|
||||||
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
|
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
|
||||||
create temporary table results (a int);
|
create temporary table results (a int);
|
||||||
SELECT SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"');
|
SELECT SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"') as exp;
|
||||||
SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"')
|
exp
|
||||||
1
|
1
|
||||||
select * from results;
|
select * from results;
|
||||||
a
|
a
|
||||||
|
@@ -52,9 +52,11 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
CHECKSUM TABLE tbl_a EXTENDED;
|
CHECKSUM TABLE tbl_a EXTENDED;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
@@ -59,9 +59,11 @@ SET NAMES utf8;
|
|||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
SET NAMES cp932;
|
SET NAMES cp932;
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
SET NAMES utf8;
|
SET NAMES utf8;
|
||||||
|
|
||||||
|
@@ -78,9 +78,11 @@ sync_with_master;
|
|||||||
SET SESSION sql_log_bin= 0;
|
SET SESSION sql_log_bin= 0;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection slave1_1
|
--connection slave1_1
|
||||||
|
@@ -71,16 +71,22 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
|
set @old_spider_direct_aggregate=@@session.spider_direct_aggregate;
|
||||||
set spider_direct_aggregate=1;
|
set spider_direct_aggregate=1;
|
||||||
SHOW STATUS LIKE 'Spider_direct_aggregate';
|
SHOW STATUS LIKE 'Spider_direct_aggregate';
|
||||||
|
--disable_view_protocol
|
||||||
SELECT skey, count(*) cnt FROM tbl_a GROUP BY skey ORDER BY cnt DESC, skey DESC LIMIT 5;
|
SELECT skey, count(*) cnt FROM tbl_a GROUP BY skey ORDER BY cnt DESC, skey DESC LIMIT 5;
|
||||||
|
--enable_view_protocol
|
||||||
SHOW STATUS LIKE 'Spider_direct_aggregate';
|
SHOW STATUS LIKE 'Spider_direct_aggregate';
|
||||||
set spider_direct_aggregate=@old_spider_direct_aggregate;
|
set spider_direct_aggregate=@old_spider_direct_aggregate;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -79,9 +79,11 @@ INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FRO
|
|||||||
INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FROM tbl_a WHERE skey = 5 AND dt > DATE_ADD('2012-12-01', INTERVAL -10 DAY));
|
INSERT IGNORE INTO tbl_b (SELECT skey, CAST(CONCAT(dt, ' ', tm) AS datetime) FROM tbl_a WHERE skey = 5 AND dt > DATE_ADD('2012-12-01', INTERVAL -10 DAY));
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
@@ -71,11 +71,15 @@ SELECT * FROM tbl_a WHERE pkey = 2;
|
|||||||
SELECT * FROM tbl_a;
|
SELECT * FROM tbl_a;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -70,7 +70,9 @@ SELECT a, b, c FROM tbl_a PARTITION (pt2,pt3);
|
|||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
--disable_ps_protocol
|
--disable_ps_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
@@ -49,17 +49,23 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
|
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
--connection master_1
|
--connection master_1
|
||||||
|
--disable_view_protocol
|
||||||
SELECT id, 0 AS const, val FROM tbl_a;
|
SELECT id, 0 AS const, val FROM tbl_a;
|
||||||
SELECT 1+2, id, 0 AS const, val, val+10, (SELECT tbl_a.val+1 FROM tbl_a) AS sq
|
SELECT 1+2, id, 0 AS const, val, val+10, (SELECT tbl_a.val+1 FROM tbl_a) AS sq
|
||||||
FROM tbl_a;
|
FROM tbl_a;
|
||||||
|
--enable_view_protocol
|
||||||
INSERT INTO tbl_a (val) VALUES (2), (1);
|
INSERT INTO tbl_a (val) VALUES (2), (1);
|
||||||
|
--disable_view_protocol
|
||||||
SELECT val+10, 0 AS const, val, (SELECT tbl_a.val+1 FROM tbl_a LIMIT 1) AS sq
|
SELECT val+10, 0 AS const, val, (SELECT tbl_a.val+1 FROM tbl_a LIMIT 1) AS sq
|
||||||
FROM tbl_a GROUP BY val;
|
FROM tbl_a GROUP BY val;
|
||||||
SELECT MAX(id) AS m, 0 AS const, val, (SELECT tbl_a.val+1 FROM tbl_a LIMIT 1) AS sq
|
SELECT MAX(id) AS m, 0 AS const, val, (SELECT tbl_a.val+1 FROM tbl_a LIMIT 1) AS sq
|
||||||
FROM tbl_a GROUP BY val;
|
FROM tbl_a GROUP BY val;
|
||||||
|
--enable_view_protocol
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -81,9 +81,11 @@ SELECT STRAIGHT_JOIN b.a, b.b FROM tb_l a, tbl_a b WHERE a.a = b.a;
|
|||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
SET NAMES utf8;
|
SET NAMES utf8;
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
--disable_ps_protocol
|
--disable_ps_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
|
@@ -22,6 +22,7 @@ create table t1 (a int, b int, PRIMARY KEY (a, b)) ENGINE=Spider
|
|||||||
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
|
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
|
||||||
insert into t1 VALUES (1,4), (1,2), (2,11);
|
insert into t1 VALUES (1,4), (1,2), (2,11);
|
||||||
SELECT MIN(b), a FROM t1 WHERE a=1;
|
SELECT MIN(b), a FROM t1 WHERE a=1;
|
||||||
|
select * from (SELECT MIN(b), a FROM t1 WHERE a=1) as v;
|
||||||
SELECT MAX(b), a FROM t1 WHERE a<3;
|
SELECT MAX(b), a FROM t1 WHERE a<3;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
|
||||||
|
@@ -50,8 +50,10 @@ eval CREATE TABLE tbl_a (
|
|||||||
|
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
INSERT INTO tbl_a VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
|
INSERT INTO tbl_a VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
|
||||||
|
--disable_view_protocol
|
||||||
SELECT * FROM tbl_a WHERE greeting = "Aloha!"
|
SELECT * FROM tbl_a WHERE greeting = "Aloha!"
|
||||||
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH
|
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH
|
||||||
|
--enable_view_protocol
|
||||||
|
|
||||||
# LIKE
|
# LIKE
|
||||||
eval CREATE TABLE tbl_b (
|
eval CREATE TABLE tbl_b (
|
||||||
@@ -61,8 +63,10 @@ eval CREATE TABLE tbl_b (
|
|||||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_b", srv "s_2_1"';
|
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_b", srv "s_2_1"';
|
||||||
|
|
||||||
INSERT INTO tbl_b VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
|
INSERT INTO tbl_b VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
|
||||||
|
--disable_view_protocol
|
||||||
SELECT * FROM tbl_b WHERE greeting = "Aloha!"
|
SELECT * FROM tbl_b WHERE greeting = "Aloha!"
|
||||||
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH
|
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH
|
||||||
|
--enable_view_protocol
|
||||||
|
|
||||||
# LIKE
|
# LIKE
|
||||||
eval CREATE TABLE tbl_c (
|
eval CREATE TABLE tbl_c (
|
||||||
@@ -72,11 +76,15 @@ eval CREATE TABLE tbl_c (
|
|||||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_c", srv "s_2_1"';
|
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_c", srv "s_2_1"';
|
||||||
|
|
||||||
INSERT INTO tbl_c VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
|
INSERT INTO tbl_c VALUES (1, "Hi!"),(2, "Aloha!"),(3, "Aloha!!!");
|
||||||
|
--disable_view_protocol
|
||||||
SELECT * FROM tbl_c WHERE greeting = "Aloha!"
|
SELECT * FROM tbl_c WHERE greeting = "Aloha!"
|
||||||
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH
|
AND CASE greeting WHEN "Aloha!" THEN "one" ELSE 'more' END = "one"; # hack to disable GBH
|
||||||
|
--enable_view_protocol
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
SELECT argument FROM mysql.general_log WHERE argument LIKE 'select `id`,`greeting` from %';
|
SELECT argument FROM mysql.general_log WHERE argument LIKE 'select `id`,`greeting` from %';
|
||||||
|
--enable_view_protocol
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
@@ -31,15 +31,19 @@ eval CREATE TABLE tbl_a (
|
|||||||
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
|
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"';
|
||||||
|
|
||||||
--disable_ps_protocol
|
--disable_ps_protocol
|
||||||
|
--disable_view_protocol
|
||||||
SELECT MIN(t2.a) AS f1, t1.b AS f2 FROM tbl_a AS t1 JOIN tbl_a AS t2 GROUP BY f2 ORDER BY f1, f2;
|
SELECT MIN(t2.a) AS f1, t1.b AS f2 FROM tbl_a AS t1 JOIN tbl_a AS t2 GROUP BY f2 ORDER BY f1, f2;
|
||||||
SELECT MIN(t2.a) AS f1, t1.b AS f2 FROM tbl_a AS t1 JOIN tbl_a AS t2 GROUP BY f2 ORDER BY MIN(t2.a), MAX(t2.a), f2;
|
SELECT MIN(t2.a) AS f1, t1.b AS f2 FROM tbl_a AS t1 JOIN tbl_a AS t2 GROUP BY f2 ORDER BY MIN(t2.a), MAX(t2.a), f2;
|
||||||
|
--enable_view_protocol
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
|
|
||||||
--connection master_1
|
--connection master_1
|
||||||
DROP DATABASE IF EXISTS auto_test_local;
|
DROP DATABASE IF EXISTS auto_test_local;
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
--disable_ps_protocol
|
--disable_ps_protocol
|
||||||
|
--disable_view_protocol
|
||||||
SELECT argument FROM mysql.general_log WHERE argument LIKE 'select %';
|
SELECT argument FROM mysql.general_log WHERE argument LIKE 'select %';
|
||||||
|
--enable_view_protocol
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
set global log_output=@old_log_output;
|
set global log_output=@old_log_output;
|
||||||
set global general_log=@old_general_log;
|
set global general_log=@old_general_log;
|
||||||
|
@@ -24,10 +24,14 @@ eval CREATE TABLE t1 (a INT KEY) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "$sr
|
|||||||
SELECT MAX(a) FROM t1;
|
SELECT MAX(a) FROM t1;
|
||||||
SELECT SUM(a) FROM t1;
|
SELECT SUM(a) FROM t1;
|
||||||
SELECT COUNT(a) FROM t1;
|
SELECT COUNT(a) FROM t1;
|
||||||
|
# Spider does not create a GBH with view protocol in these cases which
|
||||||
|
# would cause extra direct aggregate counts than without view protocol
|
||||||
|
--disable_view_protocol
|
||||||
SELECT MAX(a), SUM(a) FROM t1;
|
SELECT MAX(a), SUM(a) FROM t1;
|
||||||
SELECT COUNT(a), MAX(a), SUM(a) FROM t1;
|
SELECT COUNT(a), MAX(a), SUM(a) FROM t1;
|
||||||
SELECT MAX(a), COUNT(a), SUM(a) FROM t1;
|
SELECT MAX(a), COUNT(a), SUM(a) FROM t1;
|
||||||
SELECT MAX(a), MAX(COALESCE(a)) FROM t1;
|
SELECT MAX(a), MAX(COALESCE(a)) FROM t1;
|
||||||
|
--enable_view_protocol
|
||||||
SHOW STATUS LIKE 'Spider_direct_aggregate';
|
SHOW STATUS LIKE 'Spider_direct_aggregate';
|
||||||
|
|
||||||
DROP TABLE t, t1;
|
DROP TABLE t, t1;
|
||||||
|
@@ -25,7 +25,9 @@ INSERT INTO dst VALUES (555, '1999-12-12');
|
|||||||
# possibly a bug, e.g. an unnecessary requirement.
|
# possibly a bug, e.g. an unnecessary requirement.
|
||||||
evalp CREATE TABLE t (c INT, d DATE, PRIMARY KEY(c)) ENGINE=SPIDER
|
evalp CREATE TABLE t (c INT, d DATE, PRIMARY KEY(c)) ENGINE=SPIDER
|
||||||
COMMENT='table "src dst", srv "s_2_1 s_1"';
|
COMMENT='table "src dst", srv "s_2_1 s_1"';
|
||||||
|
--disable_view_protocol
|
||||||
SELECT spider_copy_tables('t', '0', '1');
|
SELECT spider_copy_tables('t', '0', '1');
|
||||||
|
--enable_view_protocol
|
||||||
|
|
||||||
SELECT * FROM dst;
|
SELECT * FROM dst;
|
||||||
|
|
||||||
|
@@ -7,8 +7,10 @@ CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so';
|
|||||||
SELECT spider_bg_direct_sql ('SELECT * FROM s','a','srv "b"');
|
SELECT spider_bg_direct_sql ('SELECT * FROM s','a','srv "b"');
|
||||||
|
|
||||||
CREATE FUNCTION spider_copy_tables RETURNS INT SONAME 'ha_spider.so';
|
CREATE FUNCTION spider_copy_tables RETURNS INT SONAME 'ha_spider.so';
|
||||||
|
--disable_view_protocol
|
||||||
--error ER_CANT_INITIALIZE_UDF
|
--error ER_CANT_INITIALIZE_UDF
|
||||||
SELECT spider_copy_tables ('t', '0', '0');
|
SELECT spider_copy_tables ('t', '0', '0');
|
||||||
|
--enable_view_protocol
|
||||||
|
|
||||||
# spider_flush_table_mon_cache does not require spider init to function
|
# spider_flush_table_mon_cache does not require spider init to function
|
||||||
CREATE FUNCTION spider_flush_table_mon_cache RETURNS INT SONAME 'ha_spider.so';
|
CREATE FUNCTION spider_flush_table_mon_cache RETURNS INT SONAME 'ha_spider.so';
|
||||||
@@ -21,8 +23,10 @@ install soname 'ha_spider';
|
|||||||
SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"');
|
SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"');
|
||||||
|
|
||||||
call mtr.add_suppression(".*\\[Error\\] (mysqld|mariadbd): Can't find record in 'spider_tables'");
|
call mtr.add_suppression(".*\\[Error\\] (mysqld|mariadbd): Can't find record in 'spider_tables'");
|
||||||
|
--disable_view_protocol
|
||||||
--error ER_KEY_NOT_FOUND
|
--error ER_KEY_NOT_FOUND
|
||||||
SELECT spider_copy_tables ('t', '0', '0');
|
SELECT spider_copy_tables ('t', '0', '0');
|
||||||
|
--enable_view_protocol
|
||||||
|
|
||||||
SELECT spider_flush_table_mon_cache ();
|
SELECT spider_flush_table_mon_cache ();
|
||||||
|
|
||||||
|
@@ -12,7 +12,10 @@ CREATE TABLE t1 (c INT) ENGINE=MyISAM;
|
|||||||
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "t1"';
|
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",SRV "srv",TABLE "t1"';
|
||||||
insert into t2 values (456), (123);
|
insert into t2 values (456), (123);
|
||||||
SELECT * FROM t2 ORDER BY CAST(c AS char(60));
|
SELECT * FROM t2 ORDER BY CAST(c AS char(60));
|
||||||
|
# extra warnings with view protocol
|
||||||
|
--disable_view_protocol
|
||||||
SELECT * FROM t2 ORDER BY CAST(c AS INET6);
|
SELECT * FROM t2 ORDER BY CAST(c AS INET6);
|
||||||
|
--enable_view_protocol
|
||||||
SELECT * FROM t2 GROUP BY CAST(c AS char(60));
|
SELECT * FROM t2 GROUP BY CAST(c AS char(60));
|
||||||
SELECT * FROM t2 GROUP BY CAST(c AS INET6);
|
SELECT * FROM t2 GROUP BY CAST(c AS INET6);
|
||||||
# Cleanup
|
# Cleanup
|
||||||
|
@@ -78,13 +78,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
|
|
||||||
--connection master_1
|
--connection master_1
|
||||||
@@ -103,13 +107,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
|
|
||||||
--connection master_1
|
--connection master_1
|
||||||
@@ -129,12 +137,16 @@ SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
|||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -78,13 +78,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
|
|
||||||
--connection master_1
|
--connection master_1
|
||||||
@@ -103,13 +107,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
|
|
||||||
--connection master_1
|
--connection master_1
|
||||||
@@ -128,13 +136,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -78,13 +78,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
|
|
||||||
--connection master_1
|
--connection master_1
|
||||||
@@ -103,13 +107,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
|
|
||||||
--connection master_1
|
--connection master_1
|
||||||
@@ -128,13 +136,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -79,13 +79,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
|
|
||||||
--connection master_1
|
--connection master_1
|
||||||
@@ -104,13 +108,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
|
|
||||||
--connection master_1
|
--connection master_1
|
||||||
@@ -129,13 +137,17 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
--replace_regex /tmp_spider_bka_0x[0-9a-f]*/tmp_spider_bka_xxxx/
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -56,9 +56,11 @@ exec $MYSQL -v -v -u root -h localhost -P $MASTER_1_MYPORT -S $MASTER_1_MYSOCK -
|
|||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
TRUNCATE TABLE mysql.general_log;
|
TRUNCATE TABLE mysql.general_log;
|
||||||
@@ -69,9 +71,11 @@ exec $MYSQL -v -v -u root -h localhost -P $MASTER_1_MYPORT -S $MASTER_1_MYSOCK -
|
|||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
TRUNCATE TABLE mysql.general_log;
|
TRUNCATE TABLE mysql.general_log;
|
||||||
@@ -82,9 +86,11 @@ exec $MYSQL -v -v -u root -h localhost -P $MASTER_1_MYPORT -S $MASTER_1_MYSOCK -
|
|||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
@@ -58,9 +58,11 @@ exec $MYSQL -v -v -u root -h localhost --default-character-set=latin1 -P $MASTER
|
|||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
@@ -52,9 +52,11 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT pkey FROM tbl_a WHERE NULL;
|
SELECT pkey FROM tbl_a WHERE NULL;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
@@ -55,7 +55,9 @@ SELECT `pkey`, LEFT(`txt_utf8`, 4) FROM `auto_test_local`.`tbl_a` ORDER BY LEFT(
|
|||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
SET NAMES utf8;
|
SET NAMES utf8;
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -71,10 +71,12 @@ SET SESSION sql_log_bin= 0;
|
|||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
--replace_regex /-[0-9a-f]{12}-[0-9a-f]+-/-xxxxxxxxxxxx-xxxxx-/
|
--replace_regex /-[0-9a-f]{12}-[0-9a-f]+-/-xxxxxxxxxxxx-xxxxx-/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection slave1_1
|
--connection slave1_1
|
||||||
|
@@ -49,8 +49,10 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
SELECT * FROM tbl_a ORDER BY pkey;
|
SELECT * FROM tbl_a ORDER BY pkey;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--replace_regex /-[0-9a-f]{12}-[0-9a-f]+-/-xxxxxxxxxxxx-xxxxx-/
|
--replace_regex /-[0-9a-f]{12}-[0-9a-f]+-/-xxxxxxxxxxxx-xxxxx-/
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -78,15 +78,19 @@ SHOW STATUS LIKE 'Spider_direct_aggregate';
|
|||||||
set spider_direct_aggregate=@old_spider_direct_aggregate;
|
set spider_direct_aggregate=@old_spider_direct_aggregate;
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--connection child2_2
|
--connection child2_2
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_2_SELECT_TABLES;
|
eval $CHILD2_2_SELECT_TABLES;
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
@@ -37,7 +37,7 @@ eval CREATE TABLE tbl_a (
|
|||||||
|
|
||||||
create temporary table results (a int);
|
create temporary table results (a int);
|
||||||
--disable_ps_protocol
|
--disable_ps_protocol
|
||||||
SELECT SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"');
|
SELECT SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"') as exp;
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
select * from results;
|
select * from results;
|
||||||
|
|
||||||
|
@@ -47,12 +47,14 @@ TRUNCATE TABLE mysql.general_log;
|
|||||||
|
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
--connection master_1
|
--connection master_1
|
||||||
|
--disable_view_protocol
|
||||||
SELECT * FROM tbl_a ORDER BY pkey;
|
SELECT * FROM tbl_a ORDER BY pkey;
|
||||||
|
--enable_view_protocol
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
# in --ps a query is logged differently in a general log
|
--disable_view_protocol
|
||||||
replace_regex /order by t0.`pkey`/order by `pkey`/;
|
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
|
||||||
|
@@ -49,9 +49,11 @@ XA PREPARE 'test';
|
|||||||
XA COMMIT 'test';
|
XA COMMIT 'test';
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
|
--disable_view_protocol
|
||||||
--disable_ps2_protocol
|
--disable_ps2_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
--enable_ps2_protocol
|
--enable_ps2_protocol
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
|
|
||||||
--echo
|
--echo
|
||||||
|
@@ -11,11 +11,11 @@ create table t2 (c int);
|
|||||||
create table t1 (c int) ENGINE=Spider
|
create table t1 (c int) ENGINE=Spider
|
||||||
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
|
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
|
||||||
insert into t1 values (42), (3), (848), (100);
|
insert into t1 values (42), (3), (848), (100);
|
||||||
explain select case c when 3 then "three" when 42 then "answer" else "other" end from t1;
|
explain select case c when 3 then "three" when 42 then "answer" else "other" end as exp from t1;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Storage engine handles GROUP BY
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Storage engine handles GROUP BY
|
||||||
select case c when 3 then "three" when 42 then "answer" else "other" end from t1;
|
select case c when 3 then "three" when 42 then "answer" else "other" end as exp from t1;
|
||||||
case c when 3 then "three" when 42 then "answer" else "other" end
|
exp
|
||||||
answer
|
answer
|
||||||
three
|
three
|
||||||
other
|
other
|
||||||
@@ -29,11 +29,11 @@ answer
|
|||||||
three
|
three
|
||||||
NULL
|
NULL
|
||||||
NULL
|
NULL
|
||||||
explain select case when c = 3 then "three" when c = 42 then "answer" else "other" end from t1;
|
explain select case when c = 3 then "three" when c = 42 then "answer" else "other" end as exp from t1;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Storage engine handles GROUP BY
|
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Storage engine handles GROUP BY
|
||||||
select case when c = 3 then "three" when c = 42 then "answer" else "other" end from t1;
|
select case when c = 3 then "three" when c = 42 then "answer" else "other" end as exp from t1;
|
||||||
case when c = 3 then "three" when c = 42 then "answer" else "other" end
|
exp
|
||||||
answer
|
answer
|
||||||
three
|
three
|
||||||
other
|
other
|
||||||
|
@@ -74,10 +74,12 @@ send_eval $MASTER_1_CHECKSUM_TABLE;
|
|||||||
|
|
||||||
--connection child2_1_2
|
--connection child2_1_2
|
||||||
SELECT SLEEP(1);
|
SELECT SLEEP(1);
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
|
||||||
--connection child2_2_2
|
--connection child2_2_2
|
||||||
eval $CHILD2_2_SELECT_ARGUMENT1;
|
eval $CHILD2_2_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
@@ -16,7 +16,7 @@ insert into t1 values (42), (3), (848), (100);
|
|||||||
|
|
||||||
# everything
|
# everything
|
||||||
let $query=
|
let $query=
|
||||||
select case c when 3 then "three" when 42 then "answer" else "other" end from t1;
|
select case c when 3 then "three" when 42 then "answer" else "other" end as exp from t1;
|
||||||
eval explain $query;
|
eval explain $query;
|
||||||
eval $query;
|
eval $query;
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ eval $query;
|
|||||||
|
|
||||||
# no value
|
# no value
|
||||||
let $query=
|
let $query=
|
||||||
select case when c = 3 then "three" when c = 42 then "answer" else "other" end from t1;
|
select case when c = 3 then "three" when c = 42 then "answer" else "other" end as exp from t1;
|
||||||
eval explain $query;
|
eval explain $query;
|
||||||
eval $query;
|
eval $query;
|
||||||
|
|
||||||
|
@@ -67,7 +67,9 @@ SELECT a.val, a.akey FROM tbl_a a, tbl_b b WHERE a.akey = b.akey AND b.bkey = 5;
|
|||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
--disable_ps_protocol
|
--disable_ps_protocol
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
|
|
||||||
|
@@ -67,7 +67,9 @@ SELECT a.val, a.akey FROM tbl_a a, tbl_b b WHERE a.akey = b.akey AND b.bkey = 5;
|
|||||||
|
|
||||||
--connection child2_1
|
--connection child2_1
|
||||||
--disable_ps_protocol
|
--disable_ps_protocol
|
||||||
|
--disable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_ARGUMENT1;
|
eval $CHILD2_1_SELECT_ARGUMENT1;
|
||||||
|
--enable_view_protocol
|
||||||
eval $CHILD2_1_SELECT_TABLES;
|
eval $CHILD2_1_SELECT_TABLES;
|
||||||
--enable_ps_protocol
|
--enable_ps_protocol
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user