Commit b2af0ddc authored by Sergei Golubchik's avatar Sergei Golubchik

enable innodb tests for virtual indexed columns (sic!)

collateral changes:
* remove a test from innodb_virtual_basic that is already present in
  gcol_keys_innodb
* set thd->abort_on_warning for inplace alter, just like it's set
  for copy_data_between_tables - to have warnings converted into
  errors identically in all alter algorithms
* don't ignore errors in TABLE::update_virtual_field
parent 399e14f0
......@@ -921,15 +921,6 @@ alter table t add unique index (c(39));
replace into t set a = 'a',b =1;
replace into t set a = 'a',b =1;
drop table t;
CREATE TABLE t (a INT, b INT, h VARCHAR(10));
INSERT INTO t VALUES (12, 3, "ss");
INSERT INTO t VALUES (13, 4, "ss");
INSERT INTO t VALUES (14, 0, "ss");
alter table t add c INT GENERATED ALWAYS AS(a/b);
create index idx on t(c);
Warnings:
Warning 1365 Division by 0
DROP TABLE t;
CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10));
INSERT INTO t VALUES (11, 3, DEFAULT, 'mm');
INSERT INTO t VALUES (18, 1, DEFAULT, 'mm');
......
......@@ -37,7 +37,7 @@ eval SET @@session.default_storage_engine = 'InnoDB';
#------------------------------------------------------------------------------#
# Execute the tests to be applied to all storage engines
let $skip_spatial_index_check = 1;
let $support_virtual_index= 0;
let $support_virtual_index= 1;
--source suite/gcol/inc/gcol_keys.inc
if ($support_virtual_index) {
......
......@@ -772,16 +772,7 @@ replace into t set a = 'a',b =1;
replace into t set a = 'a',b =1;
drop table t;
CREATE TABLE t (a INT, b INT, h VARCHAR(10));
INSERT INTO t VALUES (12, 3, "ss");
INSERT INTO t VALUES (13, 4, "ss");
INSERT INTO t VALUES (14, 0, "ss");
alter table t add c INT GENERATED ALWAYS AS(a/b);
create index idx on t(c);
DROP TABLE t;
CREATE TABLE t (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10));
INSERT INTO t VALUES (11, 3, DEFAULT, 'mm');
INSERT INTO t VALUES (18, 1, DEFAULT, 'mm');
INSERT INTO t VALUES (28, 1, DEFAULT, 'mm');
......
......@@ -7179,6 +7179,7 @@ static bool mysql_inplace_alter_table(THD *thd,
HA_CREATE_INFO *create_info= ha_alter_info->create_info;
Alter_info *alter_info= ha_alter_info->alter_info;
bool reopen_tables= false;
bool res;
DBUG_ENTER("mysql_inplace_alter_table");
......@@ -7313,11 +7314,12 @@ static bool mysql_inplace_alter_table(THD *thd,
DEBUG_SYNC(thd, "alter_table_inplace_after_lock_downgrade");
THD_STAGE_INFO(thd, stage_alter_inplace);
if (table->file->ha_inplace_alter_table(altered_table,
ha_alter_info))
{
/* We can abort alter table for any table type */
thd->abort_on_warning= !ha_alter_info->ignore && thd->is_strict_mode();
res= table->file->ha_inplace_alter_table(altered_table, ha_alter_info);
thd->abort_on_warning= false;
if (res)
goto rollback;
}
// Upgrade to EXCLUSIVE before commit.
if (wait_while_table_is_used(thd, table, HA_EXTRA_PREPARE_FOR_RENAME))
......
......@@ -7468,7 +7468,7 @@ int TABLE::update_virtual_field(Field *vf)
vf->vcol_info->expr->walk(&Item::update_vcol_processor, 0, &tmp_set);
vf->vcol_info->expr->save_in_field(vf, 0);
in_use->restore_active_arena(expr_arena, &backup_arena);
DBUG_RETURN(0);
DBUG_RETURN(in_use->is_error());
}
......
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