Bug #30715 Assertion failed: item_field->field->real_maybe_null(), file .\opt_sum.cc, line
Submitted: 30 Aug 2007 5:37 Modified: 19 Nov 2007 4:53
Reporter: Ken Chen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.0.45-debug, 5.0, 5.1.23-debug, 5.2 BK OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any
Tags: assertion, crash, innodb, myisam

[30 Aug 2007 5:37] Ken Chen
Description:
Before, I am using binary distribution, but it crash times a day. I try to install with source and turn debug. It crash quickly in one hour.

The messages in .err

mysqld: opt_sum.cc:263: int opt_sum_query(TABLE_LIST*, List<Item>&, COND*): Assertion `item_field->field->real_maybe_null()' failed
070830 13:17:05 - mysqld got signal 6;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=268435456
read_buffer_size=1044480 
max_used_connections=151 
max_connections=160
threads_connected=131
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 589182 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0xa0db3a0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went   
terribly wrong...
Cannot determine thread, fp=0x7d3940a8, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x81835d3
0x47f402 
0x4f70a451
0x4f70224b
0x824dcc2 
0x81e8b67 
0x81f5487 
0x81f5aa3 
0x81a097e 
0x81a18d2 
0x81a24be 
0x81a378f 
0x81a4419 
0x4f8532db
0x4f7ad14e
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/using-stack-trace.html and follow instructions on how to resolve the stack trace. Res
stack trace is much more helpful in diagnosing the problem, so please do 
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xa478070 = SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01'
thd->thread_id=2604
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash. 
Writing a core file

How to repeat:
no idea.
[30 Aug 2007 5:39] Ken Chen
The stack trace result:

[root@db1 /tmp]# resolve_stack_dump -s /tmp/mysqld.sym -n mysql.stack
0x81835d3 handle_segfault + 563
0x47f402 (?)
0x4f70a451 _end + 1192000145
0x4f70224b _end + 1191966859
0x824dcc2 _Z13opt_sum_queryP13st_table_listR4ListI4ItemEPS2_ + 1184
0x81e8b67 _ZN4JOIN8optimizeEv + 1305
0x81f5487 _Z12mysql_selectP3THDPPP4ItemP13st_table_listjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_sel + 1493
0x81f5aa3 _Z13handle_selectP3THDP6st_lexP13select_resultm + 467
0x81a097e _Z21mysql_execute_commandP3THD + 25676
0x81a18d2 _Z11mysql_parseP3THDPKcjPS2_ + 344
0x81a24be _Z16dispatch_command19enum_server_commandP3THDPcj + 2660
0x81a378f _Z10do_commandP3THD + 537
0x81a4419 handle_one_connection + 2977
0x4f8532db _end + 1193347355
0x4f7ad14e _end + 1192667022
[30 Aug 2007 5:47] Ken Chen
[root@db1 mysql]# free
             total       used       free     shared    buffers     cached
Mem:       4025380    3897648     127732          0      54632    2806004
-/+ buffers/cache:    1037012    2988368
Swap:      2031608         52    2031556

[root@db1 mysql]# uname -a
Linux db1.xxxx.com 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

 8404 pts/0    S      0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --port=3307 --bind-address=192.168.4.233 --socket=/tmp/mysql2.sock --character-set-server=utf8 --init_connect=SET NAMES utf8 --datadir=/usr/local/mysql/data2 --max_connections=160 --interactive_timeout=15 --nice=-18 --thread_concurrency=8 --open-files-limit=8192 --core-file --log --skip-locking --key_buffer=256M --max_allowed_packet=1M --table_cache=300 --sort_buffer_size=1M --read_buffer_size=1M --read_rnd_buffer_size=1M --myisam_sort_buffer_size=32M --thread_cache_size=32 --query_cache_size=32M --tmp_table_size=16M --relay-log=db2-relay-bin --server-id=23301 --log-bin=mysql-bin --skip-bdb --innodb_data_home_dir=/usr/local/mysql/data2/ --innodb_data_file_path=ibdata1:2G:autoextend:max:8G --innodb_buffer_pool_size=512M --innodb_additional_mem_pool_size=4M --innodb_log_file_size=128M --innodb_log_buffer_size=8M --innodb_flush_log_at_trx_commit=1 --innodb_lock_wait_timeout=30 --innodb_file_per_table --replicate-ignore-table=friend.SendVKiss --replicate-wild-ignore-table=friend.fc_% --replicate-wild-ignore-table=friend._search_result_%
 8785 pts/0    S<l   10:21 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data2 --user=mysql --pid-file=/usr/local/mysql/data2/db1.topfong.com.pid --skip-external-locking --open-files-limit=8192 --port=3307 --socket=/tmp/mysql2.sock --bind-address=192.168.4.233 --character-set-server=utf8 --init_connect=SET NAMES utf8 --max_connections=160 --interactive_timeout=15 --thread_concurrency=8 --core-file --log --skip-locking --key_buffer=256M --max_allowed_packet=1M --table_cache=300 --sort_buffer_size=1M --read_buffer_size=1M --read_rnd_buffer_size=1M --myisam_sort_buffer_size=32M --thread_cache_size=32 --query_cache_size=32M --tmp_table_size=16M --relay-log=db2-relay-bin --server-id=23301 --log-bin=mysql-bin --skip-bdb --innodb_data_home_dir=/usr/local/mysql/data2/ --innodb_data_file_path=ibdata1:2G:autoextend:max:8G --innodb_buffer_pool_size=512M --innodb_additional_mem_pool_size=4M --innodb_log_file_size=128M --innodb_log_buffer_size=8M --innodb_flush_log_at_trx_commit=1 --innodb_lock_wait_timeout=30 --innodb_file_per_table --replicate-ignore-table=friend.SendVKiss --replicate-wild-ignore-table=friend.fc_% --replicate-wild-ignore-table=friend._search_result_%
[root@db1 mysql]#
[30 Aug 2007 5:49] Valeriy Kravchuk
Thank you for a problem report. Please, send the results of SHOW CREATE TABLE and SHOW TABLE STATUS for your daily table used in the query. Send the results of:

EXPLAIN SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01'\G

also.
[30 Aug 2007 5:51] Ken Chen
I don't find the core file, where is it or what I miss?

Before I finish the bug report, it crashed again.

[root@db1 tmp]# resolve_stack_dump -s /tmp/mysqld.sym -n qq
0x81835d3 handle_segfault + 563
0xbc3402 (?)
0x4f70a451 _end + 1192000145
0x4f70224b _end + 1191966859
0x824dcc2 _Z13opt_sum_queryP13st_table_listR4ListI4ItemEPS2_ + 1184
0x81e8b67 _ZN4JOIN8optimizeEv + 1305
0x81f5487 _Z12mysql_selectP3THDPPP4ItemP13st_table_listjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_sel + 1493
0x81f5aa3 _Z13handle_selectP3THDP6st_lexP13select_resultm + 467
0x81a097e _Z21mysql_execute_commandP3THD + 25676
0x81a18d2 _Z11mysql_parseP3THDPKcjPS2_ + 344
0x81a24be _Z16dispatch_command19enum_server_commandP3THDPcj + 2660
0x81a378f _Z10do_commandP3THD + 537
0x81a4419 handle_one_connection + 2977
0x4f8532db _end + 1193347355
0x4f7ad14e _end + 1192667022
[30 Aug 2007 6:03] Ken Chen
mysql> SHOW CREATE TABLE daily\G
*************************** 1. row ***************************
       Table: daily
Create Table: CREATE TABLE `daily` (
  `uid` bigint(10) unsigned NOT NULL auto_increment,
  `memberID` bigint(10) unsigned NOT NULL default '0',
  `date` date NOT NULL default '0000-00-00',
  `created` datetime NOT NULL,
  `mood` smallint(6) NOT NULL default '0',
  `text` text NOT NULL,
  `private` set('no','hot','me','adult') NOT NULL default 'no',
  `good` int(10) unsigned NOT NULL default '0',
  `view` int(10) unsigned NOT NULL default '0',
  `checkcode` varchar(32) NOT NULL default '',
  `Notify` enum('y','n') NOT NULL default 'n',
  `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `attrib` enum('user','gold','free') NOT NULL default 'user',
  PRIMARY KEY  (`uid`),
  UNIQUE KEY `memberID_2` (`memberID`,`date`),
  KEY `date` (`date`,`private`,`uid`),
  KEY `diaryLast` (`memberID`,`created`)
) ENGINE=InnoDB AUTO_INCREMENT=1695840 DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

mysql> SHOW TABLE STATUS LIKE "daily"\G
*************************** 1. row ***************************
           Name: daily
         Engine: InnoDB
        Version: 10
     Row_format: Compact
           Rows: 1429273
 Avg_row_length: 802
    Data_length: 1147142144
Max_data_length: 0
   Index_length: 185516032
      Data_free: 0
 Auto_increment: 1695840
    Create_time: 2007-08-28 09:50:52
    Update_time: NULL
     Check_time: NULL
      Collation: utf8_general_ci
       Checksum: NULL
 Create_options: 
        Comment: InnoDB free: 6144 kB
1 row in set (0.15 sec)

I tried many times, the 'EXPLAIN SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01'\G' will make mysql crashing! I will send the information later.
[30 Aug 2007 6:09] Ken Chen
When I use 'EXPLAIN SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01'\G', the mysqld crash.

[root@db1 /tmp]# resolve_stack_dump -s /tmp/mysqld.sym -n explain1
0x81835d3 handle_segfault + 563
0x4a7402 (?)
0x4f70a451 _end + 1192000145
0x4f70224b _end + 1191966859
0x824dcc2 _Z13opt_sum_queryP13st_table_listR4ListI4ItemEPS2_ + 1184
0x81e8b67 _ZN4JOIN8optimizeEv + 1305
0x81f5487 _Z12mysql_selectP3THDPPP4ItemP13st_table_listjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_sel + 1493
0x81f588f _Z19mysql_explain_unionP3THDP18st_select_lex_unitP13select_result + 533
0x819aa35 _Z21mysql_execute_commandP3THD + 1283
0x81a18d2 _Z11mysql_parseP3THDPKcjPS2_ + 344
0x81a24be _Z16dispatch_command19enum_server_commandP3THDPcj + 2660
0x81a378f _Z10do_commandP3THD + 537
0x81a4419 handle_one_connection + 2977
0x4f8532db _end + 1193347355
0x4f7ad14e _end + 1192667022

The log file:

070830 14:05:53 [Note] /usr/local/mysql/libexec/mysqld: ready for connections.
Version: '5.0.45-debug-log'  socket: '/tmp/mysql2.sock'  port: 3307  Source distribution
mysqld: opt_sum.cc:263: int opt_sum_query(TABLE_LIST*, List<Item>&, COND*): Assertion `item_field->field->real_maybe_null()' failed
070830 14:05:59 - mysqld got signal 6;
This could be because you hit a bug. It is also possible that this binary    
or one of the libraries it was linked against is corrupt, improperly built,  
or misconfigured. This error can also be caused by malfunctioning hardware.  
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=268435456
read_buffer_size=1044480
max_used_connections=5
max_connections=160
threads_connected=5
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 589182 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0xae487b0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x7dcc50a8, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x81835d3 
0x4a7402  
0x4f70a451
0x4f70224b
0x824dcc2 
0x81e8b67 
0x81f5487 
0x81f588f 
0x819aa35 
0x81a18d2 
0x81a24be 
0x81a378f 
0x81a4419 
0x4f8532db
0x4f7ad14e
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/using-stack-trace.html and follow instructions on how to resolve the stack trace. Res
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0xae5f2d8 = EXPLAIN SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01'
thd->thread_id=2
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file

Number of processes running now: 0
[30 Aug 2007 6:12] Ken Chen
The statement is executed on the slave server. It's mysql 5.0.45 binary distribution, and is on a FreeBSD 6.2 box.

mysql> EXPLAIN SELECT MIN(date) FROM daily WHERE memberID='8014' AND
    -> date>'2007-08-01'\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: NULL
         type: NULL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: NULL
        Extra: Select tables optimized away
1 row in set (0.01 sec)

mysql>
[30 Aug 2007 6:14] Ken Chen
Now, I switch back to the binary distribution on the linux box. It can run 'EXPLAIN ...'.

070830 14:13:07  mysqld started
070830 14:13:08  InnoDB: Started; log sequence number 12 2609549234
070830 14:13:08 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.0.45-log'  socket: '/tmp/mysql2.sock'  port: 3307  MySQL Community Server (GPL)

mysql> EXPLAIN SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01'\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: NULL
         type: NULL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: NULL
        Extra: Select tables optimized away
1 row in set (0.02 sec)
[30 Aug 2007 8:45] Sveta Smirnova
test case

Attachment: bug30715.test (application/octet-stream, text), 927 bytes.

[30 Aug 2007 8:46] Sveta Smirnova
Thank you for the feedback.

Verified as described on Linux using attached test case.
[30 Aug 2007 9:21] Ken Chen
I find the only different is the last line when creating table `daily`.

) DEFAULT CHARSET=utf8;

It will create the table in myisam storage. Is it right?
[30 Aug 2007 9:57] Sveta Smirnova
Yes, it doesn't matter which storage engine is used: crash occurs if using both InnoDB and MyISAM storage engine.
[30 Aug 2007 22:55] Ken Chen
mysql> ALTER TABLE daily RENAME ddddd;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    4
Current database: friend

Query OK, 0 rows affected (1.14 sec)

mysql> CREATE TABLE `daily` (  `uid` bigint(10) unsigned NOT NULL auto_increment,  `memberID` bigint(10) unsigned NOT NULL default '0',  `date` date NOT NULL default '0000-00-00',  `created` datetime NOT NULL,  `mood` smallint(6) NOT NULL default '0',  `text` text NOT NULL,  `private` set('no','hot','me','adult') NOT NULL default 'no',  `good` int(10) unsigned NOT NULL default '0',  `view` int(10) unsigned NOT NULL default '0',  `checkcode` varchar(32) NOT NULL default '',  `Notify` enum('y','n') NOT NULL default 'n',  `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,  `attrib` enum('user','gold','free') NOT NULL default 'user',  PRIMARY KEY  (`uid`),  UNIQUE KEY `memberID_2` (`memberID`,`date`),  KEY `date` (`date`,`private`,`uid`),  KEY `diaryLast` (`memberID`,`created`)) DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.05 sec)

mysql> EXPLAIN SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01';   
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    8
Current database: friend

ERROR 2013 (HY000): Lost connection to MySQL server during query

(It crashed.)

mysql> SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    2
Current database: friend

ERROR 2013 (HY000): Lost connection to MySQL server during query

(It crashed.)

mysql> EXPLAIN SELECT MIN(date) FROM daily WHERE memberID='8014'\G                      
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: NULL
         type: NULL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: NULL
        Extra: No matching min/max row
1 row in set (0.00 sec)

(It run well.)

Try to explain other table ..

mysql> explain select * from board WHERE date>='2007-08-01' AND memberID='8014'\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: board
         type: range
possible_keys: memberID_2
          key: memberID_2
      key_len: 16
          ref: NULL
         rows: 1
        Extra: Using where
1 row in set (0.00 sec)

(It run well.)
[30 Aug 2007 23:03] Ken Chen
I am keep trying..

mysql> drop table daily;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE `daily` (  `uid` bigint(10) unsigned NOT NULL auto_increment,  `memberID` bigint(10) unsigned NOT NULL default '0',  `date` date NOT NULL default '0000-00-00',  `created` datetime NOT NULL,  `mood` smallint(6) NOT NULL default '0',  `text` text NOT NULL,  `private` set('no','hot','me','adult') NOT NULL default 'no',  `good` int(10) unsigned NOT NULL default '0',  `view` int(10) unsigned NOT NULL default '0',  `checkcode` varchar(32) NOT NULL default '',  `Notify` enum('y','n') NOT NULL default 'n',  `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,  `attrib` enum('user','gold','free') NOT NULL default 'user',  PRIMARY KEY  (`uid`)) DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.03 sec)

mysql> SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01';
+-----------+
| MIN(date) |
+-----------+
| NULL      | 
+-----------+
1 row in set (0.00 sec)

mysql> drop table daily;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    34
Current database: friend

Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE `daily` (  `uid` bigint(10) unsigned NOT NULL auto_increment,  `memberID` bigint(10) unsigned NOT NULL default '0',  `date` date NOT NULL default '0000-00-00',  `created` datetime NOT NULL,  `mood` smallint(6) NOT NULL default '0',  `text` text NOT NULL,  `private` set('no','hot','me','adult') NOT NULL default 'no',  `good` int(10) unsigned NOT NULL default '0',  `view` int(10) unsigned NOT NULL default '0',  `checkcode` varchar(32) NOT NULL default '',  `Notify` enum('y','n') NOT NULL default 'n',  `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,  `attrib` enum('user','gold','free') NOT NULL default 'user',  PRIMARY KEY  (`uid`),  UNIQUE KEY `memberID_2` (`memberID`,`date`)) DEFAULT CHARSET=utf8;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    38
Current database: friend

Query OK, 0 rows affected (1.48 sec)

mysql> SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01';
ERROR 2013 (HY000): Lost connection to MySQL server during query

(crashed.)

mysql> CREATE TABLE `daily` (  `uid` bigint(10) unsigned NOT NULL auto_increment,  `memberID` bigint(10) unsigned NOT NULL default '0',  `date` date NOT NULL default '0000-00-00',  `created` datetime NOT NULL,  `mood` smallint(6) NOT NULL default '0',  `text` text NOT NULL,  `private` set('no','hot','me','adult') NOT NULL default 'no',  `good` int(10) unsigned NOT NULL default '0',  `view` int(10) unsigned NOT NULL default '0',  `checkcode` varchar(32) NOT NULL default '',  `Notify` enum('y','n') NOT NULL default 'n',  `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,  `attrib` enum('user','gold','free') NOT NULL default 'user',  PRIMARY KEY  (`uid`),KEY `date` (`date`,`private`,`uid`),  KEY `diaryLast` (`memberID`,`created`)) DEFAULT CHARSET=utf8;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    13
Current database: friend

Query OK, 0 rows affected (0.03 sec)

mysql> SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01';
+-----------+
| MIN(date) |
+-----------+
| NULL      | 
+-----------+
1 row in set (0.00 sec)

It seems the problem is related with "UNIQUE KEY `memberID_2` (`memberID`,`date`)".
[30 Aug 2007 23:14] Ken Chen
I switch back to "Version: '5.0.45-debug-log'  socket: '/tmp/mysql2.sock'  port: 3307  MySQL Community Server - Debug (GPL)".

mysql> SELECT MIN(date) FROM daily WHERE memberID='8014' AND date>'2007-08-01';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    5
Current database: friend

ERROR 2013 (HY000): Lost connection to MySQL server during query

crashed! 

Is it same problem to cause unexpected crashing on non-debug version? I will remove the key "UNIQUE KEY `memberID_2` (`memberID`,`date`)".
[30 Aug 2007 23:23] Ken Chen
I also try same statement on the FreeBSD, it still crashed mysqld '5.0.45-debug-log'.

I hope these information is helpful. Why this statement will crash mysqld-debug everytime, but mysqld can run much more time?
[9 Oct 2007 18:25] Shane Bester
#testcase:

drop table if exists `t`;
create table `t`(`a` int,`b` date not null,key(`a`,`b`))engine=myisam;
select min(`b`) from `t` where `a`='1' and `b`>'2007-08-01';

#crash seems to depend on the date used in the query.
[12 Oct 2007 14:13] Konstantin Osipov
A crash is a P1
[18 Oct 2007 10:38] Georgi Kodinov
Probably related to the fix for bug #27573
[18 Oct 2007 11:40] 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/35834

ChangeSet@1.2546, 2007-10-18 14:40:17+03:00, gkodinov@magare.gmz +3 -0
  Bug #30715: Assertion failed: item_field->field->real_maybe_null(), 
    file .\opt_sum.cc, line
  The MIN(field) can return NULL when all the row values in the group
  are NULL-able or if there were no rows.
  Fixed the assertion to reflect the case when there are no rows.
[23 Oct 2007 15:04] 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/36153

ChangeSet@1.2546, 2007-10-23 18:04:00+03:00, gkodinov@magare.gmz +3 -0
  Bug #30715: Assertion failed: item_field->field->real_maybe_null(), 
    file .\opt_sum.cc, line
  The optimizer pre-calculates the MIN/MAX values for queries like
   SELECT MIN(kp_k) WHERE kp_1 = const AND ... AND kp_k-1 = const
  when there is a key over kp_1...kp_k
  In doing so it was not checking correctly nullability and 
  there was a superfluous assert(). 
  Fixed by making sure that the field can be null before checking and
  taking out the wrong assert().
  .
  Introduced a correct check for nullability 
  The MIN(field) can return NULL when all the row values in the group
  are NULL-able or if there were no rows.
  Fixed the assertion to reflect the case when there are no rows.
[24 Oct 2007 8:15] 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/36235

ChangeSet@1.2546, 2007-10-24 11:15:08+03:00, gkodinov@magare.gmz +3 -0
  Bug #30715: Assertion failed: item_field->field->real_maybe_null(), 
    file .\opt_sum.cc, line
  The optimizer pre-calculates the MIN/MAX values for queries like
   SELECT MIN(kp_k) WHERE kp_1 = const AND ... AND kp_k-1 = const
  when there is a key over kp_1...kp_k
  In doing so it was not checking correctly nullability and 
  there was a superfluous assert(). 
  Fixed by making sure that the field can be null before checking and
  taking out the wrong assert().
  .
  Introduced a correct check for nullability 
  The MIN(field) can return NULL when all the row values in the group
  are NULL-able or if there were no rows.
  Fixed the assertion to reflect the case when there are no rows.
[16 Nov 2007 9:31] Bugs System
Pushed into 5.0.52
[16 Nov 2007 9:33] Bugs System
Pushed into 5.1.23-rc
[16 Nov 2007 9:35] Bugs System
Pushed into 6.0.4-alpha
[19 Nov 2007 4:53] Paul Dubois
Noted in 5.0.52, 5.1.23, 6.0.4 changelog.

Using the MIN() or MAX() function to select one part of a multi-part
key could cause a crash when the function result was NULL.