Bug #113037 Assertion Failure in /mysql-8.0.34/sql/my_decimal.h:186

Submitted: 10 Nov 2023 7:00 Modified: 13 Jan 2025 14:43
Reporter: xin wen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: DML Severity:S6 (Debug Builds)
Version:8.0.34, 8.0.35, 8.1.0, 8.2.0 OS:Ubuntu (20.04)
Assigned to: CPU Architecture:Any

[10 Nov 2023 7:00] xin wen
Description:
Run these queries:

CREATE TABLE t0 ( c58 DECIMAL ( 43 ) DEFAULT ( -58 ) ) ;
INSERT INTO t0 ( c58 ) VALUES ( 49 ) AS t1 ( c49 ) ON DUPLICATE KEY UPDATE c58 = -48 ;
ALTER TABLE t0 ADD COLUMN c48 INT AFTER c58 ;
INSERT INTO t0 VALUES ( -7083310911082514755 , -122 ) , ( -46 , 103 ) ;
SELECT AVG ( LOG ( RAND ( ) , 67 ) ) AS c2 FROM ( SELECT MAKE_SET ( c55 , '8-ly{)P;W}q?-mnCX\\' , '1j)&' ) AS c18 FROM ( SELECT AVG ( c58 ) AS c55 FROM t0 GROUP BY c58 ) AS t2 ) AS t3 JOIN t0 ON t0 . c58 = t3 . c18 GROUP BY c18 , c48 ORDER BY c2 ;

Will trigger assertion failure.

GDB info:
#0  0x00007ffff6b1300b in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff6af2859 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff6af2729 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff6b03fd6 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x000055555954912c in max_my_decimal (to=to@entry=0x7fffc6eec8f0, precision=precision@entry=43, frac=<optimized out>) at /home/wx/mysql-8.0.34/sql/my_decimal.h:186
#5  0x0000555559d49a76 in Item_typecast_decimal::val_decimal (this=0x6120003724f0, dec=<optimized out>) at /home/wx/mysql-8.0.34/sql/item_func.cc:1972
#6  0x0000555559ca81b5 in append_decimal_value (comparand=comparand@entry=0x6120003724f0, is_multi_column_key=is_multi_column_key@entry=false, join_key_buffer=join_key_buffer@entry=0x621000366b30) at /home/wx/mysql-8.0.34/sql/item_cmpfunc.cc:7594
#7  0x0000555559cbce49 in extract_value_for_hash_join (thd=thd@entry=0x6270002bf900, join_condition=..., comparator=comparator@entry=0x6150003bd990, is_left_argument=is_left_argument@entry=true, is_multi_column_key=is_multi_column_key@entry=false, join_key_buffer=join_key_buffer@entry=0x621000366b30) at /home/wx/mysql-8.0.34/sql/item_cmpfunc.cc:7721
#8  0x0000555559cbd0cb in Item_eq_base::append_join_key_for_hash_join (this=this@entry=0x6150003bd8b0, thd=thd@entry=0x6270002bf900, tables=tables@entry=2, join_condition=..., is_multi_column_key=<optimized out>, join_key_buffer=join_key_buffer@entry=0x621000366b30) at /home/wx/mysql-8.0.34/sql/item_cmpfunc.cc:7748
#9  0x000055555a2af29d in ConstructJoinKey (thd=0x6270002bf900, join_conditions=..., tables_bitmap=tables_bitmap@entry=2, join_key_buffer=join_key_buffer@entry=0x621000366b30) at /home/wx/mysql-8.0.34/sql/iterators/hash_join_iterator.cc:274
#10 0x000055555a2b05d6 in HashJoinIterator::LookupProbeRowInHashTable (this=this@entry=0x621000366130) at /home/wx/mysql-8.0.34/sql/iterators/hash_join_iterator.cc:864
#11 0x000055555a2b271f in HashJoinIterator::ReadRowFromProbeIterator (this=this@entry=0x621000366130) at /home/wx/mysql-8.0.34/sql/iterators/hash_join_iterator.cc:688
#12 0x000055555a2b2c1f in HashJoinIterator::Read (this=0x621000366130) at /home/wx/mysql-8.0.34/sql/iterators/hash_join_iterator.cc:1068
#13 0x000055555a2a28d5 in TemptableAggregateIterator<DummyIteratorProfiler>::Init (this=0x60c0001360f0) at /home/wx/mysql-8.0.34/sql/iterators/composite_iterators.cc:1713
#14 0x0000555559b6be45 in filesort (thd=<optimized out>, filesort=0x613000d80630, source_iterator=source_iterator@entry=0x60c0001360f0, tables_to_get_rowid_for=tables_to_get_rowid_for@entry=0, num_rows_estimate=num_rows_estimate@entry=18446744073709551615, fs_info=fs_info@entry=0x613000d809d8, sort_result=<optimized out>, found_rows=<optimized out>) at /home/wx/mysql-8.0.34/sql/filesort.cc:408
#15 0x0000555559ecd719 in SortingIterator::DoSort (this=this@entry=0x613000d809b0) at /home/wx/mysql-8.0.34/sql/iterators/sorting_iterator.cc:531
#16 0x0000555559ece024 in SortingIterator::Init (this=0x613000d809b0) at /home/wx/mysql-8.0.34/sql/iterators/sorting_iterator.cc:444
#17 0x00005555597138da in Query_expression::ExecuteIteratorQuery (this=this@entry=0x61200035bcf0, thd=thd@entry=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_union.cc:1763
#18 0x0000555559713ecd in Query_expression::execute (this=this@entry=0x61200035bcf0, thd=thd@entry=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_union.cc:1823
#19 0x00005555595b1f79 in Sql_cmd_dml::execute_inner (this=0x60b000155070, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_select.cc:1022
#20 0x00005555595ce209 in Sql_cmd_dml::execute (this=0x60b000155070, thd=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_select.cc:793
#21 0x00005555594bd568 in mysql_execute_command (thd=thd@entry=0x6270002bf900, first_level=first_level@entry=true) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:4719
#22 0x00005555594c0bfe in dispatch_sql_command (thd=0x6270002bf900, parser_state=parser_state@entry=0x7fffc6ef0c00) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:5368
#23 0x00005555594c38e2 in dispatch_command (thd=thd@entry=0x6270002bf900, com_data=com_data@entry=0x7fffc6ef2200, command=<optimized out>) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:2054
#24 0x00005555594c7392 in do_command (thd=thd@entry=0x6270002bf900) at /home/wx/mysql-8.0.34/sql/sql_parse.cc:1439
#25 0x000055555989b7be in handle_connection (arg=arg@entry=0x607000325e20) at /home/wx/mysql-8.0.34/sql/conn_handler/connection_handler_per_thread.cc:302
#26 0x000055555cc724e9 in pfs_spawn_thread (arg=0x614000140c60) at /home/wx/mysql-8.0.34/storage/perfschema/pfs.cc:3042
#27 0x00007ffff7568609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#28 0x00007ffff6bef133 in clone () from /lib/x86_64-linux-gnu/libc.so.6

How to repeat:
Run the queries above.
[10 Nov 2023 8:53] MySQL Verification Team
Hello xin wen,

Thank you for the report and test case.
Observed that 8.0.35 debug build is affected.

regards,
Umesh
[13 Jan 2025 14:43] Erlend Dahl
Fixed in 8.0.36 under the heading of 

Bug#35846221: Assertion Failure in /mysql-8.0.34/sql/field.cc:7119

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.059 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.