| Bug #35527 | Foreign keys: crash if self-reference in create ... as select | ||
|---|---|---|---|
| Submitted: | 24 Mar 2008 18:42 | Modified: | 27 Jun 2008 7:13 |
| Reporter: | Peter Gulutzan | ||
| Status: | Closed | ||
| Category: | Server | Severity: | S3 (Non-critical) |
| Version: | 6.1.0-fk-debug | OS: | Linux (SUSE 10 | 32-bit) |
| Assigned to: | Dmitri Lenev | Target Version: | 6.1 (MS2) |
| Triage: | D1 (Critical) | ||
[24 Mar 2008 18:42]
Peter Gulutzan
[24 Mar 2008 22:50]
Miguel Solorzano
Thank you for the bug report. [New Thread 1273313616 (LWP 26691)] 080324 18:48:05 [Note] Event Scheduler: Loaded 0 events 080324 18:48:05 [Note] /home/miguel/dbs/6.1fk/libexec/mysqld: ready for connections. Version: '6.1.0-fk-debug' socket: '/tmp/mysql.sock' port: 3306 Source distribution [New Thread 1273579856 (LWP 26693)] [Thread 1273579856 (LWP 26693) exited] [New Thread 1273579856 (LWP 26695)] mysqld: lock.cc:387: int lock_external(THD*, TABLE**, uint): Assertion `(*tables)->reginfo.lock_type >= TL_READ' failed. Program received signal SIGABRT, Aborted. [Switching to Thread 1273579856 (LWP 26695)] 0x0000003ef5830ec5 in raise () from /lib64/libc.so.6 (gdb) bt full #0 0x0000003ef5830ec5 in raise () from /lib64/libc.so.6 No symbol table info available. #1 0x0000003ef5832970 in abort () from /lib64/libc.so.6 No symbol table info available. #2 0x0000003ef582a11f in __assert_fail () from /lib64/libc.so.6 No symbol table info available. #3 0x00000000006e6cc5 in lock_external (thd=0x2066108, tables=0x20bcbf0, count=2) at lock.cc:387 <cut>
[27 Jun 2008 7:10]
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/48601 2678 Dmitry Lenev 2008-06-27 Fix for bug #35527 "Foreign keys: crash if self-reference in create ... as select" Execution of CREATE TABLE ... SELECT which contained foreign key definitions led to server crash due to failing debug assertion or errors about illegal constraint names for production builds. The first problem was caused by the fact that table list elements corresponding to the parent tables of foreign key constraints were added to both global table list and outer select of the statement but were not ready/intended for opening tables (didn't have lock_type properly set). The second problem occured because code implementing CREATE TABLE ... SELECT statement didn't call code generating names for constraints without explicit names. Full solution for both this problems will be implemented on one of the the later milestones of WL#148 "Foreign keys". This patch is a simple workaround which prevents server from asserting and emitting confusing errors.
[27 Jun 2008 7:13]
Dmitri Lenev
Patch implementing simple workaround for this problem was pushed into mysql-6.1-fk tree. Full blown solution for it will be implemented on one of later milestones of WL#148 "Foreign keys". Since this issue was reported against tree which is not publicly available yet I am simply closing this bug report.
