mirror of
https://github.com/DBDiff/DBDiff.git
synced 2026-04-25 05:15:49 +03:00
[GH-ISSUE #9] Failed comparison if a field is NULL #142
Labels
No labels
bug
enhancement
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/DBDiff#142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @webian on GitHub (May 23, 2016).
Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/9
If one of the fields of the analyzed record is NULL then MD5 returns NULL so even if 2 records are different they are considered equal: NULL = NULL
This happens in method getChangeDiff of class LocalTableData
@jasdeepkhalsa commented on GitHub (May 26, 2016):
Nice edge case!
I suppose we'll have to look at how to get MD5 to give a result for NULL (perhaps it could work as a string), or just to handle NULL records specially
@jasdeepkhalsa commented on GitHub (Jul 8, 2016):
Fixed in https://github.com/DBDiff/DBDiff/pull/12
@djshen-ponddy commented on GitHub (Aug 15, 2016):
In getChangeDiff` of src/DB/Data/LocalTableData.php,
if one of the columns is NULL, then the result of concat is NULL. For example,
Maybe it could be fixed by MySQL function IFNULL and replace NULL values with some characters.