Commit bce3f3f6 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-34682 Reset spider_hton_ptr in error mode of spider_db_init()

parent 8b51d344
set @old_aria_encrypt_tables=@@global.aria_encrypt_tables;
set global aria_encrypt_tables=ON;
CREATE FUNCTION spider_direct_sql RETURNS INT SONAME 'ha_spider.so';
call mtr.add_suppression(".*\\[ERROR\\] SPIDER plugin initialization failed at.* by 'Initialization of encryption failed for");
call mtr.add_suppression(".*\\[ERROR\\] Plugin 'SPIDER' registration as a STORAGE ENGINE failed.");
INSTALL PLUGIN spider SONAME 'ha_spider.so';
ERROR HY000: Can't initialize function 'spider'; Plugin initialization function failed.
SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"');
ERROR HY000: Can't initialize function 'spider_direct_sql'; Plugin 'SPIDER' is not loaded
Warnings:
Note 1305 FUNCTION test.spider_flush_table_mon_cache does not exist
Warnings:
Note 1305 FUNCTION test.spider_copy_tables does not exist
Warnings:
Note 1305 FUNCTION test.spider_ping_table does not exist
Warnings:
Note 1305 FUNCTION test.spider_bg_direct_sql does not exist
Warnings:
Note 1305 SONAME ha_spider.so does not exist
set @old_aria_encrypt_tables=@@global.aria_encrypt_tables;
set global aria_encrypt_tables=ON;
CREATE FUNCTION spider_direct_sql RETURNS INT SONAME 'ha_spider.so';
call mtr.add_suppression(".*\\[ERROR\\] SPIDER plugin initialization failed at.* by 'Initialization of encryption failed for");
call mtr.add_suppression(".*\\[ERROR\\] Plugin 'SPIDER' registration as a STORAGE ENGINE failed.");
--error ER_CANT_INITIALIZE_UDF
INSTALL PLUGIN spider SONAME 'ha_spider.so';
--error ER_CANT_INITIALIZE_UDF
SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"');
--disable_query_log
--source ../../include/clean_up_spider.inc
set global aria_encrypt_tables=@old_aria_encrypt_tables;
DROP FUNCTION spider_flush_table_mon_cache; DROP FUNCTION IF EXISTS spider_flush_table_mon_cache;
DROP FUNCTION spider_copy_tables; DROP FUNCTION IF EXISTS spider_copy_tables;
DROP FUNCTION spider_ping_table; DROP FUNCTION IF EXISTS spider_ping_table;
DROP FUNCTION spider_bg_direct_sql; DROP FUNCTION IF EXISTS spider_bg_direct_sql;
DROP FUNCTION spider_direct_sql; DROP FUNCTION IF EXISTS 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;
DROP TABLE IF EXISTS mysql.spider_xa_member; DROP TABLE IF EXISTS mysql.spider_xa_member;
......
...@@ -6805,6 +6805,7 @@ int spider_db_init( ...@@ -6805,6 +6805,7 @@ int spider_db_init(
pthread_attr_destroy(&spider_pt_attr); pthread_attr_destroy(&spider_pt_attr);
error_pt_attr_init: error_pt_attr_init:
#endif #endif
spider_hton_ptr= NULL;
DBUG_RETURN(error_num); DBUG_RETURN(error_num);
} }
......
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