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

Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed in Field_num::val_decimal

    Details

    • Sprint:
      10.0.34

      Description

      CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
      CREATE VIEW v1 AS SELECT * FROM t1;
      INSERT INTO t1 VALUES (1, NULL),(3, 4);
       
      SELECT a, b FROM t1
      UNION
      (SELECT a, VAR_POP(a) AS f FROM v1 GROUP BY a ORDER BY b/a )
      ;
      

      5.5 20089f5a39fa8f6

      mysqld: /data/src/5.5/sql/field.cc:1689: virtual my_decimal* Field_num::val_decimal(my_decimal*): Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed.
      171220  1:56:28 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f23e64ceee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000000000785aac in Field_num::val_decimal (this=0x7f23e1059f48, decimal_value=0x7f23e7f40f60) at /data/src/5.5/sql/field.cc:1689
      #9  0x00000000007c2cc0 in Item_field::val_decimal (this=0x7f23e1181660, decimal_value=0x7f23e7f40f60) at /data/src/5.5/sql/item.cc:2639
      #10 0x00000000007d02b0 in Item_direct_ref::val_decimal (this=0x7f23e1135078, decimal_value=0x7f23e7f40f60) at /data/src/5.5/sql/item.cc:7644
      #11 0x00000000007d9b84 in Item_direct_view_ref::val_decimal (this=0x7f23e1135078, tmp=0x7f23e7f40f60) at /data/src/5.5/sql/item.h:3414
      #12 0x000000000080e31a in Item_func_div::decimal_op (this=0x7f23e1149e50, decimal_value=0x7f23e7f41110) at /data/src/5.5/sql/item_func.cc:1800
      #13 0x000000000082073e in Item_func_hybrid_result_type::decimal_op_with_null_check (this=0x7f23e1149e50, decimal_buffer=0x7f23e7f41110) at /data/src/5.5/sql/item_func.h:435
      #14 0x000000000080b94c in Item_func_hybrid_result_type::val_decimal (this=0x7f23e1149e50, decimal_value=0x7f23e7f41110) at /data/src/5.5/sql/item_func.cc:1034
      #15 0x00000000007cc0c3 in Item::save_in_field (this=0x7f23e1149e50, field=0x7f23e105bc78, no_conversions=true) at /data/src/5.5/sql/item.cc:6196
      #16 0x00000000005dbb11 in Item_result_field::save_in_result_field (this=0x7f23e1149e50, no_conversions=true) at /data/src/5.5/sql/item.h:2921
      #17 0x00000000006643ca in copy_funcs (func_ptr=0x7f23e113de18, thd=0x7f23e2264060) at /data/src/5.5/sql/sql_select.cc:21947
      #18 0x000000000065c366 in end_update (join=0x7f23e1198b10, join_tab=0x7f23e113a398, end_of_records=false) at /data/src/5.5/sql/sql_select.cc:18476
      #19 0x0000000000659208 in evaluate_join_record (join=0x7f23e1198b10, join_tab=0x7f23e113a078, error=0) at /data/src/5.5/sql/sql_select.cc:17289
      #20 0x0000000000658cdc in sub_select (join=0x7f23e1198b10, join_tab=0x7f23e113a078, end_of_records=false) at /data/src/5.5/sql/sql_select.cc:17111
      #21 0x00000000006583b6 in do_select (join=0x7f23e1198b10, fields=0x0, table=0x7f23e113d078, procedure=0x0) at /data/src/5.5/sql/sql_select.cc:16734
      #22 0x0000000000634d6f in JOIN::exec (this=0x7f23e1198b10) at /data/src/5.5/sql/sql_select.cc:2455
      #23 0x00000000006b1da9 in st_select_lex_unit::exec (this=0x7f23e2267388) at /data/src/5.5/sql/sql_union.cc:696
      #24 0x00000000006afbe5 in mysql_union (thd=0x7f23e2264060, lex=0x7f23e22672d8, result=0x7f23e1181e30, unit=0x7f23e2267388, setup_tables_done_option=0) at /data/src/5.5/sql/sql_union.cc:39
      #25 0x000000000062d7a9 in handle_select (thd=0x7f23e2264060, lex=0x7f23e22672d8, result=0x7f23e1181e30, setup_tables_done_option=0) at /data/src/5.5/sql/sql_select.cc:297
      #26 0x0000000000606d02 in execute_sqlcom_select (thd=0x7f23e2264060, all_tables=0x7f23e1148410) at /data/src/5.5/sql/sql_parse.cc:4678
      #27 0x0000000000600083 in mysql_execute_command (thd=0x7f23e2264060) at /data/src/5.5/sql/sql_parse.cc:2224
      #28 0x00000000006098ce in mysql_parse (thd=0x7f23e2264060, rawbuf=0x7f23e1148078 "SELECT a, b FROM t1\nUNION\n(SELECT a, VAR_POP(a) AS f FROM v1 GROUP BY a ORDER BY b/a )", length=86, parser_state=0x7f23e7f42640) at /data/src/5.5/sql/sql_parse.cc:5923
      #29 0x00000000005fd5e3 in dispatch_command (command=COM_QUERY, thd=0x7f23e2264060, packet=0x7f23e5f5b061 "SELECT a, b FROM t1\nUNION\n(SELECT a, VAR_POP(a) AS f FROM v1 GROUP BY a ORDER BY b/a )\n", packet_length=87) at /data/src/5.5/sql/sql_parse.cc:1066
      #30 0x00000000005fc7d5 in do_command (thd=0x7f23e2264060) at /data/src/5.5/sql/sql_parse.cc:793
      #31 0x00000000006ff7cf in do_handle_one_connection (thd_arg=0x7f23e2264060) at /data/src/5.5/sql/sql_connect.cc:1268
      #32 0x00000000006ff55c in handle_one_connection (arg=0x7f23e2264060) at /data/src/5.5/sql/sql_connect.cc:1184
      #33 0x0000000000a0d6d9 in pfs_spawn_thread (arg=0x7f23e2f76fc0) at /data/src/5.5/storage/perfschema/pfs.cc:1015
      #34 0x00007f23e7b75494 in start_thread (arg=0x7f23e7f43700) at pthread_create.c:333
      #35 0x00007f23e658b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      No visible effect on non-debug builds.

      Variation (difference in ORDER BY, b/a vs b/NULL):

      CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
      CREATE VIEW v1 AS SELECT * FROM t1;
      INSERT INTO t1 VALUES (1, NULL),(3, 4);
       
      SELECT a, b FROM t1
      UNION
      (SELECT a, VAR_POP(a) AS f FROM v1 GROUP BY a ORDER BY b/NULL )
      ;
      

      mysqld: /data/src/5.5/sql/field.cc:3654: virtual double Field_long::val_real(): Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed.
      171220  1:59:55 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fb29a39aee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000000000078c0ea in Field_long::val_real (this=0x7fb294c59f48) at /data/src/5.5/sql/field.cc:3654
      #9  0x00000000007c2ba7 in Item_field::val_real (this=0x7fb294d815e8) at /data/src/5.5/sql/item.cc:2622
      #10 0x00000000007d0177 in Item_direct_ref::val_real (this=0x7fb294d99ed0) at /data/src/5.5/sql/item.cc:7620
      #11 0x00000000007d9acb in Item_direct_view_ref::val_real (this=0x7fb294d99ed0) at /data/src/5.5/sql/item.h:3393
      #12 0x000000000080e1bb in Item_func_div::real_op (this=0x7fb294d49dd8) at /data/src/5.5/sql/item_func.cc:1781
      #13 0x000000000080b48f in Item_func_hybrid_result_type::val_real (this=0x7fb294d49dd8) at /data/src/5.5/sql/item_func.cc:957
      #14 0x00000000007cbfdd in Item::save_in_field (this=0x7fb294d49dd8, field=0x7fb294c5bc78, no_conversions=true) at /data/src/5.5/sql/item.cc:6187
      #15 0x00000000005dbb11 in Item_result_field::save_in_result_field (this=0x7fb294d49dd8, no_conversions=true) at /data/src/5.5/sql/item.h:2921
      #16 0x00000000006643ca in copy_funcs (func_ptr=0x7fb294d3de18, thd=0x7fb295e64060) at /data/src/5.5/sql/sql_select.cc:21947
      #17 0x000000000065c366 in end_update (join=0x7fb294d98ac0, join_tab=0x7fb294d3a398, end_of_records=false) at /data/src/5.5/sql/sql_select.cc:18476
      #18 0x0000000000659208 in evaluate_join_record (join=0x7fb294d98ac0, join_tab=0x7fb294d3a078, error=0) at /data/src/5.5/sql/sql_select.cc:17289
      #19 0x0000000000658cdc in sub_select (join=0x7fb294d98ac0, join_tab=0x7fb294d3a078, end_of_records=false) at /data/src/5.5/sql/sql_select.cc:17111
      #20 0x00000000006583b6 in do_select (join=0x7fb294d98ac0, fields=0x0, table=0x7fb294d3d078, procedure=0x0) at /data/src/5.5/sql/sql_select.cc:16734
      #21 0x0000000000634d6f in JOIN::exec (this=0x7fb294d98ac0) at /data/src/5.5/sql/sql_select.cc:2455
      #22 0x00000000006b1da9 in st_select_lex_unit::exec (this=0x7fb295e67388) at /data/src/5.5/sql/sql_union.cc:696
      #23 0x00000000006afbe5 in mysql_union (thd=0x7fb295e64060, lex=0x7fb295e672d8, result=0x7fb294d81db8, unit=0x7fb295e67388, setup_tables_done_option=0) at /data/src/5.5/sql/sql_union.cc:39
      #24 0x000000000062d7a9 in handle_select (thd=0x7fb295e64060, lex=0x7fb295e672d8, result=0x7fb294d81db8, setup_tables_done_option=0) at /data/src/5.5/sql/sql_select.cc:297
      #25 0x0000000000606d02 in execute_sqlcom_select (thd=0x7fb295e64060, all_tables=0x7fb294d48418) at /data/src/5.5/sql/sql_parse.cc:4678
      #26 0x0000000000600083 in mysql_execute_command (thd=0x7fb295e64060) at /data/src/5.5/sql/sql_parse.cc:2224
      #27 0x00000000006098ce in mysql_parse (thd=0x7fb295e64060, rawbuf=0x7fb294d48078 "SELECT a, b FROM t1\nUNION\n(SELECT a, VAR_POP(a) AS f FROM v1 GROUP BY a ORDER BY b/NULL )", length=89, parser_state=0x7fb29be0e640) at /data/src/5.5/sql/sql_parse.cc:5923
      #28 0x00000000005fd5e3 in dispatch_command (command=COM_QUERY, thd=0x7fb295e64060, packet=0x7fb299b5b061 "SELECT a, b FROM t1\nUNION\n(SELECT a, VAR_POP(a) AS f FROM v1 GROUP BY a ORDER BY b/NULL )\n", packet_length=90) at /data/src/5.5/sql/sql_parse.cc:1066
      #29 0x00000000005fc7d5 in do_command (thd=0x7fb295e64060) at /data/src/5.5/sql/sql_parse.cc:793
      #30 0x00000000006ff7cf in do_handle_one_connection (thd_arg=0x7fb295e64060) at /data/src/5.5/sql/sql_connect.cc:1268
      #31 0x00000000006ff55c in handle_one_connection (arg=0x7fb295e64060) at /data/src/5.5/sql/sql_connect.cc:1184
      #32 0x0000000000a0d6d9 in pfs_spawn_thread (arg=0x7fb296b76fc0) at /data/src/5.5/storage/perfschema/pfs.cc:1015
      #33 0x00007fb29ba41494 in start_thread (arg=0x7fb29be0f700) at pthread_create.c:333
      #34 0x00007fb29a45793f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

        Attachments

          Activity

            People

            • Assignee:
              cvicentiu Vicențiu Ciorbaru
              Reporter:
              elenst Elena Stepanova
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: