[MDEV-3777] LP:612543 - Crash in Item_field::used_tables() with view + subquery + prepared statements Created: 2010-08-02 Updated: 2012-10-04 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Timour Katchaounov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad, MariaDB_5.3 | ||
| Attachments: |
|
| Description |
|
When executing the following query as a prepared statement twice, maria 5.3 crashes if certain optimizations are disabled. 5.2 is not affected. query: SELECT table1 .`col_int_key` explain: id select_type table type possible_keys key key_len ref rows filtered Extra backtrace: #3 0x0827e86a in handle_segfault (sig=11) at mysqld.cc:2703 |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2010-08-02 ] | |||||||||
|
Re: Crash in Item_field::used_tables() with view + subquery + prepared statements CREATE TABLE `B` ( INSERT INTO `B` VALUES (1,1,7,'1900-01-01','1900-01-01','01:13:38','01:13:38','2005-02-05 00:00:00','2005-02-05 00:00:00','f','f'); CREATE VIEW `view_B` AS select * FROM B; CREATE TABLE `C` ( INSERT INTO `C` VALUES (2,'w','w'); PREPARE st1 FROM "SELECT table1 .`col_int_key` EXECUTE st1; | |||||||||
| Comment by Philip Stoev (Inactive) [ 2011-02-26 ] | |||||||||
|
Re: Crash in Item_field::used_tables() with view + subquery + prepared statements simplified test case: SET SESSION optimizer_switch = 'partial_match_rowid_merge=off,partial_match_table_scan=off,semijoin=off,subquery_cache=off'; CREATE TABLE t1 ( f1 int(11), f2 varchar(1)); CREATE TABLE t2 ( f3 varchar(1)); CREATE VIEW v2 AS SELECT * FROM t2; PREPARE st1 FROM "SELECT * EXECUTE st1; | |||||||||
| Comment by Igor Babaev [ 2011-03-04 ] | |||||||||
|
Re: Crash in Item_field::used_tables() with view + subquery + prepared statements insert into t1 values (2,'x'), (5,'y'); one still have a crash on the second execution of the prepared statement: MariaDB [test]> PREPARE st1 FROM "SELECT * FROM t1 JOIN v2 ON t1.f2 > 'a' WHERE v2.f3 IN ( SELECT f2 FROM t1 )"; MariaDB [test]> EXECUTE st1;
-----
----- MariaDB [test]> EXECUTE st1; | |||||||||
| Comment by Timour Katchaounov (Inactive) [ 2011-03-08 ] | |||||||||
|
Re: Crash in Item_field::used_tables() with view + subquery + prepared statements The most likely reason there is no crash in mwl89 is that in mwl89 (see LP BUG#611396 - both bugs exposes a general problem with | |||||||||
| Comment by Timour Katchaounov (Inactive) [ 2011-03-08 ] | |||||||||
|
Re: Crash in Item_field::used_tables() with view + subquery + prepared statements CREATE TABLE t1 ( f1 int(11), f2 varchar(1)); set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off'; set @@optimizer_switch='materialization=off,in_to_exists=on,semijoin=off'; set @@optimizer_switch='materialization=on,in_to_exists=on,semijoin=off'; | |||||||||
| Comment by Timour Katchaounov (Inactive) [ 2011-07-07 ] | |||||||||
|
Re: Crash in Item_field::used_tables() with view + subquery + prepared statements | |||||||||
| Comment by Timour Katchaounov (Inactive) [ 2011-07-07 ] | |||||||||
|
Re: Crash in Item_field::used_tables() with view + subquery + prepared statements | |||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | |||||||||
|
Launchpad bug id: 612543 |