Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
N/A
Description
INSTALL PLUGIN Spider SONAME 'ha_spider.so'; |
CREATE TABLE t ENGINE=Spider COMMENT='WRAPPER "mysql"'; |
Leads to, on base:
11.3.0 126157061b4376496c034a809ea4943e863d1465 (Debug) |
11.3.0-dbg> INSTALL PLUGIN Spider SONAME 'ha_spider.so';
|
Query OK, 0 rows affected, 1 warning (0.285 sec)
|
|
11.3.0-dbg> CREATE TABLE ts1 ENGINE=Spider COMMENT='WRAPPER "mysql",TABLE "t1"';
|
ERROR 1429 (HY000): Unable to connect to foreign data source: localhost
|
Versus the patch:
11.4.0 f93c20081a8a505ac502850ec02630f95673dfba (Optimized) |
11.4.0-opt> INSTALL PLUGIN Spider SONAME 'ha_spider.so';
|
Query OK, 0 rows affected, 1 warning (0.284 sec)
|
|
11.4.0-opt> CREATE TABLE ts1 ENGINE=Spider COMMENT='WRAPPER "mysql",TABLE "t1"';
|
ERROR 138 (0A000): Spider table params in COMMENT or CONNECTION strings have been deprecated and will be removed in a future release. Please use table options instead.
|
Two issues:
1) It seems that other errors are masked in favor of ERROR 138
2) The ERROR should have been a warning only
Attachments
Issue Links
- blocks
-
MDEV-28861 Spider: Deprecate table options by COMMENT
-
- Closed
-
- is caused by
-
MDEV-28861 Spider: Deprecate table options by COMMENT
-
- Closed
-
This issue has nothing to do with spider, as spider is simply using
the warning API provided by the server layer.
What happens is the value of THD::abort_on_warning during table
creation at the server layer. When it is true, warnings are converted
to errors, and if the first warning happens before the first error,
then the warning will "mask" errors.
When one executes a CREATE TABLE without table structure, i.e. without
defining columns of the table like in the case in the previous
comment, this causes create_table_mode to be
C_ASSISTED_DISCOVERY (-3), which causes thd->abort_on_warning
to be true. Thus the warning becomes an error and no further error is
displayed.
When one executes a (more common) CREATE TABLE with table
structure e.g. CREATE TABLE ts1 (c int)..., the
create_table_mode is C_ORDINARY_CREATE (0), which causes
mysql_create_frm_image() to be called and sets
thd->abort_on_warning to false, and errors (if any) are printed
instead of warnings.
See the following example in
storage/spider/mysql-test/spider/feature/r/engine_defined_attributes.result:
);
So this is either intended behaviour or a server layer bug. I am
leaning towards the former.