[MDEV-30149] Table discovery hides the real problem behind ER_SQL_DISCOVER_ERROR Created: 2022-12-02  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - Federated
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None


 Description   

INSTALL SONAME 'ha_federatedx'; 
eval create server s foreign data wrapper mysql options (host "127.0.0.1", database "test", user "root", port $MASTER_MYPORT);
 
CREATE TABLE t (a INT, g POINT);
--error ER_SQL_DISCOVER_ERROR
CREATE TABLE t_fed ENGINE=FEDERATED CONNECTION="s/t";
SHOW WARNINGS;
 
# Cleanup
DROP TABLE t;
DROP SERVER s;
UNINSTALL SONAME 'ha_federatedx';

The table discovery fails because Federated does not support GIS. The problem is the error message. To avoid suspicion that it's MTR-induced truncation, here is the output from the client:

10.10 a27bfb2a872

MariaDB [test]> CREATE TABLE t_fed ENGINE=FEDERATED CONNECTION="s/t";
ERROR 1939 (HY000): Engine FEDERATED failed to discover table `test`.`t_fed` with 'CREATE TABLE `t` (
  `a` int(11) DEFAULT NULL,
  `g` point DEFAULT NULL
) CONNECTION='s/t''

SHOW WARNINGS show four errors, the first being ER_CHECK_NOT_IMPLEMENTED and the above ER_SQL_DISCOVER_ERROR being the second, so it's not quite clear why it ends up in the client. On the bright side, it's better than the other two which are even more generic.

MariaDB [test]> show warnings;
+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message                                                                                                                                                    |
+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Error | 1178 | The storage engine for the table doesn't support GEOMETRY                                                                                                  |
| Error | 1939 | Engine FEDERATED failed to discover table `test`.`t_fed` with 'CREATE TABLE `t` (
  `a` int(11) DEFAULT NULL,
  `g` point DEFAULT NULL
) CONNECTION='s/t'' |
| Error | 1429 | Unable to connect to foreign data source:                                                                                                                  |
| Error | 1030 | Got error 168 "Unknown (generic) error from engine" from storage engine FEDERATED                                                                          |
+-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+


Generated at Thu Feb 08 10:14:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.