Bug #55973 | Assertion `thd->transaction.stmt.is_empty()' on CREATE TABLE .. SELECT I_S.PART | ||
---|---|---|---|
Submitted: | 13 Aug 2010 15:35 | Modified: | 10 Sep 2010 3:02 |
Reporter: | Elena Stepanova | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.5.6-m3-debug, 5.6.1-m3-debug | OS: | Any |
Assigned to: | Jon Olav Hauglid | CPU Architecture: | Any |
Tags: | regression |
[13 Aug 2010 15:35]
Elena Stepanova
[16 Aug 2010 13:49]
Nirbhay Choubey
Similar failure noticed while running following set of statements on 5.5.6-m3-debug : USE test; CREATE TABLE IF NOT EXISTS `SERVER_INFO` (`ROW_FORMAT` varchar(10)); INSERT INTO `SERVER_INFO` (`ROW_FORMAT`) SELECT `ROW_FORMAT` FROM INFORMATION_SCHEMA.TABLES WHERE `TABLE_NAME`='dummy';
[17 Aug 2010 6:54]
Nirbhay Choubey
Selecting 'ENGINE' (instead of 'ROW_FORMAT') from INFORMATION_SCHEMA.TABLES, as in the above statement does not cause the assertion to fail.
[19 Aug 2010 14:27]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/116267 3114 Jon Olav Hauglid 2010-08-19 Bug #55973 Assertion `thd->transaction.stmt.is_empty()' on CREATE TABLE .. SELECT I_S.PART This assert could be triggered if an InnoDB table was created using CREATE TABLE ... AS SELECT where the query used an I_S table, and a view existed in the database. The assert was triggered if open_normal_and_derived_tables() failed and a statement transaction had been started. This will usually not happen as tables are opened before a statement transaction is started. However, CREATE TABLE ... AS SELECT starts a transaction in order to insert tuples into the new table. And if the SELECT is an I_S query, all current tables and views can be opened in order to fill the I_S table on the fly. If a view is discovered, open will fail as it is instructed to open tables only (OPEN_TABLE_ONLY). This would then trigger the assert. This patch fixes the problem by adjusting the assert to take into consideration the possibility of tables being opened as part of an I_S query. This is similar to what is already done for close_tables_for_reopen(). Test case added to information_schema_inno.test.
[20 Aug 2010 7:17]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/116332 3114 Jon Olav Hauglid 2010-08-20 Bug #55973 Assertion `thd->transaction.stmt.is_empty()' on CREATE TABLE .. SELECT I_S.PART This assert was triggered if an InnoDB table was created using CREATE TABLE ... AS SELECT where the query used an I_S table, and a view existed in the database. It would also be triggered for any statement changing an InnoDB table (e.g. INSERT, UPDATE, DELETE) which had a subquery referencing an I_S table. The assert was triggered if open_normal_and_derived_tables() failed and a statement transaction had been started. This will usually not happen as tables are opened before a statement transaction is started. However, e.g. CREATE TABLE ... AS SELECT starts a transaction in order to insert tuples into the new table. And if the subquery references an I_S table, all current tables and views can be opened in order to fill the I_S table on the fly. If a view is discovered, open will fail as it is instructed to open tables only (OPEN_TABLE_ONLY). This would cause the assert to be triggered. The assert was added in the patch for Bug#52044 and was therefore not in any released versions of the server. This patch fixes the problem by adjusting the assert to take into consideration the possibility of tables being opened as part of an I_S query. This is similar to what is already done for close_tables_for_reopen(). Test case added to information_schema_inno.test.
[20 Aug 2010 7:34]
Jon Olav Hauglid
Pushed to mysql-5.5-runtime (5.5.6-m3).
[25 Aug 2010 9:22]
Bugs System
Pushed into mysql-5.5 5.5.6-m3 (revid:alik@ibmvm-20100825092002-2yvkb3iwu43ycpnm) (version source revid:alik@ibmvm-20100825092002-2yvkb3iwu43ycpnm) (merge vers: 5.5.6-m3) (pib:20)
[30 Aug 2010 8:29]
Bugs System
Pushed into mysql-trunk 5.6.1-m4 (revid:alik@sun.com-20100830082732-n2eyijnv86exc5ci) (version source revid:alik@sun.com-20100830082732-n2eyijnv86exc5ci) (merge vers: 5.6.1-m4) (pib:21)
[30 Aug 2010 8:33]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100830082745-n6sh01wlwh3itasv) (version source revid:alik@sun.com-20100830082745-n6sh01wlwh3itasv) (pib:21)
[10 Sep 2010 3:02]
Paul DuBois
Noted in 5.5.6, 5.6.1 changelogs. An assertion was raised if (1) an InnoDB table was created using CREATE TABLE ... SELECT where the query used an INFORMATION_SCHEMA table and a view existed in the database; or (2) sny statement that modified an InnoDB table had a subquery referencing an INFORMATION_SCHEMA table.