Commit 2a64e72a authored by Yuchen Pei's avatar Yuchen Pei

MDEV-32046 [DEMO] Do not ignore error in spider_get_share()

parent a60cf9c7
......@@ -7,5 +7,5 @@ CREATE TABLE t (i CHAR) ENGINE=SPIDER;
INSERT INTO t VALUES (0);
ERROR HY000: Unable to connect to foreign data source: localhost
INSERT t SELECT 1 ON DUPLICATE KEY UPDATE c=1;
ERROR 42S22: Unknown column 'c' in 'field list'
ERROR HY000: Unable to connect to foreign data source: localhost
DROP DATABASE IF EXISTS auto_test_local;
......@@ -8,11 +8,7 @@ CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (a INT) ENGINE=SPIDER;
FLUSH TABLE tbl_a WITH READ LOCK;
Warnings:
Error 1429 Unable to connect to foreign data source: localhost
Error 1429 Unable to connect to foreign data source: localhost
Error 1429 Unable to connect to foreign data source: localhost
Error 1429 Unable to connect to foreign data source: localhost
ERROR HY000: Unable to connect to foreign data source: localhost
BEGIN;
DROP DATABASE auto_test_local;
for master_1
......
......@@ -5,7 +5,7 @@ CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (a INT KEY) ENGINE=SPIDER;
SELECT a.z FROM tbl_a AS a,tbl_a b WHERE a.z=b.z;
ERROR 42S22: Unknown column 'a.z' in 'field list'
ERROR HY000: Unable to connect to foreign data source: localhost
ALTER TABLE tbl_a CHANGE c c INT;
ERROR 42S22: Unknown column 'c' in 'tbl_a'
LOCK TABLE tbl_a READ;
......
......@@ -12,9 +12,9 @@ alter table t2 ENGINE=Spider COMMENT='WRAPPER "mysql", srv "srv_self_reference_m
select * from t0;
ERROR HY000: An infinite loop is detected when opening table test.t0
select * from t1;
ERROR HY000: An infinite loop is detected when opening table test.t0
ERROR HY000: An infinite loop is detected when opening table test.t1
select * from t2;
ERROR HY000: An infinite loop is detected when opening table test.t0
ERROR HY000: An infinite loop is detected when opening table test.t2
drop table t0, t1, t2;
for master_1
for child2
......
......@@ -15,7 +15,7 @@ USE auto_test_local;
CREATE TABLE t (i CHAR) ENGINE=SPIDER;
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
INSERT INTO t VALUES (0);
--error ER_BAD_FIELD_ERROR
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
INSERT t SELECT 1 ON DUPLICATE KEY UPDATE c=1;
DROP DATABASE IF EXISTS auto_test_local;
......
......@@ -12,6 +12,7 @@ CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (a INT) ENGINE=SPIDER;
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
FLUSH TABLE tbl_a WITH READ LOCK;
BEGIN;
......
......@@ -10,7 +10,7 @@ CREATE DATABASE auto_test_local;
USE auto_test_local;
CREATE TABLE tbl_a (a INT KEY) ENGINE=SPIDER;
--error ER_BAD_FIELD_ERROR
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
SELECT a.z FROM tbl_a AS a,tbl_a b WHERE a.z=b.z;
--error ER_BAD_FIELD_ERROR
ALTER TABLE tbl_a CHANGE c c INT;
......
......@@ -276,11 +276,9 @@ DROP TABLE ta_l2;
connection master_1;
CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
SHOW FIELDS FROM t;
Field Type Null Key Default Extra
c int(11) YES NULL
ERROR HY000: Unable to connect to foreign data source: localhost
SHOW FIELDS FROM t;
Field Type Null Key Default Extra
c int(11) YES NULL
ERROR HY000: Unable to connect to foreign data source: localhost
DROP TABLE t;
deinit
......
......@@ -985,7 +985,9 @@ if ($HAVE_PARTITION)
--connection master_1
CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER);
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
SHOW FIELDS FROM t;
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
SHOW FIELDS FROM t;
DROP TABLE t;
......
......@@ -4948,17 +4948,12 @@ SPIDER_SHARE *spider_get_share(
sts_sync,
1, HA_STATUS_VARIABLE | HA_STATUS_CONST | HA_STATUS_AUTO))
) {
if (*error_num != ER_SPIDER_SYS_TABLE_VERSION_NUM)
{
thd->clear_error();
} else {
pthread_mutex_unlock(&share->crd_mutex);
pthread_mutex_unlock(&share->sts_mutex);
share->init_error = TRUE;
share->init_error_time = (time_t) time((time_t*) 0);
share->init = TRUE;
goto error_after_alloc_dbton_handler;
}
}
if (
(
......
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