diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_34682.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_34682.result new file mode 100644 index 00000000000..7253e136488 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_34682.result @@ -0,0 +1,19 @@ +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 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_34682.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_34682.test new file mode 100644 index 00000000000..d61f7db4330 --- /dev/null +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_34682.test @@ -0,0 +1,14 @@ +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; diff --git a/storage/spider/mysql-test/spider/include/clean_up_spider.inc b/storage/spider/mysql-test/spider/include/clean_up_spider.inc index 249606ec774..5b016e731d9 100644 --- a/storage/spider/mysql-test/spider/include/clean_up_spider.inc +++ b/storage/spider/mysql-test/spider/include/clean_up_spider.inc @@ -1,8 +1,8 @@ -DROP FUNCTION spider_flush_table_mon_cache; -DROP FUNCTION spider_copy_tables; -DROP FUNCTION spider_ping_table; -DROP FUNCTION spider_bg_direct_sql; -DROP FUNCTION spider_direct_sql; +DROP FUNCTION IF EXISTS spider_flush_table_mon_cache; +DROP FUNCTION IF EXISTS spider_copy_tables; +DROP FUNCTION IF EXISTS spider_ping_table; +DROP FUNCTION IF EXISTS spider_bg_direct_sql; +DROP FUNCTION IF EXISTS spider_direct_sql; UNINSTALL SONAME IF EXISTS 'ha_spider'; DROP TABLE IF EXISTS mysql.spider_xa; DROP TABLE IF EXISTS mysql.spider_xa_member; diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc index 461e47dd012..c1166c4e7d5 100644 --- a/storage/spider/spd_table.cc +++ b/storage/spider/spd_table.cc @@ -6805,6 +6805,7 @@ error_pt_attr_setstate: pthread_attr_destroy(&spider_pt_attr); error_pt_attr_init: #endif + spider_hton_ptr= NULL; DBUG_RETURN(error_num); }