Bug #77842 assert in row_sel_convert_mysql_key_to_innobase with REPLACE generated column
Submitted: 27 Jul 2015 10:24 Modified: 6 Aug 2015 18:15
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Optimizer Severity:S3 (Non-critical)
Version:5.7.8 OS:Any
Assigned to: CPU Architecture:Any

[27 Jul 2015 10:24] Guilhem Bichot
Description:
Found by Shane Bester. He originally posted it in 
bug#21216067 but it's actually unrelated, so I'm making a new report for it.

Stack:

Version: '5.8.0-m17-debug'  MySQL Community Server (GPL)
[Warning] InnoDB: Using a partial-field key prefix in search, index `c` of
table `test`.`t`. Last data field length 6 bytes, key ptr now exceeds key end
by 4 bytes. Key value in the MySQL format:
 len 42; hex
000100610000000000000000000000000000000000000000000000000000000000000000000000
000000; asc    a                                      ;
InnoDB: Assertion failure in thread 4952 in file row0sel.cc line 2680

mysqld-debug.exe!my_sigabrt_handler()[my_thr_init.c:364]
mysqld-debug.exe!raise()[winsig.c:594]
mysqld-debug.exe!abort()[abort.c:82]
mysqld-debug.exe!ut_dbg_assertion_failed()[ut0dbg.cc:68]
mysqld-debug.exe!row_sel_convert_mysql_key_to_innobase()[row0sel.cc:2680]
mysqld-debug.exe!ha_innobase::index_read()[ha_innodb.cc:8246]
mysqld-debug.exe!handler::index_read_map()[handler.h:2574]
mysqld-debug.exe!handler::index_read_idx_map()[handler.cc:7059]
mysqld-debug.exe!handler::ha_index_read_idx_map()[handler.cc:2791]
mysqld-debug.exe!write_record()[sql_insert.cc:1530]
mysqld-debug.exe!Sql_cmd_insert::mysql_insert()[sql_insert.cc:704]
mysqld-debug.exe!Sql_cmd_insert::execute()[sql_insert.cc:3040]
mysqld-debug.exe!mysql_execute_command()[sql_parse.cc:3280]
mysqld-debug.exe!mysql_parse()[sql_parse.cc:5245]
mysqld-debug.exe!dispatch_command()[sql_parse.cc:1265]
mysqld-debug.exe!do_command()[sql_parse.cc:815]
mysqld-debug.exe!handle_connection()[connection_handler_per_thread.cc:301]
mysqld-debug.exe!pfs_spawn_thread()[pfs.cc:2215]
mysqld-debug.exe!win_thread_start()[my_thread.c:37]
mysqld-debug.exe!_callthreadstartex()[threadex.c:376]
mysqld-debug.exe!_threadstartex()[threadex.c:359]

How to repeat:
drop table if exists t;
create table t(a blob not null )engine=innodb;
alter table t add column b int;
alter table t add column c varbinary (1000) generated always as (a) virtual;
alter table t add unique index (c(39));
replace into t set a = 'a',b =1;
replace into t set a = 'a',b =1;
[6 Aug 2015 18:15] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.7.9, 5.8.0 release, and here's the changelog entry:

A virtual generated column on a table that uses index condition pushdown
(ICP) caused an assertion. 

Thank you for the bug report.