1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-18967 Load data in system version with long unique does not work

Update system versioning fields before generated columns for left out
fill_record
This commit is contained in:
Sachin
2019-03-19 16:36:54 +05:30
parent 1dffa9d9c1
commit 625aa232a6
3 changed files with 24 additions and 2 deletions

View File

@@ -186,3 +186,12 @@ c varchar(5000),
UNIQUE(c,b(64))
) ENGINE=InnoDB;
drop table t1;
CREATE TABLE t1 (data VARCHAR(4), unique(data) using hash) with system versioning;
INSERT INTO t1 VALUES ('A');
SELECT * INTO OUTFILE 'load.data' from t1;
LOAD DATA INFILE 'load.data' INTO TABLE t1;
ERROR 23000: Duplicate entry 'A' for key 'data'
select * from t1;
data
A
DROP TABLE t1;

View File

@@ -215,3 +215,16 @@ CREATE TABLE t1 (
UNIQUE(c,b(64))
) ENGINE=InnoDB;
drop table t1;
#
# MDEV-18967 Load data in system version with long unique does not work
#
CREATE TABLE t1 (data VARCHAR(4), unique(data) using hash) with system versioning;
INSERT INTO t1 VALUES ('A');
SELECT * INTO OUTFILE 'load.data' from t1;
--error ER_DUP_ENTRY
LOAD DATA INFILE 'load.data' INTO TABLE t1;
select * from t1;
DROP TABLE t1;
--let $datadir= `select @@datadir`
--remove_file $datadir/test/load.data

View File

@@ -8439,12 +8439,12 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
if (!update && table_arg->default_field &&
table_arg->update_default_fields(0, ignore_errors))
goto err;
if (table_arg->versioned() && !only_unvers_fields)
table_arg->vers_update_fields();
/* Update virtual fields */
if (table_arg->vfield &&
table_arg->update_virtual_fields(table_arg->file, VCOL_UPDATE_FOR_WRITE))
goto err;
if (table_arg->versioned() && !only_unvers_fields)
table_arg->vers_update_fields();
thd->abort_on_warning= save_abort_on_warning;
thd->no_errors= save_no_errors;
DBUG_RETURN(thd->is_error());