Bug #49486 Assertion failed: (precision <= ((9 * 9) - 8*2)) && (dec <= 30)
Submitted: 6 Dec 2009 9:29 Modified: 5 Jan 2010 23:47
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: Data Types Severity:S1 (Critical)
Version:5.0.89-debug (5.0 only) OS:Any
Assigned to: CPU Architecture:Any
Tags: assertion, decimal, distinct

[6 Dec 2009 9:29] Shane Bester
Description:
Version: '5.1.41-enterprise-gpl-advanced-debug'  socket: ''  port: 3306  MySQL Enterprise Server - Advanced Edition Debug (GPL)
Assertion failed: (precision <= ((9 * 9) - 8*2)) && (dec <= 30), file .\field.cc, line 2484

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!Field_new_decimal::Field_new_decimal()[field.cc:2484]
mysqld-debug.exe!Item_sum::create_tmp_field()[item_sum.cc:521]
mysqld-debug.exe!create_tmp_field()[sql_select.cc:9602]
mysqld-debug.exe!create_tmp_table()[sql_select.cc:10030]
mysqld-debug.exe!JOIN::optimize()[sql_select.cc:1484]
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]
kernel32.dll!BaseThreadStart()
ariables.
 invalid and cause the dump to abort...
000445F098=select distinct avg(distinct `a`) from `t1` group by `a`

How to repeat:
on debug build:

drop table if exists `t1`;
create table `t1`(`a` decimal(60,28))engine=myisam;
insert `t1` values (),();
select distinct avg(distinct `a`) from `t1` group by `a`;
[6 Dec 2009 10:25] Valeriy Kravchuk
Does not happen for me with 5.1.43-debug on Mac OS X:

  bzr help topics    list all help topics
77-52-7-73:5.1 openxs$ bin/mysql -uroot test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 32
Server version: 5.1.43-debug-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

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

mysql> create table `t1`(`a` decimal(60,28))engine=myisam;
Query OK, 0 rows affected (0.05 sec)

mysql> insert `t1` values (),();
Query OK, 2 rows affected (0.00 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> select distinct avg(distinct `a`) from `t1` group by `a`;
+-------------------+
| avg(distinct `a`) |
+-------------------+
|              NULL |
+-------------------+
1 row in set (0.00 sec)
[6 Dec 2009 11:08] Sveta Smirnova
Thank you for the reprot.

Verified as described. Repeatable with version 5.0 only.

Looks like duplicate of bug #45261, but as it is repeatable with simple query without cursors and SPs probably should be fixed in 5.0 too?
[5 Jan 2010 23:48] Omer Barnir
Issue is 5.0 specific and standard support for the release ended
[9 May 2011 5:20] MySQL Verification Team
see oracle bug #12532830 for a testcase for 5.0, 5.1, 5.5, 5.6 ...