Commit d0ce9cb8 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-4468 Assertion `error != 0' fails or timeout occurs on select from a...

MDEV-4468 Assertion `error != 0' fails or timeout occurs on select from a FEDERATED table which points at a non-existent table

Federated uses SHOW TABLE STATUS LIKE for ::info().
For nonexisting remote table it doesn't fail, but returns an empty result set.
We need to fake the error in the handler.
parent 742899e5
......@@ -7,6 +7,12 @@ Level Code Message
Error 1 server name: 'non_existing' doesn't exist!
Error 1 Can't create/write to file 'non_existing' (Errcode: 14)
Error 1005 Can't create table 'test.t1' (errno: 1)
create table t1 (a int);
create table fed (a int) engine=Federated CONNECTION='mysql://root@127.0.0.1:MASTER_PORT/test/t1';
drop table t1;
select * from fed;
Got one of the listed errors
drop table fed;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
......
......@@ -8,5 +8,17 @@ connection master;
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='non_existing';
SHOW WARNINGS;
#
# MDEV-4468 Assertion `error != 0' fails or timeout occurs on select from a FEDERATED table which points at a non-existent table
#
create table t1 (a int);
--replace_result $MASTER_MYPORT MASTER_PORT
eval create table fed (a int) engine=Federated CONNECTION='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1';
drop table t1;
--error 1146,1431
select * from fed;
drop table fed;
source include/federated_cleanup.inc;
......@@ -599,6 +599,11 @@ bool federatedx_io_mysql::table_metadata(ha_statistics *stats,
return 0;
error:
if (!mysql_errno(&mysql))
{
mysql.net.last_errno= ER_NO_SUCH_TABLE;
strmake_buf(mysql.net.last_error, "Remote table does not exist");
}
free_result(result);
return 1;
}
......
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