DDC-2658: Inserting NULL for Undefined Variables #3335

Open
opened 2026-01-22 14:18:10 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 7, 2013).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user jjulien:

When a MySQL schema contains a line like this:
failedattempts int(11) NOT NULL DEFAULT '0',

If a new entity is created and the failedattempts variable is never set, Doctrine attempts to insert the value NULL which throws an SQL error. If a value is undefined for a new object, shouldn't it just be excluded from the insert fields?

Originally created by @doctrinebot on GitHub (Sep 7, 2013). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user jjulien: When a MySQL schema contains a line like this: `failedattempts` int(11) NOT NULL DEFAULT '0', If a new entity is created and the failedattempts variable is never set, Doctrine attempts to insert the value NULL which throws an SQL error. If a value is undefined for a new object, shouldn't it just be excluded from the insert fields?
admin added the ImprovementWon't FixCan't FixInvalidQuestion labels 2026-01-22 14:18:10 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3335