Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23188

Assertion `!new_field->field_name.str || strlen(new_field->field_name.str) == new_field->field_name.length' failed in create_tmp_table or alike upon query from view

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (1),(2);
      SET CHARACTER_SET_CONNECTION= utf32;
      CREATE VIEW v1 AS SELECT DISTINCT a FROM t1 GROUP BY 'foo' WITH ROLLUP;
      SELECT * FROM v1;
       
      # Cleanup
      DROP VIEW v1;
      DROP TABLE t1;
      

      10.5 c3afcc7c debug

      mariadbd: /data/src/10.5/sql/sql_select.cc:18198: void Create_tmp_table::add_field(TABLE*, Field*, uint, bool): Assertion `!field->field_name.str || strlen(field->field_name.str) == field->field_name.length' failed.
      200716  0:31:13 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fea3e68bf12 in __GI___assert_fail (assertion=0x555ec04e02a0 "!field->field_name.str || strlen(field->field_name.str) == field->field_name.length", file=0x555ec04de278 "/data/src/10.5/sql/sql_select.cc", line=18198, function=0x555ec04e4000 <Create_tmp_table::add_field(TABLE*, Field*, unsigned int, bool)::__PRETTY_FUNCTION__> "void Create_tmp_table::add_field(TABLE*, Field*, uint, bool)") at assert.c:101
      #8  0x0000555ebf7ada80 in Create_tmp_table::add_field (this=0x7fea39225fb0, table=0x7fea2806e6a0, field=0x7fea2806f440, fieldnr=0, force_not_null_cols=false) at /data/src/10.5/sql/sql_select.cc:18198
      #9  0x0000555ebf7af29a in Create_tmp_table::add_fields (this=0x7fea39225fb0, thd=0x7fea28000b18, table=0x7fea2806e6a0, param=0x7fea2806c2c0, fields=...) at /data/src/10.5/sql/sql_select.cc:18602
      #10 0x0000555ebf7b1e3c in create_tmp_table (thd=0x7fea28000b18, param=0x7fea2806c2c0, fields=..., group=0x0, distinct=false, save_sum_fields=true, select_options=2201171004161, rows_limit=18446744073709551615, table_alias=0x555ec0f40240 <empty_clex_str>, do_not_open=true, keep_row_order=false) at /data/src/10.5/sql/sql_select.cc:19195
      #11 0x0000555ebf785a3b in JOIN::create_postjoin_aggr_table (this=0x7fea28018fa8, tab=0x7fea2806b708, table_fields=0x7fea280192d0, table_group=0x0, save_sum_fields=true, distinct=false, keep_row_order=false) at /data/src/10.5/sql/sql_select.cc:3742
      #12 0x0000555ebf784088 in JOIN::make_aggr_tables_info (this=0x7fea28018fa8) at /data/src/10.5/sql/sql_select.cc:3339
      #13 0x0000555ebf782a4b in JOIN::optimize_stage2 (this=0x7fea28018fa8) at /data/src/10.5/sql/sql_select.cc:2983
      #14 0x0000555ebf780214 in JOIN::optimize_inner (this=0x7fea28018fa8) at /data/src/10.5/sql/sql_select.cc:2268
      #15 0x0000555ebf77dc35 in JOIN::optimize (this=0x7fea28018fa8) at /data/src/10.5/sql/sql_select.cc:1618
      #16 0x0000555ebf6d99ee in mysql_derived_optimize (thd=0x7fea28000b18, lex=0x7fea28004a68, derived=0x7fea28013f50) at /data/src/10.5/sql/sql_derived.cc:1025
      #17 0x0000555ebf6d73d6 in mysql_handle_single_derived (lex=0x7fea28004a68, derived=0x7fea28013f50, phases=4) at /data/src/10.5/sql/sql_derived.cc:206
      #18 0x0000555ebf77f74c in JOIN::optimize_inner (this=0x7fea28018950) at /data/src/10.5/sql/sql_select.cc:2074
      #19 0x0000555ebf77dc35 in JOIN::optimize (this=0x7fea28018950) at /data/src/10.5/sql/sql_select.cc:1618
      #20 0x0000555ebf788ef1 in mysql_select (thd=0x7fea28000b18, tables=0x7fea28013f50, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fea28018928, unit=0x7fea28004b30, select_lex=0x7fea28013958) at /data/src/10.5/sql/sql_select.cc:4641
      #21 0x0000555ebf778c30 in handle_select (thd=0x7fea28000b18, lex=0x7fea28004a68, result=0x7fea28018928, setup_tables_done_option=0) at /data/src/10.5/sql/sql_select.cc:429
      #22 0x0000555ebf73e276 in execute_sqlcom_select (thd=0x7fea28000b18, all_tables=0x7fea28013f50) at /data/src/10.5/sql/sql_parse.cc:6209
      #23 0x0000555ebf73551d in mysql_execute_command (thd=0x7fea28000b18) at /data/src/10.5/sql/sql_parse.cc:3931
      #24 0x0000555ebf7430c3 in mysql_parse (thd=0x7fea28000b18, rawbuf=0x7fea280138d0 "SELECT * FROM v1", length=16, parser_state=0x7fea39227520, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7993
      #25 0x0000555ebf72f3bc in dispatch_command (command=COM_QUERY, thd=0x7fea28000b18, packet=0x7fea281af209 "SELECT * FROM v1", packet_length=16, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1867
      #26 0x0000555ebf72daf4 in do_command (thd=0x7fea28000b18) at /data/src/10.5/sql/sql_parse.cc:1348
      #27 0x0000555ebf8d31d9 in do_handle_one_connection (connect=0x555ec4031398, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1411
      #28 0x0000555ebf8d2f41 in handle_one_connection (arg=0x555ec4031398) at /data/src/10.5/sql/sql_connect.cc:1313
      #29 0x0000555ebfe10dd0 in pfs_spawn_thread (arg=0x555ec4030fc8) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #30 0x00007fea406144a4 in start_thread (arg=0x7fea39228700) at pthread_create.c:456
      #31 0x00007fea3e748d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      10.3 debug 8a094408

      mysqld: /data/src/10.3/sql/sql_select.cc:17759: TABLE* create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, ORDER*, bool, bool, ulonglong, ha_rows, const LEX_CSTRING*, bool, bool): Assertion `!new_field->field_name.str || strlen(new_field->field_name.str) == new_field->field_name.length' failed.
      200716  0:38:32 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f7785f71f12 in __GI___assert_fail (assertion=0x55ea11e2ca60 "!new_field->field_name.str || strlen(new_field->field_name.str) == new_field->field_name.length", file=0x55ea11e2b040 "/data/src/10.3/sql/sql_select.cc", line=17759, function=0x55ea11e2f680 <create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, st_order*, bool, bool, unsigned long long, unsigned long long, st_mysql_const_lex_string const*, bool, bool)::__PRETTY_FUNCTION__> "TABLE* create_tmp_table(THD*, TMP_TABLE_PARAM*, List<Item>&, ORDER*, bool, bool, ulonglong, ha_rows, const LEX_CSTRING*, bool, bool)") at assert.c:101
      #8  0x000055ea1122b9c3 in create_tmp_table (thd=0x7f7770000af0, param=0x7f7770018488, fields=..., group=0x0, distinct=false, save_sum_fields=true, select_options=2416184065, rows_limit=18446744073709551615, table_alias=0x55ea1271c080 <empty_clex_str>, do_not_open=true, keep_row_order=false) at /data/src/10.3/sql/sql_select.cc:17759
      #9  0x000055ea11204cef in JOIN::create_postjoin_aggr_table (this=0x7f7770016050, tab=0x7f77700178e8, table_fields=0x7f7770016370, table_group=0x0, save_sum_fields=true, distinct=false, keep_row_order=false) at /data/src/10.3/sql/sql_select.cc:3427
      #10 0x000055ea11203342 in JOIN::make_aggr_tables_info (this=0x7f7770016050) at /data/src/10.3/sql/sql_select.cc:3024
      #11 0x000055ea11201d2f in JOIN::optimize_stage2 (this=0x7f7770016050) at /data/src/10.3/sql/sql_select.cc:2671
      #12 0x000055ea111ff752 in JOIN::optimize_inner (this=0x7f7770016050) at /data/src/10.3/sql/sql_select.cc:1977
      #13 0x000055ea111fdb85 in JOIN::optimize (this=0x7f7770016050) at /data/src/10.3/sql/sql_select.cc:1497
      #14 0x000055ea11169a10 in mysql_derived_optimize (thd=0x7f7770000af0, lex=0x7f77700048f8, derived=0x7f7770012a08) at /data/src/10.3/sql/sql_derived.cc:939
      #15 0x000055ea11167bfe in mysql_handle_single_derived (lex=0x7f77700048f8, derived=0x7f7770012a08, phases=4) at /data/src/10.3/sql/sql_derived.cc:199
      #16 0x000055ea111febdb in JOIN::optimize_inner (this=0x7f7770015a00) at /data/src/10.3/sql/sql_select.cc:1774
      #17 0x000055ea111fdb85 in JOIN::optimize (this=0x7f7770015a00) at /data/src/10.3/sql/sql_select.cc:1497
      #18 0x000055ea11207c5a in mysql_select (thd=0x7f7770000af0, tables=0x7f7770012a08, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f77700159d8, unit=0x7f77700049b8, select_lex=0x7f7770005140) at /data/src/10.3/sql/sql_select.cc:4301
      #19 0x000055ea111f92ca in handle_select (thd=0x7f7770000af0, lex=0x7f77700048f8, result=0x7f77700159d8, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:370
      #20 0x000055ea111c0bb2 in execute_sqlcom_select (thd=0x7f7770000af0, all_tables=0x7f7770012a08) at /data/src/10.3/sql/sql_parse.cc:6286
      #21 0x000055ea111b7305 in mysql_execute_command (thd=0x7f7770000af0) at /data/src/10.3/sql/sql_parse.cc:3812
      #22 0x000055ea111c4ebd in mysql_parse (thd=0x7f7770000af0, rawbuf=0x7f7770012818 "SELECT * FROM v1", length=16, parser_state=0x7f77801705e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7810
      #23 0x000055ea111b1704 in dispatch_command (command=COM_QUERY, thd=0x7f7770000af0, packet=0x7f7770123501 "SELECT * FROM v1", packet_length=16, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1848
      #24 0x000055ea111b001c in do_command (thd=0x7f7770000af0) at /data/src/10.3/sql/sql_parse.cc:1393
      #25 0x000055ea113295f1 in do_handle_one_connection (connect=0x55ea14e7f310) at /data/src/10.3/sql/sql_connect.cc:1403
      #26 0x000055ea11329353 in handle_one_connection (arg=0x55ea14e7f310) at /data/src/10.3/sql/sql_connect.cc:1308
      #27 0x000055ea11ce0302 in pfs_spawn_thread (arg=0x55ea14e9a3c0) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #28 0x00007f7787efa4a4 in start_thread (arg=0x7f7780171700) at pthread_create.c:456
      #29 0x00007f778602ed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.3+ with at least InnoDB and MyISAM.
      Not reproducible on 10.2.
      No obvious problem on a non-debug build.

        Attachments

          Activity

            People

            Assignee:
            bar Alexander Barkov
            Reporter:
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: