Commit 7e4c185c authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-14272 Mariadb crashes with signal 11 when using federatedx engine and galera

cherry-pick e6ce97a5
parent d1c2cd30
set global query_cache_size= 16*1024*1024;
set global query_cache_type= 1;
create table t1 (i int) engine=innodb;
create table t2 (i int) engine=federated
CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
select * from t2;
i
drop table t2;
drop table t1;
set global query_cache_type= default;
set global query_cache_size= default;
#
# MDEV-12951 Server crash [mysqld got exception 0xc0000005]
#
--source include/have_innodb.inc
set global query_cache_size= 16*1024*1024;
set global query_cache_type= 1;
create table t1 (i int) engine=innodb;
--replace_result $MASTER_MYPORT MASTER_MYPORT
eval create table t2 (i int) engine=federated
CONNECTION="mysql://root@localhost:$MASTER_MYPORT/test/t1";
select * from t2;
source include/restart_mysqld.inc;
drop table t2;
drop table t1;
set global query_cache_type= default;
set global query_cache_size= default;
...@@ -2982,6 +2982,9 @@ int ha_federated::reset(void) ...@@ -2982,6 +2982,9 @@ int ha_federated::reset(void)
} }
reset_dynamic(&results); reset_dynamic(&results);
if (mysql)
mysql->net.thd= NULL;
return 0; return 0;
} }
...@@ -3202,12 +3205,14 @@ int ha_federated::real_query(const char *query, size_t length) ...@@ -3202,12 +3205,14 @@ int ha_federated::real_query(const char *query, size_t length)
int rc= 0; int rc= 0;
DBUG_ENTER("ha_federated::real_query"); DBUG_ENTER("ha_federated::real_query");
if (!mysql && (rc= real_connect())) if (!query || !length)
goto end; goto end;
if (!query || !length) if (!mysql && (rc= real_connect()))
goto end; goto end;
mysql->net.thd= table->in_use;
rc= mysql_real_query(mysql, query, (uint) length); rc= mysql_real_query(mysql, query, (uint) length);
end: end:
......
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