Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

another load data infile issue

6 views
Skip to first unread message

DFS

unread,
Aug 17, 2021, 1:13:39 PM8/17/21
to
MariaDB allows NULLs in a FK field, but 'load data infile' insists on
NOT NULL

load data infile:
"ERROR 1452 (23000): Cannot add or update a child row: a foreign key
constraint fails (`db`.`table`, CONSTRAINT `ibfk_1` FOREIGN KEY
(`fkcol`) REFERENCES `parenttable` (`parentcolumn`))


MariaDB [db]> insert into tbl values (999999,'test',null);
Query OK, 1 row affected (0.161 sec)

(the third column is the FK column)
0 new messages