Merge branch '10.6' into 10.11

This commit is contained in:
Yuchen Pei 2024-05-31 09:13:40 +10:00
commit 22774ddb53
No known key found for this signature in database
GPG key ID: 3DD1B35105743563
6 changed files with 96 additions and 4 deletions

View file

@ -0,0 +1,24 @@
#
# MDEV-29027 ASAN errors in spider_db_free_result after partition DDL
#
for master_1
for child2
child2_1
child2_2
child2_3
for child3
CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (
c INT
) ENGINE=Spider DEFAULT CHARSET=utf8 PARTITION BY HASH(c) (
PARTITION pt1
);
ALTER TABLE tbl_a ADD PARTITION (PARTITION pt2);
DROP DATABASE auto_test_local;
for master_1
for child2
child2_1
child2_2
child2_3
for child3

View file

@ -0,0 +1,15 @@
for master_1
for child2
for child3
set spider_same_server_link= 1;
CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 (a INT);
CREATE TABLE t_spider (a INT) ENGINE=SPIDER PARTITION BY HASH(a) (PARTITION p1 COMMENT = "wrapper 'mysql', srv 'srv', table 't1'");
CREATE TABLE t2 (a INT);
ALTER TABLE t_spider ADD PARTITION (PARTITION p2 COMMENT = "wrapper 'mysql', srv 'srv', table 't2'");
DROP TABLE t_spider, t1, t2;
drop server srv;
for master_1
for child2
for child3

View file

@ -0,0 +1,3 @@
!include include/default_mysqld.cnf
!include ../my_1_1.cnf
!include ../my_2_1.cnf

View file

@ -0,0 +1,28 @@
--echo #
--echo # MDEV-29027 ASAN errors in spider_db_free_result after partition DDL
--echo #
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
CREATE DATABASE auto_test_local;
USE auto_test_local;
eval CREATE TABLE tbl_a (
c INT
) $MASTER_1_ENGINE $MASTER_1_CHARSET PARTITION BY HASH(c) (
PARTITION pt1
);
ALTER TABLE tbl_a ADD PARTITION (PARTITION pt2);
DROP DATABASE auto_test_local;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log

View file

@ -0,0 +1,22 @@
--disable_query_log
--disable_result_log
--source ../../t/test_init.inc
--enable_result_log
--enable_query_log
--source include/have_partition.inc
set spider_same_server_link= 1;
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
CREATE TABLE t1 (a INT);
CREATE TABLE t_spider (a INT) ENGINE=SPIDER PARTITION BY HASH(a) (PARTITION p1 COMMENT = "wrapper 'mysql', srv 'srv', table 't1'");
CREATE TABLE t2 (a INT);
ALTER TABLE t_spider ADD PARTITION (PARTITION p2 COMMENT = "wrapper 'mysql', srv 'srv', table 't2'");
DROP TABLE t_spider, t1, t2;
drop server srv;
--disable_query_log
--disable_result_log
--source ../../t/test_deinit.inc
--enable_result_log
--enable_query_log

View file

@ -2858,7 +2858,7 @@ int spider_db_free_result(
SPIDER_RESULT *result;
SPIDER_RESULT *prev;
SPIDER_SHARE *share = spider->share;
SPIDER_TRX *trx = spider->wide_handler->trx;
THD *thd= current_thd;
SPIDER_POSITION *position;
int roop_count, error_num;
DBUG_ENTER("spider_db_free_result");
@ -2874,10 +2874,10 @@ int spider_db_free_result(
if (
final ||
spider_param_reset_sql_alloc(trx->thd, share->reset_sql_alloc) == 1
spider_param_reset_sql_alloc(thd, share->reset_sql_alloc) == 1
) {
int alloc_size = final ? 0 :
(spider_param_init_sql_alloc_size(trx->thd, share->init_sql_alloc_size));
(spider_param_init_sql_alloc_size(thd, share->init_sql_alloc_size));
while (result)
{
position = result->first_position;
@ -2920,7 +2920,7 @@ int spider_db_free_result(
{
ulong realloced = 0;
int init_sql_alloc_size =
spider_param_init_sql_alloc_size(trx->thd, share->init_sql_alloc_size);
spider_param_init_sql_alloc_size(thd, share->init_sql_alloc_size);
for (roop_count = 0; roop_count < (int) share->use_dbton_count;
roop_count++)
{