Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.4.31
-
None
Description
Test:
loaddata.test |
SET sql_mode='';
|
CREATE TABLE t1 (v1 varchar(10), v2 varchar(10), constraint unequal check (v1 != v2));
|
LOAD DATA INFILE '../../std_data/loaddata7.dat' IGNORE INTO TABLE t1 FIELDS TERMINATED BY ',';
|
SELECT * FROM t1;
|
TRUNCATE TABLE t1;
|
INSERT IGNORE INTO t1 VALUES (11,12),(33,33);
|
SELECT * FROM t1;
|
DROP TABLE t1;
|
mysql-test/std_data/loaddata7.dat |
2,2
|
3,3
|
4,4
|
5,5
|
6,6
|
Result:
+SET sql_mode='';
|
+CREATE TABLE t1 (v1 varchar(10), v2 varchar(10), constraint unequal check (v1 != v2));
|
+LOAD DATA INFILE '../../std_data/loaddata7.dat' IGNORE INTO TABLE t1 FIELDS TERMINATED BY ',';
|
+Warnings:
|
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
|
+SELECT * FROM t1;
|
+v1 v2
|
+2 2
|
+3 3
|
+4 4
|
+5 5
|
+TRUNCATE TABLE t1;
|
+INSERT IGNORE INTO t1 VALUES (11,12),(33,33);
|
+Warnings:
|
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
|
+SELECT * FROM t1;
|
+v1 v2
|
+11 12
|
+DROP TABLE t1;
|
values 2,2 to 5,5 shouldn't have been inserted.
Expected result:
+LOAD DATA INFILE '../../std_data/loaddata7.dat' IGNORE INTO TABLE t1 FIELDS TERMINATED BY ',';
|
+Warnings:
|
+Note 1265 Data truncated for column 'v2' at row 1
|
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
|
+Note 1265 Data truncated for column 'v2' at row 1
|
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
|
+Note 1265 Data truncated for column 'v2' at row 1
|
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
|
+Note 1265 Data truncated for column 'v2' at row 1
|
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
|
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
|
+SELECT * FROM t1;
|
+v1 v2
|
+INSERT IGNORE INTO t1 VALUES (11,12),(33,33);
|
+Warnings:
|
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
|
+SELECT * FROM t1;
|
+v1 v2
|
+11 12
|
+DROP TABLE t1;
|
Which is the result if the v1,v2 where int rather than varchar or text