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

Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed in Field_num::get_date upon SELECT from view

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (pk int  default 0, a1 date);
      INSERT INTO t1 VALUES (1,'1900-01-01'),(2,NULL),(3,NULL),(4,NULL);
       
      CREATE VIEW v1 AS 
      SELECT t1.pk AS pk, t1.a1 AS a1 FROM t1;
       
      SELECT a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk)) FROM v1;
      

      mysqld: /home/alice/git/10.2/sql/field.cc:2078: virtual bool Field_num::get_date(MYSQL_TIME*, ulonglong): Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed.
      180518 12:46:23 [ERROR] mysqld got signal 6 ;
      Server version: 10.2.16-MariaDB-debug-log
       
      Thread pointer: 0x7fa588000a98
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7fa598c0ce70 thread_stack 0x49000
      mysys/stacktrace.c:267(my_print_stacktrace)[0x564f6448f14b]
      sql/signal_handler.cc:168(handle_fatal_signal)[0x564f63d28c15]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fa59f581390]
      linux/raise.c:54(__GI_raise)[0x7fa59e93a428]
      stdlib/abort.c:91(__GI_abort)[0x7fa59e93c02a]
      assert/assert.c:92(__assert_fail_base)[0x7fa59e932bd7]
      /lib/x86_64-linux-gnu/libc.so.6(+0x2dc82)[0x7fa59e932c82]
      sql/field.cc:2079(Field_num::get_date(st_mysql_time*, unsigned long long))[0x564f63cfb41d]
      sql/item.cc:2824(Item_field::get_date_result(st_mysql_time*, unsigned long long))[0x564f63d45401]
      sql/item.cc:9799(Item_cache_temporal::cache_value())[0x564f63d595a2]
      sql/item.cc:9717(Item_cache_temporal::val_datetime_packed())[0x564f63d5918e]
      sql/item.h:1427(Item::val_temporal_packed(enum_field_types))[0x564f63d5de05]
      sql/item_cmpfunc.cc:2166(Item_func_between::val_int())[0x564f63d6d1a1]
      sql/item.cc:7009(Item::send(Protocol*, String*))[0x564f63d50f5b]
      sql/protocol.cc:979(Protocol::send_result_set_row(List<Item>*))[0x564f639ee417]
      sql/sql_class.cc:2800(select_send::send_data(List<Item>&))[0x564f63a70882]
      sql/sql_select.cc:19863(end_send(JOIN*, st_join_table*, bool))[0x564f63b29b22]
      sql/sql_select.cc:18915(evaluate_join_record(JOIN*, st_join_table*, int))[0x564f63b275ed]
      sql/sql_select.cc:18695(sub_select(JOIN*, st_join_table*, bool))[0x564f63b26ede]
      sql/sql_select.cc:18239(do_select(JOIN*, Procedure*))[0x564f63b26472]
      sql/sql_select.cc:3570(JOIN::exec_inner())[0x564f63b00edf]
      sql/sql_select.cc:3366(JOIN::exec())[0x564f63b00380]
      sql/sql_select.cc:3767(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x564f63b01550]
      sql/sql_select.cc:376(handle_select(THD*, LEX*, select_result*, unsigned long))[0x564f63af5ace]
      sql/sql_parse.cc:6476(execute_sqlcom_select(THD*, TABLE_LIST*))[0x564f63ac16b6]
      sql/sql_parse.cc:3483(mysql_execute_command(THD*))[0x564f63ab73f7]
      sql/sql_parse.cc:7940(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x564f63ac524c]
      sql/sql_parse.cc:1822(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x564f63ab2c56]
      sql/sql_parse.cc:1374(do_command(THD*))[0x564f63ab15b2]
      sql/sql_connect.cc:1335(do_handle_one_connection(CONNECT*))[0x564f63c006cb]
      sql/sql_connect.cc:1242(handle_one_connection)[0x564f63c0044b]
      perfschema/pfs.cc:1864(pfs_spawn_thread)[0x564f6442cc98]
      /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fa59f5776ba]
      x86_64/clone.S:111(clone)[0x7fa59ea0c41d]
       
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7fa588149ba0): SELECT a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk)) FROM v1
      Connection ID (thread ID): 4
      Status: NOT_KILLED
      

       10.2 de86997160ea5e02
      Thread 1 (Thread 0x7fa598c0d700 (LWP 29177)):
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
      #1  0x0000564f6448f23d in my_write_core (sig=6) at /home/alice/git/10.2/mysys/stacktrace.c:477
      #2  0x0000564f63d2903d in handle_fatal_signal (sig=6) at /home/alice/git/10.2/sql/signal_handler.cc:305
      #3  <signal handler called>
      #4  0x00007fa59e93a428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
      #5  0x00007fa59e93c02a in __GI_abort () at abort.c:89
      #6  0x00007fa59e932bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x564f64667338 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))", file=file@entry=0x564f646670d0 "/home/alice/git/10.2/sql/field.cc", line=line@entry=2078, function=function@entry=0x564f64668de0 <Field_num::get_date(st_mysql_time*, unsigned long long)::__PRETTY_FUNCTION__> "virtual bool Field_num::get_date(MYSQL_TIME*, ulonglong)") at assert.c:92
      #7  0x00007fa59e932c82 in __GI___assert_fail (assertion=0x564f64667338 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))", file=0x564f646670d0 "/home/alice/git/10.2/sql/field.cc", line=2078, function=0x564f64668de0 <Field_num::get_date(st_mysql_time*, unsigned long long)::__PRETTY_FUNCTION__> "virtual bool Field_num::get_date(MYSQL_TIME*, ulonglong)") at assert.c:101
      #8  0x0000564f63cfb41d in Field_num::get_date (this=0x7fa58806a9c0, ltime=0x7fa598c0a5b0, fuzzydate=33554433) at /home/alice/git/10.2/sql/field.cc:2078
      #9  0x0000564f63d45401 in Item_field::get_date_result (this=0x7fa58806d8d0, ltime=0x7fa598c0a5b0, fuzzydate=33554433) at /home/alice/git/10.2/sql/item.cc:2824
      #10 0x0000564f63d595a2 in Item_cache_temporal::cache_value (this=0x7fa58806aac0) at /home/alice/git/10.2/sql/item.cc:9799
      #11 0x0000564f63d5918e in Item_cache_temporal::val_datetime_packed (this=0x7fa58806aac0) at /home/alice/git/10.2/sql/item.cc:9717
      #12 0x0000564f63d5de05 in Item::val_temporal_packed (this=0x7fa58806aac0, f_type=MYSQL_TYPE_DATE) at /home/alice/git/10.2/sql/item.h:1426
      #13 0x0000564f63d6d1a1 in Item_func_between::val_int (this=0x7fa588120390) at /home/alice/git/10.2/sql/item_cmpfunc.cc:2166
      #14 0x0000564f63d50f5b in Item::send (this=0x7fa588120390, protocol=0x7fa588001058, buffer=0x7fa598c0a8c0) at /home/alice/git/10.2/sql/item.cc:7009
      #15 0x0000564f639ee417 in Protocol::send_result_set_row (this=0x7fa588001058, row_items=0x7fa588004ec8) at /home/alice/git/10.2/sql/protocol.cc:979
      #16 0x0000564f63a70882 in select_send::send_data (this=0x7fa5881490e0, items=...) at /home/alice/git/10.2/sql/sql_class.cc:2800
      #17 0x0000564f63b29b22 in end_send (join=0x7fa588183c00, join_tab=0x7fa58816f840, end_of_records=false) at /home/alice/git/10.2/sql/sql_select.cc:19863
      #18 0x0000564f63b275ed in evaluate_join_record (join=0x7fa588183c00, join_tab=0x7fa58816f490, error=0) at /home/alice/git/10.2/sql/sql_select.cc:18915
      #19 0x0000564f63b26ede in sub_select (join=0x7fa588183c00, join_tab=0x7fa58816f490, end_of_records=false) at /home/alice/git/10.2/sql/sql_select.cc:18695
      #20 0x0000564f63b26472 in do_select (join=0x7fa588183c00, procedure=0x0) at /home/alice/git/10.2/sql/sql_select.cc:18239
      #21 0x0000564f63b00edf in JOIN::exec_inner (this=0x7fa588183c00) at /home/alice/git/10.2/sql/sql_select.cc:3570
      #22 0x0000564f63b00380 in JOIN::exec (this=0x7fa588183c00) at /home/alice/git/10.2/sql/sql_select.cc:3365
      #23 0x0000564f63b01550 in mysql_select (thd=0x7fa588000a98, tables=0x7fa588140d40, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fa5881490e0, unit=0x7fa588004640, select_lex=0x7fa588004d98) at /home/alice/git/10.2/sql/sql_select.cc:3765
      #24 0x0000564f63af5ace in handle_select (thd=0x7fa588000a98, lex=0x7fa588004578, result=0x7fa5881490e0, setup_tables_done_option=0) at /home/alice/git/10.2/sql/sql_select.cc:376
      #25 0x0000564f63ac16b6 in execute_sqlcom_select (thd=0x7fa588000a98, all_tables=0x7fa588140d40) at /home/alice/git/10.2/sql/sql_parse.cc:6476
      #26 0x0000564f63ab73f7 in mysql_execute_command (thd=0x7fa588000a98) at /home/alice/git/10.2/sql/sql_parse.cc:3483
      #27 0x0000564f63ac524c in mysql_parse (thd=0x7fa588000a98, rawbuf=0x7fa588149ba0 "SELECT a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk)) FROM v1", length=60, parser_state=0x7fa598c0c1f0, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:7940
      #28 0x0000564f63ab2c56 in dispatch_command (command=COM_QUERY, thd=0x7fa588000a98, packet=0x7fa588007f39 "", packet_length=60, is_com_multi=false, is_next_command=false) at /home/alice/git/10.2/sql/sql_parse.cc:1820
      #29 0x0000564f63ab15b2 in do_command (thd=0x7fa588000a98) at /home/alice/git/10.2/sql/sql_parse.cc:1374
      #30 0x0000564f63c006cb in do_handle_one_connection (connect=0x564f65fb3f78) at /home/alice/git/10.2/sql/sql_connect.cc:1335
      #31 0x0000564f63c0044b in handle_one_connection (arg=0x564f65fb3f78) at /home/alice/git/10.2/sql/sql_connect.cc:1241
      #32 0x0000564f6442cc98 in pfs_spawn_thread (arg=0x564f65f18af8) at /home/alice/git/10.2/storage/perfschema/pfs.cc:1862
      #33 0x00007fa59f5776ba in start_thread (arg=0x7fa598c0d700) at pthread_create.c:333
      #34 0x00007fa59ea0c41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
      

       10.3 395c8ca708c15e7f4b
      Thread 1 (Thread 0x7f30a63d6700 (LWP 29397)):
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
      #1  0x0000555b0581bc69 in my_write_core (sig=6) at /home/alice/git/10.3/mysys/stacktrace.c:481
      #2  0x0000555b0500a4d1 in handle_fatal_signal (sig=6) at /home/alice/git/10.3/sql/signal_handler.cc:305
      #3  <signal handler called>
      #4  0x00007f30ac238428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
      #5  0x00007f30ac23a02a in __GI_abort () at abort.c:89
      #6  0x00007f30ac230bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x555b05a8f480 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))", file=file@entry=0x555b05a8f270 "/home/alice/git/10.3/sql/field.cc", line=line@entry=2068, function=function@entry=0x555b05a909e0 <Field_int::get_date(st_mysql_time*, unsigned long long)::__PRETTY_FUNCTION__> "virtual bool Field_int::get_date(MYSQL_TIME*, ulonglong)") at assert.c:92
      #7  0x00007f30ac230c82 in __GI___assert_fail (assertion=0x555b05a8f480 "!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))", file=0x555b05a8f270 "/home/alice/git/10.3/sql/field.cc", line=2068, function=0x555b05a909e0 <Field_int::get_date(st_mysql_time*, unsigned long long)::__PRETTY_FUNCTION__> "virtual bool Field_int::get_date(MYSQL_TIME*, ulonglong)") at assert.c:101
      #8  0x0000555b04fd3610 in Field_int::get_date (this=0x7f309418bab0, ltime=0x7f30a63d3d00, fuzzydate=33554433) at /home/alice/git/10.3/sql/field.cc:2068
      #9  0x0000555b0502d52b in Item_field::get_date_result (this=0x7f3094017850, ltime=0x7f30a63d3d00, fuzzydate=33554433) at /home/alice/git/10.3/sql/item.cc:3415
      #10 0x0000555b05023200 in Item::val_datetime_packed_result (this=0x7f3094017850) at /home/alice/git/10.3/sql/item.cc:121
      #11 0x0000555b05040ac3 in Item_cache_temporal::cache_value (this=0x7f3094136390) at /home/alice/git/10.3/sql/item.cc:10057
      #12 0x0000555b050406a6 in Item_cache_temporal::val_datetime_packed (this=0x7f3094136390) at /home/alice/git/10.3/sql/item.cc:9981
      #13 0x0000555b05061f11 in Item::val_temporal_packed (this=0x7f3094136390, f_type=MYSQL_TYPE_DATE) at /home/alice/git/10.3/sql/item.h:1483
      #14 0x0000555b05052ed0 in Item_func_between::val_int_cmp_temporal (this=0x7f309406e570) at /home/alice/git/10.3/sql/item_cmpfunc.cc:2127
      #15 0x0000555b04f00ae2 in Type_handler_temporal_result::Item_func_between_val_int (this=0x555b06556e88 <type_handler_newdate>, func=0x7f309406e570) at /home/alice/git/10.3/sql/sql_type.cc:3713
      #16 0x0000555b0518c4fa in Item_func_between::val_int (this=0x7f309406e570) at /home/alice/git/10.3/sql/item_cmpfunc.h:901
      #17 0x0000555b04f03e8f in Type_handler::Item_send_long (this=0x555b06556e00 <type_handler_long>, item=0x7f309406e570, protocol=0x7f3094001080, buf=0x7f30a63d3f50) at /home/alice/git/10.3/sql/sql_type.cc:5304
      #18 0x0000555b04f08566 in Type_handler_long::Item_send (this=0x555b06556e00 <type_handler_long>, item=0x7f309406e570, protocol=0x7f3094001080, buf=0x7f30a63d3f50) at /home/alice/git/10.3/sql/sql_type.h:2415
      #19 0x0000555b04c08ecc in Item::send (this=0x7f309406e570, protocol=0x7f3094001080, buffer=0x7f30a63d3f50) at /home/alice/git/10.3/sql/item.h:834
      #20 0x0000555b04c03ea9 in Protocol::send_result_set_row (this=0x7f3094001080, row_items=0x7f30940051e0) at /home/alice/git/10.3/sql/protocol.cc:986
      #21 0x0000555b04cad6ec in select_send::send_data (this=0x7f3094107180, items=...) at /home/alice/git/10.3/sql/sql_class.cc:3042
      #22 0x0000555b04d88efe in end_send (join=0x7f3094183330, join_tab=0x7f30940dd1b0, end_of_records=false) at /home/alice/git/10.3/sql/sql_select.cc:20425
      #23 0x0000555b04d86723 in evaluate_join_record (join=0x7f3094183330, join_tab=0x7f30940dce00, error=0) at /home/alice/git/10.3/sql/sql_select.cc:19465
      #24 0x0000555b04d85fdb in sub_select (join=0x7f3094183330, join_tab=0x7f30940dce00, end_of_records=false) at /home/alice/git/10.3/sql/sql_select.cc:19244
      #25 0x0000555b04d85502 in do_select (join=0x7f3094183330, procedure=0x0) at /home/alice/git/10.3/sql/sql_select.cc:18783
      #26 0x0000555b04d5e83a in JOIN::exec_inner (this=0x7f3094183330) at /home/alice/git/10.3/sql/sql_select.cc:3996
      #27 0x0000555b04d5dcaa in JOIN::exec (this=0x7f3094183330) at /home/alice/git/10.3/sql/sql_select.cc:3790
      #28 0x0000555b04d5ef15 in mysql_select (thd=0x7f3094000a98, tables=0x7f3094076f40, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7f3094107180, unit=0x7f3094004918, select_lex=0x7f30940050b0) at /home/alice/git/10.3/sql/sql_select.cc:4195
      #29 0x0000555b04d50f3e in handle_select (thd=0x7f3094000a98, lex=0x7f3094004850, result=0x7f3094107180, setup_tables_done_option=0) at /home/alice/git/10.3/sql/sql_select.cc:382
      #30 0x0000555b04d1ada2 in execute_sqlcom_select (thd=0x7f3094000a98, all_tables=0x7f3094076f40) at /home/alice/git/10.3/sql/sql_parse.cc:6545
      #31 0x0000555b04d11068 in mysql_execute_command (thd=0x7f3094000a98) at /home/alice/git/10.3/sql/sql_parse.cc:3768
      #32 0x0000555b04d1ea84 in mysql_parse (thd=0x7f3094000a98, rawbuf=0x7f30940fa0c0 "SELECT a1 BETWEEN (('2018-08-24')) AND (DEFAULT(pk)) FROM v1", length=60, parser_state=0x7f30a63d55d0, is_com_multi=false, is_next_command=false) at /home/alice/git/10.3/sql/sql_parse.cc:8019
      #33 0x0000555b04d0ba67 in dispatch_command (command=COM_QUERY, thd=0x7f3094000a98, packet=0x7f309400a589 "", packet_length=60, is_com_multi=false, is_next_command=false) at /home/alice/git/10.3/sql/sql_parse.cc:1846
      #34 0x0000555b04d0a484 in do_command (thd=0x7f3094000a98) at /home/alice/git/10.3/sql/sql_parse.cc:1391
      #35 0x0000555b04e75149 in do_handle_one_connection (connect=0x555b07152f68) at /home/alice/git/10.3/sql/sql_connect.cc:1402
      #36 0x0000555b04e74e9a in handle_one_connection (arg=0x555b07152f68) at /home/alice/git/10.3/sql/sql_connect.cc:1308
      #37 0x0000555b0579d7fa in pfs_spawn_thread (arg=0x555b070b1ec8) at /home/alice/git/10.3/storage/perfschema/pfs.cc:1862
      #38 0x00007f30ace756ba in start_thread (arg=0x7f30a63d6700) at pthread_create.c:333
      #39 0x00007f30ac30a41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            alice Alice Sherepa
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.