summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-02-23 20:33:48 +0100
committerSergei Golubchik <serg@mariadb.org>2018-02-24 01:28:51 +0100
commit22073cbf3b507969eccee09cf4282aa70cd4c914 (patch)
treedb87bc4d3ed85c5fe1de51ef693905befde2ed96
parent5c7a40e3cf0b9869c7023e2f8c48b7c6e65a87dd (diff)
downloadmariadb-git-22073cbf3b507969eccee09cf4282aa70cd4c914.tar.gz
omit system invisible fields from the duplicate key error
just as SHOW CREATE TABLE omits them from the index definition
-rw-r--r--mysql-test/suite/versioning/r/load_data.result2
-rw-r--r--sql/key.cc2
2 files changed, 3 insertions, 1 deletions
diff --git a/mysql-test/suite/versioning/r/load_data.result b/mysql-test/suite/versioning/r/load_data.result
index 83d64cee787..5e7b36c9a6a 100644
--- a/mysql-test/suite/versioning/r/load_data.result
+++ b/mysql-test/suite/versioning/r/load_data.result
@@ -3,6 +3,6 @@ INSERT IGNORE INTO t1 (a,b,c) VALUES (1,2,3);
SELECT a, b, c FROM t1 INTO OUTFILE '15330.data';
LOAD DATA INFILE '15330.data' IGNORE INTO TABLE t1 (a,b,c);
Warnings:
-Warning 1062 Duplicate entry '1-2038-01-19 04:14:07.999999' for key 'a'
+Warning 1062 Duplicate entry '1' for key 'a'
LOAD DATA INFILE '15330.data' REPLACE INTO TABLE t1 (a,b,c);
DROP TABLE t1;
diff --git a/sql/key.cc b/sql/key.cc
index 5c1afb1f82d..8642820ff3f 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -427,6 +427,8 @@ void key_unpack(String *to, TABLE *table, KEY *key)
key_part < key_part_end;
key_part++)
{
+ if (key_part->field->invisible > INVISIBLE_USER)
+ continue;
if (to->length())
to->append('-');
if (key_part->null_bit)