mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-30649 Adding a spider testcase showing copying from a remote to a local table
Also deleted some trailing whitespace in mdev_30191.test.
This commit is contained in:
parent
a8cc40d9a4
commit
5be859d52c
3 changed files with 95 additions and 0 deletions
45
storage/spider/mysql-test/spider/bugfix/r/mdev_30649.result
Normal file
45
storage/spider/mysql-test/spider/bugfix/r/mdev_30649.result
Normal file
|
@ -0,0 +1,45 @@
|
|||
for master_1
|
||||
for child2
|
||||
child2_1
|
||||
child2_2
|
||||
child2_3
|
||||
for child3
|
||||
connection child2_1;
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
CREATE TABLE src (c INT, d DATE, PRIMARY KEY(c));
|
||||
INSERT INTO src VALUES (42, '2024-08-27'), (73, '2024-07-12');
|
||||
connection master_1;
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
SET spider_same_server_link=1;
|
||||
CREATE TABLE dst (c INT, d DATE, PRIMARY KEY(c)) ENGINE=INNODB;
|
||||
INSERT INTO dst VALUES (555, '1999-12-12');
|
||||
CREATE TABLE t (c INT, d DATE, PRIMARY KEY(c)) ENGINE=SPIDER
|
||||
COMMENT='table "src dst", srv "s_2_1 s_1"';
|
||||
SELECT spider_copy_tables('t', '0', '1');
|
||||
spider_copy_tables('t', '0', '1')
|
||||
1
|
||||
SELECT * FROM dst;
|
||||
c d
|
||||
42 2024-08-27
|
||||
73 2024-07-12
|
||||
555 1999-12-12
|
||||
connection child2_1;
|
||||
DROP TABLE src;
|
||||
DROP DATABASE auto_test_remote;
|
||||
connection master_1;
|
||||
DROP TABLE t;
|
||||
SELECT * FROM dst;
|
||||
c d
|
||||
42 2024-08-27
|
||||
73 2024-07-12
|
||||
555 1999-12-12
|
||||
DROP TABLE dst;
|
||||
DROP DATABASE auto_test_local;
|
||||
for master_1
|
||||
for child2
|
||||
child2_1
|
||||
child2_2
|
||||
child2_3
|
||||
for child3
|
3
storage/spider/mysql-test/spider/bugfix/t/mdev_30649.cnf
Normal file
3
storage/spider/mysql-test/spider/bugfix/t/mdev_30649.cnf
Normal file
|
@ -0,0 +1,3 @@
|
|||
!include include/default_mysqld.cnf
|
||||
!include ../my_1_1.cnf
|
||||
!include ../my_2_1.cnf
|
47
storage/spider/mysql-test/spider/bugfix/t/mdev_30649.test
Normal file
47
storage/spider/mysql-test/spider/bugfix/t/mdev_30649.test
Normal file
|
@ -0,0 +1,47 @@
|
|||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_init.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
||||
--connection child2_1
|
||||
CREATE DATABASE auto_test_remote;
|
||||
USE auto_test_remote;
|
||||
# works without primary key
|
||||
CREATE TABLE src (c INT, d DATE, PRIMARY KEY(c));
|
||||
INSERT INTO src VALUES (42, '2024-08-27'), (73, '2024-07-12');
|
||||
|
||||
--connection master_1
|
||||
CREATE DATABASE auto_test_local;
|
||||
USE auto_test_local;
|
||||
SET spider_same_server_link=1;
|
||||
|
||||
# works without primary key
|
||||
CREATE TABLE dst (c INT, d DATE, PRIMARY KEY(c)) ENGINE=INNODB;
|
||||
INSERT INTO dst VALUES (555, '1999-12-12');
|
||||
|
||||
# requires primary key, but it is ok if the data node tables have no
|
||||
# primary key and the corresponding column has duplicate values.
|
||||
# possibly a bug, e.g. an unnecessary requirement.
|
||||
evalp CREATE TABLE t (c INT, d DATE, PRIMARY KEY(c)) ENGINE=SPIDER
|
||||
COMMENT='table "src dst", srv "s_2_1 s_1"';
|
||||
SELECT spider_copy_tables('t', '0', '1');
|
||||
|
||||
SELECT * FROM dst;
|
||||
|
||||
--connection child2_1
|
||||
DROP TABLE src;
|
||||
DROP DATABASE auto_test_remote;
|
||||
|
||||
--connection master_1
|
||||
|
||||
DROP TABLE t;
|
||||
SELECT * FROM dst;
|
||||
DROP TABLE dst;
|
||||
DROP DATABASE auto_test_local;
|
||||
|
||||
--disable_query_log
|
||||
--disable_result_log
|
||||
--source ../../t/test_deinit.inc
|
||||
--enable_result_log
|
||||
--enable_query_log
|
Loading…
Reference in a new issue