Bug #32262 crash with decimal column...
Submitted: 11 Nov 2007 14:47 Modified: 19 Nov 2007 5:22
Reporter: Shane Bester
Status: Closed
Category:Server: Optimizer Severity:S1 (Critical)
Version:6.0.3, 6.0.4 OS:Any
Assigned to: Gleb Shchepa Target Version:

[11 Nov 2007 14:47] Shane Bester
Description:
when comparing a decimal value to a string, the server crashed with stack trace.

mysqld-debug.exe!check_quick_select
mysqld-debug.exe!get_best_group_min_max
mysqld-debug.exe!SQL_SELECT::test_quick_select
mysqld-debug.exe!get_quick_record_count
mysqld-debug.exe!make_join_statistics
mysqld-debug.exe!JOIN::optimize
mysqld-debug.exe!mysql_select
mysqld-debug.exe!mysql_derived_filling
mysqld-debug.exe!mysql_handle_derived
mysqld-debug.exe!open_and_lock_tables
mysqld-debug.exe!execute_sqlcom_select
mysqld-debug.exe!mysql_execute_command
mysqld-debug.exe!mysql_parse
mysqld-debug.exe!dispatch_command
mysqld-debug.exe!do_command
mysqld-debug.exe!handle_one_connection
mysqld-debug.exe!pthread_start
mysqld-debug.exe!_threadstart

How to repeat:
drop table if exists `t1`;
create table `t1`( `col0` decimal(10,0),index(`col0`))engine=myisam;
insert into `t1` values (1),(2),(3);
select `col0` from `t1` where `col0` >= 'a' group by 1;

I could not repeat this on 5.0 or 5.1.
[12 Nov 2007 16:52] 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/37583

ChangeSet@1.2683, 2007-11-12 19:52:48+04:00, gshchepa@gleb.loc +3 -0
  Fixed bug #32262: crash with decimal column.
  
  The server crashed on optimization of queries
  with a comparison of an indexed decimal column with
  a string value.
[15 Nov 2007 21:20] 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/37888

ChangeSet@1.2663, 2007-11-15 23:18:38+03:00, sergefp@mysql.com +3 -0
  Merging Gleb's fix:
  Fixed bug #32262: crash with decimal column.
  
  The server crashed on optimization of queries
  with a comparison of an indexed decimal column with
  a string value.
[16 Nov 2007 10:36] Bugs System
Pushed into 6.0.4-alpha
[16 Nov 2007 17:01] 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/37961

ChangeSet@1.2634, 2007-11-16 18:59:44+03:00, sergefp@mysql.com +3 -0
  Merging Gleb's fix:
  Fixed bug #32262: crash with decimal column.
  
  The server crashed on optimization of queries
  with a comparison of an indexed decimal column with
  a string value.
[19 Nov 2007 5:22] Paul DuBois
Noted in 6.0.4 changelog.
[21 Nov 2007 19:54] Bugs System
Pushed into 6.0.4-alpha
[22 Nov 2007 11:54] Stefan Hinz
Moved from 6.0.4 to 6.0.3 as per Build team; changelog revised accordingly.
[29 Nov 2007 13:53] Bugs System
Pushed into 6.0.4-alpha