-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-30727 Check spider_hton_ptr in spider udfs
We have to #undef my_error and find it from udfs when spider is not installed.
- Loading branch information
1 parent
bda8d4f
commit 267dd5a
Showing
4 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
storage/spider/mysql-test/spider/bugfix/r/mdev_30727.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
CREATE FUNCTION spider_direct_sql RETURNS INT SONAME 'ha_spider.so'; | ||
SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"'); | ||
ERROR HY000: Plugin 'SPIDER' is not loaded | ||
CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so'; | ||
SELECT spider_bg_direct_sql ('SELECT * FROM s','a','srv "b"'); | ||
ERROR HY000: Plugin 'SPIDER' is not loaded | ||
CREATE FUNCTION spider_copy_tables RETURNS INT SONAME 'ha_spider.so'; | ||
SELECT spider_copy_tables ('t', '0', '0'); | ||
ERROR HY000: Plugin 'SPIDER' is not loaded | ||
CREATE FUNCTION spider_flush_table_mon_cache RETURNS INT SONAME 'ha_spider.so'; | ||
SELECT spider_flush_table_mon_cache (); | ||
spider_flush_table_mon_cache () | ||
1 | ||
install soname 'ha_spider'; | ||
SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"'); | ||
ERROR HY000: The foreign server name you are trying to reference does not exist. Data source error: b | ||
call mtr.add_suppression(".*\\[Error\\] (mysqld|mariadbd): Can't find record in 'spider_tables'"); | ||
SELECT spider_copy_tables ('t', '0', '0'); | ||
ERROR HY000: Can't find record in 'spider_tables' | ||
SELECT spider_flush_table_mon_cache (); | ||
spider_flush_table_mon_cache () | ||
1 | ||
Warnings: | ||
Warning 1620 Plugin is busy and will be uninstalled on shutdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE FUNCTION spider_direct_sql RETURNS INT SONAME 'ha_spider.so'; | ||
--error ER_PLUGIN_IS_NOT_LOADED | ||
SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"'); | ||
|
||
CREATE FUNCTION spider_bg_direct_sql RETURNS INT SONAME 'ha_spider.so'; | ||
--error ER_PLUGIN_IS_NOT_LOADED | ||
SELECT spider_bg_direct_sql ('SELECT * FROM s','a','srv "b"'); | ||
|
||
CREATE FUNCTION spider_copy_tables RETURNS INT SONAME 'ha_spider.so'; | ||
--error ER_PLUGIN_IS_NOT_LOADED | ||
SELECT spider_copy_tables ('t', '0', '0'); | ||
|
||
# spider_flush_table_mon_cache does not require spider init to function | ||
CREATE FUNCTION spider_flush_table_mon_cache RETURNS INT SONAME 'ha_spider.so'; | ||
SELECT spider_flush_table_mon_cache (); | ||
|
||
# The function functions properly after the plugin is installed | ||
install soname 'ha_spider'; | ||
|
||
--error ER_FOREIGN_SERVER_DOESNT_EXIST | ||
SELECT spider_direct_sql ('SELECT * FROM s','a','srv "b"'); | ||
|
||
call mtr.add_suppression(".*\\[Error\\] (mysqld|mariadbd): Can't find record in 'spider_tables'"); | ||
--error ER_KEY_NOT_FOUND | ||
SELECT spider_copy_tables ('t', '0', '0'); | ||
|
||
SELECT spider_flush_table_mon_cache (); | ||
|
||
--disable_query_log | ||
--source ../../include/clean_up_spider.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters