First off, I didn't know that SQLite could read from zip files directly. I don't like it, but, I'm sure there's a use case somewhere.
Second, shouldn't SQLite only consider reading a file if the file size is zero or if the appropriate SQLite header is found, and completely ignore the file extension? If I create a normal SQLite file, then rename the file to a .zip, the content isn't a ZIP, so things would break, I would think. On Tue, Oct 30, 2018 at 9:49 AM Richard Hipp <d...@sqlite.org> wrote: > On 10/30/18, Dingyuan Wang <gumb...@aosc.io> wrote: > > > I look at the database file, there is a half zip file in the end. So > > maybe the PK header confused the SQLite command line. > > That is the likely explanation. > > The code that deduces the database type (whether it is an ordinary > SQLite database file, or a ZIP archive, or something else) is seen at > (https://www.sqlite.org/src/artifact/ac4a731dac549746?ln=3666-3694). > Line 3687 is the one that is causing problems for you, I am guessing. > > > > > Is this considered a bug? > > I suppose it is. I'm still trying to figure out exactly how to fix > it, though. Perhaps we should only look for the EOCD record at the > end of the file if the file does not begin with the proper SQLite > database prefix. > -- > D. Richard Hipp > d...@sqlite.org > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users