Bug #49445 Assertion failed: 0, file .\item_row.cc, line 55 with fulltext search and row op
Submitted: 4 Dec 2009 4:15 Modified: 12 Mar 2010 16:39
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S1 (Critical)
Version:5.0.88-debug, 5.1.41-debug, 5.1.43-debug OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any
Tags: assertion, fulltext, row
Triage: Triaged: D2 (Serious)

[4 Dec 2009 4:15] Shane Bester
Description:
Version: '5.1.41-enterprise-gpl-advanced-debug'  socket: ''  port: 3306  MySQL Enterprise Server - Advanced Edition Debug (GPL)
Assertion failed: 0, file .\item_row.cc, line 55

mysqld-debug.exe!my_sigabrt_handler()[mysqld.cc:2048]
mysqld-debug.exe!raise()[winsig.c:597]
mysqld-debug.exe!abort()[abort.c:78]
mysqld-debug.exe!_wassert()[assert.c:212]
mysqld-debug.exe!Item_row::illegal_method_call()[item_row.cc:55]
mysqld-debug.exe!Item_row::val_real()[item_row.h:44]
mysqld-debug.exe!add_ft_keys()[sql_select.cc:3635]
mysqld-debug.exe!add_ft_keys()[sql_select.cc:3654]
mysqld-debug.exe!update_ref_and_keys()[sql_select.cc:3872]
mysqld-debug.exe!make_join_statistics()[sql_select.cc:2670]
mysqld-debug.exe!JOIN::optimize()[sql_select.cc:979]
mysqld-debug.exe!mysql_select()[sql_select.cc:2421]
mysqld-debug.exe!handle_select()[sql_select.cc:269]
mysqld-debug.exe!execute_sqlcom_select()[sql_parse.cc:5051]
mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:2246]
mysqld-debug.exe!mysql_parse()[sql_parse.cc:5974]
mysqld-debug.exe!dispatch_command()[sql_parse.cc:1233]
mysqld-debug.exe!do_command()[sql_parse.cc:872]
mysqld-debug.exe!handle_one_connection()[sql_connect.cc:1127]
mysqld-debug.exe!pthread_start()[my_winthread.c:85]
mysqld-debug.exe!_callthreadstart()[thread.c:295]
mysqld-debug.exe!_threadstart()[thread.c:277]

How to repeat:
run this against a debug server:

drop table if exists `t1`;
create table `t1`(`a` char(1),fulltext(`a`))engine=myisam;
select 1 from `t1` where match(a) against ('')
and row(`a`,`a`)>row(1,1);
[4 Dec 2009 4:34] Valeriy Kravchuk
mysql-6.0-codebase does not crash:

mysql> drop table if exists `t1`;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> create table `t1`(`a` char(1),fulltext(`a`))engine=myisam;
Query OK, 0 rows affected (0.40 sec)

mysql> select 1 from `t1` where match(a) against ('')
    -> and row(`a`,`a`)>row(1,1);
Empty set (0.00 sec)

mysql> select version();
+--------------------+
| version()          |
+--------------------+
| 6.0.14-alpha-debug |
+--------------------+
1 row in set (0.00 sec)
[4 Dec 2009 4:38] Valeriy Kravchuk
Verified just as described with recent 5.1.43 from bzr:

091204  6:35:34 [Note] /Users/openxs/dbs/5.1/libexec/mysqld: ready for connections.
Version: '5.1.43-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
Assertion failed: (0), function unknown function, file item_row.cc, line 55.
091204  6:35:58 - mysqld got signal 6 ;
[8 Dec 2009 7:04] Shane Bester
no need for private flag for a debug assertion. release build didn't crash.
[19 Jan 2010 15:37] 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/97399

3325 Georgi Kodinov	2010-01-19
      Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with
        fulltext search and row op.
      
      The search for fulltext indexes is searching for some special 
      predicate layouts. While doing so it's not checking for the number
      of columns of the expressions it tries to calculate.
      And since row expressions can't return a single scalar value there
      was a crash.
      Fixed by checking if the expressions are scalar (in addition to 
      being constant) before calling Item::val_xxx() methods.
[2 Feb 2010 16:38] 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/98974

3325 Georgi Kodinov	2010-02-02
      Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with
        fulltext search and row op.
      
      The search for fulltext indexes is searching for some special 
      predicate layouts. While doing so it's not checking for the number
      of columns of the expressions it tries to calculate.
      And since row expressions can't return a single scalar value there
      was a crash.
      Fixed by checking if the expressions are scalar (in addition to 
      being constant) before calling Item::val_xxx() methods.
[2 Feb 2010 16:39] 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/98975

3350 Georgi Kodinov	2010-02-02
      Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with
        fulltext search and row op.
      
      The search for fulltext indexes is searching for some special 
      predicate layouts. While doing so it's not checking for the number
      of columns of the expressions it tries to calculate.
      And since row expressions can't return a single scalar value there
      was a crash.
      Fixed by checking if the expressions are scalar (in addition to 
      being constant) before calling Item::val_xxx() methods.
[4 Feb 2010 10:19] Bugs System
Pushed into 5.1.44 (revid:joro@sun.com-20100204101444-2j32mhqroo0iiio6) (version source revid:joro@sun.com-20100202163756-pcodpzopka4rkehf) (merge vers: 5.1.43) (pib:16)
[5 Feb 2010 11:47] Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100204063540-9czpdmpixi3iw2yb) (version source revid:alik@sun.com-20100203201557-h88bg1knpuvt7932) (pib:16)
[5 Feb 2010 11:53] 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:59] Bugs System
Pushed into 5.5.2-m2 (revid:alik@sun.com-20100203172258-1n5dsotny40yufxw) (version source revid:alik@sun.com-20100203172258-1n5dsotny40yufxw) (merge vers: 5.5.2-m2) (pib:16)
[10 Feb 2010 19:35] Paul Dubois
Noted in 5.1.44, 5.5.2, 6.0.14 changelogs.

Mixing full-text searches and row expressions caused a crash.  

Setting report to Need Merge pending push to Celosia.
[12 Mar 2010 14:11] 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:27] 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:42] 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 16:39] Paul Dubois
Fixed in earlier 5.1.x, 5.5.x.