Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-30 Thread James K. Lowden
On Tue, 24 Jun 2014 22:06:15 -0700 Jerry Krinock wrote: > > The most likely explanation is that it got processed by something > > which thought it should be treated as ASCII text and was doing a > > spurious LF-to-CR translation. If there was only one 0x0A byte in > > the "good"

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Jerry Krinock
On 2014 Jun 24, at 14:46, David Empson wrote: > The most likely explanation is that it got processed by something which > thought it should be treated as ASCII text and was doing a spurious LF-to-CR > translation. If there was only one 0x0A byte in the "good" file, then

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Igor Tandetnik
On 6/24/2014 6:04 PM, Peter Haworth wrote: SELECT * FROM itemTable WHERE +key = 'profileName' ; Note the + sign - this suppresses the use of index. That's really interesting - I've never seen that use of the "+" sign mentioned in the docs. http://www.sqlite.org/optoverview.html To be usable

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Peter Haworth
> > > SELECT * FROM itemTable WHERE +key = 'profileName' ; > > Note the + sign - this suppresses the use of index. > -- > Igor Tandetnik > That's really interesting - I've never seen that use of the "+" sign mentioned in the docs. Pete lcSQL Software Home of lcStackBrowser

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread David Empson
On 25/06/2014, at 8:29 am, Jerry Krinock wrote: > On 2014 Jun 24, at 00:06, Clemens Ladisch wrote: >> Is there any other 0x0A byte in the good file? > > No, only that one. That leads to a plausible theory: had you done anything with the "good" database

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Richard Hipp
On Tue, Jun 24, 2014 at 4:29 PM, Jerry Krinock wrote: > > Thank you, Clemens. 0x0A=index. 0x0D=table. I suppose that is a > sensible re-use of “carrige return” and “line feed”. > Indexes and tables can have several different initial bytes, depending on circumstances. Any

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Jerry Krinock
(I think it’s cleaner to reply to three replies in one message; here goes…) On 2014 Jun 23, at 22:43, Keith Medcalf wrote: > Unique is implemented (as it must be) via a unique index. Very good, Keith. So my database *does* have an index. > You should be able to rebuild

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Eduardo Morras
On Mon, 23 Jun 2014 20:16:44 -0700 Jerry Krinock wrote: > How can it be that adding a WHERE clause to a successful query causes > ‘database disk image is malformed’? > > My database has one table named `itemTable`. This table has two > columns, `key` which is type text and

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-24 Thread Clemens Ladisch
Jerry Krinock wrote: > On 2014 Jun 23, at 21:49, Igor Tandetnik wrote: >> The data corruption happens to affect the area of the file where >> this index is stored. > > The culprit is byte 2048, the first byte in the 3rd page. In the Good > file, it is 0x0A and in the Bad

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-23 Thread Keith Medcalf
>Subject: Re: [sqlite] Adding WHERE to query --> database disk image is >malformed > >Oh, I just realized that, although Igor's suggestion "fixed" the problem, >this database definitely does not contain any indexes. The schema dump >is simply this... > &

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-23 Thread Jerry Krinock
Oh, I just realized that, although Igor’s suggestion “fixed” the problem, this database definitely does not contain any indexes. The schema dump is simply this… CREATE TABLE ItemTable ( "key" text UNIQUE, value blob NOT NULL ); ___ sqlite-users

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-23 Thread Jerry Krinock
On 2014 Jun 23, at 21:49, Igor Tandetnik wrote: > One possibility: the query with WHERE clause attempts to use some index, > while the query without doesn't. > > Try this query: > > SELECT * FROM itemTable WHERE +key = 'profileName' ; > > Note the + sign - this

Re: [sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-23 Thread Igor Tandetnik
On 6/23/2014 11:16 PM, Jerry Krinock wrote: How can it be that adding a WHERE clause to a successful query causes ‘database disk image is malformed’? One possibility: the query with WHERE clause attempts to use some index, while the query without doesn't. The data corruption happens to

[sqlite] Adding WHERE to query --> database disk image is malformed

2014-06-23 Thread Jerry Krinock
How can it be that adding a WHERE clause to a successful query causes ‘database disk image is malformed’? My database has one table named `itemTable`. This table has two columns, `key` which is type text and `value` which is type blob. There are two rows of data. Their `value` blobs are