Re: [sqlite] Tracking database corruption

2017-11-06 Thread Simon Slavin
On 6 Nov 2017, at 10:38pm, Nicholas Lovell wrote: > When getting sqlite_corrupt when reading from a database, is there a way to > know if a particular failure came from reading/initializing a page from a WAL > file, or the database disk file? Obtain the extended error code to learn more than y

[sqlite] Tracking database corruption

2017-11-06 Thread Nicholas Lovell
When getting sqlite_corrupt when reading from a database, is there a way to know if a particular failure came from reading/initializing a page from a WAL file, or the database disk file? Specifically I've been seeing a number of failures around btreeInitPage. However when I pull up the saved c

Re: [sqlite] How not to let random be calculated again and again and

2017-11-06 Thread Cecil Westerhof
2017-11-06 10:39 GMT+01:00 Keith Medcalf : > > The easiest way is likely to make the query so that it cannot be flattened > by adding an ORDER BY (that does not reference the column containing the > non-deterministic function by name -- ie, use only OUTPUT column position > indicators (ordinals),

Re: [sqlite] How not to let random be calculated again and again and

2017-11-06 Thread Keith Medcalf
The easiest way is likely to make the query so that it cannot be flattened by adding an ORDER BY (that does not reference the column containing the non-deterministic function by name -- ie, use only OUTPUT column position indicators (ordinals), not names or aliases). This will require the quer

[sqlite] How not to let random be calculated again and again and

2017-11-06 Thread Cecil Westerhof
I have a query that I use to randomly select a set of records, but an older one should have a higher change and a never used record is selected before a used record. For this I use a query that looks a bit like this: SELECT "Last Used" , Randomiser , Randomiser , Rand

Re: [sqlite] [EXTERNAL] memory leak

2017-11-06 Thread Yuriy M. Kaminskiy
On 11/06/17 10:02 , Hick Gunter wrote: > You are preparing statements inside the loop, but only finalizing the > last one (i.e. outside the loop) This is not a real loop, it executes one time only (do {...} while(0)). > -Ursprüngliche Nachricht- > Von: sqlite-users [mailto:sqlite-users-bo