Commit db0b9ec3 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-33584 Use the default SQL_MODE for spider init queries

This should fix all future problems caused by a non-default global
sql_mode from the server where spider is to be installed.
parent 9d34939c
set @old_sql_mode=@@global.sql_mode;
set global sql_mode='traditional';
install soname 'ha_spider';
set global sql_mode=@old_sql_mode;
# This test tests spider init with global no_zero_date sql mode
set @old_sql_mode=@@global.sql_mode;
set global sql_mode='traditional';
install soname 'ha_spider';
set global sql_mode=@old_sql_mode;
--disable_query_log
--disable_result_log
--source ../../include/clean_up_spider.inc
--enable_result_log
--enable_query_log
...@@ -20,8 +20,10 @@ ...@@ -20,8 +20,10 @@
*/ */
static LEX_STRING spider_init_queries[] = { static LEX_STRING spider_init_queries[] = {
/* Use the default SQL_MODE for this connection. */
{C_STRING_WITH_LEN( {C_STRING_WITH_LEN(
"SET @@SQL_MODE = REGEXP_REPLACE(@@SQL_MODE, '(ORACLE|NO_ZERO_DATE)', '');" "SET @@SQL_MODE = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,"
"NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';"
)}, )},
{C_STRING_WITH_LEN( {C_STRING_WITH_LEN(
"create table if not exists mysql.spider_xa(" "create table if not exists mysql.spider_xa("
......
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