On 3 May 2017, at 3:40pm, Scott Robison <sc...@casaderobison.com> wrote:
> On May 3, 2017 8:07 AM, "Tony Papadimitriou" <to...@acm.org> wrote: > >> While trying to search/replace some text from an SQLite3 dump I noticed >> that, unfortunately, .DUMP does not produce the exact same numbers as a >> plain SELECT on the same values. > > I know all about expected floating point inaccuracies, but I don’t see why > it should matter in this case as we have two different places in the same > app (SQLite3) where the same number is ‘displayed’ using whatever default > format. IMO, in both places the same number should display exactly the > same (i.e., using the same format), both for consistency and easy > verification between dump and actual database. That’s a matter of preference. There is one possible bug here. If the results of reading the dump file back in produces a different value to the original INSERT, that’s a problem. So I tried it: SQLite version 3.16.0 2016-11-04 19:09:39 Enter ".help" for usage hints. sqlite> create table xxx(x); sqlite> insert into xxx values(1.23); sqlite> select * from xxx; 1.23 sqlite> .dump PRAGMA foreign_keys=OFF; BEGIN TRANSACTION; CREATE TABLE xxx(x); INSERT INTO "xxx" VALUES(1.23); COMMIT; Hmm. Cannot reproduce your problem in my version of the command-line tool. You’re using 3.18.0. I’m using 3.16.0. Perhaps its a recent change. Or perhaps there’s a difference in a library between my platform (macOS) and yours. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users