SQLite Forum

SQLite diff tool doesn't work with CRLF new line characters
Login
\[... Showing a diff reported by sqldiff.exe. \]

> Could this be an issue with the sqldiff.exe tool's handling of certain new line characters or is it my usage of the tool?

I highly doubt either case is the cause of the diffs you see. The sqldiff utility, (source for which is at tool/sqldiff.c in the project source), finds differences by constructing queries which detect missing, extra, and not identical rows in the two DBs. The tool itself makes no effort to compare individual column-intersect-row values; it relies on the SQLite library to do that. For this reason, I highly doubt the precise truth of:

> I will get some SQL output like this even though the two DBs are identical:

I think that, if you do a conversion to BLOB of the differing fields, you will find that they are **not** identical. I suspect you will want to subject your text fields to a newline normalization process to make simple comparison (such as sqldiff does) work as you expect. Or, you could modify the tool to do further processing on differences, subjecting just different fields to newline normalization for re-comparison before reporting them as different (by generating UPDATE statements.)