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

Merge branch '10.5' into 10.6

This commit is contained in:
Yuchen Pei
2024-01-11 12:59:22 +11:00
90 changed files with 713 additions and 198 deletions

View File

@@ -6,6 +6,9 @@ for child2
for child3
set @old_spider_bgs_mode= @@spider_bgs_mode;
set session spider_bgs_mode=1;
set spider_same_server_link=1;
set @old_spider_same_server_link=@@global.spider_same_server_link;
set global spider_same_server_link=1;
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table td (a int, PRIMARY KEY (a));
create table ts (a int, PRIMARY KEY (a)) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_mdev_26151",TABLE "td", casual_read "3"';
@@ -26,6 +29,7 @@ min(a)
drop table td, ts;
drop server srv_mdev_26151;
set session spider_bgs_mode=@old_spider_bgs_mode;
set global spider_same_server_link=@old_spider_same_server_link;
for master_1
for child2
for child3

View File

@@ -5,6 +5,7 @@ for master_1
for child2
for child3
set global query_cache_type= on;
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c int);

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
# testing monitoring_*

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);

View File

@@ -0,0 +1,34 @@
for master_1
for child2
for child3
SET spider_same_server_link= on;
CREATE SERVER s FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (a INT);
CREATE TABLE t1_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
CREATE TABLE t2_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
SELECT * FROM t1_spider, t2_spider;
a a
SELECT table_name, index_name, cardinality FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name IN ('t1_spider','t2_spider');
table_name index_name cardinality
RENAME TABLE t1_spider TO t3_spider;
SELECT * FROM t3_spider;
a
DROP TABLE t3_spider, t2_spider, t;
drop server s;
CREATE TABLE t1 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
CREATE TABLE t3 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
SHOW TABLE STATUS;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 SPIDER 10 NULL 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL Unable to connect to foreign data source: srv 0
t2 SPIDER 10 NULL 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL Unable to connect to foreign data source: srv 0
t3 SPIDER 10 NULL 0 0 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL Unable to connect to foreign data source: srv 0
Warnings:
Warning 1429 Unable to connect to foreign data source: srv
Warning 1429 Unable to connect to foreign data source: srv
Warning 1429 Unable to connect to foreign data source: srv
drop table t1, t2, t3;
for master_1
for child2
for child3

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT);

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c int);

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (a INT);
INSERT INTO t VALUES (23),(48);

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (a INT) ENGINE=Spider;

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c int);

View File

@@ -0,0 +1,7 @@
install soname 'ha_spider';
DROP TABLE non_existing_table;
ERROR 42S02: Unknown table 'test.non_existing_table'
create or replace table non_existing_table (c int) engine=Spider;
drop table non_existing_table;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (c BLOB) ENGINE=InnoDB;
CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';

View File

@@ -5,6 +5,7 @@ for master_1
for child2
for child3
SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
set spider_same_server_link=1;
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
set session spider_read_only_mode = default;
create table t2 (c int);

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a));
CREATE TABLE t2 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a)) ENGINE=SPIDER COMMENT='srv "srv", WRAPPER "mysql", TABLE "t1"';

View File

@@ -1,6 +1,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
set session spider_delete_all_rows_type=0;

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c varchar(16));

View File

@@ -0,0 +1,25 @@
for master_1
for child2
for child3
set spider_same_server_link=on;
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`)
);
create table t1 ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=SPIDER DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"'
drop table t1, t2;
drop server srv;
for master_1
for child2
for child3

View File

@@ -4,6 +4,9 @@ for child3
MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever
set spider_same_server_link=1;
set @old_spider_same_server_link=@@global.spider_same_server_link;
set global spider_same_server_link=1;
CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c int);
create table t1 (c int) ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_self_reference_multi",TABLE "t2"';
@@ -17,6 +20,7 @@ select * from t2;
ERROR HY000: An infinite loop is detected when opening table test.t0
drop table t0, t1, t2;
drop server srv_self_reference_multi;
set global spider_same_server_link=@old_spider_same_server_link;
for master_1
for child2
for child3

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c int);
create table t2 (d int);

View File

@@ -4,6 +4,7 @@
for master_1
for child2
for child3
set spider_same_server_link=1;
CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c1 int);
create table t2 (c2 int);

View File

@@ -14,6 +14,10 @@
--let $srv=srv_mdev_26151
set @old_spider_bgs_mode= @@spider_bgs_mode;
set session spider_bgs_mode=1;
set spider_same_server_link=1;
set @old_spider_same_server_link=@@global.spider_same_server_link;
set global spider_same_server_link=1;
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
# casual_read != 0 && casual_read != 1
@@ -42,6 +46,7 @@ drop table td, ts;
eval drop server $srv;
set session spider_bgs_mode=@old_spider_bgs_mode;
set global spider_same_server_link=@old_spider_same_server_link;
--disable_query_log
--disable_result_log

View File

@@ -12,6 +12,7 @@
#set @@global.debug_dbug="d:t:i:o,mysqld.trace";
set global query_cache_type= on;
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c int);

View File

@@ -9,6 +9,7 @@
# This test covers some table params under consideration for inclusion
# in the engine-defined options to be implemented in MDEV-28856.
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');

View File

@@ -12,6 +12,7 @@ if (`select not(count(*)) from information_schema.system_variables where variabl
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 (a INT);

