Commit f78c0f6f authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-18722 Assertion `templ->mysql_null_bit_mask' failed in...

MDEV-18722 Assertion `templ->mysql_null_bit_mask' failed in row_sel_store_mysql_rec upon modifying indexed column into blob

don't assert that virtual columns are always nullable
parent 3f535154
...@@ -26,3 +26,10 @@ replace into t1 (pk) values (1); ...@@ -26,3 +26,10 @@ replace into t1 (pk) values (1);
alter table t1 force; alter table t1 force;
replace into t1 (pk) values (1); replace into t1 (pk) values (1);
drop table t1; 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); ...@@ -36,3 +36,11 @@ replace into t1 (pk) values (1);
alter table t1 force; alter table t1 force;
replace into t1 (pk) values (1); replace into t1 (pk) values (1);
drop table t1; 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,9 +3057,6 @@ static bool row_sel_store_mysql_rec( ...@@ -3057,9 +3057,6 @@ static bool row_sel_store_mysql_rec(
const mysql_row_templ_t*templ = &prebuilt->mysql_template[i]; const mysql_row_templ_t*templ = &prebuilt->mysql_template[i];
if (templ->is_virtual && dict_index_is_clust(index)) { 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 /* Skip virtual columns if it is not a covered
search or virtual key read is not requested. */ search or virtual key read is not requested. */
if (!rec_clust if (!rec_clust
...@@ -3067,8 +3064,10 @@ static bool row_sel_store_mysql_rec( ...@@ -3067,8 +3064,10 @@ static bool row_sel_store_mysql_rec(
|| (!prebuilt->read_just_key || (!prebuilt->read_just_key
&& !prebuilt->m_read_virtual_key)) { && !prebuilt->m_read_virtual_key)) {
/* Initialize the NULL bit. */ /* Initialize the NULL bit. */
if (templ->mysql_null_bit_mask) {
mysql_rec[templ->mysql_null_byte_offset] mysql_rec[templ->mysql_null_byte_offset]
|= (byte) templ->mysql_null_bit_mask; |= (byte) templ->mysql_null_bit_mask;
}
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment