Bug #40884 main.group_min_max crashes regularly on some Solaris 10 boxes
Submitted: 20 Nov 2008 13:16 Modified: 21 Jan 2009 16:07
Reporter: Alexander Nozdrin Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Server Severity:S3 (Non-critical)
Version:6.0-TRUNK OS:Solaris (Solaris 10)
Assigned to: Timour Katchaounov CPU Architecture:Any
Tags: pushbuild, sporadic, test failure

[20 Nov 2008 13:16] Alexander Nozdrin
Description:
main.group_min_max crashes regularly in PushBuild2 on some Solaris10 boxes.

Symptoms:
-----------------------------------------------------
mysqltest: At line 960: query 'insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a' failed: 2013: Lost connection to MySQL server during query

The result from queries just before the failure was:
< snip >
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	index	NULL	break_it	10	NULL	12	Using index
SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
a	MIN(b)	MAX(b)	AVG(b)
4	1	3	2.0000
3	1	3	2.0000
2	1	3	2.0000
1	1	3	2.0000
DROP TABLE t1;
create table t1 (a int, b int, primary key (a,b), key `index` (a,b)) engine=MyISAM;
insert into  t1 (a,b) values 
(0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),
(0,7),(0,8),(0,9),(0,10),(0,11),(0,12),(0,13),
(1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),
(1,7),(1,8),(1,9),(1,10),(1,11),(1,12),(1,13),
(2,0),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),
(2,7),(2,8),(2,9),(2,10),(2,11),(2,12),(2,13),
(3,0),(3,1),(3,2),(3,3),(3,4),(3,5),(3,6),
(3,7),(3,8),(3,9),(3,10),(3,11),(3,12),(3,13);
insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a;
-----------------------------------------------------

How to repeat:
Look at mysql-6.0 page in PushBuild2. Xref is not available yet.
http://clustra.norway.sun.com/~bteam/pb2/web.py?branch=7&template=show_pushes

Click on some build, then grep for group_min_max name.
Open log and grep there.
[25 Nov 2008 8:08] Timour Katchaounov
The crash happens in the test case for
Bug#38195: Incorrect handling of aggregate functions when loose index scan
           is used causes server crash.
[25 Nov 2008 8:41] Timour Katchaounov
reproducible with the test case for BUG#38195, and the query:

select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a;

Call stack of the crash:
JOIN::exec -> ... -> evaluate_join_record -> end_write -> copy_funcs ->
Item_result_field::save_in_result_field -> Item::save_in_field
Here "field" is NULL, so field->set_notnull() crashes.
[27 Nov 2008 16:07] Timour Katchaounov
I believe this bug is a duplicate of BUG#38195 because it occurs in the
same test case, and the crash is in exactly the same place.
[15 Dec 2008 21:02] 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/61718

2809 First_name Last_name	2008-12-15
      Bug#40884: Failure of the test case for the bug#38195.
      
      Fix for the bug#38195 was removed by an incorrect merge.
      
      Fix is restored.
[15 Dec 2008 21:48] 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/61719

2809 First_name Last_name	2008-12-16 [merge]
      Merged fix for the bug#40884.
[20 Jan 2009 18:59] Bugs System
Pushed into 6.0.10-alpha (revid:joro@sun.com-20090119171328-2hemf2ndc1dxl0et) (version source revid:azundris@mysql.com-20081230114916-c290n83z25wkt6e4) (merge vers: 6.0.9-alpha) (pib:6)
[21 Jan 2009 16:07] Paul DuBois
Test case-related changes. No changelog entry needed.