MDEV-33494 fix spider init with no_zero_date global sql mode

Like the fix for MDEV-32753 and MDEV-33242, spider init queries
creates new connections that use the global sql_mode of the existing
connection.
This commit is contained in:
Yuchen Pei 2024-02-20 11:20:21 +11:00
parent bf49e7cfc7
commit 9d34939c6e
No known key found for this signature in database
GPG key ID: 3DD1B35105743563
3 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,4 @@
set @old_sql_mode=@@global.sql_mode;
set global sql_mode=(SELECT CONCAT (@@sql_mode,',no_zero_date'));
install soname 'ha_spider';
set global sql_mode=@old_sql_mode;

View file

@ -0,0 +1,11 @@
# This test tests spider init with global no_zero_date sql mode
set @old_sql_mode=@@global.sql_mode;
set global sql_mode=(SELECT CONCAT (@@sql_mode,',no_zero_date'));
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

View file

@ -21,7 +21,7 @@
static LEX_STRING spider_init_queries[] = {
{C_STRING_WITH_LEN(
"SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'ORACLE', '');"
"SET @@SQL_MODE = REGEXP_REPLACE(@@SQL_MODE, '(ORACLE|NO_ZERO_DATE)', '');"
)},
{C_STRING_WITH_LEN(
"create table if not exists mysql.spider_xa("