Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' with virtual columns
Bug #603654 reported by
Philip Stoev
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Igor Babaev |
Bug Description
When a virtual column is used in an ORDER BY, the server asserts as follows:
mysqld: field.cc:6610: virtual String* Field_string:
This is not observed if the expression from the virtual column is inlined in the query, so it seems to be a virtual-
Changed in maria: | |
assignee: | nobody → Igor Babaev (igorb-seattle) |
status: | New → Fix Committed |
importance: | Undecided → High |
Changed in maria: | |
milestone: | none → 5.2 |
Changed in maria: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Test case:
CREATE TABLE IF NOT EXISTS X (
f1 CHAR(255) BINARY NOT NULL DEFAULT 0,
f2 CHAR(255) BINARY NOT NULL DEFAULT 0,
v3 CHAR(255) BINARY AS ( CONCAT( f2 , f1 ) ) VIRTUAL );
REPLACE INTO X ( f1 , f2 ) VALUES ( '4' , '6' );
REPLACE INTO X ( f1 , f2 ) VALUES ( '4' , '6' );
SELECT 1 FROM X ORDER BY v3;
Backtrace:
#8 0x00897de8 in __assert_fail () from /lib/libc.so.6 :val_str (this=0xb5f58490, val_buffer= 0xb5f58700, val_ptr=0xb5f585b8) at field.cc:6610 concat: :val_str (this=0xb5f586f8, str=0xb5f58700) at item_strfunc.cc:288 false) at item.cc:5178 virtual_ fields (table=0xb5fd6800, for_write=false) at table.cc:5448 0xb5f5cef0, buffpek_ pointers= 0xb60fda70, tempfile= 0xb60fdb54, indexfile=0x0) 0xb5f4bd90, s_length=1, select=0xb5f4bc68, max_rows= 184467440737095 51615, positions= false, examined_ rows=0xb60fdda0 ) at filesort.cc:246 limit=184467440 73709551615, limit=184467440 73709551615, is_order_by=false) at sql_select.cc:14091 array=0xaf3a08c , tables=0xb5f4a180, wild_num=0, fields=..., conds=0x0, og_num=1, 0xb5f4a410, group=0x0, having=0x0, proc_param=0x0, select_ options= 2147764736, result=0xb5f4a4a8, unit=0xaf39d14, select_ lex=0xaf39f94) done_option= 0) at sql_select.cc:280 sqlcom_ select (thd=0xaf38658, all_tables= 0xb5f4a180) at sql_parse.cc:5079 command (thd=0xaf38658) at sql_parse.cc:2264 =0xb60ff230) at sql_parse.cc:6024 one_connection (arg=0xaf38658) at sql_connect.cc:1153 .so.0
#9 0x08242d5a in Field_string:
#10 0x081b417c in Item_field::val_str (this=0xb5f585b0, str=0xb5f58700) at item.cc:2054
#11 0x081fd94e in Item_func_
#12 0x081bb567 in Item::save_in_field (this=0xb5f586f8, field=0xb5f58500, no_conversions=
#13 0x082e2a0e in update_
#14 0x0839b5f9 in find_all_keys (param=0xb60fdc38, select=0xb5f4bc68, sort_keys=
at filesort.cc:590
#15 0x0839a3d9 in filesort (thd=0xaf38658, table=0xb5fd6800, sortorder=
sort_
#16 0x0830814f in create_sort_index (thd=0xaf38658, join=0xb5f4a4c0, order=0xb5f4a410, filesort_
select_
#17 0x082ea43f in JOIN::exec (this=0xb5f4a4c0) at sql_select.cc:2253
#18 0x082eae4d in mysql_select (thd=0xaf38658, rref_pointer_
order=
at sql_select.cc:2510
#19 0x082e37a7 in handle_select (thd=0xaf38658, lex=0xaf39cb8, result=0xb5f4a4a8, setup_tables_
#20 0x08287dd5 in execute_
#21 0x0827e7c8 in mysql_execute_
#22 0x08289fa0 in mysql_parse (thd=0xaf38658, inBuf=0xb5f4a068 "SELECT 1 FROM X ORDER BY v3", length=27, found_semicolon
#23 0x0827c1fa in dispatch_command (command=COM_QUERY, thd=0xaf38658, packet=0xaf50571 "SELECT 1 FROM X ORDER BY v3", packet_length=27) at sql_parse.cc:1183
#24 0x0827b6a0 in do_command (thd=0xaf38658) at sql_parse.cc:890
#25 0x08278800 in handle_
#26 0x00a08919 in start_thread () from /lib/libpthread
#27 0x00951e5e in clone () from /lib/libc.so.6
bzr version-info:
revision-id: <email address hidden>
date: 2010-07-02 20:24:39 -0700
build-date: 2010-07-09 08:58:16 -0700
revno: 2818
branch-nick: 5.2