[PR #77] Fix compare of data fields for NULL values #120

Open
opened 2026-02-25 21:33:22 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/DBDiff/DBDiff/pull/77

State: open
Merged: No


The MySQL md5() function will return NULL if one of the given columns has
a NULL values in it. So if one field in the row is NULL, the whole MD5
will be NULL and the compare not actually work.

If the values is wrapped into a "IFNULL", all NULL values will be replaced
with '' (an empty string) for the compare of the values. This can maybe be
bad also, as the values '' and NULL are threaded the same. For this reason
all NULL values are joined together to check if there are still the same
as before.

Fixes #53

**Original Pull Request:** https://github.com/DBDiff/DBDiff/pull/77 **State:** open **Merged:** No --- The MySQL md5() function will return NULL if one of the given columns has a NULL values in it. So if one field in the row is NULL, the whole MD5 will be NULL and the compare not actually work. If the values is wrapped into a "IFNULL", all NULL values will be replaced with '' (an empty string) for the compare of the values. This can maybe be bad also, as the values '' and NULL are threaded the same. For this reason all NULL values are joined together to check if there are still the same as before. Fixes #53
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/DBDiff#120
No description provided.