Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-04-06 Thread Bob Friesenhahn
I got the virtual table module which obviously breaks with 3.17 to work again. Is there particular cursor behavior which must be provided although an update is currently or has just been made to the underlying store? With my new implementation, the existing cursor uses prior data until it

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Cezary H. Noweta
Hello, On 2017-03-29 18:00, Richard Hipp wrote: One could omit all OP_Close opcodes and I think everything would still work. But sometimes an OP_Close can free up resources sooner rather than later. Also, some b-tree operations are faster if there is only a single open cursor on that b-tree,

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Cezary H. Noweta
Hello, On 2017-03-29 18:00, Richard Hipp wrote: One could omit all OP_Close opcodes and I think everything would still work. But sometimes an OP_Close can free up resources sooner rather than later. Also, some b-tree operations are faster if there is only a single open cursor on that b-tree,

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Richard Hipp
On 3/29/17, Hick Gunter wrote: > The Close (1) in the second program is closing (=deleting) the ephemeral > table. I have no idea if this would also be handled in Halt or not. OP_Halt always closes all open cursors. Calling sqlite3_reset() does too. In fact, it's the same

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Hick Gunter
: Mittwoch, 29. März 2017 17:45 An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> Betreff: Re: [sqlite] VT table behavior change between 3.10 and 3.17 Hello, On 2017-03-29 15:34, Bob Friesenhahn wrote: > If this is supposed to be the case, then it seems that xClose() is not >

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Cezary H. Noweta
Hello, On 2017-03-29 15:34, Bob Friesenhahn wrote: If this is supposed to be the case, then it seems that xClose() is not being called before xUpdate() with 3.17. BTW. Why (while in UPDATE) there is still emitted Close just before Halt? Halt closes opened cursors at the very beginning. Maybe

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Hick Gunter
Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Bob Friesenhahn Gesendet: Mittwoch, 29. März 2017 17:05 An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> Betreff: Re: [sqlite] VT table behavior change between 3.10 and 3.17 On W

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Bob Friesenhahn
On Wed, 29 Mar 2017, Hick Gunter wrote: Can you provide an example of the bytecode produced? sqlite> .explain sqlite> explain delete from device_cfgrecord where name == 'bar'; addr opcode p1p2p3p4 p5 comment -

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Dan Kennedy
org> Betreff: Re: [sqlite] VT table behavior change between 3.10 and 3.17 On Wed, 29 Mar 2017, Hick Gunter wrote: To avoid anomalies when changing "key fields", SQLite will scan through the whole cursor first, saving the rowids and new contents of the record(s) satisfying t

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Hick Gunter
be helpful. -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Bob Friesenhahn Gesendet: Mittwoch, 29. März 2017 15:34 An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> Betreff: Re: [sqlite] VT table behavior

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Bob Friesenhahn
On Wed, 29 Mar 2017, Hick Gunter wrote: To avoid anomalies when changing "key fields", SQLite will scan through the whole cursor first, saving the rowids and new contents of the record(s) satisfying the WHERE clause. It will then close the cursor and call xUpdate for the affected records.

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Hick Gunter
> [...] Why xOpen-ed cursor cannot be used to write to a table? > The xUpdate method alone is used to perform updates to virtual tables. > It does not take a cursor argument. > Also, there is no method taking a cursor argument that allows data to be > changed. > The documentation is correct

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Dominique Devienne
On Wed, Mar 29, 2017 at 2:33 PM, Cezary H. Noweta wrote: > My questions concerned a connection between your first sentence > (``According to the documentation...'') and the remaining part of your post. Now, I see that you have explained the behavior of SQLite rather then >

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Cezary H. Noweta
org> Betreff: Re: [sqlite] VT table behavior change between 3.10 and 3.17 [...] Why xOpen-ed cursor cannot be used to write to a table? The xUpdate method alone is used to perform updates to virtual tables. It does not take a cursor argument. Also, there is no method taking a cursor ar

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Hick Gunter
-Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Cezary H. Noweta Gesendet: Mittwoch, 29. März 2017 12:37 An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> Betreff: Re: [sqlite] VT table behavior change b

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Cezary H. Noweta
Hello, On 2017-03-29 10:48, Hick Gunter wrote: According to the documentation of Virtual Tables and Opcodes: [...] xOpen( table, cursor) is called to announce that SQLite intends to read from a table. A cursor cannot be used to write to a table. Do whatever is necessary to read from the backing

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Hick Gunter
- xClose() - xUpdate()... - xSync() - xCommit() -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Dan Kennedy Gesendet: Mittwoch, 29. März 2017 10:03 An: sqlite-users@mailinglists.sqlite.org Betreff: Re: [sqlite] VT t

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Dan Kennedy
On 03/29/2017 02:48 AM, Bob Friesenhahn wrote: We are trying to update from sqlite3 3.10 to 3.17. Our virtual table modules are encountering problems with 3.17 since the 'xOpen' callback is now being called for value change and row deletion operations. Previously it was only being called for

Re: [sqlite] VT table behavior change between 3.10 and 3.17

2017-03-29 Thread Hick Gunter
ite-users@mailinglists.sqlite.org> Betreff: [sqlite] VT table behavior change between 3.10 and 3.17 We are trying to update from sqlite3 3.10 to 3.17. Our virtual table modules are encountering problems with 3.17 since the 'xOpen' callback is now being called for value change and row deletion operations