[sqlite] Limiting the result set size at each recursive step in a CTE

2019-05-07 Thread Thomas Zimmermann
Hi! Sometimes it is desirable to limit the size of the queue¹ in a recursive CTE when the domain allows for it. That puts an upper bound on processing time, even when the given table is huge. This can be achieved by adding a LIMIT clause at every step (setup and recursive). But there is my

Re: [sqlite] INSERT OR FAIL inserts row although it violates a table constraint

2019-05-07 Thread Richard Hipp
On 5/7/19, Manuel Rigger wrote: > Great, thanks! In which commits were they addressed? I saw two commits that > address https://www.sqlite.org/src/info/e63cbcfd3378afe6980d6. Was this > issue derived from the test case? Issue 1: Foreign key constraints are not checked until the end of a

Re: [sqlite] INSERT OR FAIL inserts row although it violates a table constraint

2019-05-07 Thread Manuel Rigger
Great, thanks! In which commits were they addressed? I saw two commits that address https://www.sqlite.org/src/info/e63cbcfd3378afe6980d6. Was this issue derived from the test case? Best, Manuel On Tue, May 7, 2019 at 10:08 PM Richard Hipp wrote: > Two separate problems, both now fixed on

[sqlite] PRAGMA reverse_unordered_selects=true results into row not being fetched

2019-05-07 Thread Manuel Rigger
Hi everyone, I discovered what I think is a bug, as demonstrated below: CREATE TABLE t0(c0); CREATE TABLE t1(c0 INTEGER PRIMARY KEY); PRAGMA reverse_unordered_selects=true; INSERT INTO t1(c0) VALUES (0); INSERT INTO t0(c0) VALUES ('a'); SELECT * FROM t1, t0 WHERE t1.c0 < t0.c0; I would expect

Re: [sqlite] INSERT OR FAIL inserts row although it violates a table constraint

2019-05-07 Thread Richard Hipp
Two separate problems, both now fixed on trunk. On 5/6/19, Manuel Rigger wrote: > Hi everyone, > > consider the following example: > > PRAGMA foreign_keys=true; > CREATE TABLE t0 (c0 UNIQUE, c1 UNIQUE, FOREIGN KEY(c0) REFERENCES t0(c1)); > INSERT OR FAIL INTO t0(c0, c1) VALUES > (0, 1), > (0,

[sqlite] .import into databases other than main doesn't work

2019-05-07 Thread Shawn Wagner
The .import command doesn't play well with attempts to use tables in schemas other than main: sqlite> .mode csv sqlite> .import test.csv temp.test Error: no such table: temp.test It creates the table if needed, but fails on the insert part because it tries to execute `INSERT INTO

Re: [sqlite] Improving CSV import

2019-05-07 Thread Shawn Wagner
Late follow up: > .import "tail -n +2 foo.csv |" mytable Found out today that this works (Though the pipe character has to be the first character, not the last) and apparently has for years, though I can't find it documented anywhere. On Thu, Mar 21, 2019 at 4:06 PM Shawn Wagner wrote: >

Re: [sqlite] Getting the week of the month from strftime or date functions

2019-05-07 Thread Petite Abeille
> On May 7, 2019, at 05:35, Jens Alfke wrote: > > [https://en.wikipedia.org/wiki/French_Republican_calendar] Along the same lines: International Fixed Calendar https://en.m.wikipedia.org/wiki/International_Fixed_Calendar > You Advocate An Approach To Calendar Reform; Your Idea Will Not

Re: [sqlite] Getting the week of the month from strftime or date functions

2019-05-07 Thread Jose Isaias Cabrera
I apologize to the group for the non-sqlite emails caused by my post. It was just having a little fun. :-) josé ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] GCC 4.8.5 compiler warnings with sqlite3 3.28.0: -Warray-bounds and -Wempty-body

2019-05-07 Thread LfSt
Hi! when including SQLite3 in our build, I noticed the following warnings: sqlite3.c: In function 'sqlite3WhereCodeOneLoopStart': sqlite3.c:138260:56: warning: suggest braces around empty body in an 'if' statement [-Wempty-body] if( pWInfo->nLevel>1 )

Re: [sqlite] Getting the week of the month from strftime or date functions

2019-05-07 Thread R Smith
On 2019/05/07 3:07 PM, Jose Isaias Cabrera wrote: Warren Young, on Monday, May 6, 2019 09:15 PM, wrote... On May 6, 2019, at 11:58 AM, Jose Isaias Cabrera wrote: someday, as John Lennon sang, "...the world will live as one." ;-) Okay, but one *what*? Serious question. Yeah, if I have to

Re: [sqlite] [EXTERNAL] If two orders are both the same order?

2019-05-07 Thread sqlite
sqlite-users@mailinglists.sqlite.org wrote: > Your schema implies that there can be more than one TIME for any GNAME and AN > combination (otherwise the primary key would not need to include alle three > fields). This contradicts your statement that AN and TIME are "the same > order". >

Re: [sqlite] Location of error in SQL statements ?

2019-05-07 Thread x
I think pzTail just points to the trailing ‘/0’ of zSql if an error occurs. From: sqlite-users on behalf of Rowan Worth Sent: Tuesday, May 7, 2019 9:07:34 AM To: SQLite mailing list Subject: Re: [sqlite] Location of error in SQL statements ? On Tue, 7 May

Re: [sqlite] Error when renaming a table when an invalid view exists in the schema

2019-05-07 Thread Tom Bassel
Thanks Keith. LEGACY_ALTER_TABLE=ON lets me change the table name without error. But the docs say "New applications should leave this flag turned off." Is there any other way of checking if the schema is invalid besides attempting to change the name of a table? I went through the pragmas and

Re: [sqlite] Getting the week of the month from strftime or date functions

2019-05-07 Thread Jose Isaias Cabrera
Warren Young, on Monday, May 6, 2019 09:15 PM, wrote... On May 6, 2019, at 11:58 AM, Jose Isaias Cabrera wrote: >> someday, as John Lennon sang, "...the world will live as one." ;-) > > Okay, but one *what*? Serious question. Yeah, if I have to explain it to you, then you miss the idea. :-) But

Re: [sqlite] Location of error in SQL statements ?

2019-05-07 Thread Rowan Worth
On Tue, 7 May 2019 at 16:00, Eric Grange wrote: > Is there are way to get more information about an SQL syntax error message > ? > For example on a largish SQL query I got the following error message > > near "on": syntax error > > but as the query is basically a long list of joins, this

[sqlite] Location of error in SQL statements ?

2019-05-07 Thread Eric Grange
Hi, Is there are way to get more information about an SQL syntax error message ? For example on a largish SQL query I got the following error message near "on": syntax error but as the query is basically a long list of joins, this is not too helpful ;) Having a character offset, a line

Re: [sqlite] [EXTERNAL] Re: Getting the week of the month from strftime or date functions

2019-05-07 Thread Gary R. Schmidt
On 07/05/2019 16:46, Hick Gunter wrote: Even the concept of "year" is subject to differing religious and cultural viewpoints, with some traditions still insisting on a lunar calendar with the corresponding shift of seasons by 11 days each year. And in one case, the length of a month depending

Re: [sqlite] [EXTERNAL] Re: Getting the week of the month from strftime or date functions

2019-05-07 Thread Hick Gunter
Even the concept of "year" is subject to differing religious and cultural viewpoints, with some traditions still insisting on a lunar calendar with the corresponding shift of seasons by 11 days each year. And in one case, the length of a month depending on the weather conditions and the