| Bug #36137 | virtual longlong Item_in_subselect::val_int(): Assertion `0' failed. | ||
|---|---|---|---|
| Submitted: | 16 Apr 2008 14:48 | Modified: | 30 May 2008 20:11 |
| Reporter: | Shane Bester | ||
| Status: | Closed | ||
| Category: | Server: Optimizer | Severity: | S2 (Serious) |
| Version: | 6.0.4-debug-nt, 6.0.5-bk | OS: | Any |
| Assigned to: | Bugs System | Target Version: | 6.0 |
| Triage: | D1 (Critical) | ||
[16 Apr 2008 14:48]
Shane Bester
[16 Apr 2008 15:14]
Miguel Solorzano
Thank you for the bug report. Verified as described on Suse 10.3 X64:
miguel@hegel:~/dbs> 6.0/bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 6.0.5-alpha-debug Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> drop table if exists `t1`;
Query OK, 0 rows affected (0.00 sec)
mysql> create table `t1` (`a` int,`b` int,key (`a`),key (`b`)) engine=myisam;
Query OK, 0 rows affected (0.10 sec)
mysql> insert into `t1` values (2,4),(2,4),(2,4);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select t1.a from t1 where t1.a not in (select 1 from t1) and
-> t1.a in (select 1 from t1 where t1.a in (select 1 from t1) group by t1.a );
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
[22 Apr 2008 8:31]
Sergey Petrunya
The crash happens only when both semi-join and materialization are enabled. If I set @@optimizer switch to disable semi-join, or materialization, or both, the crash goes away.
[23 Apr 2008 4:57]
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/45856 ChangeSet@1.2625, 2008-04-23 06:56:36+04:00, sergefp@mysql.com +3 -0 BUG#36137: virtual longlong Item_in_subselect::val_int(): Assertion `0' failed. - Call join->flatten_subqueries() before we call join->optimize(). If we don't do this, subquery predicates which were slated for conversion it semi-join nests will remain in the WHERE clause and will fire an assert when we attempt to evaluate them (this happens because these predicates have not undergone the mandatory IN->EXISTS rewrite)
[23 Apr 2008 7: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/45861 ChangeSet@1.2623, 2008-04-23 09:26:34+04:00, sergefp@mysql.com +3 -0 BUG#36137: virtual longlong Item_in_subselect::val_int(): Assertion `0' failed. - Call join->flatten_subqueries() before we call join->optimize() If we don't do this, subquery predicates which were slated for conversion into semi-join nests will remain half-converted and will fire an assert when we attempt to evaluate them.
[28 May 2008 12:02]
Bugs System
Pushed into 6.0.6-alpha
[30 May 2008 20:11]
Paul DuBois
Noted in 6.0.6 changelog. The combination of semi-join and materialization both being enabled could lead to assertion failure during subquery processing.
