Bug #47649 | crash during CALL procedure | ||
---|---|---|---|
Submitted: | 25 Sep 2009 13:25 | Modified: | 12 Mar 2010 17:21 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S3 (Non-critical) |
Version: | 5.1,6.0.14 | OS: | Any |
Assigned to: | Sergei Glukhov | CPU Architecture: | Any |
[25 Sep 2009 13:25]
Matthias Leich
[25 Sep 2009 13:49]
Peter Laursen
I do not get crash with 5.1.39 (64 bit) on Windows. Only 'table does not exist'. -- but I do not understand the meaning of the line reading 'f1' either so I skipped it.
[25 Sep 2009 22:19]
Matthias Leich
Hi, my mysql-5.1-bugteam shows this bug and says it is of version "5.1.39-debug-log". I guess you mean with "the line reading 'f1' " the CREATE VIEW t3 AS SELECT f1 ... The test is pure artificial. A run of the RandomQueryGenerator (RQG) with a huge grammar which runs aggressive DDL. After detecting a problem the testcase gets shrinked = statements and columns which are not required for the bad effect get removed. This makes debugging easier. Therefore statements or table definitions look ugly. The current bug is IMHO more important for testing with RQG (I do not want to abort because of such a crash and I cannot avoid that RQG invents such "crap") than for a user with a production or development scenario. RQG tests with a lot dense and aggressive DDL try to simulate "accidents" which could happen if a DBA makes typo's, is careless, whatever ... Regards Matthias
[25 Sep 2009 22:37]
Peter Laursen
@Mathias .. your wrote an example like this: CREATE TABLE t1 ( f1 integer, primary key (f1)); CREATE TABLE t2 LIKE t1; CREATE TEMPORARY TABLE t3 LIKE t1; CREATE PROCEDURE p1 () BEGIN SELECT f1 FROM t3 AS A WHERE A.f1 IN ( SELECT f1 FROM t3 ) ; END| CALL p1; ERROR HY000: Can't reopen table: 'A' CREATE VIEW t3 AS SELECT f1 FROM t2 A WHERE A.f1 IN ( SELECT f1 FROM t2 ); DROP TABLE t3; CALL p1; f1 DROP TABLE t3; ERROR 42S02: Unknown table 't3' CALL p1; ERROR HY000: Lost connection to MySQL server during query There is a line reading "f1" only.
[28 Sep 2009 6:17]
MySQL Verification Team
repeatable with following crash on 5.1.38 on win32.....
Attachment: bug47649_5.1.38_crash.txt (text/plain), 3.71 KiB.
[28 Sep 2009 6:34]
MySQL Verification Team
5.1.39 results under valgrind - look at all those invalid reads/writes!!
Attachment: bug47649_5.1.39_valgrind_errors.txt (text/plain), 41.16 KiB.
[28 Sep 2009 10:37]
Matthias Leich
Hi Peter, now I understand what you mean. You refer to the protocol and not to my script. The single line with "f1" is no statement. This is the empty result set produced by the preceding "CALL p1". Regards Matthias
[17 Nov 2009 11:15]
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/90642 3147 Sergey Glukhov 2009-11-17 Bug#47649 crash during CALL procedure If first call of the procedure is failed on the open_table stage stmt_arena->state is set to EXECUTED state. On second call(if no errors on open_table stage) it leads to use of worng memory arena in find_field_in_view() function as thd->stmt_arena->is_stmt_prepare_or_first_sp_execute() returns FALSE for EXECUTED state. The item is created not in its own arena and it leads to crash on further calls of the procedure. The fix: change state of arena only if no errors on open_table stage happens. @ mysql-test/r/sp.result test result @ mysql-test/t/sp.test test case @ sql/sp_head.cc If first call of the procedure is failed on the open_table stage stmt_arena->state is set to EXECUTED state. On second call(if no errors on open_table stage) it leads to use of worng memory arena in find_field_in_view() function as thd->stmt_arena->is_stmt_prepare_or_first_sp_execute() returns FALSE for EXECUTED state. The item is created not in its own arena and it leads to crash on further calls of the procedure. The fix: change state of arena only if no errors on open_table stage happens.
[1 Dec 2009 16:20]
Georgi Kodinov
Bug #48760 is a marked as a duplicate of this one.
[23 Dec 2009 11:26]
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/95490 3147 Sergey Glukhov 2009-12-23 Bug#47649 crash during CALL procedure If first call of the procedure is failed on the open_table stage stmt_arena->state is set to EXECUTED state. On second call(if no errors on open_table stage) it leads to use of worng memory arena in find_field_in_view() function as thd->stmt_arena->is_stmt_prepare_or_first_sp_execute() returns FALSE for EXECUTED state. The item is created not in its own arena and it leads to crash on further calls of the procedure. The fix: change state of arena only if no errors on open_table stage happens. @ mysql-test/t/sp.test If first call of the procedure is failed on the open_table stage stmt_arena->state is set to EXECUTED state. On second call(if no errors on open_table stage) it leads to use of worng memory arena in find_field_in_view() function as thd->stmt_arena->is_stmt_prepare_or_first_sp_execute() returns FALSE for EXECUTED state. The item is created not in its own arena and it leads to crash on further calls of the procedure. The fix: change state of arena only if no errors on open_table stage happens.
[23 Dec 2009 13:44]
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/95540 3294 Sergey Glukhov 2009-12-23 Bug#47649 crash during CALL procedure If first call of the procedure is failed on the open_table stage stmt_arena->state is set to EXECUTED state. On second call(if no errors on open_table stage) it leads to use of worng memory arena in find_field_in_view() function as thd->stmt_arena->is_stmt_prepare_or_first_sp_execute() returns FALSE for EXECUTED state. The item is created not in its own arena and it leads to crash on further calls of the procedure. The fix: change state of arena only if no errors on open_table stage happens. @ mysql-test/r/sp.result test result @ mysql-test/t/sp.test test case @ sql/sp_head.cc If first call of the procedure is failed on the open_table stage stmt_arena->state is set to EXECUTED state. On second call(if no errors on open_table stage) it leads to use of worng memory arena in find_field_in_view() function as thd->stmt_arena->is_stmt_prepare_or_first_sp_execute() returns FALSE for EXECUTED state. The item is created not in its own arena and it leads to crash on further calls of the procedure. The fix: change state of arena only if no errors on open_table stage happens.
[15 Jan 2010 9:01]
Bugs System
Pushed into 5.1.43 (revid:joro@sun.com-20100115085139-qkh0i0fpohd9u9p5) (version source revid:sergey.glukhov@sun.com-20091223134403-p8lee8eve2riql83) (merge vers: 5.1.42) (pib:16)
[16 Jan 2010 1:25]
Paul DuBois
Noted in 5.1.43 changelog. If an invocation of a stored procedure failed in the table-open stage, subsequent invocations that did not fail in that stage could cause a crash. Setting report to NDI pending push to 5.5.x+.
[5 Feb 2010 11:46]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100204063540-9czpdmpixi3iw2yb) (version source revid:alik@sun.com-20100119163614-172adculixyu26j5) (pib:16)
[5 Feb 2010 11:52]
Bugs System
Pushed into 6.0.14-alpha (revid:alik@sun.com-20100205113942-oqovjy0eoqbarn7i) (version source revid:alik@sun.com-20100204064210-ljwanqvrjs83s1gq) (merge vers: 6.0.14-alpha) (pib:16)
[5 Feb 2010 11:58]
Bugs System
Pushed into 5.5.2-m2 (revid:alik@sun.com-20100203172258-1n5dsotny40yufxw) (version source revid:alexey.kopytov@sun.com-20091225105650-qletdbs0wz9sx5nc) (merge vers: 5.5.1-m2) (pib:16)
[5 Feb 2010 16:58]
Paul DuBois
Noted in 5.5.2, 6.0.14 changelogs. Setting report to Need Merge pending push to Celosia.
[12 Mar 2010 14:12]
Bugs System
Pushed into 5.1.44-ndb-7.0.14 (revid:jonas@mysql.com-20100312135944-t0z8s1da2orvl66x) (version source revid:jonas@mysql.com-20100312115609-woou0te4a6s4ae9y) (merge vers: 5.1.44-ndb-7.0.14) (pib:16)
[12 Mar 2010 14:28]
Bugs System
Pushed into 5.1.44-ndb-6.2.19 (revid:jonas@mysql.com-20100312134846-tuqhd9w3tv4xgl3d) (version source revid:jonas@mysql.com-20100312060623-mx6407w2vx76h3by) (merge vers: 5.1.44-ndb-6.2.19) (pib:16)
[12 Mar 2010 14:44]
Bugs System
Pushed into 5.1.44-ndb-6.3.33 (revid:jonas@mysql.com-20100312135724-xcw8vw2lu3mijrhn) (version source revid:jonas@mysql.com-20100312103652-snkltsd197l7q2yg) (merge vers: 5.1.44-ndb-6.3.33) (pib:16)
[12 Mar 2010 17:21]
Paul DuBois
Fixed in earlier 5.1.x, 5.5.x.