Re: [sqlite] Bad query plan selection only with "LEFT JOIN"

2017-01-05 Thread Richard Hipp
On 1/5/17, Domingo Alvarez Duarte wrote: > Hello ! > > Today I found this unexpected behavior when using sqlite3 trunk: > > When using views with joins sqlite3 is choosing expected plans except > for "LEFT JOIN", bellow is the snippet that shows this unexpected behavior. > >

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Richard Hipp
On 1/5/17, Richard Hipp wrote: > But apparently, many people are looking at the result of > sqlite3_column_count() and if it is zero, they never bother to > sqlite3_finalize() their PRAGMA statements. Or maybe not. I just did an analysis of the sqlite3_column_count() changes

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Richard Hipp
On 1/5/17, kk wrote: > All, > Many thanks for all the replies. It seems that I had now need to run > SQLite3Finalize against the PRAGMA stmts, You should *always* run sqlite3_finalize() on every statement, before you call sqlite3_close(). No exceptions. Pragmas are no

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread kk
On 05/01/2017 23:35, Richard Hipp wrote: On 1/5/17, Kyle wrote: Dear all, Under version 3.16.1, SQLite3Close is returning SQLITE_BUSY when I open a database, execute some PRAGMAS, (run some stmts) then attempt the close. This did not occur under version 3.15.2, nor does

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Richard Hipp
On 1/5/17, Jens Alfke wrote: > > That would explain the SQLITE_BUSY error — if the pragma returns a non-empty > list of rows, and you’re not reading the rows or resetting the statement, > the statement stays busy and will block closing the database. > There has been a change

Re: [sqlite] SQLite3 Tutorial error

2017-01-05 Thread Ken Wagner
David, Yes. That would be a big assist. I am new to using SQLite3 and found the GLOB function erratic in practice -- not on SQLite3 but on other web sites using SQLite. They yielded completely opposite results. Second the motion. Ken On 01/05/2017 05:23 PM, dandl wrote: From:

Re: [sqlite] SQLite3 Tutorial error

2017-01-05 Thread Ken Wagner
Danap, I thought so, too. But it is not the case. I am cross-checking with the Unix/SQLite results, using Unix/SQLite as the base reference. Ken On 01/05/2017 01:30 PM, dmp wrote: Message: 21 Date: Wed, 4 Jan 2017 22:10:59 -0600 From: Ken Wagner To: SQLite mailing

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Jens Alfke
> On Jan 5, 2017, at 3:11 PM, Kyle wrote: > > Furthermore the PRAGMAs now seem to return a resultset whereas previously > they did not? Is this expected (or documented)? That would explain the SQLITE_BUSY error — if the pragma returns a non-empty list of rows, and

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Simon Slavin
On 5 Jan 2017, at 11:30pm, Kyle wrote: > no, the database is :memory: You should not be getting SQLITE_BUSY when using a memory database. So far my guess is the same as DRH’s. Can you tell us how you are executing your SQLite functions ? Are you using the C interface

Re: [sqlite] SQLite3 Tutorial error

2017-01-05 Thread Jens Alfke
> On Jan 5, 2017, at 3:23 PM, dandl wrote: > > Perhaps some accurate documentation for GLOB in Sqlite would help to clarify > things? +1. I for one was unaware that glob understands the “[…]” syntax for character classes (both in SQLite and in the Unix glob(3) function),

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Richard Hipp
On 1/5/17, Kyle wrote: > Dear all, > Under version 3.16.1, SQLite3Close is returning SQLITE_BUSY when I open > a database, execute some PRAGMAS, (run some stmts) then attempt the > close. This did not occur under version 3.15.2, nor does it occur under > the new version if

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Kyle
On 05/01/2017 23:14, Simon Slavin wrote: On 5 Jan 2017, at 11:11pm, Kyle wrote: Under version 3.16.1, SQLite3Close is returning SQLITE_BUSY when I open a database, execute some PRAGMAS, (run some stmts) then attempt the close. This did not occur under version 3.15.2,

Re: [sqlite] SQLite3 Tutorial error

2017-01-05 Thread dandl
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin >>>They’re probably using the external function interface to override the >>>internal globbing function. And by the look of the results at least one of >>>the programmers involved thinks that

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Simon Slavin
On 5 Jan 2017, at 11:11pm, Kyle wrote: > Under version 3.16.1, SQLite3Close is returning SQLITE_BUSY when I open a > database, execute some PRAGMAS, (run some stmts) then attempt the close. This > did not occur under version 3.15.2, nor does it occur under the new

[sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Kyle
Dear all, Under version 3.16.1, SQLite3Close is returning SQLITE_BUSY when I open a database, execute some PRAGMAS, (run some stmts) then attempt the close. This did not occur under version 3.15.2, nor does it occur under the new version if I omit the PRAGMAs. Furthermore the PRAGMAs now seem

Re: [sqlite] Quest for "scratch table" implementation in SQLite.

2017-01-05 Thread Simon Slavin
On 5 Jan 2017, at 7:26pm, Smith, Randall wrote: > I'm still trying to figure out a graceful way to implement a "scratch" > database table that has the following properties: > >o Can be created on demand while a database connection is open. >o Can

Re: [sqlite] SQLite3 Tutorial error

2017-01-05 Thread Simon Slavin
On 5 Jan 2017, at 7:30pm, dmp wrote: > I don't know what those other apps may be doing, but they should > just pass the query created by the user "DIRECTLY" to the SQLite DB > engine without any modification. Likewise the result should also > not be mucked with

Re: [sqlite] Quest for "scratch table" implementation in SQLite.

2017-01-05 Thread Donald Griggs
On Thu, Jan 5, 2017 at 2:26 PM, Smith, Randall wrote: > "I'm still trying to figure out a graceful way..." I may well just be missing something important, but would the following not be simple, unclunky, and not highly error-prone? 1) Before your program closes:

[sqlite] Bad query plan selection only with "LEFT JOIN"

2017-01-05 Thread Domingo Alvarez Duarte
Hello ! Today I found this unexpected behavior when using sqlite3 trunk: When using views with joins sqlite3 is choosing expected plans except for "LEFT JOIN", bellow is the snippet that shows this unexpected behavior. === create table if not exists a(id integer primary key, val text);

Re: [sqlite] Quest for "scratch table" implementation in SQLite.

2017-01-05 Thread David Raymond
The usual caveats apply of course -Temporary tables and triggers are only visible by your own connection, so if anyone else came in and made updates then everything would get thrown out of synch and become dangerous. If it's all within a single transaction then it should be ok. -Since triggers

Re: [sqlite] Quest for "scratch table" implementation in SQLite.

2017-01-05 Thread David Raymond
Probably not the most elegant solution, but with enough triggers you can simulate close approximations to foreign keys. create table permTable (pk integer primary key, t text); create temp table tempTable (pk int /*references permTable on update cascade on delete set null*/); create temp

Re: [sqlite] new user seeking help

2017-01-05 Thread Chen, Hui
Well, my question is how do I get connections open with [STAThread] attribute on Main method. -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Kevin Benson Sent: January-05-17 2:49 PM To: SQLite mailing list

Re: [sqlite] new user seeking help

2017-01-05 Thread Kevin Benson
On Thu, Jan 5, 2017 at 1:26 PM, Chen, Hui wrote: > Hi there, > > I just recently started integrating System.Data.SQLite.dll into my > project, I started with a very simple winform application. > > I have a very simple method to create a connection, txtSqliteFile is >

Re: [sqlite] SQLite3 Tutorial error

2017-01-05 Thread dmp
> Message: 21 > Date: Wed, 4 Jan 2017 22:10:59 -0600 > From: Ken Wagner > To: SQLite mailing list > Subject: Re: [sqlite] SQLite3 Tutorial error > Yes, I am beginning to understand that. SQLite3 is its own GLOB standard. > I will abide

[sqlite] Quest for "scratch table" implementation in SQLite.

2017-01-05 Thread Smith, Randall
I'm still trying to figure out a graceful way to implement a "scratch" database table that has the following properties: o Can be created on demand while a database connection is open. o Can include references to other material in the database to ensure integrity. o Will

Re: [sqlite] Commit ad601c7962 degrade performance in a client program

2017-01-05 Thread Don V Nielsen
I loved this remark posted in the bugzilla chain: "(... Fossil? where do people find these version control systems?)" On Thu, Jan 5, 2017 at 2:09 AM, Richard Hipp wrote: > On 1/3/17, Jianxun Zhang wrote: >> I am working in Yocto project. We have

Re: [sqlite] Performance degradation of in-memory database with high row count and overall design discussion of my project

2017-01-05 Thread Dan Kennedy
On 01/06/2017 12:56 AM, Simone Mosciatti wrote: Hi all, I am writing a small Redis module that embeds SQLite [1] I am facing some performance issues and I wonder if the behaviour I am seeing is expected or if I am doing something completely wrong. However I am finding some issues on the

[sqlite] new user seeking help

