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

Assertion `is_unsigned() == attr.unsigned_flag' or Assertion `field.is_sane()' failed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.5
    • Fix Version/s: 10.5.1
    • Component/s: Data types
    • Labels:
      None

      Description

      CREATE  TABLE t1 (a TIMESTAMP);
      INSERT INTO t1 VALUES (NULL),(NULL);
      SET SESSION SQL_MODE= 'NO_UNSIGNED_SUBTRACTION';
      SELECT DISTINCT UUID_SHORT() - a FROM t1;
       
      # Cleanup
      DROP TABLE t1;
      

      10.5 debug e47bd007

      mysqld: /data/src/10.5/sql/sql_type.cc:3428: virtual Field* Type_handler_int_result::make_table_field(MEM_ROOT*, const LEX_CSTRING*, const Record_addr&, const Type_all_attributes&, TABLE_SHARE*) const: Assertion `is_unsigned() == attr.unsigned_flag' failed.
      191210 22:13:54 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fbbfda35f12 in __GI___assert_fail (assertion=0x55872ab185d0 "is_unsigned() == attr.unsigned_flag", file=0x55872ab17698 "/data/src/10.5/sql/sql_type.cc", line=3428, function=0x55872ab1ae00 <Type_handler_int_result::make_table_field(st_mem_root*, st_mysql_const_lex_string const*, Record_addr const&, Type_all_attributes const&, TABLE_SHARE*) const::__PRETTY_FUNCTION__> "virtual Field* Type_handler_int_result::make_table_field(MEM_ROOT*, const LEX_CSTRING*, const Record_addr&, const Type_all_attributes&, TABLE_SHARE*) const") at assert.c:101
      #8  0x0000558729fa96b9 in Type_handler_int_result::make_table_field (this=0x55872b7b9180 <type_handler_ulonglong>, root=0x7fbbe8069c38, name=0x7fbbe8013c20, addr=..., attr=..., share=0x7fbbe8069d40) at /data/src/10.5/sql/sql_type.cc:3428
      #9  0x0000558729fa95e3 in Type_handler::make_and_init_table_field (this=0x55872b7b9180 <type_handler_ulonglong>, root=0x7fbbe8069c38, name=0x7fbbe8013c20, addr=..., attr=..., table=0x7fbbe8068f68) at /data/src/10.5/sql/sql_type.cc:3415
      #10 0x0000558729deee2e in Item_result_field::create_tmp_field_ex_from_handler (this=0x7fbbe8013bc8, root=0x7fbbe8069c38, table=0x7fbbe8068f68, src=0x7fbbf8408120, param=0x7fbbf8408114, h=0x55872b7b9180 <type_handler_ulonglong>) at /data/src/10.5/sql/sql_select.cc:17799
      #11 0x0000558729ce1eca in Item_result_field::create_tmp_field_ex (this=0x7fbbe8013bc8, root=0x7fbbe8069c38, table=0x7fbbe8068f68, src=0x7fbbf8408120, param=0x7fbbf8408114) at /data/src/10.5/sql/item.h:3191
      #12 0x0000558729deefb1 in create_tmp_field (table=0x7fbbe8068f68, item=0x7fbbe8013bc8, copy_func=0x7fbbf84081c8, from_field=0x7fbbe806a2e0, default_field=0x7fbbe806a2d0, group=true, modify_item=true, table_cant_handle_bit_fields=true, make_copy_field=false) at /data/src/10.5/sql/sql_select.cc:17859
      #13 0x0000558729df08c3 in Create_tmp_table::add_fields (this=0x7fbbf84082c0, thd=0x7fbbe8000b00, table=0x7fbbe8068f68, param=0x7fbbe8016ae0, fields=...) at /data/src/10.5/sql/sql_select.cc:18307
      #14 0x0000558729df31d2 in create_tmp_table (thd=0x7fbbe8000b00, param=0x7fbbe8016ae0, fields=..., group=0x7fbbe8016a88, distinct=false, save_sum_fields=false, select_options=2147748609, rows_limit=18446744073709551615, table_alias=0x55872b43efc0 <empty_clex_str>, do_not_open=true, keep_row_order=false) at /data/src/10.5/sql/sql_select.cc:18902
      #15 0x0000558729dc79fd in JOIN::create_postjoin_aggr_table (this=0x7fbbe8014d08, tab=0x7fbbe8016320, table_fields=0x7fbbe8015028, table_group=0x7fbbe8016a88, save_sum_fields=false, distinct=false, keep_row_order=false) at /data/src/10.5/sql/sql_select.cc:3730
      #16 0x0000558729dc604a in JOIN::make_aggr_tables_info (this=0x7fbbe8014d08) at /data/src/10.5/sql/sql_select.cc:3327
      #17 0x0000558729dc49f3 in JOIN::optimize_stage2 (this=0x7fbbe8014d08) at /data/src/10.5/sql/sql_select.cc:2970
      #18 0x0000558729dc2242 in JOIN::optimize_inner (this=0x7fbbe8014d08) at /data/src/10.5/sql/sql_select.cc:2268
      #19 0x0000558729dbfb76 in JOIN::optimize (this=0x7fbbe8014d08) at /data/src/10.5/sql/sql_select.cc:1604
      #20 0x0000558729dcaeb1 in mysql_select (thd=0x7fbbe8000b00, tables=0x7fbbe8013d20, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748609, result=0x7fbbe8014ce0, unit=0x7fbbe8004a50, select_lex=0x7fbbe8013540) at /data/src/10.5/sql/sql_select.cc:4629
      #21 0x0000558729dbac30 in handle_select (thd=0x7fbbe8000b00, lex=0x7fbbe8004988, result=0x7fbbe8014ce0, setup_tables_done_option=0) at /data/src/10.5/sql/sql_select.cc:428
      #22 0x0000558729d806a9 in execute_sqlcom_select (thd=0x7fbbe8000b00, all_tables=0x7fbbe8013d20) at /data/src/10.5/sql/sql_parse.cc:6219
      #23 0x0000558729d76702 in mysql_execute_command (thd=0x7fbbe8000b00) at /data/src/10.5/sql/sql_parse.cc:3904
      #24 0x0000558729d8536a in mysql_parse (thd=0x7fbbe8000b00, rawbuf=0x7fbbe8013488 "SELECT DISTINCT UUID_SHORT() - a FROM t1", length=40, parser_state=0x7fbbf8409570, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7988
      #25 0x0000558729d70405 in dispatch_command (command=COM_QUERY, thd=0x7fbbe8000b00, packet=0x7fbbe8008421 "SELECT DISTINCT UUID_SHORT() - a FROM t1", packet_length=40, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1846
      #26 0x0000558729d6eb5f in do_command (thd=0x7fbbe8000b00) at /data/src/10.5/sql/sql_parse.cc:1364
      #27 0x0000558729f0e6e1 in do_handle_one_connection (connect=0x55872d1dcf90, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1422
      #28 0x0000558729f0e410 in handle_one_connection (arg=0x55872d1dcf90) at /data/src/10.5/sql/sql_connect.cc:1319
      #29 0x000055872a454321 in pfs_spawn_thread (arg=0x55872d1da6f0) at /data/src/10.5/storage/perfschema/pfs.cc:1862
      #30 0x00007fbbff5ab4a4 in start_thread (arg=0x7fbbf840a700) at pthread_create.c:456
      #31 0x00007fbbfdaf2d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      CREATE  TABLE t1 (a TIMESTAMP);
      INSERT INTO t1 VALUES (NULL),(NULL);
      SET SESSION SQL_MODE= 'NO_UNSIGNED_SUBTRACTION';
      SELECT UUID_SHORT() - a FROM t1;
       
      # Cleanup
      DROP TABLE t1;
      

      mysqld: /data/src/10.5/sql/protocol.cc:810: bool Protocol_text::store_field_metadata(const THD*, const Send_field&, CHARSET_INFO*, uint): Assertion `field.is_sane()' failed.
      191210 22:16:23 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f1778ebcf12 in __GI___assert_fail (assertion=0x5611797cd671 "field.is_sane()", file=0x5611797cd2e8 "/data/src/10.5/sql/protocol.cc", line=810, function=0x5611797cde60 <Protocol_text::store_field_metadata(THD const*, Send_field const&, charset_info_st const*, unsigned int)::__PRETTY_FUNCTION__> "bool Protocol_text::store_field_metadata(const THD*, const Send_field&, CHARSET_INFO*, uint)") at assert.c:101
      #8  0x000056117899b914 in Protocol_text::store_field_metadata (this=0x7f17740905f0, thd=0x7f1758000b00, field=..., charset_for_protocol=0x56117a31a280 <my_charset_bin>, fieldnr=0) at /data/src/10.5/sql/protocol.cc:810
      #9  0x000056117899c51e in Protocol_text::store_field_metadata (this=0x7f17740905f0, thd=0x7f1758000b00, item=0x7f1758013bb0, pos=0) at /data/src/10.5/sql/protocol.cc:994
      #10 0x000056117899bf81 in Protocol::send_result_set_metadata (this=0x7f17580010c8, list=0x7f1758013678, flags=3) at /data/src/10.5/sql/protocol.cc:911
      #11 0x0000561178a51754 in select_send::send_result_set_metadata (this=0x7f1758014cc8, list=..., flags=3) at /data/src/10.5/sql/sql_class.cc:2976
      #12 0x0000561178b1c697 in JOIN::exec_inner (this=0x7f1758014cf0) at /data/src/10.5/sql/sql_select.cc:4436
      #13 0x0000561178b1b819 in JOIN::exec (this=0x7f1758014cf0) at /data/src/10.5/sql/sql_select.cc:4219
      #14 0x0000561178b1cf4a in mysql_select (thd=0x7f1758000b00, tables=0x7f1758013d08, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f1758014cc8, unit=0x7f1758004a50, select_lex=0x7f1758013528) at /data/src/10.5/sql/sql_select.cc:4643
      #15 0x0000561178b0cc30 in handle_select (thd=0x7f1758000b00, lex=0x7f1758004988, result=0x7f1758014cc8, setup_tables_done_option=0) at /data/src/10.5/sql/sql_select.cc:428
      #16 0x0000561178ad26a9 in execute_sqlcom_select (thd=0x7f1758000b00, all_tables=0x7f1758013d08) at /data/src/10.5/sql/sql_parse.cc:6219
      #17 0x0000561178ac8702 in mysql_execute_command (thd=0x7f1758000b00) at /data/src/10.5/sql/sql_parse.cc:3904
      #18 0x0000561178ad736a in mysql_parse (thd=0x7f1758000b00, rawbuf=0x7f1758013488 "SELECT UUID_SHORT() - a FROM t1", length=31, parser_state=0x7f1774091570, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7988
      #19 0x0000561178ac2405 in dispatch_command (command=COM_QUERY, thd=0x7f1758000b00, packet=0x7f1758008421 "", packet_length=31, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1846
      #20 0x0000561178ac0b5f in do_command (thd=0x7f1758000b00) at /data/src/10.5/sql/sql_parse.cc:1364
      #21 0x0000561178c606e1 in do_handle_one_connection (connect=0x56117c445f90, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1422
      #22 0x0000561178c60410 in handle_one_connection (arg=0x56117c445f90) at /data/src/10.5/sql/sql_connect.cc:1319
      #23 0x00005611791a6321 in pfs_spawn_thread (arg=0x56117c4436f0) at /data/src/10.5/storage/perfschema/pfs.cc:1862
      #24 0x00007f177aa324a4 in start_thread (arg=0x7f1774092700) at pthread_create.c:456
      #25 0x00007f1778f79d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      No obvious effect on a non-debug build, although maybe such a strange subtraction should cause a warning (it doesn't now).

        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:
              Resolved: