Skip to content

Commit

Permalink
MDEV-11704 InnoDB: Failing assertion: dfield_is_null(dfield2) || dfie…
Browse files Browse the repository at this point in the history
…ld2->data

relax innodb assertion, because Field_blob::store() clearly says
that a data pointer can be zero if the length is zero.
  • Loading branch information
vuvova committed Feb 13, 2017
1 parent 239790d commit 87075e7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
11 changes: 11 additions & 0 deletions mysql-test/suite/vcol/r/vcol_keys_innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,14 @@ insert into t1 (col_varchar,col_int,col_datetime,col_time,col_blob,col_bit,col_y
('bar',6,'1900-01-01 00:00:00','00:00:00','bar',b'10011000001101011000101',1985,'b',0.7,'','2028-04-06','1971-01-01 00:00:00');
alter table t1 add index(vcol_datetime);
drop table t1;
create table t1 (
pk int,
col_blob mediumtext not null default '',
vcol_blob tinyblob as (col_blob) virtual,
col_char char(22) null,
primary key(pk),
index(col_char,vcol_blob(64))
) engine=innodb;
insert ignore into t1 (pk) values (1),(2);
update t1 set col_char = 'foo' where pk = 1;
drop table t1;
16 changes: 16 additions & 0 deletions mysql-test/suite/vcol/t/vcol_keys_innodb.test
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,19 @@ insert into t1 (col_varchar,col_int,col_datetime,col_time,col_blob,col_bit,col_y

alter table t1 add index(vcol_datetime);
drop table t1;


#
# MDEV-11704 InnoDB: Failing assertion: dfield_is_null(dfield2) || dfield2->data
#
create table t1 (
pk int,
col_blob mediumtext not null default '',
vcol_blob tinyblob as (col_blob) virtual,
col_char char(22) null,
primary key(pk),
index(col_char,vcol_blob(64))
) engine=innodb;
insert ignore into t1 (pk) values (1),(2);
update t1 set col_char = 'foo' where pk = 1;
drop table t1;
2 changes: 1 addition & 1 deletion sql/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6243,7 +6243,7 @@ void TABLE::mark_columns_needed_for_delete()

void TABLE::mark_columns_needed_for_update()
{
DBUG_ENTER("mark_columns_needed_for_update");
DBUG_ENTER("TABLE::mark_columns_needed_for_update");
bool need_signal= false;

mark_columns_per_binlog_row_image();
Expand Down
3 changes: 2 additions & 1 deletion storage/innobase/row/row0row.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ row_build_index_entry_low(
ut_ad(v_col->v_pos < dtuple_get_n_v_fields(row));
dfield2 = dtuple_get_nth_v_field(row, v_col->v_pos);

ut_ad(dfield_is_null(dfield2) || dfield2->data);
ut_ad(dfield_is_null(dfield2) ||
dfield_get_len(dfield2) == 0 || dfield2->data);
} else {
dfield2 = dtuple_get_nth_field(row, col_no);
ut_ad(dfield_get_type(dfield2)->mtype == DATA_MISSING
Expand Down

0 comments on commit 87075e7

Please sign in to comment.