#7 0x00007f3b9fec8ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8 0x000000000078d036 in Field_long::val_str (this=0x7f3b9a858f98, val_buffer=0x7f3ba193b460, val_ptr=0x7f3b9a949f10) at /data/src/5.5/sql/field.cc:3673
#9 0x00000000007c30de in Item_field::val_str (this=0x7f3b9a949ef8, str=0x7f3ba193b460) at /data/src/5.5/sql/item.cc:2613
#10 0x00000000007bdaae in Item::print_value (this=0x7f3b9a949ef8, str=0x7f3ba193b9a0) at /data/src/5.5/sql/item.cc:635
#11 0x00000000007ce39e in Item_field::print (this=0x7f3b9a949ef8, str=0x7f3ba193b9a0, query_type=QT_TO_SYSTEM_CHARSET) at /data/src/5.5/sql/item.cc:6845
#12 0x00000000007cf911 in Item_ref::print (this=0x7f3b9a93c078, str=0x7f3ba193b9a0, query_type=QT_TO_SYSTEM_CHARSET) at /data/src/5.5/sql/item.cc:7360
#13 0x000000000080a0db in Item_func::print_args (this=0x7f3b9a948288, str=0x7f3ba193b9a0, from=0, query_type=QT_TO_SYSTEM_CHARSET) at /data/src/5.5/sql/item_func.cc:481
#14 0x000000000080a049 in Item_func::print (this=0x7f3b9a948288, str=0x7f3ba193b9a0, query_type=QT_TO_SYSTEM_CHARSET) at /data/src/5.5/sql/item_func.cc:470
#15 0x00000000007bd9e1 in Item::print_item_w_name (this=0x7f3b9a948288, str=0x7f3ba193b9a0, query_type=QT_TO_SYSTEM_CHARSET) at /data/src/5.5/sql/item.cc:620
#16 0x000000000066a039 in st_select_lex::print (this=0x7f3b9ba67a68, thd=0x7f3b9ba64060, str=0x7f3ba193b9a0, query_type=QT_TO_SYSTEM_CHARSET) at /data/src/5.5/sql/sql_select.cc:23585
#17 0x00000000005f4e0e in st_select_lex_unit::print (this=0x7f3b9ba67388, str=0x7f3ba193b9a0, query_type=QT_TO_SYSTEM_CHARSET) at /data/src/5.5/sql/sql_lex.cc:2391
#18 0x0000000000607512 in execute_sqlcom_select (thd=0x7f3b9ba64060, all_tables=0x7f3b9a9483b8) at /data/src/5.5/sql/sql_parse.cc:4663
#19 0x00000000006009b3 in mysql_execute_command (thd=0x7f3b9ba64060) at /data/src/5.5/sql/sql_parse.cc:2224
#20 0x000000000060a1fe in mysql_parse (thd=0x7f3b9ba64060, rawbuf=0x7f3b9a948078 "EXPLAIN EXTENDED SELECT ISNULL(pk) FROM v1", length=42, parser_state=0x7f3ba193c640) at /data/src/5.5/sql/sql_parse.cc:5923
#21 0x00000000005fdf13 in dispatch_command (command=COM_QUERY, thd=0x7f3b9ba64060, packet=0x7f3b9f75b061 "", packet_length=42) at /data/src/5.5/sql/sql_parse.cc:1066
#22 0x00000000005fd105 in do_command (thd=0x7f3b9ba64060) at /data/src/5.5/sql/sql_parse.cc:793
#23 0x000000000070024f in do_handle_one_connection (thd_arg=0x7f3b9ba64060) at /data/src/5.5/sql/sql_connect.cc:1268
#24 0x00000000006fffdc in handle_one_connection (arg=0x7f3b9ba64060) at /data/src/5.5/sql/sql_connect.cc:1184
#25 0x0000000000a0e06b in pfs_spawn_thread (arg=0x7f3b9c776fc0) at /data/src/5.5/storage/perfschema/pfs.cc:1015
#26 0x00007f3ba156f494 in start_thread (arg=0x7f3ba193d700) at pthread_create.c:333
#27 0x00007f3b9ff8593f in clone () from /lib/x86_64-linux-gnu/libc.so.6
Problem is that ISNULL do not need value of the argument, it is enough that it can not be NULL. So read flag removed and do not set because update_used_tables() do not called for ISNULL argument.
the question is why we print table by value...
Oleksandr Byelkin
added a comment - Problem is that ISNULL do not need value of the argument, it is enough that it can not be NULL. So read flag removed and do not set because update_used_tables() do not called for ISNULL argument.
the question is why we print table by value...
It works with table (no view) only because the query is simple and used tables of the query is not updated (any query which try to recalculate used tables will fail)
Oleksandr Byelkin
added a comment - It works with table (no view) only because the query is simple and used tables of the query is not updated (any query which try to recalculate used tables will fail)
MDEV-15475: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed on EXPLAIN EXTENDED with constant table and view
Do not try to print value of the field in table if it is optimized out.
EXPLAIN output still looks a bit strange (field from dual table, because table optimized out) but we do not indicate optimisations of ISNULL.
—
Oleksandr Byelkin
added a comment - revision-id: d1c90870ed114da62de8b12a71e2fba62724baa9 (mariadb-5.5.61-3-gd1c90870ed1)
parent(s): 68ebfb31f215247d2fa08c8ed97a320191afc179
author: Oleksandr Byelkin
committer: Oleksandr Byelkin
timestamp: 2018-08-06 15:50:22 +0200
message:
MDEV-15475 : Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed on EXPLAIN EXTENDED with constant table and view
Do not try to print value of the field in table if it is optimized out.
EXPLAIN output still looks a bit strange (field from dual table, because table optimized out) but we do not indicate optimisations of ISNULL.
—
It try to print value of const table which is not marked for read for extended explain representation.