2017-01-05 Thread Chen, Hui
Hi there, I just recently started integrating System.Data.SQLite.dll into my project, I started with a very simple winform application. I have a very simple method to create a connection, txtSqliteFile is textbox for db file location. SQLiteConnection GetConnection() { string

[sqlite] Performance degradation of in-memory database with high row count and overall design discussion of my project

2017-01-05 Thread Simone Mosciatti
Hi all, I am writing a small Redis module that embeds SQLite [1] I am facing some performance issues and I wonder if the behaviour I am seeing is expected or if I am doing something completely wrong. I would provide some context on what I am doing, hoping that you may see some flaw in my

Re: [sqlite] date-2.2c tests fail for sqlite-3.16.1 on Fedora / i686

2017-01-05 Thread Don V Nielsen
Graham, you may be on to something: "I don't know what the tests are doing, but could it be connected with the fact that a leap-second was added as we changed from 2016 to 2017". I noticed a whole bunch of rspec tests (my projects completely unrelated to sqlite) failing with microsecond

[sqlite] Need help with System.Data.SQLite.SQLiteDataReader and NUMERIC(5, 5) column

2017-01-05 Thread Burtsev , Dmitriy
Hello I got this error: Exception calling "WriteToServer" with "1" argument(s): "The given value of type SqlDecimal from the data source cannot be converted to type decimal of the specified target column." How to reproduce. 1. On SQLite execute this statements. CREATE TABLE FromNum ( id

Re: [sqlite] SQLite3 Tutorial error

2017-01-05 Thread Ken Wagner
Ryan, Thanks. I have saved the Unix GLOB reference. When I inferred that other versions of SQLite gave the other results, it was thru the other SQLite GUI tools and the version of SQLite that they used. Thanks for helping to make clear what was going on. Ken On 01/05/2017 02:53 AM, R

Re: [sqlite] date-2.2c tests fail for sqlite-3.16.1 on Fedora / i686

2017-01-05 Thread Jakub Dorňák
Since the difference is in the fraction part, i'd vote for the floating-point problem. I'have encountered this issue with all machines I've tried, however, both my laptop and koji build systems are natively 64bit. (my cpuinfo attached) 2017-01-05 11:08 GMT+01:00 Graham Holden

Re: [sqlite] date-2.2c tests fail for sqlite-3.16.1 on Fedora / i686

2017-01-05 Thread Graham Holden
I don't know what the tests are doing, but could it be connected with the fact that a leap-second was added as we changed from 2016 to 2017 and one of expected/got is taking this into account and the other isn't? Graham Original message From: Richard Hipp Date:

Re: [sqlite] SQLite3 Tutorial error

2017-01-05 Thread R Smith
On 2017/01/05 9:04 AM, Ken Wagner wrote: Keith, It appears that the folks at SQLiteTutorial.net have a coding anomaly. They are not following the UNIX / SQLite3 GLOB patterns. And so, too, do the other guys. I am adjusting my usage accordingly. I will advise users of the other products to

Re: [sqlite] date-2.2c tests fail for sqlite-3.16.1 on Fedora / i686

2017-01-05 Thread Richard Hipp
On 1/4/17, Jakub Dorňák wrote: > Example output: > > ... > ! date-2.2c-1 expected: [06:28:00.001] > ! date-2.2c-1 got: [06:28:00.000] > ! date-2.2c-4 expected: [06:28:00.004] > ! date-2.2c-4 got: [06:28:00.003] > ! date-2.2c-7 expected: [06:28:00.007] > !

Re: [sqlite] Commit ad601c7962 degrade performance in a client program

2017-01-05 Thread Richard Hipp
On 1/3/17, Jianxun Zhang wrote: > I am working in Yocto project. We have a fake-root program “pseudo” that > uses sqlite3 at a step when building Yocto images. We found a 2% increase of > the whole build time, and my bisecting shows the ad601c7962 in sqlite3 is >

[sqlite] date-2.2c tests fail for sqlite-3.16.1 on Fedora / i686

2017-01-05 Thread Jakub Dorňák
Example output: ... ! date-2.2c-1 expected: [06:28:00.001] ! date-2.2c-1 got: [06:28:00.000] ! date-2.2c-4 expected: [06:28:00.004] ! date-2.2c-4 got: [06:28:00.003] ! date-2.2c-7 expected: [06:28:00.007] ! date-2.2c-7 got: [06:28:00.006] ! date-2.2c-8 expected: [06:28:00.008] !

Re: [sqlite] Commit ad601c7962 degrade performance in a client program

2017-01-05 Thread Patrick Ohly
On Tue, 2017-01-03 at 17:49 -0800, Jianxun Zhang wrote: > I am working in Yocto project. We have a fake-root program “pseudo” > that uses sqlite3 at a step when building Yocto images. We found a 2% > increase of the whole build time, and my bisecting shows the > ad601c7962 in sqlite3 is the root

[sqlite] Commit ad601c7962 degrade performance in a client program

2017-01-05 Thread Jianxun Zhang
I am working in Yocto project. We have a fake-root program “pseudo” that uses sqlite3 at a step when building Yocto images. We found a 2% increase of the whole build time, and my bisecting shows the ad601c7962 in sqlite3 is the root cause. Basically, the sqlite3 library is built first from a