Commit f85afa51 authored by Nikita Malyavin's avatar Nikita Malyavin

MDEV-19011 Assertion `file->s->base.reclength < file->s->vreclength' failed

The assertion is improved: storage engines like myisam always have to store
at least one field, so the assertion does not cover tables with no stored
columns.
parent 6ba5f81c
......@@ -809,4 +809,12 @@ eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (p
--remove_file $MYSQLTEST_VARDIR/tmp/load.data
DROP TABLE t1;
--echo # MDEV-19011 Assertion `file->s->base.reclength < file->s->vreclength'
--echo # failed in ha_myisam::setup_vcols_for_repair
CREATE TABLE t1 (a INT GENERATED ALWAYS AS (1) VIRTUAL) ENGINE=MyISAM;
ALTER TABLE t1 ADD KEY (a);
DROP TABLE t1;
}
......@@ -875,6 +875,11 @@ Warning 1264 Out of range value for column 'vi' at row 1
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts);
ERROR 22003: Out of range value for column 'vi' at row 1
DROP TABLE t1;
# MDEV-19011 Assertion `file->s->base.reclength < file->s->vreclength'
# failed in ha_myisam::setup_vcols_for_repair
CREATE TABLE t1 (a INT GENERATED ALWAYS AS (1) VIRTUAL) ENGINE=MyISAM;
ALTER TABLE t1 ADD KEY (a);
DROP TABLE t1;
#
# BUG#21365158 WL8149:ASSERTION `!TABLE || (!TABLE->WRITE_SET
#
......
......@@ -877,6 +877,11 @@ Warning 1264 Out of range value for column 'vi' at row 1
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/load.data' REPLACE INTO TABLE t1 (pk,i,ts);
ERROR 22003: Out of range value for column 'vi' at row 1
DROP TABLE t1;
# MDEV-19011 Assertion `file->s->base.reclength < file->s->vreclength'
# failed in ha_myisam::setup_vcols_for_repair
CREATE TABLE t1 (a INT GENERATED ALWAYS AS (1) VIRTUAL) ENGINE=MyISAM;
ALTER TABLE t1 ADD KEY (a);
DROP TABLE t1;
DROP VIEW IF EXISTS v1,v2;
DROP TABLE IF EXISTS t1,t2,t3;
DROP PROCEDURE IF EXISTS p1;
......
......@@ -945,7 +945,8 @@ void ha_myisam::setup_vcols_for_repair(HA_CHECK *param)
return;
file->s->vreclength= new_vreclength;
}
DBUG_ASSERT(file->s->base.reclength < file->s->vreclength);
DBUG_ASSERT(file->s->base.reclength < file->s->vreclength ||
!table->s->stored_fields);
param->fix_record= compute_vcols;
table->use_all_columns();
table->vcol_set= &table->s->all_set;
......
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