[sqlite] bug in transactions implementation ?

2015-03-18 Thread Petite Abeille
> On Mar 18, 2015, at 10:24 PM, Jason Vas Dias > wrote: > > This seems very buggy to me. Correct. http://www.styleite.com/wp-content/uploads/2014/11/legallyblonde.gif

[sqlite] how to determine the status of last statement in sqlite3 shell ?

2015-03-18 Thread Petite Abeille
> On Mar 18, 2015, at 9:51 PM, Jason Vas Dias > wrote: > > I don't see how anything like that is possible in the sqlite3 shell . Not in the shell per se, no (.bail on|off may or may not help in your case). Perhaps ON CONFLICT clause might help you: https://www.sqlite.org/lang_conflict.html

[sqlite] bug in transactions implementation ?

2015-03-18 Thread Petite Abeille
> On Mar 18, 2015, at 9:45 PM, Jason Vas Dias > wrote: > > Would you care to expand on that ? As it says on the tin [1]: you cannot start a transactions inside another transaction (use savepoint if you want that), so? create table foo( value text, constraint uk unique( value ) ); begin

[sqlite] bug in transactions implementation ?

2015-03-18 Thread Simon Slavin
On 18 Mar 2015, at 9:24pm, Jason Vas Dias wrote: > But now I get another error after the constraint violation : > 'Error: cannot commit - no transaction is active' > which gets back to the original point of this post, > which is that SQLite is evidently not considering > all text within 'BEGIN

[sqlite] bug in transactions implementation ?

2015-03-18 Thread Petite Abeille
> On Mar 18, 2015, at 9:11 PM, Jason Vas Dias > wrote: > > am I missing something? rollback?

[sqlite] bug in transactions implementation ?

2015-03-18 Thread Jason Vas Dias
OK, I discovered the OR clause of the INSERT statement, so I'm trying: BEGIN TRANSACTION; INSERT OR ROLLBACK INTO db VALUES("This breaks a constraint"); COMMIT; But now I get another error after the constraint violation : 'Error: cannot commit - no transaction is active' which gets back to

[sqlite] how to determine the status of last statement in sqlite3 shell ?

2015-03-18 Thread Simon Slavin
On 18 Mar 2015, at 8:51pm, Jason Vas Dias wrote: > When the sqlite3 shell is used to run a long stream of commands , eg. from > a script file or input pipe from another process, how can the success / > failure > status of the last statement be determined ? > IE. if the shell has just run an

[sqlite] bug in transactions implementation ?

2015-03-18 Thread Simon Slavin
On 18 Mar 2015, at 8:11pm, Jason Vas Dias wrote: > The problem is, if this transaction runs in a session, then > NO transactions can ever run again in that session - eg. > if I try to run the same transaction twice : > On linux command line: > $ echo ' > BEGIN TRANSACTION; > INSERT INTO

[sqlite] how to determine the status of last statement in sqlite3 shell ?

2015-03-18 Thread Jason Vas Dias
When the sqlite3 shell is used to run a long stream of commands , eg. from a script file or input pipe from another process, how can the success / failure status of the last statement be determined ? IE. if the shell has just run an insert statment : BEGIN TRANSACTION; INSERT INTO db

[sqlite] bug in transactions implementation ?

2015-03-18 Thread Jason Vas Dias
On 18/03/2015, Petite Abeille wrote: > >> On Mar 18, 2015, at 9:11 PM, Jason Vas Dias >> wrote: >> >> am I missing something? > > rollback? > Would you care to expand on that ? How is the script consisting of just the two insert statements shown meant to determine if the first transaction has

[sqlite] bug in transactions implementation ?

2015-03-18 Thread Jason Vas Dias
Good day - There appears to be a bug in the way SQLite implements transactions : I have an insert transaction which breaks a uniqueness constraint on an index: BEGIN TRANSACTION; INSERT INTO db VALUES("This breaks a constraint"); COMMIT; The problem is, if this transaction runs in a

[sqlite] system.data.sqlite.dll and Widows 10

2015-03-18 Thread Nicholas Smit
fuslogvw ( https://msdn.microsoft.com/en-us/library/e74a18c4%28v=vs.110%29.aspx ) might help you understand the DLL binding issue. On 18 March 2015 at 20:04, Jeff Steinkamp wrote: > One of my users reported that he was unable to get a piece of software > that uses this .NET assembly (x86

[sqlite] how to determine the status of last statement in sqlite3 shell ?

2015-03-18 Thread Keith Medcalf
>A transaction is ended when you issue the COMMIT command. A transaction >fails if any command which changes the database in it fails due to >violating the schema. If a transaction fails then all commands in it are >automatically ignored. There's no need to use ROLLBACK. You correctly >grouped

[sqlite] bug in transactions implementation ?

2015-03-18 Thread Keith Medcalf
Works perfectly fine for me. Note that if you are submitting the commands in a single batch, then the abort action of INSERT OR ABORT aborts the batch. Submitting individual statements works just fine. You are submitting the script as a single sql statement rather than multiple statements

[sqlite] It might be nice to have sqlite3_attach() and sqlite3_detach().

2015-03-18 Thread Scott Hess
I'm thinking I could use something like: SQLITE_API int sqlite3_attach(sqlite3* db, const char* zPath, const char* dbname); SQLITE_API int sqlite3_detach(sqlite3* db, const char* dbname); Right now, I have a helper in Chromium which does "ATTACH DATABASE ? AS ?". This works, but AFAICT this

[sqlite] Query times vary between 0.2 s and 30 s for very similar queries - how to trick the optimizer?

2015-03-18 Thread Mario M. Westphal
I?m using 3.8.8.1 on Windows via the ?C? interface. I work with SQLite for several years with good success. And I know that no optimizer ever will be perfect. But I?ve just stumbled upon a case where a very similar query requires between 0.2 seconds and a whopping 30 seconds. I?ve simplified

[sqlite] system.data.sqlite.dll and Widows 10

2015-03-18 Thread J Decker
It might also be the runtime; was trying to install a debug version at one point and msvcr110d.dll was missing... maybe it's just that the required runtime is missing yet? It also just threw an error 'cannot locate' On Wed, Mar 18, 2015 at 1:09 PM, Nicholas Smit wrote: > fuslogvw ( >

[sqlite] system.data.sqlite.dll and Widows 10

2015-03-18 Thread Jeff Steinkamp
One of my users reported that he was unable to get a piece of software that uses this .NET assembly (x86 version 1.0.9.6) to run on windows 10. It is throwing an error saying that it is unable to located system.data.sqlite.dll even though it is included in the same folder as the program

[sqlite] Understanding Sqlite IO on Windows CE

2015-03-18 Thread Nicholas Smit
Thanks very much for that. Unfortunately WAL mode is not supported on CE - lacks certain structures apparently. On 18 March 2015 at 12:26, Richard Hipp wrote: > On 3/17/15, Nicholas Smit wrote: > > Hello. > > > > We have an app on CE 5, and CE 7. > > > > We are keen to move from using SQL

[sqlite] Understanding Sqlite IO on Windows CE

2015-03-18 Thread Richard Hipp
On 3/17/15, Nicholas Smit wrote: > Hello. > > We have an app on CE 5, and CE 7. > > We are keen to move from using SQL CE, to Sqlite, for our main data, as > Sqlite is superior in many ways. > > The app runs on a mobile device, where power can be removed at any time. > The data is stored on SD