|
Alike to MDEV-33195 and MDEV-33191 there is some issue reproducing this in MTR:
--let $SOCKET=`SELECT @@global.socket`
|
INSTALL PLUGIN spider SONAME 'ha_spider.so';
|
SET spider_internal_sql_log_off=1;
|
SET spider_same_server_link=1;
|
DROP TABLE mysql.spider_link_mon_servers;
|
CREATE TABLE t1(c DATE) ENGINE=MyISAM;
|
eval CREATE TABLE t(c DATE,PRIMARY KEY(c)) ENGINE=Spider COMMENT='socket "$SOCKET",table "t1 t2"' CONNECTION='mkd "1"';
|
SELECT * FROM t WHERE c=0;
|
Leads to:
|
11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Debug)
|
mysqltest: At line 7: query 'SELECT * FROM t WHERE c=0' failed: <Unknown> (12720): Host:localhost and Socket:/test/MD271223-mariadb-11.4.0-linux-x86_64-dbg/mariadb-test/var/tmp/mysqld.1.sock aim self server. Please change spider_same_server_link parameter if this link is required.
|
Adding spider_same_server_link=1 does not help as it leads to a different error:
mysqltest: At line 8: query 'SELECT * FROM t WHERE c=0' failed: ER_CONNECT_TO_FOREIGN_DATA_SOURCE (1429): Unable to connect to foreign data source: localhost
|
|
|
1) Removing only CONNECTION='mkd "1"' from the testcase changes the error log outcome to:
|
11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Debug)
|
2024-01-08 8:51:28 4 [ERROR] Got error 1227 when reading table './test/t'
|
2) Removing only PRIMARY KEY(c) from the testcase results in the same error in the CLI, but no error in the error log.
|
|
Some older versions would hang when executing DROP TABLE mysql.spider_link_mon_servers; (may be good to check why?)
|
|
Some older versions will hang when executing DROP TABLE mysql.spider_link_mon_servers; - may be good to check why
However, a 10.4(.33) build of ~20 Nov 23 (arbitrary commit 5c4c1844bf8b60dcee9fdeacd4a39705d40a4515) does not seem to have this table:
10.4.33-opt>INSTALL PLUGIN spider SONAME 'ha_spider.so';
|
Query OK, 0 rows affected, 1 warning (0.003 sec)
|
|
10.4.33-opt>SET spider_internal_sql_log_off=1;
|
Query OK, 0 rows affected (0.000 sec)
|
|
10.4.33-opt>DROP TABLE mysql.spider_link_mon_servers;
|
ERROR 1051 (42S02): Unknown table 'mysql.spider_link_mon_servers'
|
Which contradicts the manual:
https://mariadb.com/docs/server/ref/mdb/system-tables/spider_link_mon_servers/
> spider_link_mon_servers: present starting in MariaDB Community Server 10.4.0.
|
|
The current behaviour was introduced between 10.4 commits 5c4c1844bf8b60dcee9fdeacd4a39705d40a4515 on 20 Nov 2023 and 1b747ffd05dd524f8d43b35a2b583dc4c00d767b on 27 Dec 23. Bisecting.
|
|
I cannot reproduce at 11.0 d8b8adce4941e209880286fdd65340da88cf5a3c
with the case below. Instead of 12524
(ER_SPIDER_CANT_OPEN_SYS_TABLE_NUM), I get 12702 which makes
sense.
At line 15: query 'SELECT * FROM t WHERE c=0' failed: <Unknown> (12702): Remote table 'test.t2' is not found
|
--echo #
|
--echo # mdev-33196
|
--echo #
|
--disable_query_log
|
--disable_result_log
|
--source ../../t/test_init.inc
|
--enable_result_log
|
--enable_query_log
|
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql
|
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root');
|
SET spider_internal_sql_log_off=1;
|
DROP TABLE mysql.spider_link_mon_servers;
|
CREATE TABLE t1(c DATE) ENGINE=MyISAM;
|
CREATE TABLE t(c DATE,PRIMARY KEY(c)) ENGINE=Spider COMMENT='srv "srv",table "t1 t2"' CONNECTION='mkd "1"';
|
SELECT * FROM t WHERE c=0;
|
drop server srv;
|
--disable_query_log
|
--disable_result_log
|
--source ../../t/test_deinit.inc
|
--enable_result_log
|
--enable_query_log
|
--echo #
|
--echo # end of test mdev_33196
|
--echo #
|
I tried the latest 11.0 (5be8b13735cee9c224b2c1851d7a017f18c714cc)
and had the same results.
Note that I tested on a Release build, not a Debug build.
|
|
Yes, there is some issue with MTR reproducibility. It reports the 12524 error in the error log when using the CLI for replay.
|
|
ER_SPIDER_CANT_OPEN_SYS_TABLE_NUM Looks correct? Though the error message in the client (and error log if feasible) needs updating then.
|
|
I still cannot reproduce it, even in an interactive client, at 10.4 or 11.0 or 11.4 (c0c1c80346b926ea1358aa512374d72d513299b0)
For example, at 10.4 ca276a0f3fcb45ff0abc011e334c700e0c5d4315:
MariaDB [test]> INSTALL SONAME 'ha_spider.so';
|
set spider_same_server_link=1;
|
SET spider_internal_sql_log_off=1;
|
DROP TABLE mysql.spider_link_mon_servers;
|
CREATE TABLE t1(c DATE) ENGINE=MyISAM;
|
CREATE TABLE t(c DATE,PRIMARY KEY(c)) ENGINE=Spider COMMENT='socket "/home/ycp/source/mariadb-server/10.4/build/mysql-test/var/tmp/mysqld.1.sock", user "root", table "t1 t2"' CONNECTION='mkd "1"';
|
SELECT * FROM t WHERE c=0;
|
Query OK, 0 rows affected, 1 warning (0.052 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected (0.000 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected (0.000 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected (0.001 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected (0.000 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected (0.001 sec)
|
|
MariaDB [test]> Empty set (0.006 sec)
|
at 11.0 5be8b13735cee9c224b2c1851d7a017f18c714cc (the last warning is the spider ha deprecation):
MariaDB [test]> INSTALL SONAME 'ha_spider.so';
|
set spider_same_server_link=1;
|
SET spider_internal_sql_log_off=1;
|
DROP TABLE mysql.spider_link_mon_servers;
|
CREATE TABLE t1(c DATE) ENGINE=MyISAM;
|
CREATE TABLE t(c DATE,PRIMARY KEY(c)) ENGINE=Spider COMMENT='socket "/home/ycp/source/mariadb-server/11.0/build/mysql-test/var/tmp/mysqld.1.sock", user "root", table "t1 t2"' CONNECTION='mkd "1"';
|
SELECT * FROM t WHERE c=0;
|
Query OK, 0 rows affected, 1 warning (2.630 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected (0.001 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected (0.001 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected (0.010 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected (0.004 sec)
|
|
MariaDB [test]> Query OK, 0 rows affected, 1 warning (0.012 sec)
|
|
MariaDB [test]> Empty set (0.085 sec)
|
The lack of failure that t2 does not exist is notable, though.
|
|
Here is my full output for comparison
|
11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Optimized)
|
11.4.0-opt>INSTALL PLUGIN spider SONAME 'ha_spider.so';
|
Query OK, 0 rows affected, 1 warning (0.312 sec)
|
|
11.4.0-opt>SET spider_internal_sql_log_off=1;
|
Query OK, 0 rows affected (0.000 sec)
|
|
11.4.0-opt>DROP TABLE mysql.spider_link_mon_servers;
|
Query OK, 0 rows affected (0.007 sec)
|
|
11.4.0-opt>CREATE TABLE t1(c DATE) ENGINE=MyISAM;
|
Query OK, 0 rows affected (0.005 sec)
|
|
11.4.0-opt>CREATE TABLE t(c DATE,PRIMARY KEY(c)) ENGINE=Spider COMMENT='socket "../socket.sock",table "t1 t2"' CONNECTION='mkd "1"';
|
Query OK, 0 rows affected, 1 warning (0.005 sec)
|
|
11.4.0-opt>SELECT * FROM t WHERE c=0;
|
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation
|
11.4.0-opt>
|
|
11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Debug)
|
11.4.0-dbg>INSTALL PLUGIN spider SONAME 'ha_spider.so';
|
Query OK, 0 rows affected, 1 warning (0.393 sec)
|
|
11.4.0-dbg>SET spider_internal_sql_log_off=1;
|
Query OK, 0 rows affected (0.000 sec)
|
|
11.4.0-dbg>DROP TABLE mysql.spider_link_mon_servers;
|
Query OK, 0 rows affected (0.008 sec)
|
|
11.4.0-dbg>CREATE TABLE t1(c DATE) ENGINE=MyISAM;
|
Query OK, 0 rows affected (0.005 sec)
|
|
11.4.0-dbg>CREATE TABLE t(c DATE,PRIMARY KEY(c)) ENGINE=Spider COMMENT='socket "../socket.sock",table "t1 t2"' CONNECTION='mkd "1"';
|
Query OK, 0 rows affected, 1 warning (0.006 sec)
|
|
11.4.0-dbg>SELECT * FROM t WHERE c=0;
|
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) for this operation
|
11.4.0-dbg>
|
Maybe something to do with the startup command? Server:
MYEXTRA=" --no-defaults "
|
/test/MD271223-mariadb-11.4.0-linux-x86_64-opt/bin/mariadbd ${MYEXTRA} --core-file --basedir=/test/MD271223-mariadb-11.4.0-linux-x86_64-opt --tmpdir=/test/MD271223-mariadb-11.4.0-linux-x86_64-opt/data --datadir=/test/MD271223-mariadb-11.4.0-linux-x86_64-opt/data --socket=/test/MD271223-mariadb-11.4.0-linux-x86_64-opt/socket.sock --port=$PORT --log-error=/test/MD271223-mariadb-11.4.0-linux-x86_64-opt/log/master.err --server-id=100 ${MYEXTRA_OPT} 2>&1 &
|
Client:
/test/MD271223-mariadb-11.4.0-linux-x86_64-opt/bin/mariadb -A -uroot -S/test/MD271223-mariadb-11.4.0-linux-x86_64-opt/socket.sock --force --prompt="$(/test/MD271223-mariadb-11.4.0-linux-x86_64-opt/bin/mariadbd --version | grep -o 'Ver [\.0-9]\+' | sed 's|[^\.0-9]*||')$(if [ "$(pwd | grep -o '...$' | sed 's|[do][bp][gt]|aaa|')" == "aaa" ]; then echo "-$(pwd | grep -o '...$')"; fi)>" --binary-mode test
|
|