Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c33ca17c
Commit
c33ca17c
authored
Dec 07, 2023
by
Yuchen Pei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.4' into 10.5
parents
13dd7875
ba94778d
Changes
49
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
49 changed files
with
881 additions
and
683 deletions
+881
-683
storage/spider/mysql-test/spider/bugfix/r/mdev_22979.result
storage/spider/mysql-test/spider/bugfix/r/mdev_22979.result
+5
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_26541.result
storage/spider/mysql-test/spider/bugfix/r/mdev_26541.result
+1
-1
storage/spider/mysql-test/spider/bugfix/r/mdev_27233.result
storage/spider/mysql-test/spider/bugfix/r/mdev_27233.result
+11
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_28218.result
storage/spider/mysql-test/spider/bugfix/r/mdev_28218.result
+9
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_28218_init_file.result
...er/mysql-test/spider/bugfix/r/mdev_28218_init_file.result
+5
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_28218_mixed.result
...spider/mysql-test/spider/bugfix/r/mdev_28218_mixed.result
+5
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_30370.result
storage/spider/mysql-test/spider/bugfix/r/mdev_30370.result
+5
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_32683.result
storage/spider/mysql-test/spider/bugfix/r/mdev_32683.result
+16
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_32753.result
storage/spider/mysql-test/spider/bugfix/r/mdev_32753.result
+10
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_32753_after_start.result
.../mysql-test/spider/bugfix/r/mdev_32753_after_start.result
+14
-0
storage/spider/mysql-test/spider/bugfix/r/mdev_32753_after_start_session.result
...est/spider/bugfix/r/mdev_32753_after_start_session.result
+17
-0
storage/spider/mysql-test/spider/bugfix/r/plugin_load_add_all.result
...der/mysql-test/spider/bugfix/r/plugin_load_add_all.result
+7
-0
storage/spider/mysql-test/spider/bugfix/r/plugin_load_add_spider.result
.../mysql-test/spider/bugfix/r/plugin_load_add_spider.result
+7
-0
storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early.result
...er/mysql-test/spider/bugfix/r/udf_mysql_func_early.result
+43
-0
storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early_init_file.result
...est/spider/bugfix/r/udf_mysql_func_early_init_file.result
+1
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_22979.test
storage/spider/mysql-test/spider/bugfix/t/mdev_22979.test
+18
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_27233.opt
storage/spider/mysql-test/spider/bugfix/t/mdev_27233.opt
+1
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_27233.sql
storage/spider/mysql-test/spider/bugfix/t/mdev_27233.sql
+3
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_27233.test
storage/spider/mysql-test/spider/bugfix/t/mdev_27233.test
+7
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_28218.test
storage/spider/mysql-test/spider/bugfix/t/mdev_28218.test
+10
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_init_file.opt
...pider/mysql-test/spider/bugfix/t/mdev_28218_init_file.opt
+1
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_init_file.sql
...pider/mysql-test/spider/bugfix/t/mdev_28218_init_file.sql
+2
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_init_file.test
...ider/mysql-test/spider/bugfix/t/mdev_28218_init_file.test
+7
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_mixed.opt
...ge/spider/mysql-test/spider/bugfix/t/mdev_28218_mixed.opt
+2
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_mixed.sql
...ge/spider/mysql-test/spider/bugfix/t/mdev_28218_mixed.sql
+1
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_mixed.test
...e/spider/mysql-test/spider/bugfix/t/mdev_28218_mixed.test
+8
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_30370.test
storage/spider/mysql-test/spider/bugfix/t/mdev_30370.test
+6
-4
storage/spider/mysql-test/spider/bugfix/t/mdev_32683.test
storage/spider/mysql-test/spider/bugfix/t/mdev_32683.test
+14
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_32753.opt
storage/spider/mysql-test/spider/bugfix/t/mdev_32753.opt
+2
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_32753.test
storage/spider/mysql-test/spider/bugfix/t/mdev_32753.test
+12
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_32753_after_start.opt
...der/mysql-test/spider/bugfix/t/mdev_32753_after_start.opt
+1
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_32753_after_start.test
...er/mysql-test/spider/bugfix/t/mdev_32753_after_start.test
+19
-0
storage/spider/mysql-test/spider/bugfix/t/mdev_32753_after_start_session.test
...-test/spider/bugfix/t/mdev_32753_after_start_session.test
+22
-0
storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_all.opt
...spider/mysql-test/spider/bugfix/t/plugin_load_add_all.opt
+1
-0
storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_all.test
...pider/mysql-test/spider/bugfix/t/plugin_load_add_all.test
+7
-0
storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_spider.opt
...der/mysql-test/spider/bugfix/t/plugin_load_add_spider.opt
+1
-0
storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_spider.test
...er/mysql-test/spider/bugfix/t/plugin_load_add_spider.test
+7
-0
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.cnf
...pider/mysql-test/spider/bugfix/t/udf_mysql_func_early.cnf
+3
-0
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.opt
...pider/mysql-test/spider/bugfix/t/udf_mysql_func_early.opt
+1
-0
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.test
...ider/mysql-test/spider/bugfix/t/udf_mysql_func_early.test
+48
-0
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.cnf
...l-test/spider/bugfix/t/udf_mysql_func_early_init_file.cnf
+3
-0
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.opt
...l-test/spider/bugfix/t/udf_mysql_func_early_init_file.opt
+1
-0
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.sql
...l-test/spider/bugfix/t/udf_mysql_func_early_init_file.sql
+1
-0
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.test
...-test/spider/bugfix/t/udf_mysql_func_early_init_file.test
+4
-0
storage/spider/mysql-test/spider/include/clean_up_spider.inc
storage/spider/mysql-test/spider/include/clean_up_spider.inc
+1
-1
storage/spider/mysql-test/spider/include/init_spider.inc
storage/spider/mysql-test/spider/include/init_spider.inc
+2
-2
storage/spider/spd_include.h
storage/spider/spd_include.h
+0
-1
storage/spider/spd_init_query.h
storage/spider/spd_init_query.h
+454
-589
storage/spider/spd_table.cc
storage/spider/spd_table.cc
+55
-85
No files found.
storage/spider/mysql-test/spider/bugfix/r/mdev_22979.result
0 → 100644
View file @
c33ca17c
MDEV-22979 "mysqld --bootstrap" / mysql_install_db hangs when Spider is installed
# Kill the server
# restart
Warnings:
Note 1305 SONAME ha_spider.so does not exist
storage/spider/mysql-test/spider/bugfix/r/mdev_26541.result
View file @
c33ca17c
...
...
@@ -7,7 +7,7 @@ DROP FUNCTION spider_copy_tables;
DROP FUNCTION spider_ping_table;
DROP FUNCTION spider_bg_direct_sql;
DROP FUNCTION spider_direct_sql;
UNINSTALL SONAME IF EXISTS
"ha_spider"
;
UNINSTALL SONAME IF EXISTS
'ha_spider'
;
DROP TABLE IF EXISTS mysql.spider_xa;
DROP TABLE IF EXISTS mysql.spider_xa_member;
DROP TABLE IF EXISTS mysql.spider_xa_failed_log;
...
...
storage/spider/mysql-test/spider/bugfix/r/mdev_27233.result
0 → 100644
View file @
c33ca17c
#
# MDEV-27233 Server hangs when using --init-file which loads Spider and creates a Spider table
#
show create table t;
Table Create Table
t CREATE TABLE `t` (
`c` int(11) DEFAULT NULL
) ENGINE=SPIDER DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
Warnings:
Error 1429 Unable to connect to foreign data source: localhost
Error 1429 Unable to connect to foreign data source: localhost
storage/spider/mysql-test/spider/bugfix/r/mdev_28218.result
0 → 100644
View file @
c33ca17c
#
# MDEV-28218 Spider: thread hang/deadlock as result of INSTALL PLUGIN and DROP TABLE
#
INSTALL SONAME 'ha_spider.so';
DROP TABLE IF EXISTS mysql.spider_tables;
show create table mysql.spider_tables;
ERROR 42S02: Table 'mysql.spider_tables' doesn't exist
Warnings:
Note 1051 Unknown table 'mysql.spider_tables'
storage/spider/mysql-test/spider/bugfix/r/mdev_28218_init_file.result
0 → 100644
View file @
c33ca17c
#
# MDEV-28218 Spider: thread hang/deadlock as result of INSTALL PLUGIN and DROP TABLE
#
show create table mysql.spider_tables;
ERROR 42S02: Table 'mysql.spider_tables' doesn't exist
storage/spider/mysql-test/spider/bugfix/r/mdev_28218_mixed.result
0 → 100644
View file @
c33ca17c
#
# MDEV-28218 Spider: thread hang/deadlock as result of INSTALL PLUGIN and DROP TABLE
#
show create table mysql.spider_tables;
ERROR 42S02: Table 'mysql.spider_tables' doesn't exist
storage/spider/mysql-test/spider/bugfix/r/mdev_30370.result
View file @
c33ca17c
#
# MDEV-30370 mariadbd hangs when running with --wsrep-recover and --plugin-load-add=ha_spider.so
#
call mtr.add_suppression(".*\\[Warning\\] InnoDB: Skipping buffer pool dump/restore during wsrep recovery");
# Kill the server
# restart
Warnings:
Note 1305 SONAME ha_spider.so does not exist
storage/spider/mysql-test/spider/bugfix/r/mdev_32683.result
0 → 100644
View file @
c33ca17c
#
# MDEV-32683 Spider engine does not load with non-default alter-algorithm
#
set global alter_algorithm=INSTANT;
install plugin spider soname 'ha_spider';
select plugin_name, plugin_status, plugin_type, plugin_license, load_option from information_schema.plugins where plugin_name like 'spider';
plugin_name plugin_status plugin_type plugin_license load_option
SPIDER ACTIVE STORAGE ENGINE GPL ON
uninstall plugin spider;
drop table mysql.spider_link_failed_log, mysql.spider_link_mon_servers, mysql.spider_tables, mysql.spider_table_crd, mysql.spider_table_position_for_recovery, mysql.spider_table_sts, mysql.spider_xa, mysql.spider_xa_failed_log, mysql.spider_xa_member;
drop function spider_direct_sql;
drop function spider_bg_direct_sql;
drop function spider_ping_table;
drop function spider_copy_tables;
drop function spider_flush_table_mon_cache;
set global alter_algorithm=DEFAULT;
storage/spider/mysql-test/spider/bugfix/r/mdev_32753.result
0 → 100644
View file @
c33ca17c
#
# MDEV-32753 Spider engine does not load in ORACLE mode
#
select * from mysql.plugin;
name dl
create table t (c int) Engine=SPIDER;
drop table t;
#
# end of test mdev_32753
#
storage/spider/mysql-test/spider/bugfix/r/mdev_32753_after_start.result
0 → 100644
View file @
c33ca17c
#
# MDEV-32753 Spider engine does not load in ORACLE mode
#
install soname 'ha_spider';
select * from mysql.plugin;
name dl
SPIDER ha_spider.so
SPIDER_ALLOC_MEM ha_spider.so
SPIDER_WRAPPER_PROTOCOLS ha_spider.so
create table t (c int) Engine=SPIDER;
drop table t;
#
# end of test mdev_32753_after_start
#
storage/spider/mysql-test/spider/bugfix/r/mdev_32753_after_start_session.result
0 → 100644
View file @
c33ca17c
#
# MDEV-32753 Spider engine does not load in ORACLE mode
#
set @old_sql_mode=@@sql_mode;
SET @@sql_mode = CONCAT(@@sql_mode, ',ORACLE');
install soname 'ha_spider';
select * from mysql.plugin;
name dl
SPIDER ha_spider.so
SPIDER_ALLOC_MEM ha_spider.so
SPIDER_WRAPPER_PROTOCOLS ha_spider.so
create table t (c int) Engine=SPIDER;
drop table t;
set sql_mode=@old_sql_mode;
#
# end of test mdev_32753_after_start
#
storage/spider/mysql-test/spider/bugfix/r/plugin_load_add_all.result
0 → 100644
View file @
c33ca17c
#
# plugin-load-add=ha_spider
#
select * from mysql.plugin;
name dl
create table t (c int) Engine=SPIDER;
drop table t;
storage/spider/mysql-test/spider/bugfix/r/plugin_load_add_spider.result
0 → 100644
View file @
c33ca17c
#
# plugin-load-add=ha_spider
#
select * from mysql.plugin;
name dl
create table t (c int) Engine=SPIDER;
drop table t;
storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early.result
0 → 100644
View file @
c33ca17c
#
# Test that udf created by inserting into mysql_func works as expected
#
CREATE SERVER s_1 FOREIGN DATA WRAPPER mysql OPTIONS (
HOST 'localhost',
DATABASE 'auto_test_local',
USER 'root',
PASSWORD '',
SOCKET '$MASTER_1_MYSOCK'
);
CREATE SERVER s_2_1 FOREIGN DATA WRAPPER mysql OPTIONS (
HOST 'localhost',
DATABASE 'auto_test_remote',
USER 'root',
PASSWORD '',
SOCKET '$CHILD2_1_MYSOCK'
);
connect master_1, localhost, root, , , $MASTER_1_MYPORT, $MASTER_1_MYSOCK;
connect child2_1, localhost, root, , , $CHILD2_1_MYPORT, $CHILD2_1_MYSOCK;
connection child2_1;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
CREATE TABLE tbl_a (
a INT
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into tbl_a values (42);
connection master_1;
CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (
a INT
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"';
create temporary table results (a int);
SELECT SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"');
SPIDER_DIRECT_SQL('select * from tbl_a', 'results', 'srv "s_2_1", database "auto_test_remote"')
1
select * from results;
a
42
connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
storage/spider/mysql-test/spider/bugfix/r/udf_mysql_func_early_init_file.result
0 → 120000
View file @
c33ca17c
udf_mysql_func_early.result
\ No newline at end of file
storage/spider/mysql-test/spider/bugfix/t/mdev_22979.test
0 → 100644
View file @
c33ca17c
--
echo
MDEV
-
22979
"mysqld --bootstrap"
/
mysql_install_db
hangs
when
Spider
is
installed
# This test is not the most faithful, as it does not have any
# dependency problems on the existence of the `mysql` database. To
# test MDEV-22979 faithfully, a mysql_install_db invocation with
# --plugin-load-add=ha_spider should be run. We cannot run it in mtr
# because we do not have access to --srcdir.
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
let
$PLUGIN_DIR
=
`select @@plugin_dir`
;
--
source
include
/
kill_mysqld
.
inc
--
write_file
$MYSQLTEST_VARDIR
/
tmp
/
mdev_22979
.
sql
drop
table
if
exists
foo
.
bar
;
EOF
--
exec
$MYSQLD_CMD
--
datadir
=
$MYSQLD_DATADIR
--
bootstrap
--
plugin
-
dir
=
$PLUGIN_DIR
--
plugin
-
load
-
add
=
ha_spider
<
$MYSQLTEST_VARDIR
/
tmp
/
mdev_22979
.
sql
--
source
include
/
start_mysqld
.
inc
--
disable_query_log
--
source
../../
include
/
clean_up_spider
.
inc
storage/spider/mysql-test/spider/bugfix/t/mdev_27233.opt
0 → 100644
View file @
c33ca17c
--init-file=$MTR_SUITE_DIR/t/mdev_27233.sql
storage/spider/mysql-test/spider/bugfix/t/mdev_27233.sql
0 → 100644
View file @
c33ca17c
INSTALL
SONAME
'ha_spider.so'
;
USE
test
;
CREATE
TABLE
t
(
c
INT
)
ENGINE
=
SPIDER
;
storage/spider/mysql-test/spider/bugfix/t/mdev_27233.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# MDEV-27233 Server hangs when using --init-file which loads Spider and creates a Spider table
--
echo
#
# ps protocol eats warnings
--
disable_ps_protocol
show
create
table
t
;
--
enable_ps_protocol
storage/spider/mysql-test/spider/bugfix/t/mdev_28218.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# MDEV-28218 Spider: thread hang/deadlock as result of INSTALL PLUGIN and DROP TABLE
--
echo
#
INSTALL
SONAME
'ha_spider.so'
;
DROP
TABLE
IF
EXISTS
mysql
.
spider_tables
;
--
error
ER_NO_SUCH_TABLE
show
create
table
mysql
.
spider_tables
;
--
disable_query_log
--
source
../../
include
/
clean_up_spider
.
inc
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_init_file.opt
0 → 100644
View file @
c33ca17c
--init-file=$MTR_SUITE_DIR/t/mdev_28218_init_file.sql
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_init_file.sql
0 → 100644
View file @
c33ca17c
INSTALL
PLUGIN
spider
SONAME
'ha_spider.so'
;
DROP
TABLE
IF
EXISTS
mysql
.
spider_tables
;
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_init_file.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# MDEV-28218 Spider: thread hang/deadlock as result of INSTALL PLUGIN and DROP TABLE
--
echo
#
# This is a variant of the testcase in MDEV-28218, where we put the
# queries are in an init file
--
error
ER_NO_SUCH_TABLE
show
create
table
mysql
.
spider_tables
;
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_mixed.opt
0 → 100644
View file @
c33ca17c
--plugin-load-add=ha_spider
--init-file=$MTR_SUITE_DIR/t/mdev_28218_mixed.sql
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_mixed.sql
0 → 100644
View file @
c33ca17c
DROP
TABLE
IF
EXISTS
mysql
.
spider_tables
;
storage/spider/mysql-test/spider/bugfix/t/mdev_28218_mixed.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# MDEV-28218 Spider: thread hang/deadlock as result of INSTALL PLUGIN and DROP TABLE
--
echo
#
# this is a variant of the testcase in MDEV-28218, where we load
# spider early with --plugin_load_add, and execute the drop table
# query in an init file
--
error
ER_NO_SUCH_TABLE
show
create
table
mysql
.
spider_tables
;
storage/spider/mysql-test/spider/bugfix/t/mdev_30370.test
View file @
c33ca17c
...
...
@@ -3,7 +3,9 @@
--
echo
# MDEV-30370 mariadbd hangs when running with --wsrep-recover and --plugin-load-add=ha_spider.so
--
echo
#
let
$MYSQLD_DATADIR
=
$MYSQLTEST_VARDIR
/
mdev_30370
;
--
mkdir
$MYSQLD_DATADIR
--
exec
$MYSQLD_BOOTSTRAP_CMD
--
wsrep
-
recover
--
plugin
-
load
-
add
=
ha_spider
.
so
--
datadir
=
$MYSQLD_DATADIR
--
rmdir
$MYSQLD_DATADIR
call
mtr
.
add_suppression
(
".*
\\
[Warning
\\
] InnoDB: Skipping buffer pool dump/restore during wsrep recovery"
);
--
source
include
/
kill_mysqld
.
inc
--
exec
$MYSQLD_LAST_CMD
--
wsrep
-
recover
--
plugin
-
load
-
add
=
ha_spider
--
source
include
/
start_mysqld
.
inc
--
disable_query_log
--
source
../../
include
/
clean_up_spider
.
inc
storage/spider/mysql-test/spider/bugfix/t/mdev_32683.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# MDEV-32683 Spider engine does not load with non-default alter-algorithm
--
echo
#
set
global
alter_algorithm
=
INSTANT
;
install
plugin
spider
soname
'ha_spider'
;
select
plugin_name
,
plugin_status
,
plugin_type
,
plugin_license
,
load_option
from
information_schema
.
plugins
where
plugin_name
like
'spider'
;
uninstall
plugin
spider
;
drop
table
mysql
.
spider_link_failed_log
,
mysql
.
spider_link_mon_servers
,
mysql
.
spider_tables
,
mysql
.
spider_table_crd
,
mysql
.
spider_table_position_for_recovery
,
mysql
.
spider_table_sts
,
mysql
.
spider_xa
,
mysql
.
spider_xa_failed_log
,
mysql
.
spider_xa_member
;
drop
function
spider_direct_sql
;
drop
function
spider_bg_direct_sql
;
drop
function
spider_ping_table
;
drop
function
spider_copy_tables
;
drop
function
spider_flush_table_mon_cache
;
set
global
alter_algorithm
=
DEFAULT
;
storage/spider/mysql-test/spider/bugfix/t/mdev_32753.opt
0 → 100644
View file @
c33ca17c
--sql-mode=oracle
--plugin-load-add=ha_spider
storage/spider/mysql-test/spider/bugfix/t/mdev_32753.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# MDEV-32753 Spider engine does not load in ORACLE mode
--
echo
#
# This test tests spider init during server startup under global
# ORACLE mode
select
*
from
mysql
.
plugin
;
create
table
t
(
c
int
)
Engine
=
SPIDER
;
drop
table
t
;
--
echo
#
--
echo
# end of test mdev_32753
--
echo
#
storage/spider/mysql-test/spider/bugfix/t/mdev_32753_after_start.opt
0 → 100644
View file @
c33ca17c
--sql-mode=oracle
storage/spider/mysql-test/spider/bugfix/t/mdev_32753_after_start.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# MDEV-32753 Spider engine does not load in ORACLE mode
--
echo
#
# This test tests spider init after startup under global ORACLE mode
install
soname
'ha_spider'
;
select
*
from
mysql
.
plugin
;
create
table
t
(
c
int
)
Engine
=
SPIDER
;
drop
table
t
;
--
disable_query_log
--
disable_result_log
--
source
../../
include
/
clean_up_spider
.
inc
--
enable_result_log
--
enable_query_log
--
echo
#
--
echo
# end of test mdev_32753_after_start
--
echo
#
storage/spider/mysql-test/spider/bugfix/t/mdev_32753_after_start_session.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# MDEV-32753 Spider engine does not load in ORACLE mode
--
echo
#
# This test tests spider init after startup under session ORACLE mode
set
@
old_sql_mode
=@@
sql_mode
;
SET
@@
sql_mode
=
CONCAT
(
@@
sql_mode
,
',ORACLE'
);
install
soname
'ha_spider'
;
select
*
from
mysql
.
plugin
;
create
table
t
(
c
int
)
Engine
=
SPIDER
;
drop
table
t
;
set
sql_mode
=@
old_sql_mode
;
--
disable_query_log
--
disable_result_log
--
source
../../
include
/
clean_up_spider
.
inc
--
enable_result_log
--
enable_query_log
--
echo
#
--
echo
# end of test mdev_32753_after_start
--
echo
#
storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_all.opt
0 → 100644
View file @
c33ca17c
--plugin-load-add=ha_spider
storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_all.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# plugin-load-add=ha_spider
--
echo
#
# A simple test that tests plugin-load-add=ha_spider
select
*
from
mysql
.
plugin
;
create
table
t
(
c
int
)
Engine
=
SPIDER
;
drop
table
t
;
storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_spider.opt
0 → 100644
View file @
c33ca17c
--plugin-load-add=SPIDER=ha_spider
storage/spider/mysql-test/spider/bugfix/t/plugin_load_add_spider.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# plugin-load-add=ha_spider
--
echo
#
# A simple test that tests plugin-load-add=SPIDER=ha_spider
select
*
from
mysql
.
plugin
;
create
table
t
(
c
int
)
Engine
=
SPIDER
;
drop
table
t
;
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.cnf
0 → 100644
View file @
c33ca17c
!include include/default_mysqld.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.opt
0 → 100644
View file @
c33ca17c
--plugin-load-add=ha_spider
\ No newline at end of file
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early.test
0 → 100644
View file @
c33ca17c
--
echo
#
--
echo
# Test that udf created by inserting into mysql_func works as expected
--
echo
#
evalp
CREATE
SERVER
s_1
FOREIGN
DATA
WRAPPER
mysql
OPTIONS
(
HOST
'localhost'
,
DATABASE
'auto_test_local'
,
USER
'root'
,
PASSWORD
''
,
SOCKET
'$MASTER_1_MYSOCK'
);
evalp
CREATE
SERVER
s_2_1
FOREIGN
DATA
WRAPPER
mysql
OPTIONS
(
HOST
'localhost'
,
DATABASE
'auto_test_remote'
,
USER
'root'
,
PASSWORD
''
,
SOCKET
'$CHILD2_1_MYSOCK'
);
--
connect
(
master_1
,
localhost
,
root
,
,
,
$MASTER_1_MYPORT
,
$MASTER_1_MYSOCK
)
--
connect
(
child2_1
,
localhost
,
root
,
,
,
$CHILD2_1_MYPORT
,
$CHILD2_1_MYSOCK
)
--
connection
child2_1
CREATE
DATABASE
auto_test_remote
;
USE
auto_test_remote
;
eval
CREATE
TABLE
tbl_a
(
a
INT
)
$CHILD2_1_ENGINE
$CHILD2_1_CHARSET
;
insert
into
tbl_a
values
(
42
);
--
connection
master_1
CREATE
DATABASE
auto_test_local
;
USE
auto_test_local
;
eval
CREATE
TABLE
tbl_a
(
a
INT
)
$MASTER_1_ENGINE
$MASTER_1_CHARSET
COMMENT
=
'table "tbl_a", srv "s_2_1"'
;
create
temporary
table
results
(
a
int
);
--
disable_ps_protocol
SELECT
SPIDER_DIRECT_SQL
(
'select * from tbl_a'
,
'results'
,
'srv "s_2_1", database "auto_test_remote"'
);
--
enable_ps_protocol
select
*
from
results
;
--
connection
master_1
DROP
DATABASE
IF
EXISTS
auto_test_local
;
--
connection
child2_1
DROP
DATABASE
IF
EXISTS
auto_test_remote
;
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.cnf
0 → 100644
View file @
c33ca17c
!include include/default_mysqld.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.opt
0 → 100644
View file @
c33ca17c
--init-file=$MTR_SUITE_DIR/t/udf_mysql_func_early_init_file.sql
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.sql
0 → 100644
View file @
c33ca17c
install
soname
"ha_spider.so"
;
storage/spider/mysql-test/spider/bugfix/t/udf_mysql_func_early_init_file.test
0 → 100644
View file @
c33ca17c
# Same as udf_mysql_func_early.test, except that we load spider in
# init_file, which is after udf_init() and before
# mysqld_server_started is on.
--
source
udf_mysql_func_early
.
test
storage/spider/mysql-test/spider/include/clean_up_spider.inc
View file @
c33ca17c
...
...
@@ -3,7 +3,7 @@ DROP FUNCTION spider_copy_tables;
DROP
FUNCTION
spider_ping_table
;
DROP
FUNCTION
spider_bg_direct_sql
;
DROP
FUNCTION
spider_direct_sql
;
UNINSTALL
SONAME
IF
EXISTS
"ha_spider"
;
UNINSTALL
SONAME
IF
EXISTS
'ha_spider'
;
DROP
TABLE
IF
EXISTS
mysql
.
spider_xa
;
DROP
TABLE
IF
EXISTS
mysql
.
spider_xa_member
;
DROP
TABLE
IF
EXISTS
mysql
.
spider_xa_failed_log
;
...
...
storage/spider/mysql-test/spider/include/init_spider.inc
View file @
c33ca17c
...
...
@@ -2,7 +2,7 @@ let $VERSION_COMPILE_OS_WIN=
`SELECT IF(@@version_compile_os like 'Win%', 1, 0)`
;
if
(
$VERSION_COMPILE_OS_WIN
)
{
INSTALL
PLUGIN
spider
SONAME
'ha_spider.dll
'
;
INSTALL
SONAME
'ha_spider
'
;
if
(
$MASTER_1_MYPORT
)
{
eval
CREATE
SERVER
s_1
FOREIGN
DATA
WRAPPER
mysql
OPTIONS
(
...
...
@@ -76,7 +76,7 @@ if ($VERSION_COMPILE_OS_WIN)
}
if
(
!
$VERSION_COMPILE_OS_WIN
)
{
INSTALL
PLUGIN
spider
SONAME
'ha_spider.so
'
;
INSTALL
SONAME
'ha_spider
'
;
if
(
$MASTER_1_MYSOCK
)
{
eval
CREATE
SERVER
s_1
FOREIGN
DATA
WRAPPER
mysql
OPTIONS
(
...
...
storage/spider/spd_include.h
View file @
c33ca17c
...
...
@@ -597,7 +597,6 @@ typedef struct st_spider_thread
volatile
bool
killed
;
volatile
bool
thd_wait
;
volatile
bool
first_free_wait
;
volatile
bool
init_command
;
volatile
int
error
;
pthread_t
thread
;
pthread_cond_t
cond
;
...
...
storage/spider/spd_init_query.h
View file @
c33ca17c
This diff is collapsed.
Click to expand it.
storage/spider/spd_table.cc
View file @
c33ca17c
...
...
@@ -129,9 +129,6 @@ const char **spd_mysqld_unix_port;
uint
*
spd_mysqld_port
;
bool
volatile
*
spd_abort_loop
;
Time_zone
*
spd_tz_system
;
static
int
*
spd_mysqld_server_started
;
static
pthread_mutex_t
*
spd_LOCK_server_started
;
static
pthread_cond_t
*
spd_COND_server_started
;
extern
long
spider_conn_mutex_id
;
handlerton
*
spider_hton_ptr
;
SPIDER_DBTON
spider_dbton
[
SPIDER_DBTON_SIZE
];
...
...
@@ -6610,30 +6607,6 @@ handler* spider_create_handler(
MEM_ROOT
*
mem_root
)
{
DBUG_ENTER
(
"spider_create_handler"
);
#ifndef WITHOUT_SPIDER_BG_SEARCH
SPIDER_THREAD
*
thread
=
&
spider_table_sts_threads
[
0
];
if
(
unlikely
(
thread
->
init_command
))
{
THD
*
thd
=
current_thd
;
pthread_cond_t
*
cond
=
thd
->
mysys_var
->
current_cond
;
pthread_mutex_t
*
mutex
=
thd
->
mysys_var
->
current_mutex
;
/* wait for finishing init_command */
pthread_mutex_lock
(
&
thread
->
mutex
);
if
(
unlikely
(
thread
->
init_command
))
{
thd
->
mysys_var
->
current_cond
=
&
thread
->
sync_cond
;
thd
->
mysys_var
->
current_mutex
=
&
thread
->
mutex
;
pthread_cond_wait
(
&
thread
->
sync_cond
,
&
thread
->
mutex
);
}
pthread_mutex_unlock
(
&
thread
->
mutex
);
thd
->
mysys_var
->
current_cond
=
cond
;
thd
->
mysys_var
->
current_mutex
=
mutex
;
if
(
thd
->
killed
)
{
DBUG_RETURN
(
NULL
);
}
}
#endif
DBUG_RETURN
(
new
(
mem_root
)
ha_spider
(
hton
,
table
));
}
...
...
@@ -6934,6 +6907,50 @@ int spider_panic(
DBUG_RETURN
(
0
);
}
/*
Create or fix the system tables. See spd_init_query.h for the details.
*/
bool
spider_init_system_tables
()
{
DBUG_ENTER
(
"spider_init_system_tables"
);
MYSQL
*
mysql
=
mysql_init
(
NULL
);
if
(
!
mysql
)
{
DBUG_RETURN
(
TRUE
);
}
if
(
!
mysql_real_connect_local
(
mysql
))
{
mysql_close
(
mysql
);
DBUG_RETURN
(
TRUE
);
}
const
int
size
=
sizeof
(
spider_init_queries
)
/
sizeof
(
spider_init_queries
[
0
]);
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
const
LEX_STRING
*
query
=
&
spider_init_queries
[
i
];
if
(
mysql_real_query
(
mysql
,
query
->
str
,
query
->
length
))
{
fprintf
(
stderr
,
"[ERROR] SPIDER plugin initialization failed at '%s' by '%s'
\n
"
,
query
->
str
,
mysql_error
(
mysql
));
mysql_close
(
mysql
);
DBUG_RETURN
(
TRUE
);
}
if
(
MYSQL_RES
*
res
=
mysql_store_result
(
mysql
))
{
mysql_free_result
(
res
);
}
}
mysql_close
(
mysql
);
DBUG_RETURN
(
FALSE
);
}
int
spider_db_init
(
void
*
p
)
{
...
...
@@ -6942,6 +6959,11 @@ int spider_db_init(
uchar
addr
[
6
];
handlerton
*
spider_hton
=
(
handlerton
*
)
p
;
DBUG_ENTER
(
"spider_db_init"
);
const
LEX_CSTRING
aria_name
=
{
STRING_WITH_LEN
(
"Aria"
)};
if
(
!
plugin_is_ready
(
&
aria_name
,
MYSQL_STORAGE_ENGINE_PLUGIN
))
DBUG_RETURN
(
HA_ERR_RETRY_INIT
);
spider_hton_ptr
=
spider_hton
;
spider_hton
->
flags
=
HTON_TEMPORARY_NOT_SUPPORTED
;
...
...
@@ -7021,9 +7043,6 @@ int spider_db_init(
spd_mysqld_port
=
&
mysqld_port
;
spd_abort_loop
=
&
abort_loop
;
spd_tz_system
=
my_tz_SYSTEM
;
spd_mysqld_server_started
=
&
mysqld_server_started
;
spd_LOCK_server_started
=
&
LOCK_server_started
;
spd_COND_server_started
=
&
COND_server_started
;
#ifdef HAVE_PSI_INTERFACE
init_spider_psi_keys
();
...
...
@@ -7299,6 +7318,11 @@ int spider_db_init(
spider_udf_table_mon_list_hash
[
roop_count
].
array
.
size_of_element
);
}
if
(
spider_init_system_tables
())
{
goto
error_system_table_creation
;
}
#ifndef WITHOUT_SPIDER_BG_SEARCH
if
(
!
(
spider_table_sts_threads
=
(
SPIDER_THREAD
*
)
spider_bulk_malloc
(
NULL
,
SPD_MID_DB_INIT_12
,
MYF
(
MY_WME
|
MY_ZEROFILL
),
...
...
@@ -7309,7 +7333,6 @@ int spider_db_init(
NullS
))
)
goto
error_alloc_mon_mutxes
;
spider_table_sts_threads
[
0
].
init_command
=
TRUE
;
for
(
roop_count
=
0
;
roop_count
<
(
int
)
spider_param_table_sts_thread_count
();
...
...
@@ -7400,6 +7423,7 @@ int spider_db_init(
error_init_udf_table_mon_cond:
for
(;
roop_count
>=
0
;
roop_count
--
)
pthread_cond_destroy
(
&
spider_udf_table_mon_conds
[
roop_count
]);
error_system_table_creation:
roop_count
=
spider_param_udf_table_mon_mutex_count
()
-
1
;
error_init_udf_table_mon_mutex:
for
(;
roop_count
>=
0
;
roop_count
--
)
...
...
@@ -9812,7 +9836,6 @@ void spider_free_sts_threads(
)
{
bool
thread_killed
;
DBUG_ENTER
(
"spider_free_sts_threads"
);
spider_thread
->
init_command
=
FALSE
;
pthread_mutex_lock
(
&
spider_thread
->
mutex
);
thread_killed
=
spider_thread
->
killed
;
spider_thread
->
killed
=
TRUE
;
...
...
@@ -9963,59 +9986,6 @@ void *spider_table_bg_sts_action(
trx
->
thd
=
thd
;
/* init end */
if
(
thread
->
init_command
)
{
uint
i
=
0
;
tmp_disable_binlog
(
thd
);
thd
->
security_ctx
->
skip_grants
();
thd
->
client_capabilities
|=
CLIENT_MULTI_RESULTS
;
if
(
!
(
*
spd_mysqld_server_started
)
&&
!
thd
->
killed
&&
!
thread
->
killed
)
{
pthread_mutex_lock
(
spd_LOCK_server_started
);
thd
->
mysys_var
->
current_cond
=
spd_COND_server_started
;
thd
->
mysys_var
->
current_mutex
=
spd_LOCK_server_started
;
if
(
!
(
*
spd_mysqld_server_started
)
&&
!
thd
->
killed
&&
!
thread
->
killed
&&
thread
->
init_command
)
{
do
{
struct
timespec
abstime
;
set_timespec_nsec
(
abstime
,
1000
);
error_num
=
pthread_cond_timedwait
(
spd_COND_server_started
,
spd_LOCK_server_started
,
&
abstime
);
}
while
(
(
error_num
==
ETIMEDOUT
||
error_num
==
ETIME
)
&&
!
(
*
spd_mysqld_server_started
)
&&
!
thd
->
killed
&&
!
thread
->
killed
&&
thread
->
init_command
);
}
pthread_mutex_unlock
(
spd_LOCK_server_started
);
thd
->
mysys_var
->
current_cond
=
&
thread
->
cond
;
thd
->
mysys_var
->
current_mutex
=
&
thread
->
mutex
;
}
bool
spd_wsrep_on
=
thd
->
variables
.
wsrep_on
;
thd
->
variables
.
wsrep_on
=
false
;
while
(
spider_init_queries
[
i
].
length
&&
!
thd
->
killed
&&
!
thread
->
killed
&&
thread
->
init_command
)
{
dispatch_command
(
COM_QUERY
,
thd
,
spider_init_queries
[
i
].
str
,
(
uint
)
spider_init_queries
[
i
].
length
,
FALSE
,
FALSE
);
if
(
unlikely
(
thd
->
is_error
()))
{
fprintf
(
stderr
,
"[ERROR] %s
\n
"
,
spider_stmt_da_message
(
thd
));
thd
->
clear_error
();
break
;
}
++
i
;
}
thd
->
variables
.
wsrep_on
=
spd_wsrep_on
;
thd
->
mysys_var
->
current_cond
=
&
thread
->
cond
;
thd
->
mysys_var
->
current_mutex
=
&
thread
->
mutex
;
thd
->
client_capabilities
-=
CLIENT_MULTI_RESULTS
;
reenable_binlog
(
thd
);
thread
->
init_command
=
FALSE
;
pthread_cond_broadcast
(
&
thread
->
sync_cond
);
}
if
(
thd
->
killed
)
{
thread
->
killed
=
TRUE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment