Commit 45fadb64 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-32753 Make spider init queries compatible with oracle sql mode

Remove ORACLE from the (session) sql_mode in connections made with sql
service to run init queries

The connection is new and the global variable value takes effect
rather than the session value from the caller of spider_db_init.
parent 3ba041f9
#
# 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
#
#
# 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
#
#
# 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
#
--sql-mode=oracle
--plugin-load-add=ha_spider
--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 #
--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 #
--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 #
......@@ -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;
......
......@@ -20,6 +20,9 @@
*/
static LEX_STRING spider_init_queries[] = {
{C_STRING_WITH_LEN(
"SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'ORACLE', '');"
)},
{C_STRING_WITH_LEN(
"create table if not exists mysql.spider_xa("
" format_id int not null default 0,"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment