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

Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' or alike failed upon SELECT with mix of functions from simple view

    XMLWordPrintable

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • 5.5, 10.1, 10.2, 10.3, 10.4
    • 10.4
    • Server
    • None

    Description

      Note: We have plenty of open bugs with the same assertion failure, but they either use virtual columns, or in some other way essentially different scenarios. Unfortunately, the assertion is generic and happens in various cases, it's impossible to distinguish them.

      CREATE TABLE t1 (a INT) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (1),(2);
      CREATE VIEW v1 AS SELECT * FROM t1;
       
      SELECT ISNULL( BENCHMARK( 1, MIN(a) ) ) FROM v1;
       
      # Cleanup
      DROP VIEW v1;
      DROP TABLE t1;
      

      10.3 7060b032

      mysqld: /data/src/10.3/sql/field.cc:4267: virtual longlong Field_long::val_int(): Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' failed.
      190603 20:00:48 [ERROR] mysqld got signal 6 ;
       
      #6  0x00007f8a5c99de67 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55f3962f10f8 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))", file=file@entry=0x55f3962f0ef0 "/data/src/10.3/sql/field.cc", line=line@entry=4267, function=function@entry=0x55f3962f3620 <Field_long::val_int()::__PRETTY_FUNCTION__> "virtual longlong Field_long::val_int()") at assert.c:92
      #7  0x00007f8a5c99df12 in __GI___assert_fail (assertion=0x55f3962f10f8 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))", file=0x55f3962f0ef0 "/data/src/10.3/sql/field.cc", line=4267, function=0x55f3962f3620 <Field_long::val_int()::__PRETTY_FUNCTION__> "virtual longlong Field_long::val_int()") at assert.c:101
      #8  0x000055f3958ebd97 in Field_long::val_int (this=0x7f8a44006b00) at /data/src/10.3/sql/field.cc:4267
      #9  0x000055f39593f4a2 in Item_field::val_int (this=0x7f8a44014e78) at /data/src/10.3/sql/item.cc:3432
      #10 0x000055f39594df91 in Item_direct_ref::val_int (this=0x7f8a44016b68) at /data/src/10.3/sql/item.cc:8485
      #11 0x000055f39595810b in Item_direct_view_ref::val_int (this=0x7f8a44016b68) at /data/src/10.3/sql/item.h:5294
      #12 0x000055f39594d3d6 in Item_ref::val_int_result (this=0x7f8a44016b68) at /data/src/10.3/sql/item.cc:8279
      #13 0x000055f395951ec1 in Item_cache_int::cache_value (this=0x7f8a44016d50) at /data/src/10.3/sql/item.cc:9875
      #14 0x000055f395a067e2 in Item_sum_min::add (this=0x7f8a44012ad0) at /data/src/10.3/sql/item_sum.cc:2465
      #15 0x000055f395a0d9f7 in Aggregator_simple::add (this=0x7f8a44018730) at /data/src/10.3/sql/item_sum.h:706
      #16 0x000055f3956af9c1 in Item_sum::aggregator_add (this=0x7f8a44012ad0) at /data/src/10.3/sql/item_sum.h:551
      #17 0x000055f3956af8ac in Item_sum::reset_and_add (this=0x7f8a44012ad0) at /data/src/10.3/sql/item_sum.h:441
      #18 0x000055f3956a49c0 in init_sum_functions (func_ptr=0x7f8a44016fb0, end_ptr=0x7f8a44016fb8) at /data/src/10.3/sql/sql_select.cc:24401
      #19 0x000055f39569b724 in end_send_group (join=0x7f8a44015c48, join_tab=0x7f8a44017f38, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:20819
      #20 0x000055f395698571 in evaluate_join_record (join=0x7f8a44015c48, join_tab=0x7f8a44017ba0, error=0) at /data/src/10.3/sql/sql_select.cc:19652
      #21 0x000055f395697e30 in sub_select (join=0x7f8a44015c48, join_tab=0x7f8a44017ba0, end_of_records=false) at /data/src/10.3/sql/sql_select.cc:19432
      #22 0x000055f395697358 in do_select (join=0x7f8a44015c48, procedure=0x0) at /data/src/10.3/sql/sql_select.cc:18972
      #23 0x000055f39566f85d in JOIN::exec_inner (this=0x7f8a44015c48) at /data/src/10.3/sql/sql_select.cc:4042
      #24 0x000055f39566eca0 in JOIN::exec (this=0x7f8a44015c48) at /data/src/10.3/sql/sql_select.cc:3836
      #25 0x000055f39566ff41 in mysql_select (thd=0x7f8a44000b00, tables=0x7f8a44012ef0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f8a44015c20, unit=0x7f8a440049c8, select_lex=0x7f8a44005140) at /data/src/10.3/sql/sql_select.cc:4241
      #26 0x000055f395661ea4 in handle_select (thd=0x7f8a44000b00, lex=0x7f8a44004900, result=0x7f8a44015c20, setup_tables_done_option=0) at /data/src/10.3/sql/sql_select.cc:373
      #27 0x000055f39562ca31 in execute_sqlcom_select (thd=0x7f8a44000b00, all_tables=0x7f8a44012ef0) at /data/src/10.3/sql/sql_parse.cc:6562
      #28 0x000055f395623010 in mysql_execute_command (thd=0x7f8a44000b00) at /data/src/10.3/sql/sql_parse.cc:3818
      #29 0x000055f395630988 in mysql_parse (thd=0x7f8a44000b00, rawbuf=0x7f8a44012808 "SELECT ISNULL( BENCHMARK( 1, MIN(a) ) ) FROM v1", length=47, parser_state=0x7f8a56b9c5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8105
      #30 0x000055f39561d9ca in dispatch_command (command=COM_QUERY, thd=0x7f8a44000b00, packet=0x7f8a44008c61 "", packet_length=47, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1858
      #31 0x000055f39561c3ed in do_command (thd=0x7f8a44000b00) at /data/src/10.3/sql/sql_parse.cc:1403
      #32 0x000055f395785135 in do_handle_one_connection (connect=0x55f397fb6ef0) at /data/src/10.3/sql/sql_connect.cc:1402
      #33 0x000055f395784eac in handle_one_connection (arg=0x55f397fb6ef0) at /data/src/10.3/sql/sql_connect.cc:1308
      #34 0x000055f39605d7e2 in pfs_spawn_thread (arg=0x55f397fd1df0) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #35 0x00007f8a5e5124a4 in start_thread (arg=0x7f8a56b9d700) at pthread_create.c:456
      #36 0x00007f8a5ca5ad0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      5.5 6660c072

      mysqld: /data/src/5.5/sql/field.cc:3662: virtual longlong Field_long::val_int(): Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed.
      190603 20:01:45 [ERROR] mysqld got signal 6 ;
       
      #6  0x00007f7dddf3de67 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x564d14bb56c0 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))", file=file@entry=0x564d14bb55cc "/data/src/5.5/sql/field.cc", line=line@entry=3662, function=function@entry=0x564d14bb7740 <Field_long::val_int()::__PRETTY_FUNCTION__> "virtual longlong Field_long::val_int()") at assert.c:92
      #7  0x00007f7dddf3df12 in __GI___assert_fail (assertion=0x564d14bb56c0 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))", file=0x564d14bb55cc "/data/src/5.5/sql/field.cc", line=3662, function=0x564d14bb7740 <Field_long::val_int()::__PRETTY_FUNCTION__> "virtual longlong Field_long::val_int()") at assert.c:101
      #8  0x0000564d145a592d in Field_long::val_int (this=0x7f7dd8c56f98) at /data/src/5.5/sql/field.cc:3662
      #9  0x0000564d145dbe99 in Item_field::val_int (this=0x7f7dd8cc4f50) at /data/src/5.5/sql/item.cc:2636
      #10 0x0000564d145e8e2b in Item_direct_ref::val_int (this=0x7f7dd8d82d20) at /data/src/5.5/sql/item.cc:7462
      #11 0x0000564d145f274d in Item_direct_view_ref::val_int (this=0x7f7dd8d82d20) at /data/src/5.5/sql/item.h:3416
      #12 0x0000564d145e81d4 in Item_ref::val_int_result (this=0x7f7dd8d82d20) at /data/src/5.5/sql/item.cc:7238
      #13 0x0000564d145ecc3f in Item_cache_int::cache_value (this=0x7f7dd8d82ef0) at /data/src/5.5/sql/item.cc:8855
      #14 0x0000564d1466f00f in Item_sum_min::add (this=0x7f7dd8cc4340) at /data/src/5.5/sql/item_sum.cc:2117
      #15 0x0000564d14675093 in Aggregator_simple::add (this=0x7f7dd8d9a310) at /data/src/5.5/sql/item_sum.h:671
      #16 0x0000564d14483b29 in Item_sum::aggregator_add (this=0x7f7dd8cc4340) at /data/src/5.5/sql/item_sum.h:520
      #17 0x0000564d14483a14 in Item_sum::reset_and_add (this=0x7f7dd8cc4340) at /data/src/5.5/sql/item_sum.h:417
      #18 0x0000564d1447b491 in init_sum_functions (func_ptr=0x7f7dd8d82fb0, end_ptr=0x7f7dd8d82fb8) at /data/src/5.5/sql/sql_select.cc:21967
      #19 0x0000564d14472e03 in end_send_group (join=0x7f7dd8cc5ad8, join_tab=0x7f7dd8d99e80, end_of_records=false) at /data/src/5.5/sql/sql_select.cc:18425
      #20 0x0000564d14470276 in evaluate_join_record (join=0x7f7dd8cc5ad8, join_tab=0x7f7dd8d99b60, error=0) at /data/src/5.5/sql/sql_select.cc:17347
      #21 0x0000564d1446fb30 in sub_select (join=0x7f7dd8cc5ad8, join_tab=0x7f7dd8d99b60, end_of_records=false) at /data/src/5.5/sql/sql_select.cc:17130
      #22 0x0000564d1446f38f in do_select (join=0x7f7dd8cc5ad8, fields=0x7f7dd8cc5eb8, table=0x0, procedure=0x0) at /data/src/5.5/sql/sql_select.cc:16792
      #23 0x0000564d1444cb1b in JOIN::exec (this=0x7f7dd8cc5ad8) at /data/src/5.5/sql/sql_select.cc:2912
      #24 0x0000564d1444d2f1 in mysql_select (thd=0x7f7dd9a6f060, rref_pointer_array=0x7f7dd9a72d08, tables=0x7f7dd8cc4768, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f7dd8cc5ab8, unit=0x7f7dd9a72388, select_lex=0x7f7dd9a72a68) at /data/src/5.5/sql/sql_select.cc:3133
      #25 0x0000564d144438d4 in handle_select (thd=0x7f7dd9a6f060, lex=0x7f7dd9a722d8, result=0x7f7dd8cc5ab8, setup_tables_done_option=0) at /data/src/5.5/sql/sql_select.cc:311
      #26 0x0000564d1441c7a0 in execute_sqlcom_select (thd=0x7f7dd9a6f060, all_tables=0x7f7dd8cc4768) at /data/src/5.5/sql/sql_parse.cc:4684
      #27 0x0000564d144156a1 in mysql_execute_command (thd=0x7f7dd9a6f060) at /data/src/5.5/sql/sql_parse.cc:2222
      #28 0x0000564d1441f363 in mysql_parse (thd=0x7f7dd9a6f060, rawbuf=0x7f7dd8cc4078 "SELECT ISNULL( BENCHMARK( 1, MIN(a) ) ) FROM v1", length=47, parser_state=0x7f7ddf9b2620) at /data/src/5.5/sql/sql_parse.cc:5929
      #29 0x0000564d14412c1f in dispatch_command (command=COM_QUERY, thd=0x7f7dd9a6f060, packet=0x7f7dd9bea061 "", packet_length=47) at /data/src/5.5/sql/sql_parse.cc:1067
      #30 0x0000564d14411e2f in do_command (thd=0x7f7dd9a6f060) at /data/src/5.5/sql/sql_parse.cc:793
      #31 0x0000564d145174f9 in do_handle_one_connection (thd_arg=0x7f7dd9a6f060) at /data/src/5.5/sql/sql_connect.cc:1268
      #32 0x0000564d14517268 in handle_one_connection (arg=0x7f7dd9a6f060) at /data/src/5.5/sql/sql_connect.cc:1184
      #33 0x0000564d1489bbd8 in pfs_spawn_thread (arg=0x7f7dd9b92300) at /data/src/5.5/storage/perfschema/pfs.cc:1015
      #34 0x00007f7ddf5e44a4 in start_thread (arg=0x7f7ddf9b3700) at pthread_create.c:456
      #35 0x00007f7dddffad0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Also reproducible with Aria. Not reproducible with InnoDB.
      No obvious problem on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              igor Igor Babaev
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.