Am Montag, 28. September 2015 15:55 CEST, "R.Smith" <rsmith at rsweb.co.za> 
schrieb: 

> 
> 
> On 2015-09-28 11:30 AM, Aaron Digulla wrote:
> >   
> > Am Freitag, 25. September 2015 20:46 CEST, Warren Young <wyml at 
> > etr-usa.com> schrieb:
> >   
> >>
> >> That suggests a good test for Aaron, then:
> >>
> >>      sqlite3 my.db .dump > dump.sql
> >>      sqlite3 a.db < dump.sql
> >>      sqlite3 b.db < dump.sql
> > Thank you very much. This set of commands has allowed me to narrow down the 
> > root cause to the Java JDBC driver by xerial 
> > (https://github.com/xerial/sqlite-jdbc):
> >
> > When I dump the database and recreate it two times with the command line 
> > sqlite3 tool, I get the exact same files. Looking at the source code of the 
> > JDBC driver, I can't see anything obviously wrong, either. There is one 
> > malloc() where it doesn't clear the memory but
> > I'm not creating functions, so the code is never used.
> >
> > The other malloc() when I read metadata from the database.
> >
> > That leaves me with a bug in my code or some really odd behavior because of 
> > the Java VM.
> 
> Also note that if the Java VM builds the DB in any way other than a 

> straight dump-the-sql-to-SQLite-Execute method, it might for instance 
> add comments to the Table definitions, often if this is done a date / 
> time is included, which by itself will cause different byte images for 
> the DB file.

I wrote the client side of the code (which executes CREATE TABLE and INSERT 
statements); there is nothing there.

Also, the JDBC driver is only a thin wrapper around the C API, so I don't 
expect oddities there. But I think I found it, now:

There is code which optimizes imports from CSV files by remembering the 
timestamp, size, etc. The API was a bit stubborn, which means I couldn't 
disable this code - instead I fed the code fake input files (table name = file 
name, size=0, timestamp=now) ... The result was a series of small changes in 
several places (= a new place every time the last page for the timestamp table 
was full).

sqlite works :-)

Regards,

-- 
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits." 
http://blog.pdark.de/ 

Reply via email to