Re: [sqlite] How do sqlite3_reset_last_insert_rowid() or functionalequivalent?

2013-05-07 Thread James K. Lowden
On Tue, 7 May 2013 18:54:48 +0200 Hick Gunter wrote: > The problem with checking the ID of the last inserted row is that the > abstraction for checking it cannot reasonably know that a query is an > insert; > > Essentially doing a string match for "INSERT " in the query

Re: [sqlite] How do sqlite3_reset_last_insert_rowid() or functionalequivalent?

2013-05-07 Thread Nico Williams
On Tue, May 7, 2013 at 7:14 AM, Mikael wrote: > A generalized way of getting if an ID was inserted on the last performed > query and if so which, is of value for instance when inserting a row into a > table with an AUTOINCREMENT key e.g. This can get tricky if you have

Re: [sqlite] Suspected bug in SELECT EXCEPT ORDER COLLATE

2013-05-07 Thread Nico Williams
On Mon, May 6, 2013 at 9:39 PM, Keith Medcalf wrote: >> I read this: >> >> SELECT a FROM t1 EXCEPT SELECT a FROM t2 ORDER BY a; >> >> as saying "select all a from t1 that are not in t2, *then* order that >> by that a". > > No, that is not what it says, actually. The

Re: [sqlite] Slowness with FTS Queries and non-FTS tables

2013-05-07 Thread Dan Kennedy
On 05/08/2013 01:54 AM, Scott Robison wrote: On Tue, 30 Apr 2013 23:56:35 -0700 (PDT) Paul Vercellotti wrote: We've got some trouble with FTS4 queries taking too long in which we're looking for a subset of matching records in the FTS table, as narrowed by a non-FTS table.

Re: [sqlite] Update statement

2013-05-07 Thread skywind mailing lists
Hi Peter, thanks. But it does not seem to work in my environment. Probably somewhere a bug on my side. Hartwig Am 07.05.2013 um 19:55 schrieb Peter Aronson: > At least for SQLite it appears to be. From the Update doc page > (http://www.sqlite.org/lang_update.html): > > "The modifications

Re: [sqlite] How do sqlite3_reset_last_insert_rowid() or functionalequivalent?

2013-05-07 Thread Mikael
Hi Günter, Great, yes that makes sense! So that solves it. I was thinking about this and thought there must be some way to do this already; thank you so much for pointing this out. This would also open up for picking up several inserted id:s from one query which is nice. Thanks, Mikael

[sqlite] Who can explain the xCodec API?

2013-05-07 Thread Neo Anderson
I'm trying to implement a encryption VFS, but it turned out it's too tedious and error prone. The main cause is that my simple VFS does not handle locking well (or not at all). This leads to database file corruption when inserting thousands of records (I believe). Then I turned to the

Re: [sqlite] Update statement

2013-05-07 Thread Simon Slavin
On 7 May 2013, at 8:04pm, Luuk wrote: > http://www.andrew.cmu.edu/user/shadow/sql/sql1992.txt > chapter: 13.9 > 6) The s are effectively evaluated before updat- >ing the object row. If a contains a reference >to a column of T, then the reference is

Re: [sqlite] Update statement

2013-05-07 Thread Luuk
On 07-05-2013 19:46, skywind mailing lists wrote: Hi, my question is: is it guaranteed that it works? Regards, Hartwig http://www.andrew.cmu.edu/user/shadow/sql/sql1992.txt chapter: 13.9 6) The s are effectively evaluated before updat- ing the object row. If a contains a

Re: [sqlite] Slowness with FTS Queries and non-FTS tables

2013-05-07 Thread Scott Robison
On Tue, 30 Apr 2013 23:56:35 -0700 (PDT) Paul Vercellotti wrote: > We've got some trouble with FTS4 queries taking too long in which > we're looking for a subset of matching records in the FTS table, as > narrowed by a non-FTS table. > {details snipped} I've recently had to

Re: [sqlite] Update statement

2013-05-07 Thread Peter Aronson
At least for SQLite it appears to be.  From the Update doc page (http://www.sqlite.org/lang_update.html): "The modifications made to each row affected by an UPDATE statement are determined by the list of assignments following the SET keyword. Each assignment specifies a column name to the

Re: [sqlite] Update statement

2013-05-07 Thread skywind mailing lists
Hi, my question is: is it guaranteed that it works? Regards, Hartwig Am 07.05.2013 um 03:24 schrieb James K. Lowden: > On Mon, 6 May 2013 23:53:40 +0100 > Simon Slavin wrote: > >>> How do I create this kind of update statement? >>> >>> UPDATE T SET a=0.5*(a+b),

Re: [sqlite] How do sqlite3_reset_last_insert_rowid() or functionalequivalent?

2013-05-07 Thread Hick Gunter
How about calling sqlite3_update_hook()? You will be notified about all UPDATE, INSERT and DELETE operations as they occur, with the database, table and rowid affected and in the thread executing the statement. If you register a well-behaved function (i.e. that calls the previously registered

Re: [sqlite] Is there a way to select a precision?

2013-05-07 Thread Michael Black
OK...this way then...it's stored correctly and the view should display correctly in a 3rd party app. Correctly gives the 99 cent discount. Should work for any 2 decimal place number. create table mine(a number(10,2)); create view v1 as select a/100.0 as a from mine; create trigger t1 after

Re: [sqlite] Security concern with new fts3tokenize virtual table

2013-05-07 Thread Dan Kennedy
On 05/07/2013 05:17 PM, Ralf Junker wrote: The new fts3tokenize virtual table calls the fts3_tokenizer() ... However, this call is rejected if, for security reasons, So the problem is that with the authorizer block in place, the fts3tokneize virtual table does not work. One would have to

Re: [sqlite] How do sqlite3_reset_last_insert_rowid() or functionalequivalent?

2013-05-07 Thread Mikael
Hi, Thanks for your feedback, James. A generalized way of getting if an ID was inserted on the last performed query and if so which, is of value for instance when inserting a row into a table with an AUTOINCREMENT key e.g. CREATE TABLE t ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,

Re: [sqlite] Very important performance regression due to totally different query plan

2013-05-07 Thread Richard Hipp
On Mon, May 6, 2013 at 3:15 PM, Stephane MANKOWSKI wrote: > Hi, > > I am the main developer of Skrooge (application using sqlite) and since my > upgrade to ubuntu 13.04, I have very bad performances due to sqlite. > Have you considered including source code (the sqlite3.c

[sqlite] Very important performance regression due to totally different query plan

2013-05-07 Thread Stephane MANKOWSKI
Hi, I am the main developer of Skrooge (application using sqlite) and since my upgrade to ubuntu 13.04, I have very bad performances due to sqlite. Here is my analysis: All tests are done with the file http://skrooge.org/files/skrooge_bug_performance.sqlite

Re: [sqlite] Suspected bug in SELECT EXCEPT ORDER COLLATE

2013-05-07 Thread Staffan Tylen
I just wish to confirm that the workaround shown by Nico works fine for me which makes the issue low priority from my point of view. Thanks all. Staffan On Tue, May 7, 2013 at 5:00 AM, Keith Medcalf wrote: > > So you are saying that: > > Select a from t1 except select a

[sqlite] Security concern with new fts3tokenize virtual table

2013-05-07 Thread Ralf Junker
The new fts3tokenize virtual table calls the fts3_tokenizer() SQL function internally to retrieve the pointer to the tokenizer implementation for a FTS table: http://www.sqlite.org/src/artifact/a29f126b9e6c6a6f1021a8f7440bf125e68af1f9?ln=74-100 However, this call is rejected if, for security