Commit 13896f73 authored by Yuchen Pei's avatar Yuchen Pei

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.
parent a8bd6a98
......@@ -10999,6 +10999,8 @@ int ha_spider::direct_delete_rows_init()
DBUG_RETURN(bulk_access_link_exec_tgt->spider->direct_delete_rows_init());
}
#endif
if (int error_num = spider_check_trx_and_get_conn(thd, this, TRUE))
DBUG_RETURN(error_num);
direct_update_init(
thd,
FALSE
......
--echo #
--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
--echo #
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
CREATE TABLE t (c INT) ENGINE=Spider;
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
SELECT * FROM t;
--error 12701
INSERT INTO t (SELECT 1 FROM t);
LOCK TABLES t WRITE CONCURRENT;
--error 12701
DELETE FROM t;
UNLOCK TABLES;
DROP TABLE t;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log
--echo #
--echo # end of test mdev_28683
--echo #
......@@ -3720,9 +3720,6 @@ int spider_check_trx_and_get_conn(
for (roop_count = 0; roop_count < (int) share->link_count; roop_count++)
{
if (
/*
spider->conn_kind[roop_count] != SPIDER_CONN_KIND_MYSQL &&
*/
share->hs_dbton_ids[spider->conn_link_idx[roop_count]] ==
SPIDER_DBTON_SIZE
) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment