Column temporaryID cannot be null

Bei einem Kundenshop von uns tauchte bei einer Bestellung plötzlich diese Fehlermeldung auf:

core.ERROR: PDOException: SQLSTATE[23000]:
Integrity constraint violation: 1048 Column ‚temporaryID‘ cannot be null in /var/…/engine/Library/Zend/Db/Statement/Pdo.php:219

Welche Ursachen könnten sein, wenn „temporaryID“ keinen Wert hat? Session-Problem? Proxy-Problem?

Replace 0 with any value you want.

insert into TABLE1 (id,table2id)
values
(
    1,
    COALESCE((SELECT DISTINCT id FROM TABLE2 as table2 WHERE table2.data = 'ABC'),0))
);