Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-26541 Make UBSAN builds work with spider again.
When built with ubsan and trying to load the spider plugin, the hidden visibility of mysqld compiling flag causes ha_spider.so to be missing the symbol ha_partition. This commit fixes that, as well as some memcpy null pointer issues when built with ubsan. Signed-off-by: Yuchen Pei <yuchen.pei@mariadb.com>
- Loading branch information
1 parent
284ac6f
commit a68b9dd
Showing
5 changed files
with
215 additions
and
107 deletions.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # | ||
| # MDEV-26541 Undefined symbol: _ZTI12ha_partition when attempting to use ha_spider.so in UBSAN builds | ||
| # | ||
| INSTALL PLUGIN spider SONAME 'ha_spider.so'; | ||
| 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; | ||
| UNINSTALL PLUGIN spider_alloc_mem; | ||
| UNINSTALL PLUGIN spider; | ||
| DROP TABLE IF EXISTS mysql.spider_xa; | ||
| DROP TABLE IF EXISTS mysql.spider_xa_member; | ||
| DROP TABLE IF EXISTS mysql.spider_xa_failed_log; | ||
| DROP TABLE IF EXISTS mysql.spider_tables; | ||
| DROP TABLE IF EXISTS mysql.spider_link_mon_servers; | ||
| DROP TABLE IF EXISTS mysql.spider_link_failed_log; | ||
| DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery; | ||
| DROP TABLE IF EXISTS mysql.spider_table_sts; | ||
| DROP TABLE IF EXISTS mysql.spider_table_crd; |
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,40 @@ | ||
| --echo # | ||
| --echo # MDEV-26541 Undefined symbol: _ZTI12ha_partition when attempting to use ha_spider.so in UBSAN builds | ||
| --echo # | ||
|
|
||
| if (`select not(count(*)) from information_schema.system_variables where variable_name='have_sanitizer' and global_value="UBSAN"`) | ||
| { | ||
| --skip test needs to be run with UBSAN | ||
| } | ||
|
|
||
| # init spider | ||
|
|
||
| INSTALL PLUGIN spider SONAME 'ha_spider.so'; | ||
|
|
||
| let $PLUGIN_NAME= spider_flush_table_mon_cache; | ||
| let $PLUGIN_EXIST= | ||
| `SELECT COUNT(*) FROM mysql.func WHERE name = '$PLUGIN_NAME'`; | ||
| while (!$PLUGIN_EXIST) | ||
| { | ||
| let $PLUGIN_EXIST= | ||
| `SELECT COUNT(*) FROM mysql.func WHERE name = '$PLUGIN_NAME'`; | ||
| } | ||
|
|
||
| # deinit spider | ||
|
|
||
| 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; | ||
| UNINSTALL PLUGIN spider_alloc_mem; | ||
| UNINSTALL PLUGIN spider; | ||
| DROP TABLE IF EXISTS mysql.spider_xa; | ||
| DROP TABLE IF EXISTS mysql.spider_xa_member; | ||
| DROP TABLE IF EXISTS mysql.spider_xa_failed_log; | ||
| DROP TABLE IF EXISTS mysql.spider_tables; | ||
| DROP TABLE IF EXISTS mysql.spider_link_mon_servers; | ||
| DROP TABLE IF EXISTS mysql.spider_link_failed_log; | ||
| DROP TABLE IF EXISTS mysql.spider_table_position_for_recovery; | ||
| DROP TABLE IF EXISTS mysql.spider_table_sts; | ||
| DROP TABLE IF EXISTS mysql.spider_table_crd; |
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