Commit b6a3917b authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-11750 Assertion `vfield' failed in TABLE::update_virtual_fields after...

MDEV-11750 Assertion `vfield' failed in TABLE::update_virtual_fields after crash recovery on corrupted MyISAM table

Adjust the length of the BIT field
(same as in _mi_put_key_in_record())
parent 29ed440d
...@@ -365,3 +365,13 @@ ALTER TABLE t1 ADD INDEX(col_enum,vcol_int); ...@@ -365,3 +365,13 @@ ALTER TABLE t1 ADD INDEX(col_enum,vcol_int);
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t1 ADD INDEX(col_year); ALTER TABLE t1 ADD INDEX(col_year);
DROP TABLE t1; DROP TABLE t1;
create table t1 (
pk int primary key auto_increment,
b bit default null,
key(b)
) engine=myisam;
insert into t1 values (null, 0);
repair table t1 extended;
Table Op Msg_type Msg_text
test.t1 repair status OK
drop table t1;
...@@ -249,3 +249,16 @@ SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR ...@@ -249,3 +249,16 @@ SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
ALTER TABLE t1 ADD INDEX(col_year); ALTER TABLE t1 ADD INDEX(col_year);
--enable_warnings --enable_warnings
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-11750 Assertion `vfield' failed in TABLE::update_virtual_fields after crash recovery on corrupted MyISAM table
#
create table t1 (
pk int primary key auto_increment,
b bit default null,
key(b)
) engine=myisam;
insert into t1 values (null, 0);
repair table t1 extended;
drop table t1;
...@@ -376,6 +376,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -376,6 +376,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
{ {
uint real_length= pos->flag & HA_BLOB_PART ? pos->bit_start uint real_length= pos->flag & HA_BLOB_PART ? pos->bit_start
: pos->length; : pos->length;
if (pos->type == HA_KEYTYPE_BIT && pos->bit_length)
real_length--;
set_if_bigger(share->vreclength, pos->start + real_length); set_if_bigger(share->vreclength, pos->start + real_length);
} }
} }
......
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