mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-12951 Server crash [mysqld got exception 0xc0000005]
Same as MDEV-12725 but for federated (not X). Set and reset mysql.net->thd appropriately.
This commit is contained in:
parent
e78712d464
commit
e6ce97a592
3 changed files with 41 additions and 2 deletions
11
mysql-test/suite/federated/net_thd_crash-12951.result
Normal file
11
mysql-test/suite/federated/net_thd_crash-12951.result
Normal file
|
@ -0,0 +1,11 @@
|
|||
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;
|
23
mysql-test/suite/federated/net_thd_crash-12951.test
Normal file
23
mysql-test/suite/federated/net_thd_crash-12951.test
Normal file
|
@ -0,0 +1,23 @@
|
|||
#
|
||||
# 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;
|
|
@ -2980,6 +2980,9 @@ int ha_federated::reset(void)
|
|||
}
|
||||
reset_dynamic(&results);
|
||||
|
||||
if (mysql)
|
||||
mysql->net.thd= NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3200,11 +3203,13 @@ int ha_federated::real_query(const char *query, size_t length)
|
|||
int rc= 0;
|
||||
DBUG_ENTER("ha_federated::real_query");
|
||||
|
||||
if (!query || !length)
|
||||
goto end;
|
||||
|
||||
if (!mysql && (rc= real_connect()))
|
||||
goto end;
|
||||
|
||||
if (!query || !length)
|
||||
goto end;
|
||||
mysql->net.thd= table->in_use;
|
||||
|
||||
rc= mysql_real_query(mysql, query, (uint) length);
|
||||
|
||||
|
|
Loading…
Reference in a new issue