[MDEV-25523] Assertion `using_unique_constra int || group_buff <= param->group_buff + param->group_length' failed in create_tmp_table Created: 2021-04-26  Updated: 2023-07-28  Resolved: 2023-07-28

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.2
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Won't Fix Votes: 0
Labels: not-10.3, not-10.4, not-10.5, not-10.6


 Description   

I'm setting it to Minor because it's a debug assertion failure which only affects 10.2

CREATE TABLE t1 (a DECIMAL(2,2) UNSIGNED);
INSERT INTO t1 VALUES (0.60),(0.88);
SELECT IF(1, NULL, a) AS f, COUNT(*) FROM t1 GROUP BY f;
 
# Cleanup
DROP TABLE t1;

10.2 14a18d7d

mysqld: /data/src/10.2/sql/sql_select.cc:17364: TABLE* create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, ORDER*, bool, bool, ulonglong, ha_rows, const char*, bool, bool): Assertion `using_unique_constraint || group_buff <= param->group_buff + param->group_length' failed.
210426 18:42:30 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f9066d20f36 in __GI___assert_fail (assertion=0x55836c0966a0 "using_unique_constraint || group_buff <= param->group_buff + param->group_length", file=0x55836c08fa20 "/data/src/10.2/sql/sql_select.cc", line=17364, function=0x55836c096460 "TABLE* create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, ORDER*, bool, bool, ulonglong, ha_rows, const char*, bool, bool)") at assert.c:101
#8  0x000055836a7c3a28 in create_tmp_table (thd=0x62a000060270, param=0x62b0000030b8, fields=..., group=0x62b0000010c0, distinct=false, save_sum_fields=false, select_options=2147748608, rows_limit=18446744073709551615, table_alias=0x55836c08d0a0 "", do_not_open=true, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:17364
#9  0x000055836a75fded in JOIN::create_postjoin_aggr_table (this=0x62b000001228, tab=0x62b000002920, table_fields=0x62b000001548, table_group=0x62b0000010c0, save_sum_fields=false, distinct=false, keep_row_order=false) at /data/src/10.2/sql/sql_select.cc:2974
#10 0x000055836a75bcdc in JOIN::make_aggr_tables_info (this=0x62b000001228) at /data/src/10.2/sql/sql_select.cc:2579
#11 0x000055836a757c44 in JOIN::optimize_inner (this=0x62b000001228) at /data/src/10.2/sql/sql_select.cc:2250
#12 0x000055836a74c484 in JOIN::optimize (this=0x62b000001228) at /data/src/10.2/sql/sql_select.cc:1118
#13 0x000055836a767b8b in mysql_select (thd=0x62a000060270, tables=0x62b000000960, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x62b0000010c0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x62b000001200, unit=0x62a000063e68, select_lex=0x62a0000645a8) at /data/src/10.2/sql/sql_select.cc:3826
#14 0x000055836a74479e in handle_select (thd=0x62a000060270, lex=0x62a000063da8, result=0x62b000001200, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:361
#15 0x000055836a6bb4c1 in execute_sqlcom_select (thd=0x62a000060270, all_tables=0x62b000000960) at /data/src/10.2/sql/sql_parse.cc:6274
#16 0x000055836a6a8860 in mysql_execute_command (thd=0x62a000060270) at /data/src/10.2/sql/sql_parse.cc:3585
#17 0x000055836a6c4a10 in mysql_parse (thd=0x62a000060270, rawbuf=0x62b000000290 "SELECT IF(1, NULL, a) AS f, COUNT(*) FROM t1 GROUP BY f", length=55, parser_state=0x7f905c390c10, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7796
#18 0x000055836a69db34 in dispatch_command (command=COM_QUERY, thd=0x62a000060270, packet=0x6290000eb271 "SELECT IF(1, NULL, a) AS f, COUNT(*) FROM t1 GROUP BY f", packet_length=55, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
#19 0x000055836a69a8f3 in do_command (thd=0x62a000060270) at /data/src/10.2/sql/sql_parse.cc:1381
#20 0x000055836aa2478c in do_handle_one_connection (connect=0x611000005470) at /data/src/10.2/sql/sql_connect.cc:1336
#21 0x000055836aa2404f in handle_one_connection (arg=0x611000005470) at /data/src/10.2/sql/sql_connect.cc:1241
#22 0x000055836bdc6faa in pfs_spawn_thread (arg=0x616000009ff0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
#23 0x00007f9067230609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#24 0x00007f9066e0c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

In 10.3+ the failure disappeared after one of numerous refactoring commits in 10.3.1:

commit 0f642188ccdd309056f3a2a29be6cf3cc83dc256
Author: Alexander Barkov
Date:   Wed May 10 09:27:15 2017 +0400
 
    MDEV-12771 Remove Item_func_xxx::decimal_precision() for case and abbreviations

I don't know however whether it really eliminated the problem or just hid it.



 Comments   
Comment by Elena Stepanova [ 2023-07-28 ]

10.2 is EOL.

Generated at Thu Feb 08 09:38:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.