[MDEV-3704] LP:878753 - Assertion `0' failed in replace_where_subcondition with derived_merge and first execution of prepared statement Created: 2011-10-20 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Philip Stoev (Inactive) | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
This query: SELECT * crashes when executed with derived_merge=ON, semijoin=ON and prepared statement. explain: id select_type table type possible_keys key key_len ref rows Extra optimizer switch: derived_merge=ON,semijoin=ON test case: CREATE TABLE t1 ( a varchar(1)) ; CREATE TABLE t2 ( a int(11), b int(11)) ; CREATE TABLE t3 ( a int(11) NOT NULL , b varchar(1)) ; SET SESSION optimizer_switch = 'derived_merge=on'; PREPARE st1 from " bzr version-info |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2011-10-26 ] |
|
Re: Assertion `0' failed in replace_where_subcondition with derived_merge and first execution of prepared statement |
| Comment by Philip Stoev (Inactive) [ 2011-10-26 ] |
|
Re: Assertion `0' failed in replace_where_subcondition with derived_merge and first execution of prepared statement CREATE TABLE t1 ( b int(11)) ; CREATE TABLE t2 (c int, b int, d varchar(52) NOT NULL ) ; CREATE TABLE t3 (b int(11)) ; SET SESSION optimizer_switch='semijoin=on,derived_merge=on'; |
| Comment by Sergei Petrunia [ 2011-11-02 ] |
|
Re: Assertion `0' failed in replace_where_subcondition with derived_merge and first execution of prepared statement |
| Comment by Sergei Petrunia [ 2011-11-02 ] |
|
Re: Assertion `0' failed in replace_where_subcondition with derived_merge and first execution of prepared statement Item **tree= (in_subq->emb_on_expr_nest == NO_JOIN_NEST)? ... if (!thd->stmt_arena->is_conventional()) { tree= (in_subq->emb_on_expr_nest == NO_JOIN_NEST)? &join->select_lex->prep_where : &(in_subq->emb_on_expr_nest->prep_on_expr); if (*tree && replace_where_subcondition(join, tree, replace_me, substitute, FALSE)) DBUG_RETURN(TRUE); }the assert happens inside the second invocation. We fail to replace Item_in_subselect in prep_on_expr, because prep_on_expr shares the "sub-item" that contains Item_in_subselect with on_expr. First, we do [successfull] replace in on_expr, which also makes the replace in prep_on_expr. |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 878753 |