Bug #31440 'select 1 regex null' asserts debug server
Submitted: 8 Oct 2007 7:13 Modified: 30 Oct 2007 1:08
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Data Types Severity:S3 (Non-critical)
Version:4.1.21-debug, 5.0.50-debug, 5.1.23-debug OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any
Tags: assertion, REGEXP

[8 Oct 2007 7:13] Shane Bester
Description:
Assertion failed: fixed == 1, file .\item_cmpfunc.cpp, line 4282

mysqld-debug.exe!_NMSG_WRITE
mysqld-debug.exe!abort
mysqld-debug.exe!_wassert
mysqld-debug.exe!Item_func_regex::val_int
mysqld-debug.exe!Item::send
mysqld-debug.exe!select_send::send_data
mysqld-debug.exe!JOIN::exec
mysqld-debug.exe!mysql_select
mysqld-debug.exe!handle_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!_callthreadstart
mysqld-debug.exe!_threadstart

How to repeat:
select 1 regexp null;
[11 Oct 2007 8:29] 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/35323

ChangeSet@1.2537, 2007-10-11 11:29:26+03:00, gkodinov@magare.gmz +3 -0
  Bug #31440: 'select 1 regex null' asserts debug server
  
  The special case with NULL as a regular expression
  was handled at prepare time. But in this special case
  the item was not marked as fixed. This caused an assertion
  at execution time.
  Fixed my marking the item as fixed even when known to 
  return NULL at prepare time.
[29 Oct 2007 8:43] Bugs System
Pushed into 5.0.52
[29 Oct 2007 8:46] Bugs System
Pushed into 5.1.23-beta
[29 Oct 2007 8:50] Bugs System
Pushed into 6.0.4-alpha
[30 Oct 2007 1:08] Paul DuBois
Noted in 5.0.52, 5.1.23, 6.0.4 changelogs.

SELECT 1 REGEX NULL caused an assertion failure for debug servers.