Skip to content

Commit 13896f7

Browse files
MDEV-28683 Spider: create conn on demand when direct delete
We do this in 10.4 at the same place where in 10.5+ dml_init() is called which does the same thing, among other things.
1 parent a8bd6a9 commit 13896f7

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

storage/spider/ha_spider.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10999,6 +10999,8 @@ int ha_spider::direct_delete_rows_init()
1099910999
DBUG_RETURN(bulk_access_link_exec_tgt->spider->direct_delete_rows_init());
1100011000
}
1100111001
#endif
11002+
if (int error_num = spider_check_trx_and_get_conn(thd, this, TRUE))
11003+
DBUG_RETURN(error_num);
1100211004
direct_update_init(
1100311005
thd,
1100411006
FALSE
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--echo #
2+
--echo # MDEV-28683 Spider: SIGSEGV in spider_db_direct_delete, SIGSEGV in spider_db_connect, ASAN: heap-use-after-free in spider_db_direct_delete
3+
--echo #
4+
--disable_query_log
5+
--disable_result_log
6+
--source ../../t/test_init.inc
7+
--enable_result_log
8+
--enable_query_log
9+
10+
CREATE TABLE t (c INT) ENGINE=Spider;
11+
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
12+
SELECT * FROM t;
13+
--error 12701
14+
INSERT INTO t (SELECT 1 FROM t);
15+
LOCK TABLES t WRITE CONCURRENT;
16+
--error 12701
17+
DELETE FROM t;
18+
19+
UNLOCK TABLES;
20+
DROP TABLE t;
21+
22+
--disable_query_log
23+
--disable_result_log
24+
--source ../../t/test_deinit.inc
25+
--enable_result_log
26+
--enable_query_log
27+
--echo #
28+
--echo # end of test mdev_28683
29+
--echo #

storage/spider/spd_trx.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3720,9 +3720,6 @@ int spider_check_trx_and_get_conn(
37203720
for (roop_count = 0; roop_count < (int) share->link_count; roop_count++)
37213721
{
37223722
if (
3723-
/*
3724-
spider->conn_kind[roop_count] != SPIDER_CONN_KIND_MYSQL &&
3725-
*/
37263723
share->hs_dbton_ids[spider->conn_link_idx[roop_count]] ==
37273724
SPIDER_DBTON_SIZE
37283725
) {

0 commit comments

Comments
 (0)