> -----Original Message----- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On > Behalf Of Simon Slavin > Sent: Wednesday, May 03, 2017 12:30 PM > To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> > Subject: Re: [sqlite] .DUMP displays floats differently from SELECT > > > 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.
Nor I with 3.14.1 on Windows 7: SQLite version 3.14.1 2016-08-11 18:53:32 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. 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; sqlite> -- Bill Drago Staff Engineer L3 Narda-MITEQ 435 Moreland Road Hauppauge, NY 11788 631-272-5947 / william.dr...@l3t.com CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any attachments are solely for the use of the addressee and may contain information that is privileged or confidential. Any disclosure, use or distribution of the information contained herein is prohibited. In the event this e-mail contains technical data within the definition of the International Traffic in Arms Regulations or Export Administration Regulations, it is subject to the export control laws of the U.S.Government. The recipient should check this e-mail and any attachments for the presence of viruses as L-3 does not accept any liability associated with the transmission of this e-mail. If you have received this communication in error, please notify the sender by reply e-mail and immediately delete this message and any attachments. Effective immediately my new email address is william.dr...@l3t.com. Please update your records. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users