[GH-ISSUE #53] Edited row in table does not compre in diff #39

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

Originally created by @stevevg on GitHub (Jun 13, 2017).
Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/53

Hello, I've tried to clone a database, edit a single value in a table row, and launch the program.
The edit passed unnoted, and no diff file was generated.

Conversely, editing the primary key of the table is noted and the diff file is generated.

The databases reside on the same (local VM) server.

Originally created by @stevevg on GitHub (Jun 13, 2017). Original GitHub issue: https://github.com/DBDiff/DBDiff/issues/53 Hello, I've tried to clone a database, edit a single value in a table row, and launch the program. The edit passed unnoted, and no diff file was generated. Conversely, editing the primary key of the table is noted and the diff file is generated. The databases reside on the same (local VM) server.
Author
Owner

@P-Zenker commented on GitHub (Jul 26, 2017):

Yeah, I've got the same issue. But there are some tables with working diffs...
With a test-table I figured out, that if there are (only) nullable rows, diff doesn't work.

<!-- gh-comment-id:318001743 --> @P-Zenker commented on GitHub (Jul 26, 2017): Yeah, I've got the same issue. But there are some tables with working diffs... With a test-table I figured out, that if there are (only) nullable rows, diff doesn't work.
Author
Owner

@jasdeepkhalsa commented on GitHub (Nov 24, 2017):

Hi @stevevg,

Please can you post the exact command you're giving to DBDiff?

Also if possible could you post the two tables/databases which you're comparing and which is failing for you?

Thanks

<!-- gh-comment-id:346851280 --> @jasdeepkhalsa commented on GitHub (Nov 24, 2017): Hi @stevevg, Please can you post the exact command you're giving to DBDiff? Also if possible could you post the two tables/databases which you're comparing and which is failing for you? Thanks
Author
Owner

@ruancilliers commented on GitHub (Dec 7, 2017):

Dear All,

Excellent program. LUV it! Also encountered the same problem with a row that had NULLs. If I update any field from a field that had a NULL value then the diff don't pick it up. Here is a screen shot of the two rows that don't work. Try it...
Let me know if there is any questions. Great program!!!
Ruan Cilliers
screenshot - 07122017 - 16 19 08
screenshot - 07122017 - 16 19 36

<!-- gh-comment-id:349980563 --> @ruancilliers commented on GitHub (Dec 7, 2017): Dear All, Excellent program. LUV it! Also encountered the same problem with a row that had NULLs. If I update any field from a field that had a NULL value then the diff don't pick it up. Here is a screen shot of the two rows that don't work. Try it... Let me know if there is any questions. Great program!!! Ruan Cilliers ![screenshot - 07122017 - 16 19 08](https://user-images.githubusercontent.com/11680550/33719777-887b5bd0-db6a-11e7-88a0-a9c23fe24358.png) ![screenshot - 07122017 - 16 19 36](https://user-images.githubusercontent.com/11680550/33719782-91602514-db6a-11e7-8a06-c1df38e87380.png)
Author
Owner

@ruancilliers commented on GitHub (Dec 7, 2017):

Also here is the schema definition of the table. Once I change the "end" field to a value which is not NULL then dbDiff picks up the difference, but if I keep it NULL it does not recognize the diff at all and ignores that line...
screenshot - 07122017 - 16 31 44

<!-- gh-comment-id:349984474 --> @ruancilliers commented on GitHub (Dec 7, 2017): Also here is the schema definition of the table. Once I change the "end" field to a value which is not NULL then dbDiff picks up the difference, but if I keep it NULL it does not recognize the diff at all and ignores that line... ![screenshot - 07122017 - 16 31 44](https://user-images.githubusercontent.com/11680550/33720374-72d4ed58-db6c-11e7-98b4-05d1bc1d6303.png)
Author
Owner

@dev-jan commented on GitHub (Apr 26, 2018):

I fixed the problem in my pull request.

A workaround is to set one of the servers to "another" host.

Example:
server1-host = localhost
server2-host = 127.0.0.1

<!-- gh-comment-id:384783201 --> @dev-jan commented on GitHub (Apr 26, 2018): I fixed the problem in my pull request. A workaround is to set one of the servers to "another" host. Example: server1-host = localhost server2-host = 127.0.0.1
Author
Owner

@bojidar-bg commented on GitHub (Mar 15, 2023):

Just ran into that issue myself, fixed it similar to dev-jan's PR, changing
github.com/DBDiff/DBDiff@0a0021e2e1/src/DB/Data/LocalTableData.php (L109)
to

                return "CAST(IFNULL(`{$p}`.`{$el}`,'') AS CHAR CHARACTER SET utf8),IF(`{$p}`.`{$el}` IS NULL, '+', '-')";

(which is ugly, but got the job done, so..)

<!-- gh-comment-id:1469470214 --> @bojidar-bg commented on GitHub (Mar 15, 2023): Just ran into that issue myself, fixed it similar to dev-jan's PR, changing https://github.com/DBDiff/DBDiff/blob/0a0021e2e1dd4abea78209b1a4e6df8a6af70c8b/src/DB/Data/LocalTableData.php#L109 to ```php return "CAST(IFNULL(`{$p}`.`{$el}`,'') AS CHAR CHARACTER SET utf8),IF(`{$p}`.`{$el}` IS NULL, '+', '-')"; ``` (which is ugly, but got the job done, so..)
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#39
No description provided.