1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-34541 Clean up spider self reference check

SPIDER_CONN::loop_check_meraged_first is useless, because all
SPIDER_CONN_LOOP_CHECKs are in SPIDER_CONN::loop_check_queue, which in
spider_db_conn::fin_loop_check() is iterated over.

This fixes the use-after-free issue when there are three spider tables
sharing the same remote, and their corresponding
SPIDER_CONN_LOOP_CHECKs getting merged in
spider_conn_queue_and_merge_loop_check()

This also fixes MDEV-34555
This commit is contained in:
Yuchen Pei
2024-07-11 11:16:46 +08:00
parent 0bb9862888
commit 132270d3de
9 changed files with 288 additions and 74 deletions

View File

@@ -5283,6 +5283,22 @@ int spider_db_mbase_util::append_time_zone(
DBUG_RETURN(0);
}
/*
iterate over loop_check_queue and build queries for loop check
The query is in the form of
set @`spider_lc_.<to_table>` =
'-<mac1>-<pid1>-<from_table1>--<mac2>-<pid2>-<from_table2>-...'
where from_table1, from_table2 etc. are spider tables whose direct
or indirect remote data nodes contain to_table.
e.g. if t0->t1->t2, then the query could be:
set @`spider_lc_./test/t2` =
'-234567890abc-def012-./test/t1--1234567890ab-cdef01-./test/t0-'
*/
int spider_db_mbase_util::append_loop_check(
spider_string *str,
SPIDER_CONN *conn