You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS: Insert Row cannot leave a column on its database default #2543
Insert Row always writes every column into the INSERT. A field left empty is sent as '', the NULL badge sends NULL. There is no way to omit a column and let the database
apply its default.
That makes a NOT NULL column with a default impossible to insert from the app. Example:
`created_at` datetime NOT NULL DEFAULT current_timestamp()
leaving the field empty sends '', which is not a valid datetime
tapping NULL sends NULL, which fails the constraint: MySQL query failed: Column 'created_at' cannot be null
The NULL badge is also offered on NOT NULL columns, where it can only ever fail.
Steps to reproduce
Connect to MySQL.
Open a table with a NOT NULL column that has a default (current_timestamp(), a
literal, anything).
Tap + to insert a row.
Leave that column untouched, or tap its NULL badge.
Save.
Expected behavior
A column the user has not filled in is left out of the statement, so the database applies
its default. NULL stays available for nullable columns only.
Activity
fix(ios): six collateral defects found while fixing #2543 and #2544 (#…