75 changed files with 1425 additions and 400 deletions
-
31cmake/plugin.cmake
-
2extra/mariabackup/xtrabackup.cc
-
3mysql-test/suite/binlog/r/show_concurrent_rotate.result
-
7mysql-test/suite/binlog/t/show_concurrent_rotate.test
-
21mysql-test/suite/encryption/r/innodb_import.result
-
7mysql-test/suite/encryption/t/innodb_import.combinations
-
1mysql-test/suite/encryption/t/innodb_import.opt
-
22mysql-test/suite/encryption/t/innodb_import.test
-
36mysql-test/suite/federated/federated_partition.result
-
25mysql-test/suite/federated/federated_partition.test
-
18mysql-test/suite/galera/r/galera_as_slave_replay.result
-
12mysql-test/suite/galera/t/galera_as_slave_replay.test
-
47mysql-test/suite/galera_sr/r/MDEV-25717.result
-
113mysql-test/suite/galera_sr/t/MDEV-25717.test
-
17mysql-test/suite/innodb/r/full_crc32_import.result
-
17mysql-test/suite/innodb/r/implicit_gap_lock_convertion.result
-
30mysql-test/suite/innodb/r/import_corrupted.result
-
2mysql-test/suite/innodb/r/innodb_information_schema.result
-
8mysql-test/suite/innodb/t/full_crc32_import.test
-
21mysql-test/suite/innodb/t/implicit_gap_lock_convertion.test
-
68mysql-test/suite/innodb/t/import_corrupted.test
-
39mysql-test/suite/innodb_gis/r/alter_spatial_index.result
-
10mysql-test/suite/innodb_gis/t/alter_spatial_index.test
-
73mysql-test/suite/vcol/r/partition.result
-
48mysql-test/suite/vcol/t/partition.test
-
13mysql-test/suite/versioning/r/foreign.result
-
18mysql-test/suite/versioning/t/foreign.test
-
8scripts/wsrep_sst_common.sh
-
48scripts/wsrep_sst_mariabackup.sh
-
12scripts/wsrep_sst_rsync.sh
-
3sql/field.cc
-
35sql/field.h
-
9sql/filesort.cc
-
217sql/ha_partition.cc
-
14sql/ha_partition.h
-
2sql/item_jsonfunc.h
-
3sql/log.cc
-
6sql/log.h
-
2sql/sql_audit.h
-
4sql/sql_class.cc
-
5sql/sql_lex.cc
-
5sql/sql_prepare.cc
-
12sql/sql_repl.cc
-
2sql/sql_view.cc
-
4sql/table.cc
-
2sql/table.h
-
2storage/innobase/CMakeLists.txt
-
20storage/innobase/btr/btr0btr.cc
-
10storage/innobase/btr/btr0cur.cc
-
3storage/innobase/btr/btr0defragment.cc
-
7storage/innobase/buf/buf0buf.cc
-
3storage/innobase/buf/buf0rea.cc
-
33storage/innobase/fil/fil0fil.cc
-
3storage/innobase/fil/fil0pagecompress.cc
-
8storage/innobase/fts/fts0config.cc
-
18storage/innobase/fts/fts0fts.cc
-
28storage/innobase/fts/fts0opt.cc
-
8storage/innobase/fts/fts0que.cc
-
4storage/innobase/fts/fts0sql.cc
-
4storage/innobase/handler/i_s.cc
-
7storage/innobase/include/btr0btr.h
-
4storage/innobase/include/fil0pagecompress.h
-
12storage/innobase/include/pars0pars.h
-
6storage/innobase/lock/lock0lock.cc
-
6storage/innobase/pars/pars0pars.cc
-
275storage/innobase/row/row0import.cc
-
34storage/innobase/row/row0ins.cc
-
46storage/innobase/row/row0mysql.cc
-
3storage/perfschema/CMakeLists.txt
-
9storage/spider/mysql-test/spider/bugfix/include/mdev_24523_deinit.inc
-
31storage/spider/mysql-test/spider/bugfix/include/mdev_24523_init.inc
-
58storage/spider/mysql-test/spider/bugfix/r/mdev_24523.result
-
3storage/spider/mysql-test/spider/bugfix/t/mdev_24523.cnf
-
66storage/spider/mysql-test/spider/bugfix/t/mdev_24523.test
-
12tests/mysql_client_test.c
@ -0,0 +1,21 @@ |
|||
# |
|||
# MDEV-26131 SEGV in ha_innobase::discard_or_import_tablespace |
|||
# |
|||
CREATE TABLE t1(f1 int,f2 text)ENGINE=InnoDB; |
|||
INSERT INTO t1 VALUES(1, "InnoDB"); |
|||
CREATE TABLE t2 LIKE t1; |
|||
ALTER TABLE t2 ADD KEY idx (f2(13)); |
|||
ALTER TABLE t2 DISCARD TABLESPACE; |
|||
FLUSH TABLES t1 FOR EXPORT; |
|||
UNLOCK TABLES; |
|||
ALTER TABLE t2 IMPORT TABLESPACE; |
|||
ERROR HY000: Internal error: Drop all secondary indexes before importing table test/t2 when .cfg file is missing. |
|||
ALTER TABLE t2 DROP KEY idx; |
|||
ALTER TABLE t2 IMPORT TABLESPACE; |
|||
Warnings: |
|||
Warning 1814 Tablespace has been discarded for table `t2` |
|||
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification |
|||
SELECT * FROM t2; |
|||
f1 f2 |
|||
1 InnoDB |
|||
DROP TABLE t1, t2; |
|||
@ -0,0 +1,7 @@ |
|||
[page_compressed] |
|||
innodb-compression-default=1 |
|||
[encryption] |
|||
innodb-encrypt-tables=1 |
|||
[page_compressed_encryption] |
|||
innodb-compression-default=1 |
|||
innodb-encrypt-tables=1 |
|||
@ -0,0 +1 @@ |
|||
--innodb-checksum-algorithm=crc32 |
|||
@ -0,0 +1,22 @@ |
|||
--source include/have_innodb.inc |
|||
-- source include/have_example_key_management_plugin.inc |
|||
--echo # |
|||
--echo # MDEV-26131 SEGV in ha_innobase::discard_or_import_tablespace |
|||
--echo # |
|||
let $MYSQLD_DATADIR = `SELECT @@datadir`; |
|||
CREATE TABLE t1(f1 int,f2 text)ENGINE=InnoDB; |
|||
INSERT INTO t1 VALUES(1, "InnoDB"); |
|||
CREATE TABLE t2 LIKE t1; |
|||
ALTER TABLE t2 ADD KEY idx (f2(13)); |
|||
ALTER TABLE t2 DISCARD TABLESPACE; |
|||
FLUSH TABLES t1 FOR EXPORT; |
|||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd |
|||
UNLOCK TABLES; |
|||
--error ER_INTERNAL_ERROR |
|||
ALTER TABLE t2 IMPORT TABLESPACE; |
|||
|
|||
ALTER TABLE t2 DROP KEY idx; |
|||
--replace_regex /opening '.*\/test\//opening '.\/test\// |
|||
ALTER TABLE t2 IMPORT TABLESPACE; |
|||
SELECT * FROM t2; |
|||
DROP TABLE t1, t2; |
|||
@ -0,0 +1,47 @@ |
|||
connection node_2; |
|||
connection node_1; |
|||
connection node_1; |
|||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; |
|||
INSERT INTO t1 VALUES (1), (2), (3); |
|||
connection node_2; |
|||
SET SESSION wsrep_trx_fragment_size = 1; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (4); |
|||
connection node_1; |
|||
SELECT COUNT(*) FROM t1; |
|||
COUNT(*) |
|||
3 |
|||
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; |
|||
connection node_2a; |
|||
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_toi"; |
|||
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; |
|||
connection node_1a; |
|||
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_bf_abort"; |
|||
connection node_1; |
|||
TRUNCATE TABLE t1; |
|||
connection node_1a; |
|||
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_bf_abort_reached"; |
|||
connection node_2a; |
|||
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_toi_reached"; |
|||
connection node_2; |
|||
INSERT INTO t1 VALUES (5); |
|||
connection node_2a; |
|||
SET SESSION wsrep_sync_wait = 0; |
|||
SET SESSION wsrep_sync_wait = DEFAULT; |
|||
SET GLOBAL DEBUG_DBUG = ""; |
|||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_toi"; |
|||
connection node_2; |
|||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction |
|||
connection node_1a; |
|||
SET SESSION wsrep_sync_wait=0; |
|||
SET GLOBAL DEBUG_DBUG = "+d,sync.wsrep_log_dummy_write_set"; |
|||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_bf_abort"; |
|||
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_log_dummy_write_set_reached"; |
|||
connection node_1; |
|||
connection node_2; |
|||
SET GLOBAL DEBUG_DBUG = ""; |
|||
SET DEBUG_SYNC = "RESET"; |
|||
connection node_1; |
|||
SET GLOBAL DEBUG_DBUG = ""; |
|||
SET DEBUG_SYNC = "RESET"; |
|||
DROP TABLE t1; |
|||
@ -0,0 +1,113 @@ |
|||
# |
|||
# MDEV-25717 Assertion `owning_thread_id_ == wsrep::this_thread::get_id()' |
|||
# |
|||
# This test exposes a race condition between rollbacker thread and rollback |
|||
# fragment processing. |
|||
# |
|||
|
|||
--source include/galera_cluster.inc |
|||
--source include/have_debug_sync.inc |
|||
|
|||
--connection node_1 |
|||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; |
|||
INSERT INTO t1 VALUES (1), (2), (3); |
|||
|
|||
# |
|||
# On node_2 we start a SR transaction, it going to |
|||
# be BF aborted later on |
|||
# |
|||
--connection node_2 |
|||
SET SESSION wsrep_trx_fragment_size = 1; |
|||
START TRANSACTION; |
|||
INSERT INTO t1 VALUES (4); |
|||
|
|||
--connection node_1 |
|||
SELECT COUNT(*) FROM t1; # Sync wait |
|||
|
|||
# |
|||
# Issue a conflicting TRUNCATE statement on node_1: |
|||
# - on node_2, block it before it is going to apply |
|||
# - on node_1, block before the before it BF aborts the INSERT |
|||
# |
|||
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 |
|||
--connection node_2a |
|||
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_toi"; |
|||
|
|||
--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 |
|||
--connection node_1a |
|||
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_bf_abort"; |
|||
|
|||
--connection node_1 |
|||
--send TRUNCATE TABLE t1 |
|||
|
|||
--connection node_1a |
|||
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_bf_abort_reached"; |
|||
|
|||
--connection node_2a |
|||
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_apply_toi_reached"; |
|||
|
|||
# |
|||
# Generate one more fragment on the SR transaction. |
|||
# This is going to fail certification and results |
|||
# in a rollback fragment. |
|||
# |
|||
--connection node_2 |
|||
--let $expected_cert_failures = `SELECT VARIABLE_VALUE + 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures'` |
|||
|
|||
--send INSERT INTO t1 VALUES (5) |
|||
|
|||
# |
|||
# Wait until after certify and observe the certification |
|||
# failure. Let both continue and we are done on node_2. |
|||
# |
|||
--connection node_2a |
|||
SET SESSION wsrep_sync_wait = 0; |
|||
--let $wait_condition = SELECT VARIABLE_VALUE = $expected_cert_failures FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_cert_failures' |
|||
--source include/wait_condition.inc |
|||
SET SESSION wsrep_sync_wait = DEFAULT; |
|||
|
|||
SET GLOBAL DEBUG_DBUG = ""; |
|||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_toi"; |
|||
|
|||
--connection node_2 |
|||
--error ER_LOCK_DEADLOCK |
|||
--reap |
|||
|
|||
# |
|||
# On node_1 we expect the following things: |
|||
# - the TRUNCATE should successfully bf abort the transaction |
|||
# - A rollback fragment should be delivered as a result of |
|||
# certification failure. We expect the rollback fragment to |
|||
# be delivered after TRUNCATE has bf aborted, therefore rollback |
|||
# fragment logs a dummy writeset. |
|||
# |
|||
--connection node_1a |
|||
SET SESSION wsrep_sync_wait=0; |
|||
SET GLOBAL DEBUG_DBUG = "+d,sync.wsrep_log_dummy_write_set"; |
|||
|
|||
# Signal the TRUNCATE to continue and observe the BF abort |
|||
--let $expected_bf_aborts = `SELECT VARIABLE_VALUE + 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` |
|||
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_bf_abort"; |
|||
|
|||
# Expect a timeout if bug is present |
|||
--let $wait_condition = SELECT VARIABLE_VALUE = $expected_bf_aborts FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts' |
|||
--source include/wait_condition.inc |
|||
|
|||
# Observe logging of dummy writeset |
|||
SET DEBUG_SYNC = "now WAIT_FOR sync.wsrep_log_dummy_write_set_reached"; |
|||
|
|||
# TRUNCATE succeeds |
|||
--connection node_1 |
|||
--reap |
|||
|
|||
# |
|||
# Cleanup |
|||
# |
|||
--connection node_2 |
|||
SET GLOBAL DEBUG_DBUG = ""; |
|||
SET DEBUG_SYNC = "RESET"; |
|||
|
|||
--connection node_1 |
|||
SET GLOBAL DEBUG_DBUG = ""; |
|||
SET DEBUG_SYNC = "RESET"; |
|||
DROP TABLE t1; |
|||
@ -0,0 +1,17 @@ |
|||
CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE=InnoDB; |
|||
INSERT INTO t VALUES (10), (30); |
|||
connect con1,localhost,root,,; |
|||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; |
|||
BEGIN; |
|||
INSERT INTO t VALUES (20); |
|||
SELECT * FROM t WHERE a BETWEEN 10 AND 30; |
|||
a |
|||
10 |
|||
20 |
|||
30 |
|||
connection default; |
|||
SET session innodb_lock_wait_timeout=1; |
|||
INSERT INTO t VALUES (15); |
|||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction |
|||
disconnect con1; |
|||
DROP TABLE t; |
|||
@ -0,0 +1,30 @@ |
|||
call mtr.add_suppression("Table `test`.`t2` should have 2 indexes but the tablespace has 1 indexes"); |
|||
call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it"); |
|||
call mtr.add_suppression("Trying to read .* bytes at .* outside the bounds of the file: ./test/t2.ibd"); |
|||
CREATE TABLE t1 ( |
|||
id INT AUTO_INCREMENT PRIMARY KEY, |
|||
not_id INT, |
|||
data CHAR(255), |
|||
data2 BLOB |
|||
) ENGINE=INNODB; |
|||
ALTER TABLE t1 MODIFY not_id INT UNIQUE KEY; |
|||
connect purge_control,localhost,root,,; |
|||
START TRANSACTION WITH CONSISTENT SNAPSHOT; |
|||
connection default; |
|||
DELETE FROM t1 WHERE id % 2 = 1; |
|||
FLUSH TABLES t1 FOR EXPORT; |
|||
UNLOCK TABLES; |
|||
connection purge_control; |
|||
COMMIT; |
|||
connection default; |
|||
DROP TABLE t1; |
|||
CREATE TABLE t2 ( |
|||
id INT AUTO_INCREMENT PRIMARY KEY, |
|||
not_id INT UNIQUE KEY, |
|||
data CHAR(255), |
|||
data2 BLOB |
|||
) ENGINE=INNODB; |
|||
ALTER TABLE t2 DISCARD TABLESPACE; |
|||
ALTER TABLE t2 IMPORT TABLESPACE; |
|||
ERROR HY000: Index for table 't2' is corrupt; try to repair it |
|||
DROP TABLE t2; |
|||
@ -0,0 +1,21 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/count_sessions.inc |
|||
|
|||
CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE=InnoDB; |
|||
|
|||
INSERT INTO t VALUES (10), (30); |
|||
|
|||
--connect (con1,localhost,root,,) |
|||
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; |
|||
BEGIN; |
|||
INSERT INTO t VALUES (20); |
|||
SELECT * FROM t WHERE a BETWEEN 10 AND 30; |
|||
|
|||
--connection default |
|||
SET session innodb_lock_wait_timeout=1; |
|||
--error ER_LOCK_WAIT_TIMEOUT |
|||
INSERT INTO t VALUES (15); |
|||
|
|||
--disconnect con1 |
|||
DROP TABLE t; |
|||
--source include/wait_until_count_sessions.inc |
|||
@ -0,0 +1,68 @@ |
|||
--source include/have_innodb.inc |
|||
|
|||
call mtr.add_suppression("Table `test`.`t2` should have 2 indexes but the tablespace has 1 indexes"); |
|||
call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it"); |
|||
call mtr.add_suppression("Trying to read .* bytes at .* outside the bounds of the file: ./test/t2.ibd"); |
|||
|
|||
let MYSQLD_DATADIR = `SELECT @@datadir`; |
|||
|
|||
CREATE TABLE t1 ( |
|||
id INT AUTO_INCREMENT PRIMARY KEY, |
|||
not_id INT, |
|||
data CHAR(255), |
|||
data2 BLOB |
|||
) ENGINE=INNODB; |
|||
|
|||
--disable_query_log |
|||
--let i = 0 |
|||
while ($i != 1000) { |
|||
eval INSERT INTO t1 VALUES (DEFAULT, $i, REPEAT('b', 255), REPEAT('a', 5000)); |
|||
--inc $i |
|||
} |
|||
--enable_query_log |
|||
|
|||
ALTER TABLE t1 MODIFY not_id INT UNIQUE KEY; |
|||
|
|||
connect (purge_control,localhost,root,,); |
|||
START TRANSACTION WITH CONSISTENT SNAPSHOT; |
|||
connection default; |
|||
|
|||
DELETE FROM t1 WHERE id % 2 = 1; |
|||
|
|||
FLUSH TABLES t1 FOR EXPORT; |
|||
|
|||
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/tmp.ibd |
|||
--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/tmp.cfg |
|||
|
|||
perl; |
|||
use strict; |
|||
die unless open(FILE, "+<$ENV{MYSQLD_DATADIR}/test/tmp.ibd"); |
|||
die unless truncate(FILE, 16384*23); |
|||
close(FILE); |
|||
EOF |
|||
|
|||
UNLOCK TABLES; |
|||
connection purge_control; |
|||
COMMIT; |
|||
connection default; |
|||
DROP TABLE t1; |
|||
|
|||
CREATE TABLE t2 ( |
|||
id INT AUTO_INCREMENT PRIMARY KEY, |
|||
not_id INT UNIQUE KEY, |
|||
data CHAR(255), |
|||
data2 BLOB |
|||
) ENGINE=INNODB; |
|||
|
|||
ALTER TABLE t2 DISCARD TABLESPACE; |
|||
|
|||
--copy_file $MYSQLD_DATADIR/test/tmp.ibd $MYSQLD_DATADIR/test/t2.ibd |
|||
--copy_file $MYSQLD_DATADIR/test/tmp.cfg $MYSQLD_DATADIR/test/t2.cfg |
|||
|
|||
--error ER_NOT_KEYFILE |
|||
ALTER TABLE t2 IMPORT TABLESPACE; |
|||
|
|||
DROP TABLE t2; |
|||
|
|||
--remove_file $MYSQLD_DATADIR/test/tmp.ibd |
|||
--remove_file $MYSQLD_DATADIR/test/tmp.cfg |
|||
@ -0,0 +1,9 @@ |
|||
--let $MASTER_1_COMMENT_P_2_1= $MASTER_1_COMMENT_P_2_1_BACKUP |
|||
--let $CHILD2_1_CREATE_TABLES= $CHILD2_1_CREATE_TABLES_BACKUP |
|||
--disable_warnings |
|||
--disable_query_log |
|||
--disable_result_log |
|||
--source ../t/test_deinit.inc |
|||
--enable_result_log |
|||
--enable_query_log |
|||
--enable_warnings |
|||
@ -0,0 +1,31 @@ |
|||
--disable_warnings |
|||
--disable_query_log |
|||
--disable_result_log |
|||
--source ../t/test_init.inc |
|||
--enable_result_log |
|||
--enable_query_log |
|||
--enable_warnings |
|||
--let $MASTER_1_COMMENT_P_2_1_BACKUP= $MASTER_1_COMMENT_P_2_1 |
|||
let $MASTER_1_COMMENT_P_2_1= |
|||
PARTITION BY RANGE(i) ( |
|||
PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1", table "ta_r2"', |
|||
PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r3"', |
|||
PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", table "ta_r4"' |
|||
); |
|||
--let $CHILD2_1_CREATE_TABLES_BACKUP= $CHILD2_1_CREATE_TABLES |
|||
let $CHILD2_1_CREATE_TABLES= |
|||
CREATE TABLE ta_r2 ( |
|||
i INT, |
|||
j JSON, |
|||
PRIMARY KEY(i) |
|||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET $STR_SEMICOLON |
|||
CREATE TABLE ta_r3 ( |
|||
i INT, |
|||
j JSON, |
|||
PRIMARY KEY(i) |
|||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET $STR_SEMICOLON |
|||
CREATE TABLE ta_r4 ( |
|||
i INT, |
|||
j JSON, |
|||
PRIMARY KEY(i) |
|||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; |
|||
@ -0,0 +1,58 @@ |
|||
for master_1 |
|||
for child2 |
|||
child2_1 |
|||
child2_2 |
|||
child2_3 |
|||
for child3 |
|||
|
|||
this test is for MDEV-24523 |
|||
|
|||
drop and create databases |
|||
connection master_1; |
|||
CREATE DATABASE auto_test_local; |
|||
USE auto_test_local; |
|||
connection child2_1; |
|||
CREATE DATABASE auto_test_remote; |
|||
USE auto_test_remote; |
|||
|
|||
create table and insert |
|||
connection child2_1; |
|||
CHILD2_1_CREATE_TABLES |
|||
connection master_1; |
|||
CREATE TABLE tbl_a ( |
|||
i INT, |
|||
j JSON, |
|||
PRIMARY KEY(i) |
|||
) ENGINE=Spider PARTITION BY RANGE(i) ( |
|||
PARTITION pt1 VALUES LESS THAN (5) COMMENT='srv "s_2_1", table "ta_r2"', |
|||
PARTITION pt2 VALUES LESS THAN (10) COMMENT='srv "s_2_1", table "ta_r3"', |
|||
PARTITION pt3 VALUES LESS THAN MAXVALUE COMMENT='srv "s_2_1", table "ta_r4"' |
|||
) |
|||
INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}'); |
|||
|
|||
test 1 |
|||
connection master_1; |
|||
UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.c', '[1, 2]'); |
|||
SELECT * FROM tbl_a; |
|||
i j |
|||
1 {"a": 10, "b": [2, 3]} |
|||
TRUNCATE TABLE tbl_a; |
|||
INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}'); |
|||
UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.b', '[1, 2]'); |
|||
SELECT * FROM tbl_a; |
|||
i j |
|||
1 {"a": 10, "b": "[1, 2]"} |
|||
|
|||
deinit |
|||
connection master_1; |
|||
DROP DATABASE IF EXISTS auto_test_local; |
|||
connection child2_1; |
|||
DROP DATABASE IF EXISTS auto_test_remote; |
|||
for master_1 |
|||
for child2 |
|||
child2_1 |
|||
child2_2 |
|||
child2_3 |
|||
for child3 |
|||
|
|||
end of test |
|||
@ -0,0 +1,3 @@ |
|||
!include include/default_mysqld.cnf |
|||
!include ../my_1_1.cnf |
|||
!include ../my_2_1.cnf |
|||
@ -0,0 +1,66 @@ |
|||
--source ../include/mdev_24523_init.inc |
|||
--echo |
|||
--echo this test is for MDEV-24523 |
|||
--echo |
|||
--echo drop and create databases |
|||
|
|||
--connection master_1 |
|||
--disable_warnings |
|||
CREATE DATABASE auto_test_local; |
|||
USE auto_test_local; |
|||
|
|||
--connection child2_1 |
|||
CREATE DATABASE auto_test_remote; |
|||
USE auto_test_remote; |
|||
--enable_warnings |
|||
|
|||
--echo |
|||
--echo create table and insert |
|||
|
|||
--connection child2_1 |
|||
--disable_query_log |
|||
--disable_ps_protocol |
|||
echo CHILD2_1_CREATE_TABLES; |
|||
eval $CHILD2_1_CREATE_TABLES; |
|||
--enable_ps_protocol |
|||
--enable_query_log |
|||
|
|||
--connection master_1 |
|||
--disable_query_log |
|||
echo CREATE TABLE tbl_a ( |
|||
i INT, |
|||
j JSON, |
|||
PRIMARY KEY(i) |
|||
) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; |
|||
eval CREATE TABLE tbl_a ( |
|||
i INT, |
|||
j JSON, |
|||
PRIMARY KEY(i) |
|||
) $MASTER_1_ENGINE $MASTER_1_COMMENT_P_2_1; |
|||
--enable_query_log |
|||
INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}'); |
|||
|
|||
--echo |
|||
--echo test 1 |
|||
|
|||
--connection master_1 |
|||
UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.c', '[1, 2]'); |
|||
SELECT * FROM tbl_a; |
|||
TRUNCATE TABLE tbl_a; |
|||
INSERT INTO tbl_a VALUES (1, '{ "a": 1, "b": [2, 3]}'); |
|||
UPDATE tbl_a SET j = JSON_REPLACE(j, '$.a', 10, '$.b', '[1, 2]'); |
|||
SELECT * FROM tbl_a; |
|||
--echo |
|||
--echo deinit |
|||
--disable_warnings |
|||
|
|||
--connection master_1 |
|||
DROP DATABASE IF EXISTS auto_test_local; |
|||
|
|||
--connection child2_1 |
|||
DROP DATABASE IF EXISTS auto_test_remote; |
|||
|
|||
--enable_warnings |
|||
--source ../include/mdev_24523_deinit.inc |
|||
--echo |
|||
--echo end of test |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue