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

Assertion `field.is_sane()' failed in Protocol_text::store_field_metadata

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (a YEAR);
      INSERT INTO t VALUES (2000),(2001);
      SELECT MAX( NULLIF( a, 1970 ) ) AS f FROM t;
       
      # Cleanup
      DROP TABLE t;
      

      10.5 da53fb6d

      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.
      190819 16:02:06 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fefa90b1f12 in __GI___assert_fail (assertion=0x559c5870c029 "field.is_sane()", file=0x559c5870bd68 "/data/src/10.5/sql/protocol.cc", line=810, function=0x559c5870c7a0 <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  0x0000559c579ee5df in Protocol_text::store_field_metadata (this=0x7fefa4220a30, thd=0x7fef88000b10, field=..., charset_for_protocol=0x559c591f44c0 <my_charset_bin>, fieldnr=0) at /data/src/10.5/sql/protocol.cc:810
      #9  0x0000559c579ef1b2 in Protocol_text::store_field_metadata (this=0x7fefa4220a30, thd=0x7fef88000b10, item=0x7fef88013d68, pos=0) at /data/src/10.5/sql/protocol.cc:994
      #10 0x0000559c579eec15 in Protocol::send_result_set_metadata (this=0x7fef880010d8, list=0x7fef880152a0, flags=3) at /data/src/10.5/sql/protocol.cc:911
      #11 0x0000559c57a9d033 in select_send::send_result_set_metadata (this=0x7fef88014ec8, list=..., flags=3) at /data/src/10.5/sql/sql_class.cc:2974
      #12 0x0000559c57b5d02b in JOIN::exec_inner (this=0x7fef88014ef0) at /data/src/10.5/sql/sql_select.cc:4417
      #13 0x0000559c57b5c22e in JOIN::exec (this=0x7fef88014ef0) at /data/src/10.5/sql/sql_select.cc:4201
      #14 0x0000559c57b5d8d3 in mysql_select (thd=0x7fef88000b10, tables=0x7fef88013f20, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fef88014ec8, unit=0x7fef88004a40, select_lex=0x7fef88013468) at /data/src/10.5/sql/sql_select.cc:4633
      #15 0x0000559c57b4dcb0 in handle_select (thd=0x7fef88000b10, lex=0x7fef88004978, result=0x7fef88014ec8, setup_tables_done_option=0) at /data/src/10.5/sql/sql_select.cc:425
      #16 0x0000559c57b170fc in execute_sqlcom_select (thd=0x7fef88000b10, all_tables=0x7fef88013f20) at /data/src/10.5/sql/sql_parse.cc:6335
      #17 0x0000559c57b0cffa in mysql_execute_command (thd=0x7fef88000b10) at /data/src/10.5/sql/sql_parse.cc:3898
      #18 0x0000559c57b1ae64 in mysql_parse (thd=0x7fef88000b10, rawbuf=0x7fef880133a8 "SELECT MAX( NULLIF( a, 1970 ) ) AS f FROM t", length=43, parser_state=0x7fefa4222170, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7884
      #19 0x0000559c57b071f0 in dispatch_command (command=COM_QUERY, thd=0x7fef88000b10, packet=0x7fef88137221 "", packet_length=43, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1843
      #20 0x0000559c57b05936 in do_command (thd=0x7fef88000b10) at /data/src/10.5/sql/sql_parse.cc:1360
      #21 0x0000559c57c92d12 in do_handle_one_connection (connect=0x559c5ba25c10, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1414
      #22 0x0000559c57c92a41 in handle_one_connection (arg=0x559c5ba25c10) at /data/src/10.5/sql/sql_connect.cc:1309
      #23 0x0000559c5819675f in pfs_spawn_thread (arg=0x559c5b98f7c0) at /data/src/10.5/storage/perfschema/pfs.cc:1862
      #24 0x00007fefaac264a4 in start_thread (arg=0x7fefa4223700) at pthread_create.c:456
      #25 0x00007fefa916ed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible with MyISAM, Aria, InnoDB. With MyISAM and Aria INSERT is not necessary.

      The problem appeared in 10.5 tree with this commit:

      commit 6073049a3675363f7d7efe26f47525b528be9e2f
      Author: Alexander Barkov
      Date:   Thu Aug 15 13:16:00 2019 +0400
       
          MDEV-20353 Add separate type handlers for unsigned integer data types
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.