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

Assertion `marked_for_read()' failed upon SELECT with VALUE(virtual column)

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • 10.4, 10.5, 10.6
    • Virtual Columns
    • None

    Description

      I've closed some bugs where similar failures are no longer reproducible on whatever reason, and opening this one instead in hope to get some action on it

      CREATE TABLE t1 (a VARCHAR(8), b VARCHAR(8) AS (REPEAT(a,1)) VIRTUAL) ENGINE=MyISAM;
      INSERT INTO t1 (a) VALUES ('foo'),('bar');
      SELECT VALUE(b) FROM (SELECT * FROM t1) sq;
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 b44e12fe

      mysqld: /data/src/10.4/sql/field.cc:7794: virtual String* Field_varstring::val_str(String*, String*): Assertion `marked_for_read()' failed.
      211013 19:05:31 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f3cfd2d9f36 in __GI___assert_fail (assertion=0x562abd4cc68d "marked_for_read()", file=0x562abd4cc0c3 "/data/src/10.4/sql/field.cc", line=7794, function=0x562abd4cee48 "virtual String* Field_varstring::val_str(String*, String*)") at assert.c:101
      #8  0x0000562abc96725d in Field_varstring::val_str (this=0x7f3cdc187718, val_buffer=0x7f3cdc1a5438, val_ptr=0x7f3cdc1a5328) at /data/src/10.4/sql/field.cc:7794
      #9  0x0000562abc9b4c82 in Item_field::val_str (this=0x7f3cdc1a52f8, str=0x7f3cdc1a5438) at /data/src/10.4/sql/item.cc:3173
      #10 0x0000562abca62b1c in Item_func_repeat::val_str (this=0x7f3cdc1a5408, str=0x7f3cdc1a5438) at /data/src/10.4/sql/item_strfunc.cc:3074
      #11 0x0000562abc9bf533 in Item::save_str_in_field (this=0x7f3cdc1a5408, field=0x7f3cdc187800, no_conversions=false) at /data/src/10.4/sql/item.cc:6581
      #12 0x0000562abc845f46 in Type_handler_string_result::Item_save_in_field (this=0x562abdbe1dd0 <type_handler_varchar>, item=0x7f3cdc1a5408, field=0x7f3cdc187800, no_conversions=false) at /data/src/10.4/sql/sql_type.cc:3817
      #13 0x0000562abc9bf87f in Item::save_in_field (this=0x7f3cdc1a5408, field=0x7f3cdc187800, no_conversions=false) at /data/src/10.4/sql/item.cc:6629
      #14 0x0000562abc75e315 in TABLE::update_virtual_fields (this=0x7f3cdc041590, h=0x7f3cdc1a4b18, update_mode=VCOL_UPDATE_FOR_READ) at /data/src/10.4/sql/table.cc:8404
      #15 0x0000562abc9945a1 in handler::ha_rnd_next (this=0x7f3cdc1a4b18, buf=0x7f3cdc1876d0 "\376\003foo") at /data/src/10.4/sql/handler.cc:2895
      #16 0x0000562abcb48040 in rr_sequential (info=0x7f3cdc019528) at /data/src/10.4/sql/records.cc:485
      #17 0x0000562abc566921 in READ_RECORD::read_record (this=0x7f3cdc019528) at /data/src/10.4/sql/records.h:70
      #18 0x0000562abc69f17a in join_init_read_record (tab=0x7f3cdc019460) at /data/src/10.4/sql/sql_select.cc:21529
      #19 0x0000562abc69ccc9 in sub_select (join=0x7f3cdc017448, join_tab=0x7f3cdc019460, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20584
      #20 0x0000562abc69c1f2 in do_select (join=0x7f3cdc017448, procedure=0x0) at /data/src/10.4/sql/sql_select.cc:20125
      #21 0x0000562abc670b87 in JOIN::exec_inner (this=0x7f3cdc017448) at /data/src/10.4/sql/sql_select.cc:4534
      #22 0x0000562abc66fcb6 in JOIN::exec (this=0x7f3cdc017448) at /data/src/10.4/sql/sql_select.cc:4316
      #23 0x0000562abc671422 in mysql_select (thd=0x7f3cdc000d90, tables=0x7f3cdc016450, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f3cdc017420, unit=0x7f3cdc004cc0, select_lex=0x7f3cdc014850) at /data/src/10.4/sql/sql_select.cc:4754
      #24 0x0000562abc660c54 in handle_select (thd=0x7f3cdc000d90, lex=0x7f3cdc004c00, result=0x7f3cdc017420, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:436
      #25 0x0000562abc6255b1 in execute_sqlcom_select (thd=0x7f3cdc000d90, all_tables=0x7f3cdc016450) at /data/src/10.4/sql/sql_parse.cc:6449
      #26 0x0000562abc61bd7e in mysql_execute_command (thd=0x7f3cdc000d90) at /data/src/10.4/sql/sql_parse.cc:3963
      #27 0x0000562abc6295e3 in mysql_parse (thd=0x7f3cdc000d90, rawbuf=0x7f3cdc014798 "SELECT VALUE(b) FROM (SELECT * FROM t1) sq", length=42, parser_state=0x7f3cf81034d0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7995
      #28 0x0000562abc6158eb in dispatch_command (command=COM_QUERY, thd=0x7f3cdc000d90, packet=0x7f3cdc00abf1 "", packet_length=42, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
      #29 0x0000562abc614151 in do_command (thd=0x7f3cdc000d90) at /data/src/10.4/sql/sql_parse.cc:1373
      #30 0x0000562abc7a64de in do_handle_one_connection (connect=0x562abfd6d400) at /data/src/10.4/sql/sql_connect.cc:1420
      #31 0x0000562abc7a6177 in handle_one_connection (arg=0x562abfd6d400) at /data/src/10.4/sql/sql_connect.cc:1316
      #32 0x0000562abd1d4ca8 in pfs_spawn_thread (arg=0x562abfcc2dd0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #33 0x00007f3cfd7f2609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #34 0x00007f3cfd3c5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Reproducible on 10.4-10.7.
      Not reproducible on 10.3.
      No obvious immediate problem on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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