Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL)
-
None
-
Centos 7, linux x86_64
Description
If the resulting table produced from a ENGINE=CONNECT table_type=TBL is the same name as one of the contained tables, attempt to query the new table fail with
ERROR 1296 (HY000): Got error 174 'Error accessing FOO.Archive: This MySQL table is defined on itself' from CONNECT
|
Here is how to reproduce
CREATE DATABASE FOO;
|
USE FOO;
|
CREATE TABLE `Archive` (
|
`event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
`alarmed` datetime DEFAULT NULL,
|
PRIMARY KEY (`event_id`, `alarmed`)
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
/*!50100 PARTITION BY RANGE (TO_DAYS(alarmed))
|
(PARTITION p_2015_12 VALUES LESS THAN (736329) ENGINE = MyISAM,
|
PARTITION p_other VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
|
CREATE DATABASE BAR;
|
USE BAR;
|
CREATE TABLE `Archive` (
|
`event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
`alarmed` datetime DEFAULT NULL,
|
PRIMARY KEY (`event_id`, `alarmed`)
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
/*!50100 PARTITION BY RANGE (TO_DAYS(alarmed))
|
(PARTITION p_2015_12 VALUES LESS THAN (736329) ENGINE = MyISAM,
|
PARTITION p_other VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
|
CREATE DATABASE BAZ;
|
USE BAZ;
|
|
CREATE TABLE `Archive` (
|
`event_id` bigint(20) unsigned NOT NULL,
|
`alarmed` datetime DEFAULT NOW()
|
) ENGINE=CONNECT table_type=TBL table_list='FOO.Archive,BAR.Archive';
|
select * from Archive;
|
|
ERROR 1296 (HY000): Got error 174 'Error accessing FOO.Archive: This MySQL table is defined on itself' from CONNECT
|
|
USE msql;
|
select * from BAZ.Archive;
|
|
ERROR 1296 (HY000): Got error 174 'Error accessing FOO.Archive: This MySQL table is defined on itself' from CONNECT
|
|
use BAZ;
|
alter table Archive RENAME to Archive2;
|
|
select * from Archive2;
|
Empty set (0.00 sec)
|
|
use mysql;
|
select * from BAZ.Archive2;
|
Empty set (0.00 sec)
|
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
If the resulting table produced from a ENGINE=CONNECT table_type=TBL is the same name as one of the contained tables, attempt to query the new table fail with ERROR 1296 (HY000): Got error 174 'Error accessing FOO.Archive: This MySQL table is defined on itself' from CONNECT Here is how to reproduce CREATE DATABASE FOO; USE FOO; CREATE TABLE `Archive` ( `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `alarmed` datetime DEFAULT NULL, PRIMARY KEY (`event_id`, `alarmed`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (TO_DAYS(alarmed)) (PARTITION p_2015_12 VALUES LESS THAN (736329) ENGINE = MyISAM, PARTITION p_other VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */; CREATE DATABASE BAR; USE BAR; CREATE TABLE `Archive` ( `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `alarmed` datetime DEFAULT NULL, PRIMARY KEY (`event_id`, `alarmed`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (TO_DAYS(alarmed)) (PARTITION p_2015_12 VALUES LESS THAN (736329) ENGINE = MyISAM, PARTITION p_other VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */; CREATE DATABASE BAZ; USE BAZ; CREATE TABLE `Archive` ( `event_id` bigint(20) unsigned NOT NULL, `alarmed` datetime DEFAULT NOW() ) ENGINE=CONNECT table_type=TBL table_list='FOO.Archive,BAR.Archive'; select * from Archive; ERROR 1296 (HY000): Got error 174 'Error accessing FOO.Archive: This MySQL table is defined on itself' from CONNECT USE msql; select * from BAZ.Archive; ERROR 1296 (HY000): Got error 174 'Error accessing FOO.Archive: This MySQL table is defined on itself' from CONNECT use BAZ; alter table Archive RENAME to Archive2; select * from Archive2; Empty set (0.00 sec) use mysql; select * from BAZ.Archive2; Empty set (0.00 sec) |
If the resulting table produced from a ENGINE=CONNECT table_type=TBL is the same name as one of the contained tables, attempt to query the new table fail with {noformat} ERROR 1296 (HY000): Got error 174 'Error accessing FOO.Archive: This MySQL table is defined on itself' from CONNECT {noformat} Here is how to reproduce {noformat} CREATE DATABASE FOO; USE FOO; CREATE TABLE `Archive` ( `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `alarmed` datetime DEFAULT NULL, PRIMARY KEY (`event_id`, `alarmed`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (TO_DAYS(alarmed)) (PARTITION p_2015_12 VALUES LESS THAN (736329) ENGINE = MyISAM, PARTITION p_other VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */; {noformat} {noformat} CREATE DATABASE BAR; USE BAR; CREATE TABLE `Archive` ( `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `alarmed` datetime DEFAULT NULL, PRIMARY KEY (`event_id`, `alarmed`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (TO_DAYS(alarmed)) (PARTITION p_2015_12 VALUES LESS THAN (736329) ENGINE = MyISAM, PARTITION p_other VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */; {noformat} {noformat} CREATE DATABASE BAZ; USE BAZ; CREATE TABLE `Archive` ( `event_id` bigint(20) unsigned NOT NULL, `alarmed` datetime DEFAULT NOW() ) ENGINE=CONNECT table_type=TBL table_list='FOO.Archive,BAR.Archive'; {noformat} {noformat} select * from Archive; ERROR 1296 (HY000): Got error 174 'Error accessing FOO.Archive: This MySQL table is defined on itself' from CONNECT USE msql; select * from BAZ.Archive; ERROR 1296 (HY000): Got error 174 'Error accessing FOO.Archive: This MySQL table is defined on itself' from CONNECT use BAZ; alter table Archive RENAME to Archive2; select * from Archive2; Empty set (0.00 sec) use mysql; select * from BAZ.Archive2; Empty set (0.00 sec) {noformat} |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Fix Version/s | 10.0 [ 16000 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Affects Version/s | 10.0 [ 16000 ] | |
Affects Version/s | 10.1 [ 16100 ] | |
Affects Version/s | 10.1.8 [ 19605 ] | |
Assignee | Olivier Bertrand [ bertrandop ] |
Fix Version/s | 10.0.24 [ 21101 ] | |
Fix Version/s | 10.1.11 [ 21202 ] | |
Fix Version/s | 10.0 [ 16000 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | Confirmed [ 10101 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 72846 ] | MariaDB v4 [ 149888 ] |
Thanks for the report and test case.
I don't see anything in documentation that would justify the error, so it is most likely a bug.
Partitioning play no role in the scenario.