View File

@@ -0,0 +1,32 @@
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
SET spider_same_server_link= on;
evalp CREATE SERVER s FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (a INT);
CREATE TABLE t1_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
CREATE TABLE t2_spider (a INT) ENGINE=SPIDER COMMENT = "wrapper 'mysql', srv 's', table 't'";
SELECT * FROM t1_spider, t2_spider;
SELECT table_name, index_name, cardinality FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name IN ('t1_spider','t2_spider');
RENAME TABLE t1_spider TO t3_spider;
SELECT * FROM t3_spider;
DROP TABLE t3_spider, t2_spider, t;
drop server s;
# case by roel
CREATE TABLE t1 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
CREATE TABLE t2 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
CREATE TABLE t3 (c INT) ENGINE=Spider COMMENT='WRAPPER "mysql",HOST "srv",TABLE "t"';
SHOW TABLE STATUS;
drop table t1, t2, t3;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log

View File

@@ -6,6 +6,7 @@
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER s FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 (a INT);

View File

@@ -8,6 +8,7 @@
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');

View File

@@ -8,6 +8,7 @@
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
--let $srv=srv_mdev_29502
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');

View File

@@ -7,6 +7,7 @@
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');

View File

@@ -7,6 +7,7 @@
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');

View File

@@ -0,0 +1,8 @@
install soname 'ha_spider';
--error ER_BAD_TABLE_ERROR
DROP TABLE non_existing_table;
# Test that create or replace a non existing spider table work
create or replace table non_existing_table (c int) engine=Spider;
drop table non_existing_table;
--disable_query_log
--source ../../include/clean_up_spider.inc

View File

@@ -6,6 +6,7 @@
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 (a INT);

View File

@@ -9,6 +9,7 @@
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t (c BLOB) ENGINE=InnoDB;
CREATE TABLE ts (c BLOB) ENGINE=Spider COMMENT='WRAPPER "mysql",srv "srv",TABLE "t"';

View File

@@ -10,6 +10,7 @@
--let $srv=srv_mdev_31524
SET @old_spider_read_only_mode = @@session.spider_read_only_mode;
set spider_same_server_link=1;
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
# when the user does not set var nor the table option, the default

View File

@@ -6,6 +6,7 @@
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 ( a bigint(20) NOT NULL, b bigint(20) DEFAULT 0, PRIMARY KEY (a));

View File

@@ -4,6 +4,7 @@
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');

View File

@@ -6,6 +6,7 @@
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');

View File

@@ -0,0 +1,24 @@
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
set spider_same_server_link=on;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`)
);
create table t1 ENGINE=Spider
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
show create table t1;
drop table t1, t2;
drop server srv;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log

View File

@@ -8,6 +8,9 @@
--echo MDEV-6268 SPIDER table with no COMMENT clause causes queries to wait forever
--echo
set spider_same_server_link=1;
set @old_spider_same_server_link=@@global.spider_same_server_link;
set global spider_same_server_link=1;
--let $srv=srv_self_reference_multi
evalp CREATE SERVER $srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t2 (c int);
@@ -22,6 +25,7 @@ select * from t1;
select * from t2;
drop table t0, t1, t2;
eval drop server $srv;
set global spider_same_server_link=@old_spider_same_server_link;
--disable_query_log
--disable_result_log

View File

@@ -8,6 +8,7 @@
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c int);
create table t2 (d int);

View File

@@ -6,6 +6,7 @@
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
set spider_same_server_link=1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER MYSQL OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
create table t1 (c1 int);
create table t2 (c2 int);