-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-26539 SIGSEGV in spider_check_and_set_trx_isolation and I_P_List…
…_iterator from THD::drop_temporary_table (10.5.3 opt only) on ALTER The server crashes if ALTER TABLE, which accesses physical data placed at data nodes, is performed on a Spider table. The cause of the bug is that spider_check_trx_and_get_conn() does not allocate connections if sql_command == SQLCOM_ALTER_TABLE. Some ALTER TABLE statements, like ALTER TABLE ... CHECK PARTITION, access data nodes. So, we need to allocate a new connection before performing ALTER TABLEs.
- Loading branch information
1 parent
052dda6
commit 9068020
Showing
4 changed files
with
81 additions
and
4 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
storage/spider/mysql-test/spider/bugfix/r/mdev_26539.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,36 @@ | ||
for master_1 | ||
for child2 | ||
child2_1 | ||
child2_2 | ||
child2_3 | ||
for child3 | ||
# | ||
# MDEV-26539 SIGSEGV in spider_check_and_set_trx_isolation and I_P_List_iterator from THD::drop_temporary_table (10.5.3 opt only) on ALTER | ||
# | ||
connection child2_1; | ||
CREATE DATABASE auto_test_remote; | ||
USE auto_test_remote; | ||
CREATE TABLE tbl_a ( | ||
c INT | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
connection master_1; | ||
CREATE DATABASE auto_test_local; | ||
USE auto_test_local; | ||
CREATE TABLE tbl_a ( | ||
c INT | ||
) ENGINE=Spider DEFAULT CHARSET=utf8 COMMENT='table "tbl_a"' PARTITION BY LIST COLUMNS (c) ( | ||
PARTITION pt1 DEFAULT COMMENT = 'srv "s_2_1"' | ||
); | ||
INSERT INTO tbl_a VALUES (1); | ||
ALTER TABLE tbl_a CHECK PARTITION ALL; | ||
Table Op Msg_type Msg_text | ||
auto_test_local.tbl_a check status OK | ||
DROP DATABASE auto_test_local; | ||
connection child2_1; | ||
DROP DATABASE 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 @@ | ||
--disable_query_log | ||
--disable_result_log | ||
--source ../../t/test_init.inc | ||
--enable_result_log | ||
--enable_query_log | ||
|
||
--echo # | ||
--echo # MDEV-26539 SIGSEGV in spider_check_and_set_trx_isolation and I_P_List_iterator from THD::drop_temporary_table (10.5.3 opt only) on ALTER | ||
--echo # | ||
|
||
--connection child2_1 | ||
CREATE DATABASE auto_test_remote; | ||
USE auto_test_remote; | ||
eval CREATE TABLE tbl_a ( | ||
c INT | ||
) $CHILD2_1_ENGINE $CHILD2_1_CHARSET; | ||
|
||
--connection master_1 | ||
CREATE DATABASE auto_test_local; | ||
USE auto_test_local; | ||
|
||
eval CREATE TABLE tbl_a ( | ||
c INT | ||
) $MASTER_1_ENGINE $MASTER_1_CHARSET COMMENT='table "tbl_a"' PARTITION BY LIST COLUMNS (c) ( | ||
PARTITION pt1 DEFAULT COMMENT = 'srv "s_2_1"' | ||
); | ||
|
||
INSERT INTO tbl_a VALUES (1); | ||
ALTER TABLE tbl_a CHECK PARTITION ALL; | ||
|
||
DROP DATABASE auto_test_local; | ||
|
||
--connection child2_1 | ||
DROP DATABASE auto_test_remote; | ||
|
||
--disable_query_log | ||
--disable_result_log | ||
--source ../../t/test_deinit.inc | ||
--enable_result_log | ||
--enable_query_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