Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.6.5
-
None
-
Debian unstable
Description
Hi
Assuming STRICT_ALL_TABLES is not set and the column is specified as NOT NULL then MariaDB behaves differently depending in the order of the data during LOAD.
Here is how to reproduce (There is also a script attached)
DROP TABLE IF EXISTS bugtable; |
CREATE TABLE bugtable (id INT NOT NULL) ENGINE=MyISAM; |
 |
-- this works with warning
|
LOAD DATA INFILE '/tmp/data-with-warning.txt' INTO TABLE bugtable; |
-- this does not work - gives erros
|
LOAD DATA INFILE '/tmp/data-with-error.txt' INTO TABLE bugtable; |
The file /tmp/data-with-warning.txt
1
|
\N
|
Warning (Code 1263): Column set to default value; NULL supplied to NOT NULL column 'id' at row 2
The file /tmp/data-with-error.txt
\N
|
1
|
ERROR 1263 (22004) at line 1: Column set to default value; NULL supplied to NOT NULL column 'id' at row 1
Expected result:
SELECT * FROM bugtable;
|
1
|
0
|
0
|
1
|
Note: Specifying DEFAULT 0 during table creation does not alter the inconsistent behavior.