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

Assertion `!table || !table->read_set || bitmap_is_set(table->read_set, field_index)' failed in Field_enum::val_int upon INSERT .. SELECT into table with index on virtual column

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 ( 
        pk INT AUTO_INCREMENT,
        f1 ENUM('','a','b'),
        f2 ENUM('','a','b') AS (f1) VIRTUAL,
        PRIMARY KEY(pk),
        UNIQUE(f2,pk)
      ) ENGINE=MyISAM;
      INSERT INTO t1 (f1) VALUES ('');
      ALTER TABLE t1 DROP PRIMARY KEY;
      INSERT IGNORE INTO t1 SELECT * FROM t1;
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 55dd07765

      mysqld: /data/src/10.4/sql/field.cc:8998: virtual longlong Field_enum::val_int(): Assertion `!table || !table->read_set || bitmap_is_set(table->read_set, field_index)' failed.
      181003  0:08:18 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fe109febee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055bb83d523ae in Field_enum::val_int (this=0x7fe0f40423b8) at /data/src/10.4/sql/field.cc:8998
      #9  0x000055bb83d5f26f in Field_enum::store_field (this=0x7fe0f40424b0, from=0x7fe0f40423b8) at /data/src/10.4/sql/field.h:4100
      #10 0x000055bb83d63a3a in field_conv_incompatible (to=0x7fe0f40424b0, from=0x7fe0f40423b8) at /data/src/10.4/sql/field_conv.cc:836
      #11 0x000055bb83d63a96 in field_conv (to=0x7fe0f40424b0, from=0x7fe0f40423b8) at /data/src/10.4/sql/field_conv.cc:849
      #12 0x000055bb83d96dfb in save_field_in_field (from=0x7fe0f40423b8, null_value=0x7fe0f400db0e, to=0x7fe0f40424b0, no_conversions=false) at /data/src/10.4/sql/item.cc:6447
      #13 0x000055bb83d9703c in Item_field::save_in_field (this=0x7fe0f400da98, to=0x7fe0f40424b0, no_conversions=false) at /data/src/10.4/sql/item.cc:6498
      #14 0x000055bb83b9395c in TABLE::update_virtual_fields (this=0x7fe0f4138960, h=0x7fe0f413e8c8, update_mode=VCOL_UPDATE_FOR_WRITE) at /data/src/10.4/sql/table.cc:7775
      #15 0x000055bb839ed4da in fill_record (thd=0x7fe0f4000b00, table=0x7fe0f4138960, ptr=0x7fe0f40422d8, values=..., ignore_errors=true, use_value=false) at /data/src/10.4/sql/sql_base.cc:8500
      #16 0x000055bb839ed615 in fill_record_n_invoke_before_triggers (thd=0x7fe0f4000b00, table=0x7fe0f4138960, ptr=0x7fe0f40422b8, values=..., ignore_errors=true, event=TRG_EVENT_INSERT) at /data/src/10.4/sql/sql_base.cc:8543
      #17 0x000055bb83a38914 in select_insert::store_values (this=0x7fe0f40169f0, values=...) at /data/src/10.4/sql/sql_insert.cc:3889
      #18 0x000055bb83a38599 in select_insert::send_data (this=0x7fe0f40169f0, values=...) at /data/src/10.4/sql/sql_insert.cc:3820
      #19 0x000055bb83aeb054 in end_send (join=0x7fe0f4016aa0, join_tab=0x0, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20453
      #20 0x000055bb83ae73d9 in do_select (join=0x7fe0f4016aa0, procedure=0x0) at /data/src/10.4/sql/sql_select.cc:18770
      #21 0x000055bb83ac03b7 in JOIN::exec_inner (this=0x7fe0f4016aa0) at /data/src/10.4/sql/sql_select.cc:4089
      #22 0x000055bb83abf828 in JOIN::exec (this=0x7fe0f4016aa0) at /data/src/10.4/sql/sql_select.cc:3883
      #23 0x000055bb83ac0ab7 in mysql_select (thd=0x7fe0f4000b00, tables=0x7fe0f4015b68, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489925888, result=0x7fe0f40169f0, unit=0x7fe0f40049b0, select_lex=0x7fe0f40155e0) at /data/src/10.4/sql/sql_select.cc:4288
      #24 0x000055bb83ab23a6 in handle_select (thd=0x7fe0f4000b00, lex=0x7fe0f40048e8, result=0x7fe0f40169f0, setup_tables_done_option=1073741824) at /data/src/10.4/sql/sql_select.cc:382
      #25 0x000055bb83a76579 in mysql_execute_command (thd=0x7fe0f4000b00) at /data/src/10.4/sql/sql_parse.cc:4837
      #26 0x000055bb83a80905 in mysql_parse (thd=0x7fe0f4000b00, rawbuf=0x7fe0f4014e98 "INSERT IGNORE INTO t1 SELECT * FROM t1", length=38, parser_state=0x7fe1041925f0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8085
      #27 0x000055bb83a6dd00 in dispatch_command (command=COM_QUERY, thd=0x7fe0f4000b00, packet=0x7fe0f411d4d1 "INSERT IGNORE INTO t1 SELECT * FROM t1", packet_length=38, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1850
      #28 0x000055bb83a6c724 in do_command (thd=0x7fe0f4000b00) at /data/src/10.4/sql/sql_parse.cc:1395
      #29 0x000055bb83bd50a5 in do_handle_one_connection (connect=0x55bb87c23750) at /data/src/10.4/sql/sql_connect.cc:1402
      #30 0x000055bb83bd4e29 in handle_one_connection (arg=0x55bb87c23750) at /data/src/10.4/sql/sql_connect.cc:1308
      #31 0x000055bb84076f4d in pfs_spawn_thread (arg=0x55bb87cb8fb0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #32 0x00007fe10bcc2494 in start_thread (arg=0x7fe104193700) at pthread_create.c:333
      #33 0x00007fe10a0a893f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Couldn't reproduce on 10.3.
      Couldn't reproduce with InnoDB or Aria.
      No visible effect on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.