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-29855 Crash with SPIDER_DIRECT_SQL and spider_udf_ds_use_real_ta…
…ble=1
The crash occurs because of the following call of TABLE_LIST::init_one_table():
table_list.init_one_table(
&table_list.db, &table_list.table_name, 0, TL_WRITE);
One should not pass table_list.db and table_list.table_name to the function
because it update the very members internally.
The function is called previously, and there is no need to call it again.
So, simply removing the call will resolve the problem.- Loading branch information
1 parent
d569e6d
commit 162c150
Showing
4 changed files
with
77 additions
and
11 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # | ||
| # MDEV-29855 Crash with SPIDER_DIRECT_SQL and spider_udf_ds_use_real_table=1 | ||
| # | ||
| for master_1 | ||
| for child2 | ||
| child2_1 | ||
| child2_2 | ||
| child2_3 | ||
| for child3 | ||
| connection child2_1; | ||
| CREATE DATABASE auto_test_remote; | ||
| USE auto_test_remote; | ||
| CREATE TABLE tbl_a ( | ||
| a INT | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
| connection master_1; | ||
| CREATE DATABASE auto_test_local; | ||
| USE auto_test_local; | ||
| CREATE TABLE tbl_a ( | ||
| a INT | ||
| ) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a", srv "s_2_1"'; | ||
| SET spider_udf_ds_use_real_table=1; | ||
| SELECT SPIDER_DIRECT_SQL('select 1 as 1', 'tbl_a', 'srv "s_2_1"'); | ||
| ERROR 3D000: No database selected | ||
| connection master_1; | ||
| DROP DATABASE IF EXISTS auto_test_local; | ||
| connection child2_1; | ||
| DROP DATABASE IF EXISTS auto_test_remote; | ||
| for master_1 | ||
| for child2 | ||
| child2_1 | ||
| child2_2 | ||
| child2_3 | ||
| for child3 |
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,3 @@ | ||
| !include include/default_mysqld.cnf | ||
| !include ../my_1_1.cnf | ||
| !include ../my_2_1.cnf |
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-29855 Crash with SPIDER_DIRECT_SQL and spider_udf_ds_use_real_table=1 | ||
| --echo # | ||
|
|
||
|
|
||
| --disable_query_log | ||
| --disable_result_log | ||
| --source ../../t/test_init.inc | ||
| --enable_result_log | ||
| --enable_query_log | ||
|
|
||
| --connection child2_1 | ||
| CREATE DATABASE auto_test_remote; | ||
| USE auto_test_remote; | ||
| eval CREATE TABLE tbl_a ( | ||
| a INT | ||
| ) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; | ||
|
|
||
| --connection master_1 | ||
| CREATE DATABASE auto_test_local; | ||
| USE auto_test_local; | ||
| eval CREATE TABLE tbl_a ( | ||
| a INT | ||
| ) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a", srv "s_2_1"'; | ||
|
|
||
| SET spider_udf_ds_use_real_table=1; | ||
| --error ER_NO_DB_ERROR | ||
| SELECT SPIDER_DIRECT_SQL('select 1 as 1', 'tbl_a', 'srv "s_2_1"'); | ||
|
|
||
| --connection master_1 | ||
| DROP DATABASE IF EXISTS auto_test_local; | ||
|
|
||
| --connection child2_1 | ||
| DROP DATABASE IF EXISTS auto_test_remote; | ||
|
|
||
| --disable_query_log | ||
| --disable_result_log | ||
| --source ../t/test_deinit.inc | ||
| --enable_query_log | ||
| --enable_result_log |
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