Skip to content
Permalink
Browse files
MDEV-18722 Assertion `templ->mysql_null_bit_mask' failed in row_sel_s…
…tore_mysql_rec upon modifying indexed column into blob

don't assert that virtual columns are always nullable
  • Loading branch information
vuvova committed Feb 28, 2019
1 parent 3f53515 commit f78c0f6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
@@ -26,3 +26,10 @@ replace into t1 (pk) values (1);
alter table t1 force;
replace into t1 (pk) values (1);
drop table t1;
create table t1 (t time, unique(t)) engine=innodb;
insert into t1 values (null),(null);
alter ignore table t1 modify t text not null default '';
Warnings:
Warning 1265 Data truncated for column 't' at row 1
Warning 1265 Data truncated for column 't' at row 2
drop table t1;
@@ -36,3 +36,11 @@ replace into t1 (pk) values (1);
alter table t1 force;
replace into t1 (pk) values (1);
drop table t1;

#
# MDEV-18722 Assertion `templ->mysql_null_bit_mask' failed in row_sel_store_mysql_rec upon modifying indexed column into blob
#
create table t1 (t time, unique(t)) engine=innodb;
insert into t1 values (null),(null);
alter ignore table t1 modify t text not null default '';
drop table t1;
@@ -3057,18 +3057,17 @@ static bool row_sel_store_mysql_rec(
const mysql_row_templ_t*templ = &prebuilt->mysql_template[i];

if (templ->is_virtual && dict_index_is_clust(index)) {
/* Virtual columns are never declared NOT NULL. */
ut_ad(templ->mysql_null_bit_mask);

/* Skip virtual columns if it is not a covered
search or virtual key read is not requested. */
if (!rec_clust
|| !prebuilt->index->has_virtual()
|| (!prebuilt->read_just_key
&& !prebuilt->m_read_virtual_key)) {
/* Initialize the NULL bit. */
mysql_rec[templ->mysql_null_byte_offset]
|= (byte) templ->mysql_null_bit_mask;
if (templ->mysql_null_bit_mask) {
mysql_rec[templ->mysql_null_byte_offset]
|= (byte) templ->mysql_null_bit_mask;
}
continue;
}

0 comments on commit f78c0f6

Please sign in to comment.