mirror of
https://github.com/DBDiff/DBDiff.git
synced 2026-04-25 13:25:49 +03:00
[GH-ISSUE #26] Order of Fields while Calculating MD5 #15
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#15
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 @djshen-ponddy on GitHub (Aug 29, 2016).
Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/26
In DBManager.php, DBDiff uses
SHOW COLUMNS FROM $tableto get columns.Considering the following databases,
DB1:
DB2:
The columns of DB1 is (
id,name,pass), and the columns of DB2 is (id,pass,name).Therefore the MD5 values are MD5('1aazz') for DB1 and MD5('1zzaa').
After calculating diff data column by column, DBDiff will find that the two records are equal.
But DBDiff will still generate SQL
which is not a valid syntax.
I think you can sort the columns before concatenating the columns.
In getChangeDiff in LocalTableData.php, add
Update:
And when we insert data, order of fields should explicitly specified.
@kylefix commented on GitHub (Mar 7, 2018):
Any update on this, I have the same issue? @djshen-ponddy