mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-17227 Server crash in TABLE_SHARE::init_from_sql_statement_string upon table discovery with non-existent database
* failed init_from_binary_frm_image can clear share->db_plugin, don't use it on the error path * cleanup the test a bit
This commit is contained in:
@@ -13,8 +13,7 @@ CREATE TABLE t1 (
|
|||||||
`name` varchar(32) default 'name')
|
`name` varchar(32) default 'name')
|
||||||
DEFAULT CHARSET=latin1;
|
DEFAULT CHARSET=latin1;
|
||||||
connection master;
|
connection master;
|
||||||
CREATE TABLE t1 ENGINE=FEDERATED
|
CREATE TABLE t1 ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||||
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
@@ -38,6 +37,9 @@ id group a\\b a\\ name
|
|||||||
1 1 2 NULL foo
|
1 1 2 NULL foo
|
||||||
2 1 2 NULL fee
|
2 1 2 NULL fee
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-11311 Create federated table does not work as expected
|
||||||
|
#
|
||||||
create table t1 (
|
create table t1 (
|
||||||
a bigint(20) not null auto_increment,
|
a bigint(20) not null auto_increment,
|
||||||
b bigint(20) not null,
|
b bigint(20) not null,
|
||||||
@@ -57,8 +59,7 @@ t1 CREATE TABLE `t1` (
|
|||||||
KEY `b` (`b`,`c`,`d`(255))
|
KEY `b` (`b`,`c`,`d`(255))
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
connection master;
|
connection master;
|
||||||
create table t1 engine=federated
|
create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||||
connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
|
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
@@ -72,6 +73,12 @@ t1 CREATE TABLE `t1` (
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
connection slave;
|
connection slave;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
#
|
||||||
|
# MDEV-17227 Server crash in TABLE_SHARE::init_from_sql_statement_string upon table discovery with non-existent database
|
||||||
|
#
|
||||||
|
connection master;
|
||||||
|
create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||||
|
ERROR HY000: Unable to connect to foreign data source: Table 'test.t1' doesn't exist
|
||||||
connection master;
|
connection master;
|
||||||
DROP TABLE IF EXISTS federated.t1;
|
DROP TABLE IF EXISTS federated.t1;
|
||||||
DROP DATABASE IF EXISTS federated;
|
DROP DATABASE IF EXISTS federated;
|
||||||
|
@@ -13,9 +13,7 @@ CREATE TABLE t1 (
|
|||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
|
|
||||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
evalp CREATE TABLE t1 ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||||
eval CREATE TABLE t1 ENGINE=FEDERATED
|
|
||||||
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
|
||||||
|
|
||||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
@@ -30,9 +28,9 @@ connection slave;
|
|||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
#
|
--echo #
|
||||||
#
|
--echo # MDEV-11311 Create federated table does not work as expected
|
||||||
#
|
--echo #
|
||||||
create table t1 (
|
create table t1 (
|
||||||
a bigint(20) not null auto_increment,
|
a bigint(20) not null auto_increment,
|
||||||
b bigint(20) not null,
|
b bigint(20) not null,
|
||||||
@@ -44,9 +42,7 @@ create table t1 (
|
|||||||
show create table t1;
|
show create table t1;
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
evalp create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||||
eval create table t1 engine=federated
|
|
||||||
connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
|
||||||
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
--replace_result $SLAVE_MYPORT SLAVE_PORT
|
||||||
show create table t1;
|
show create table t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
@@ -54,5 +50,12 @@ drop table t1;
|
|||||||
connection slave;
|
connection slave;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-17227 Server crash in TABLE_SHARE::init_from_sql_statement_string upon table discovery with non-existent database
|
||||||
|
--echo #
|
||||||
|
connection master;
|
||||||
|
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
|
||||||
|
evalp create table t1 engine=federated connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
|
||||||
|
|
||||||
source include/federated_cleanup.inc;
|
source include/federated_cleanup.inc;
|
||||||
|
|
||||||
|
@@ -2869,9 +2869,8 @@ ret:
|
|||||||
if (unlikely(thd->is_error() || error))
|
if (unlikely(thd->is_error() || error))
|
||||||
{
|
{
|
||||||
thd->clear_error();
|
thd->clear_error();
|
||||||
my_error(ER_SQL_DISCOVER_ERROR, MYF(0),
|
my_error(ER_SQL_DISCOVER_ERROR, MYF(0), hton_name(hton)->str,
|
||||||
plugin_name(db_plugin)->str, db.str, table_name.str,
|
db.str, table_name.str, sql_copy);
|
||||||
sql_copy);
|
|
||||||
DBUG_RETURN(HA_ERR_GENERIC);
|
DBUG_RETURN(HA_ERR_GENERIC);
|
||||||
}
|
}
|
||||||
/* Treat the table as normal table from binary logging point of view */
|
/* Treat the table as normal table from binary logging point of view */
|
||||||
|
Reference in New Issue
Block a user