Repository navigation
fix(datagrid): save NULL when a date or number cell is cleared - #3428
Merged
Merged
Conversation
An emptied cell was staged as an empty string whatever the column type, so MySQL without strict mode stored a cleared DATETIME as the zero date. Typed text is now read for its column: a type with no empty value stages NULL, and a NOT NULL column of such a type refuses the edit.
datlechin
force-pushed
the
fix/date-clear-saves-null
branch
from
October 15, 2026 09:32
3cdb54c to
1b96f8d
Compare
A copied NULL and a stored 'NULL' copied as the same text, and a value with a tab or line break split into extra fields on paste. The grid's cell copy now carries its fields beside the text, and both cell and row paste read them while the clipboard still holds that copy. The inspector marks a NULL staged in the grid as a pending NULL instead of an empty string, so its boolean picker no longer reads false. Elasticsearch browse results hint long, short, byte, the float variants and date_nanos to the classifier, so clearing one writes NULL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Clearing a date cell and saving wrote an empty string, which MySQL without strict mode stores as
0000-00-00 00:00:00, so a cleareddeleted_atstill read as deleted. Every editing surface turned typed text into a value without looking at the column type, and copy and paste turned a NULL into the textNULL.Change
''. A NOT NULL column of those types refuses the edit, since NULL there becomes the current time on MySQL withexplicit_defaults_for_timestampoff.''is a value.long,shortanddate_nanosfields classify as numbers and dates.Verified
ClearedCellCommitTestsandMultiRowEditStateClearedFieldTestsfail onmainand pass here. Changed on purpose:MultiRowEditStateTestspinned a grid-set NULL as an empty pending value;FillColumnTestsfollowsfillColumnValue(text:setNull:columnIndex:). The Elasticsearch plugin compiles; it has no test target and reaches users with its next plugin release.Not in this PR
Docs: TableProApp/docs#22