Re: [sqlite] BUG: Aggregate functions in subqueries

2014-09-15 Thread Petite Abeille
On Sep 15, 2014, at 4:48 PM, Richard Hipp wrote: > On Sun, Sep 14, 2014 at 12:18 AM, Lea Verou wrote: > >> Per the 3.7.11 changelog [1], queries of the form SELECT max(x), y FROM >> table return the value of y from the same row that contains the maximum x >> value. However, this: >> >> select

Re: [sqlite] BUG: Aggregate functions in subqueries

2014-09-15 Thread Richard Hipp
On Sun, Sep 14, 2014 at 12:18 AM, Lea Verou wrote: > Per the 3.7.11 changelog [1], queries of the form SELECT max(x), y FROM > table return the value of y from the same row that contains the maximum x > value. However, this: > > select y from (SELECT max(x), y FROM table); > > would not return th

Re: [sqlite] BUG: Aggregate functions in subqueries

2014-09-14 Thread Richard Hipp
On Sun, Sep 14, 2014 at 11:47 AM, Keith Medcalf wrote: > > Yes, the max(y) operation is flattened out of the query probably because > it is not referenced anywhere and the optimizer does not see that it is > performing any useful function. There is still only one row returned, > however, because

Re: [sqlite] BUG: Aggregate functions in subqueries

2014-09-14 Thread Keith Medcalf
operates on all rows instead of only those which set the max() return value. >-Original Message- >From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >boun...@sqlite.org] On Behalf Of Lea Verou >Sent: Saturday, 13 September, 2014 22:19 >To: sqlite-users@sqlite.org &g

Re: [sqlite] BUG: Aggregate functions in subqueries

2014-09-14 Thread Zsbán Ambrus
On 9/14/14, Lea Verou wrote: > Per the 3.7.11 changelog [1], queries of the form SELECT max(x), y FROM > table return the value of y from the same row that contains the maximum x > value. However, this: Hello! I don't think this is a bug. The documentation for the SELECT statement at "http://sq

Re: [sqlite] BUG: Aggregate functions in subqueries

2014-09-14 Thread Kees Nuyt
On Sun, 14 Sep 2014 00:18:34 -0400, Lea Verou wrote: > Per the 3.7.11 changelog [1], queries of the form > SELECT max(x), y FROM table return the value of y > from the same row that contains the maximum x value. > However, this: > select y from (SELECT max(x), y FROM table); > would not return t

[sqlite] BUG: Aggregate functions in subqueries

2014-09-14 Thread Lea Verou
Per the 3.7.11 changelog [1], queries of the form SELECT max(x), y FROM table return the value of y from the same row that contains the maximum x value. However, this: select y from (SELECT max(x), y FROM table); would not return the same y rows. This would work as expected: select m, y from (

Re: [sqlite] Bug and fix in lemon.c

2014-09-12 Thread Richard Hipp
On Fri, Sep 12, 2014 at 7:23 AM, Benjamin Franksen < benjamin.frank...@helmholtz-berlin.de> wrote: > Hi Folks > > I am using the lemon parser generator for a different project. It > appears that an attempt to pro-actively avoid a 64-bit problem in fact > created one in the first place. I am referr

[sqlite] Bug and fix in lemon.c

2014-09-12 Thread Benjamin Franksen
Hi Folks I am using the lemon parser generator for a different project. It appears that an attempt to pro-actively avoid a 64-bit problem in fact created one in the first place. I am referring to the following change: http://www3.sqlite.org/cgi/src/fdiff?sbs=1&v1=445f18999b700d83b83a5d9be00c59654

Re: [sqlite] sqlite bug after CREATE UNIQUE INDEX

2014-07-30 Thread Keith Medcalf
I think the point is that attempting to create the unique index should fail (with an error) and the index not be created rather than creating a unique index with duplicates (or whatever it is doing) causing subsequent queries to return incorrect results. >On Wed, 30 Jul 2014 09:10:29 +0400 >Pa

Re: [sqlite] sqlite bug after CREATE UNIQUE INDEX

2014-07-30 Thread James K. Lowden
On Wed, 30 Jul 2014 09:10:29 +0400 Pavel Pimenov wrote: > CREATE TABLE fly_hash_block(tth_id integer PRIMARY KEY NOT NULL, tth > number NOT NULL); > INSERT INTO fly_hash_block VALUES(1,1); > INSERT INTO fly_hash_block VALUES(2,2); > INSERT INTO fly_hash_block VALUES(3,2); > *CREATE UNIQUE INDEX i

[sqlite] sqlite bug after CREATE UNIQUE INDEX

2014-07-30 Thread Pavel Pimenov
hi C:\!dc-db\db-sqlite-corrupt\db-uniq-bug>sqlite3 --version 3.8.5 2014-06-04 14:06:34 b1ed4f2a34ba66c29b130f8d13e9092758019212 C:\!dc-db\db-sqlite-corrupt\db-uniq-bug>sqlite3.exe FlylinkDC.sqlite 0 SQL> CREATE TABLE fly_hash_block(tth_id integer PRIMARY KEY NOT NULL, tth number NOT NULL); Table

Re: [sqlite] SQLite bug report: type mismatch security issue in sqlite3.c version 3.7.13

2014-07-25 Thread Richard Hipp
On Fri, Jul 25, 2014 at 9:50 AM, Yunjiao Xue wrote: > To whom it may concern, > > We are using SQLite 3.7.13 with an amalgamation version of sqlite3.c. We > discovered a type mismatch security issue with a recent Fortify scan. The > problem is on lines 22407, 51807, 63005, 93150 of sqlite3.c. >

[sqlite] SQLite bug report: type mismatch security issue in sqlite3.c version 3.7.13

2014-07-25 Thread Yunjiao Xue
To whom it may concern, We are using SQLite 3.7.13 with an amalgamation version of sqlite3.c. We discovered a type mismatch security issue with a recent Fortify scan. The problem is on lines 22407, 51807, 63005, 93150 of sqlite3.c. For example, the function strHash() in sqlite3.c is declared to

Re: [sqlite] [bug] Optimizer chooses suboptimal plan for correlated subqueries

2014-07-18 Thread Richard Hipp
On Fri, Jul 18, 2014 at 10:58 AM, Stephen Broberg wrote: > > As for the .fullschema thing, a few questions: > > 1. Does just produce the DDL, or does it generate data as well? Just > the DDL in this case would not be particularly useful, as you'd need the db > populated to accurately reproduce

Re: [sqlite] [bug] Optimizer chooses suboptimal plan for correlated subqueries

2014-07-18 Thread Richard Hipp
Thanks for the detailed report. We always like reproducible test cases! Having not yet looked into your problem, let me first bring out a couple of *minor* details: (1) We prefer to reserve the word "bug" for situations where it gets the wrong answer. Getting the correct answer more slowly tha

[sqlite] [bug] Optimizer chooses suboptimal plan for correlated subqueries

2014-07-18 Thread Stephen Broberg
Hi, We encountered an issue in our system where we had two nearly identical subqueries in a statement, which differed only in one table (both of which had the same definition). One table had 4 rows, the other table had zero rows. The subquery with the 4-row table ran about 10,000 times faster

Re: [sqlite] [bug] sqlite memory corruption (use by digikam)

2014-07-18 Thread Mathieu Clabaut
Thank you Dan, as it is well behind my understanding of Digikam, I've asked one of the lead developper to have a look upon your answer and its implications. Best regards, -Mathieu 2014-07-15 22:27 GMT+02:00 Dan Kennedy : > On 07/16/2014 03:22 AM, Dan Kennedy wrote: > >> On 07/15/2014 09:06 P

[sqlite] [bug] Optimizer chooses suboptimal plan for correlated subqueries containing tables with zero rows

2014-07-17 Thread Stephen Broberg
Hi, We encountered an issue in our system where we had two nearly identical subqueries in a statement, which differed only in one table (both of which had the same definition). One table had 4 rows, the other table had zero rows. The subquery with the 4-row table ran about 10,000 times faster

Re: [sqlite] [bug] sqlite memory corruption (use by digikam)

2014-07-15 Thread Dan Kennedy
On 07/16/2014 03:22 AM, Dan Kennedy wrote: On 07/15/2014 09:06 PM, Mathieu Clabaut wrote: Hello, Digikam bug https://bugs.kde.org/show_bug.cgi?id=323888#c89 seems to be caused by a sqlite memory leak It looks very much like the program is not calling sqlite3_close(). If you have a small

Re: [sqlite] [bug] sqlite memory corruption (use by digikam)

2014-07-15 Thread Dan Kennedy
On 07/15/2014 09:06 PM, Mathieu Clabaut wrote: Hello, Digikam bug https://bugs.kde.org/show_bug.cgi?id=323888#c89 seems to be caused by a sqlite memory leak It looks very much like the program is not calling sqlite3_close(). If you have a small program that shows SQLite leaking memory pleas

[sqlite] [bug] sqlite memory corruption (use by digikam)

2014-07-15 Thread Mathieu Clabaut
Hello, Digikam bug https://bugs.kde.org/show_bug.cgi?id=323888#c89 seems to be caused by a sqlite memory leak and is said to be corrected with slqlite 3.8.5, but as shown in https://bugs.kde.org/show_bug.cgi?id=321680 a similar problem appear in digikam 4.0.0 with sqlite 3.8.5. Best regards, -

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-05 Thread Martin Kleusberg
Thank you all for your replies! Good to hear that this actually is sort of a sane behaviour. I think I wasn't fully aware of the fact that the primary key and the rowid column actually are *exactly* the same - it does make sense that way though. Thankfully I'm not relying on the column names bu

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Tim Streater
On 04 Jul 2014 at 15:35, Simon Slavin wrote: > On 4 Jul 2014, at 12:28pm, Tim Streater wrote: > >> On 04 Jul 2014 at 11:43, Simon Slavin wrote: >> >>> On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote: >>> I've encountered some odd behaviour when using the sqlite3_column_name functi

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Kees Nuyt
On Thu, 03 Jul 2014 23:22:46 +0200, Martin Kleusberg wrote: > I've encountered some odd behaviour when using the sqlite3_column_name > function. Here's my attempt to build a minimal example. > > Part 1: The database. Note that the table is not a 'without rowid' table and > has a primary key: >

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Simon Slavin
On 4 Jul 2014, at 12:28pm, Tim Streater wrote: > On 04 Jul 2014 at 11:43, Simon Slavin wrote: > >> On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote: >> >>> I've encountered some odd behaviour when using the sqlite3_column_name >>> function. >> >> Sorry, but column names are guaranteed onl

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread RSmith
On 2014/07/03 23:22, Martin Kleusberg wrote: Hi everybody, I've encountered some odd behaviour when using the sqlite3_column_name function. Here's my attempt to build a minimal example. Part 1: The database. Note that the table is not a 'without rowid' table and has a primary key: The output

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Hick Gunter
of SQLite Database Betreff: Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid On 04 Jul 2014 at 11:43, Simon Slavin wrote: > On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote: > >> I've encountered some odd behaviour when using the >> sqlite3_column_name f

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Tim Streater
On 04 Jul 2014 at 11:43, Simon Slavin wrote: > On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote: > >> I've encountered some odd behaviour when using the sqlite3_column_name >> function. > > Sorry, but column names are guaranteed only if you use an 'AS' clause in your > SELECT command. For eve

Re: [sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Simon Slavin
On 3 Jul 2014, at 10:22pm, Martin Kleusberg wrote: > I've encountered some odd behaviour when using the sqlite3_column_name > function. Sorry, but column names are guaranteed only if you use an 'AS' clause in your SELECT command. For every other situation, there's no telling what you'll get.

[sqlite] Bug? sqlite3_column_name returns name of PK for rowid

2014-07-04 Thread Martin Kleusberg
Hi everybody, I've encountered some odd behaviour when using the sqlite3_column_name function. Here's my attempt to build a minimal example. Part 1: The database. Note that the table is not a 'without rowid' table and has a primary key: $ sqlite3 test.db create table test(id integer primary ke

Re: [sqlite] Bug in "with" query

2014-06-21 Thread Clemens Ladisch
Jean-Luc Hainaut wrote: > Python 2.7.6, SQLite v3.8.5 So this is not the standard Python distribution? > import sqlite3 > conn = sqlite3.connect('ORDERS.db') > c = conn.cursor() > > query = "with CTE1(ID,Name,City)"\ > + " as (select CustID,Name from CUSTOMER where City = 'London')"\ >

[sqlite] Bug in "with" query

2014-06-21 Thread Jean-Luc Hainaut
Hi, Context: Python 2.7.6, Windows XP, SQLite v3.8.5 The test program: import sqlite3 conn = sqlite3.connect('ORDERS.db') c = conn.cursor() query = "with CTE1(ID,Name,City)"\ + " as (select CustID,Name from CUSTOMER where City = 'London')"\ + " select * from CTE1" c.execute(que

Re: [sqlite] BUG with unnecessary brackets in queries with IN ( SELECT .. )

2014-06-11 Thread beell
Gesendet: Mittwoch, 11. Juni 2014 um 10:29 Uhr Von: RSmith An: sqlite-users@sqlite.org Betreff: Re: [sqlite] BUG with unnecessary brackets in queries with IN ( SELECT .. ) >On 2014/06/11 07:48, be...@web.de wrote: >>>> Simple example : >>>> >>>> Working (

Re: [sqlite] BUG with unnecessary brackets in queries with IN ( SELECT .. )

2014-06-11 Thread RSmith
On 2014/06/11 07:48, be...@web.de wrote: Simple example : Working (correct result) select id from tbl where id in (select id from tbl) NOT working (incorrect result) : select id from tbl where id in ( ( select id from tbl) ) In the first query, SQLite looks for values of "id" that are in the

[sqlite] BUG with unnecessary brackets in queries with IN ( SELECT .. )

2014-06-10 Thread beell
>Von: "Richard Hipp" >An: "General Discussion of SQLite Database" >Betreff: Re: [sqlite] BUG with unnecessary brackets in queries with IN ( >SELECT .. ) >On Sun, Jun 8, 2014 at 7:52 PM, Martin Hristov wrote: > >> Simple example : >> >> Wo

Re: [sqlite] Bug in nonassoc handling with Lemon parser generator

2014-06-09 Thread Richard Hipp
On Sun, Jun 8, 2014 at 10:52 AM, Alexander Barrentine < alexander.barrent...@gmail.com> wrote: > I can’t tell just now if this is the right place to be sending bug reports > for Lemon. I have identified a failing in the handling of nonassoc > precedence with the generated grammars. > Thanks. Fix

Re: [sqlite] Bug Report: Case Sensitive Like

2014-06-09 Thread Richard Hipp
On Fri, Jun 6, 2014 at 5:26 PM, Martin Abel wrote: > > select Name from Targets where Name like '%üabc%'; -- real UTF-8 chars "ü" > or alternatively > select Name from Targets where Name like '%üabc%'; -- real UTF-8 chars, > ASCII encoded as "ü" > > it does not work - no one of the German ä, ö,

Re: [sqlite] BUG with unnecessary brackets in queries with IN ( SELECT .. )

2014-06-09 Thread Richard Hipp
On Sun, Jun 8, 2014 at 7:52 PM, Martin Hristov wrote: > Simple example : > > Working (correct result) > select id from tbl where id in (select id from tbl) > > NOT working (incorrect result) : > select id from tbl where id in ( ( select id from tbl) ) > In the first query, SQLite looks for value

[sqlite] BUG with unnecessary brackets in queries with IN ( SELECT .. )

2014-06-09 Thread Martin Hristov
Simple example : Working (correct result) select id from tbl where id in (select id from tbl) NOT working (incorrect result) : select id from tbl where id in ( ( select id from tbl) ) ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.o

[sqlite] Bug in nonassoc handling with Lemon parser generator

2014-06-09 Thread Alexander Barrentine
I can’t tell just now if this is the right place to be sending bug reports for Lemon. I have identified a failing in the handling of nonassoc precedence with the generated grammars. I detailed my findings in this StackOverflow page:  http://stackoverflow.com/questions/24051458/is-lemon-correctly

[sqlite] Bug Report: Case Sensitive Like

2014-06-09 Thread Martin Abel
Hi, I'm using SqLite intensively and it works quite well - great and thank you! I'm using the newest version 3.8.500. I've set pragma encoding = "UTF-8"; pragma case_sensitive_like = FALSE; in order to search case insensitive - and - it works, almost. When running something like this: select N

Re: [sqlite] Bug in division?

2014-05-06 Thread Jay Kreibich
On May 6, 2014, at 5:26 PM, Gene Connor wrote: > Subject: Re: [sqlite] Bug in division? > From: j...@kreibi.ch > Date: Tue, 6 May 2014 17:02:02 -0500 > CC: neothreeei...@hotmail.com > To: sqlite-users@sqlite.org > > > The system does not return 0 any time you divide t

Re: [sqlite] Bug in division?

2014-05-06 Thread Jay Kreibich
On May 6, 2014, at 4:29 PM, John Drescher wrote: >> Interesting. It makes NO sense to return 0 when dividing two integers. >> > > Never took a C/C++ class? The system does not return 0 any time you divide two integers, but it does return zero for 2 / 4. After all, how many *whole* times

Re: [sqlite] Bug in division?

2014-05-06 Thread Simon Slavin
On 6 May 2014, at 1:52pm, RSmith wrote: > I think the OP might be seeing the list via one of those connected sites and > not getting the feedback. Maybe send a direct mail to him. I'll send a personal email to him. Simon. ___ sqlite-users mailing li

Re: [sqlite] Bug in division?

2014-05-06 Thread Simon Slavin
On 6 May 2014, at 2:06am, Gene Connor wrote: > SELECT DISTINCT 2/4 AS RESULT FROM TABLE; > returns 0 Not a bug. By providing two integer operands you have asked for integer arithmetic, and will get an integer answer. It's something that happens in several different languages, even C ! Worse

Re: [sqlite] Bug in division?

2014-05-02 Thread Hick Gunter
. -Ursprüngliche Nachricht- Von: Gene Connor [mailto:neothreeei...@hotmail.com] Gesendet: Mittwoch, 30. April 2014 06:21 An: sqlite-users@sqlite.org Betreff: [sqlite] Bug in division? SELECT DISTINCT 2/4 AS RESULT FROM TABLE;returns 0 SELECT DISTINCT 2/4.0 AS RESULT FROM TABLE;returns 0.5 (correct

Re: [sqlite] Bug in division?

2014-05-01 Thread Clemens Ladisch
Petite Abeille wrote: > I don’t thing the various ANSI standards have anything normative to > say about what the result of a division should be, merely that there > is a division operator. Indeed: | | | Syntax Rules | | 1) If the declared type of both operands of a dyadic arithmetic |operator

Re: [sqlite] Bug in division?

2014-04-30 Thread Charles J. Daniels
This is a very common thing. Many programming languages, like C++, do the same thing. So it's not just a SQL thing. --charlie On Wed, Apr 30, 2014 at 7:11 AM, Marc L. Allen wrote: > Not an error. Int/Int uses integer division and results in an integer > number. When one number is a float, the re

Re: [sqlite] Bug in division?

2014-04-30 Thread Petite Abeille
On Apr 30, 2014, at 8:50 PM, Jay Kreibich wrote: > Given Oracle’s legacy, it might be that “2” defaults to a “numeric” type, > rather than an integer. Indeed, there are no ‘integer’ type per se in Oracle. At least not at the SQL level. But more to the point, I don’t thing the various ANSI sta

Re: [sqlite] Bug in division?

2014-04-30 Thread Rob Richardson
I don't know if it's in the SQL standard or not, but the C, C++ and C# languages all act this way. The result of mathematical operations on integers is always an integer. If you want the result to be a floating-point number, you have to force at least one of the operands to be a floating-point

Re: [sqlite] Bug in division?

2014-04-30 Thread Jay Kreibich
On Apr 30, 2014, at 1:00 PM, Petite Abeille wrote: > > On Apr 30, 2014, at 2:22 PM, John McKown wrote: > >> PostgreSQL likewise returns 0 for 2/4 and .5 for 2/4.0 . This is likely a >> part of the SQL standard. > > Just to be contrarian, Oracle doesn’t and returns 0.5. Ah! > Given Oracl

Re: [sqlite] Bug in division?

2014-04-30 Thread Petite Abeille
On Apr 30, 2014, at 2:22 PM, John McKown wrote: > PostgreSQL likewise returns 0 for 2/4 and .5 for 2/4.0 . This is likely a > part of the SQL standard. Just to be contrarian, Oracle doesn’t and returns 0.5. Ah! ___ sqlite-users mailing list sqlite-us

Re: [sqlite] Bug in division?

2014-04-30 Thread John McKown
PostgreSQL likewise returns 0 for 2/4 and .5 for 2/4.0 . This is likely a part of the SQL standard. On Wed, Apr 30, 2014 at 7:11 AM, Marc L. Allen wrote: > Not an error. Int/Int uses integer division and results in an integer > number. When one number is a float, the result becomes a float. > >

Re: [sqlite] Bug in division?

2014-04-30 Thread Marc L. Allen
Not an error. Int/Int uses integer division and results in an integer number. When one number is a float, the result becomes a float. I don't know about all SQL varieties, but MSSQL is the same. > On Apr 30, 2014, at 8:04 AM, "Gene Connor" wrote: > > > SELECT DISTINCT 2/4 AS RESULT FROM TAB

[sqlite] Bug in division?

2014-04-30 Thread Gene Connor
SELECT DISTINCT 2/4 AS RESULT FROM TABLE;returns 0 SELECT DISTINCT 2/4.0 AS RESULT FROM TABLE;returns 0.5 (correct) SELECT DISTINCT 2.0/4 AS RESULT FROM TABLE;returns 0.5 (correct) SELECT DISTINCT 2.0/4.0 AS RESULT FROM TABLE;returns 0.5 (correct) SELECT DISTINCT 2.0/4.01 AS RESULT FROM TABLE;retu

Re: [sqlite] bug or inconsistency in column headers

2014-04-29 Thread Richard Hipp
On Tue, Apr 29, 2014 at 6:35 AM, wrote: > > I'm not sure whether this is a bug or not. > I stumbled across a situation where a table alias sometimes is reflected > in the column name and sometimes not. > > Uncomment the last /*LEFT*/ JOIN and the column headers are id_flaeche, > name, beschreibun

[sqlite] bug or inconsistency in column headers

2014-04-29 Thread beell
I'm not sure whether this is a bug or not. I stumbled across a situation where a table alias sometimes is reflected in the column name and sometimes not. It *is* reflected when the last join is a *left* one. Script (sorry that I couldn't come up with a simpler test case): CREATE TABLE t_variabl

[sqlite] [BUG] vfstraceAccess() logs as xDelete

2014-04-28 Thread Michael McTernan
Hi all, A very trivial bug here - in src/test_vfstrace.c, vfstraceAccess() the log message is wrong: static int vfstraceAccess( sqlite3_vfs *pVfs, const char *zPath, int flags, int *pResOut ){ vfstrace_info *pInfo = (vfstrace_info*)pVfs->pAppData; sqlite3_vfs *pRoot = pInfo->pRoot

Re: [sqlite] Bug report: column name includes table alias when CTE is used

2014-04-21 Thread Kevin Benson
On Mon, Apr 21, 2014 at 8:29 AM, Richard Hipp wrote: > On Mon, Apr 21, 2014 at 1:16 AM, Andre wrote: > > > Hi, > > > > Apparently when a CTE is used, the column name includes the table alias. > > However, when no CTE is used, the alias is not present in the returned > > column name. > > > > SQLi

Re: [sqlite] Bug with FTS3 parenthesis and ICU (2)

2014-04-21 Thread Stadin, Benjamin
Hi David, I overlooked your email at first. Thanks for your analysis. I thought that doing the quick fix wasn¹t enough for my purpose. So I replaced the tokenization part icuNext(). I hope backwards compatibility will not be an issue for this fix. Regards Ben static int icuNext( sqlite3_toke

Re: [sqlite] Bug report: column name includes table alias when CTE is used

2014-04-21 Thread Richard Hipp
On Mon, Apr 21, 2014 at 1:16 AM, Andre wrote: > Hi, > > Apparently when a CTE is used, the column name includes the table alias. > However, when no CTE is used, the alias is not present in the returned > column name. > > SQLite version 3.8.4.3 2014-04-03 16:53:12 > Enter ".help" for usage hints.

Re: [sqlite] Bug Report: Quotes added to table name after ALTER TABLE ... RENAME TO

2014-04-21 Thread Richard Hipp
On Mon, Apr 21, 2014 at 4:36 AM, Assen Totin wrote: > Hi, everybody, > > Found something which seems rather inconsistent and may be a bug, hence > reporting it here. > > Running a query to rename a table succeeds, but the name of the renamed > table is surrounded by double quotes. > > sqlite> .sc

[sqlite] Bug Report: Quotes added to table name after ALTER TABLE ... RENAME TO

2014-04-21 Thread Assen Totin
Hi, everybody, Found something which seems rather inconsistent and may be a bug, hence reporting it here. Running a query to rename a table succeeds, but the name of the renamed table is surrounded by double quotes. sqlite> .schema CREATE TABLE version (version INT); sqlite> ALTER TABLE version

Re: [sqlite] Bug report: column name includes table alias when CTE is used

2014-04-20 Thread Simon Slavin
On 21 Apr 2014, at 6:16am, Andre wrote: > Apparently when a CTE is used, the column name includes the table alias. > However, when no CTE is used, the alias is not present in the returned > column name. SQLite has no standards at all about column names unless you specifically set a column name

[sqlite] Bug report: column name includes table alias when CTE is used

2014-04-20 Thread Andre
Hi, Apparently when a CTE is used, the column name includes the table alias. However, when no CTE is used, the alias is not present in the returned column name. SQLite version 3.8.4.3 2014-04-03 16:53:12 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENA

Re: [sqlite] Bug report: ORDER BY ignored in presence of GROUP BY and index

2014-04-20 Thread Richard Hipp
On Sat, Apr 19, 2014 at 11:14 PM, foxlit wrote: > Hi, > > I recently noticed something similar to the following behaviour: > > sqlite> .version > SQLite 3.8.4.3 2014-04-03 16:53:12 a611fa96c4a848614efe899130359c9f6fb889c3 > sqlite> CREATE TABLE t1 (x, y); > sqlite> INSERT INTO t1 VALUES (1, 1), (

[sqlite] Bug report: ORDER BY ignored in presence of GROUP BY and index

2014-04-20 Thread foxlit
Hi, I recently noticed something similar to the following behaviour: sqlite> .version SQLite 3.8.4.3 2014-04-03 16:53:12 a611fa96c4a848614efe899130359c9f6fb889c3 sqlite> CREATE TABLE t1 (x, y); sqlite> INSERT INTO t1 VALUES (1, 1), (2, 0); sqlite> SELECT x, y FROM t1 GROUP BY x, y ORDER BY x,y; 1

Re: [sqlite] Bug Report

2014-04-17 Thread Jim Dodgen
Ryan, The late Grace Hopper would be happy about your responce *Jim Dodgen* On Thu, Apr 17, 2014 at 10:40 AM, RSmith wrote: > That is just the compiler trying to be helpful without being able to > completely grasp the code and can safely be ignored, but thank you for the > notice and fee

Re: [sqlite] Bug Report

2014-04-17 Thread RSmith
That is just the compiler trying to be helpful without being able to completely grasp the code and can safely be ignored, but thank you for the notice and feel free to initialize the variable in your version. As an aside, that does not qualify as a "bug", the word "bug" means a whole other thing

[sqlite] Bug Report

2014-04-17 Thread jalal Mostafa
Hey, I downloaded the "Legacy Source Code Distribution Formats - sqlite-preprocessed-3080403.zip", while compiling in Microsoft Visual Studio 2013 a bug appeared in file "fts3_tokenize_vtab.c","error C4703: potentially uninitialized local pointer variable 'pTab' used" Line:203.Assigning the poi

[sqlite] Bug report: .import csv (wiki) documentation error (sqlite 3.7.17)

2014-04-15 Thread Holger Joukl
Hi, while sqlite documentation on .import is generally a bit sparse (or I haven't found it), searching for it prominently yields this wiki page: http://www.sqlite.org/cvstrac/wiki?p=ImportingFiles The information given there seems out of date and partly incorrect. Contrary to "[...] Unfortunat

Re: [sqlite] Bug with FTS3 parenthesis and ICU (2)

2014-04-13 Thread David Hedley
This is definitely a bug in sqlite. I have experienced it too. The problem stems from “getNextToken(…)” expecting to find the parentheses in the token delimiters (rather than the tokens themselves). The ICU tokenizer returns the parentheses as tokens, rather than ignoring them as delimiters as

Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Richard Hipp
On Sat, Apr 12, 2014 at 5:04 PM, Alexander Bich wrote: > Hi there, > > I was trying to upgrade SQLite version in my C++ application from > 3.8.0.2 to 3.8.4.3. Unfortunately after upgrade my application became > experience major problems. I tracked down the bug and got an SQL > script which gives

Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread James K. Lowden
On Sun, 13 Apr 2014 06:55:09 -0400 Richard Hipp wrote: > The following simplified test case causes an assertion fault: > > CREATE TABLE t1(a,b); > CREATE UNIQUE INDEX t1ab ON t1(a,b); > CREATE INDEX t1b ON t1(b) WHERE b=1; > INSERT INTO t1(a,b) VALUES(123,456); > UPDATE OR REPLACE t1 SET b=789;

Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Simon Slavin
On 13 Apr 2014, at 12:32pm, Tim Streater wrote: >> CREATE INDEX t1b ON t1(b) WHERE b=1; > > I get no assertion fault but rather a syntax error here on "where". Partial indexes were introduced in 3.8.0. See the last section of Simon.

Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Tim Streater
On 13 Apr 2014 at 11:55, Richard Hipp wrote: > The UPDATE OR REPLACE also seems to be an essential component. The > following simplified test case causes an assertion fault: > > CREATE TABLE t1(a,b); > CREATE UNIQUE INDEX t1ab ON t1(a,b); > CREATE INDEX t1b ON t1(b) WHERE b=1; I get no asserti

Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Richard Hipp
On Sat, Apr 12, 2014 at 5:04 PM, Alexander Bich wrote: > Hi there, > > I was trying to upgrade SQLite version in my C++ application from > 3.8.0.2 to 3.8.4.3. Unfortunately after upgrade my application became > experience major problems. I tracked down the bug and got an SQL > script which gives

[sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Alexander Bich
Hi there, I was trying to upgrade SQLite version in my C++ application from 3.8.0.2 to 3.8.4.3. Unfortunately after upgrade my application became experience major problems. I tracked down the bug and got an SQL script which gives different result on different versions of SQLite. Original script i

[sqlite] Bug with FTS3 parenthesis and ICU (2)

2014-04-04 Thread Stadin, Benjamin
(Please disregard my first email. I hit the wrong button and sent the email to early.) It seems that creating a virtual FTS3 table with ICU tokenizer breaks FTS3 parenthesis. Example: — Create test table participant CREATE VIRTUAL TABLE 'participant' USING fts4 (tokenize=icu de_DE, firstName, las

[sqlite] Bug with FTS3 parenthesis and ICU

2014-04-04 Thread Stadin, Benjamin
It seems like that creating a virtual FTS3 table with ICU tokenizer breaks FTS3 parenthesis. Example: SQLITE_ENABLE_FTS3_PARENTHESIS SQLite is of course built with SQLITE_ENABLE_FTS3_PARENTHESIS, ICU, etc. I compile SQLite with ICU for the iPhone with the following flags: . Though I think it sh

Re: [sqlite] Bug in sqlite? Can't read tables just after creating them

2014-03-11 Thread Simon Slavin
On 11 Mar 2014, at 11:31am, Fabrice Triboix wrote: > The problem is actually elsewhere. I changed the filesystem and it works > fine. > > So the problem is not with sqlite but with our special filesystem. Make sure your code tests the results returned by all API calls to see that they are

Re: [sqlite] Bug in sqlite? Can't read tables just after creating them

2014-03-11 Thread Fabrice Triboix
-users-bounces@sqlite.orgDate: Tue, 11 Mar 2014 07:27:37 To: General Discussion of SQLite Database Reply-To: General Discussion of SQLite Database Subject: Re: [sqlite] Bug in sqlite? Can't read tables just after creating them On Tue, Mar 11, 2014 at 6:35 AM, wrote: > Hi, >

Re: [sqlite] Bug in sqlite? Can't read tables just after creating them

2014-03-11 Thread Richard Hipp
On Tue, Mar 11, 2014 at 6:35 AM, wrote: > Hi, > > I found a problem in sqlite. > > In essence, here is what my code does: > 1 - It opens a database file > 2 - If it doesn't find certain tables, it assumes this is a new one and > creates the necessary tables and add a few entries in one of them

[sqlite] Bug in sqlite? Can't read tables just after creating them

2014-03-11 Thread ftriboix
Hi, I found a problem in sqlite. In essence, here is what my code does: 1 - It opens a database file 2 - If it doesn't find certain tables, it assumes this is a new one and creates the necessary tables and add a few entries in one of them (let's call it mytable) 3 - It queries mytable by doing

Re: [sqlite] Bug in SQLite 3.8.2

2014-02-12 Thread Richard Hipp
Thanks for the bug report. Ticket: http://www.sqlite.org/src/info/c34d0557f740c45070 Fixed here: http://www.sqlite.org/src/info/5d01426ddf On Wed, Feb 12, 2014 at 5:31 AM, Paweł Salawa wrote: > Hi, > > The bug affects 3.8.2 and 3.8.3.1, I haven't tested other versions. > > *Preconditions:* > >

Re: [sqlite] Bug in SQLite 3.8.2

2014-02-12 Thread Kees Nuyt
On Wed, 12 Feb 2014 11:31:05 +0100, Pawe? Salawa wrote: > - open database A and attach database B: > ATTACH 'database_b.db' AS 'attached'; This is not the main cause, but that should be: ATTACH 'database_b.db' AS attached; (attached should not be a literal but an identifier, just like

[sqlite] Bug in SQLite 3.8.2

2014-02-12 Thread Paweł Salawa
Hi, The bug affects 3.8.2 and 3.8.3.1, I haven't tested other versions. *Preconditions:* - 2 databases: A and B. - database A has table "test": CREATE TABLE test (id integer PRIMARY KEY, val text) WITHOUT ROWID - database B has table "test2": CREATE TABLE test2 (EID INTEGER, node1 INTEGER, nod

Re: [sqlite] Bug: PRAGMA busy_timeout outputs the value, screws up html

2014-01-21 Thread david
Kees Nuyt writes: > > On Tue, 24 Dec 2013 22:55:32 -0500, dmitry babitsky > wrote: > > >*bug description:* > >Using PRAGMA busy_timeout outputs the value which in case of html output > >screws up the display. > >To be more precise, it creates an extra row/recordset with the timeout > >value,

Re: [sqlite] Bug: 3.8.2 assertion failure in allocateIndexInfo where 3.7.13 does not

2014-01-20 Thread Richard Hipp
Trouble ticket here: www.sqlite.org/src/tktview/1a1a194d1e5f8 On Mon, Jan 20, 2014 at 1:38 PM, Mary Holstege wrote: > > The setup here is a virtual table with two columns > and a query of the form: > > select c1,c2 from test where c1 > The code in exprAnalyze that used to say this: > > if( pLef

[sqlite] Bug: 3.8.2 assertion failure in allocateIndexInfo where 3.7.13 does not

2014-01-20 Thread Mary Holstege
The setup here is a virtual table with two columns and a query of the form: select c1,c2 from test where c1op==TK_COLUMN ){ pTerm->leftCursor = pLeft->iTable; pTerm->u.leftColumn = pLeft->iColumn; pTerm->eOperator = operatorMask(op); } now says this: u16 opMask = (pTe

[sqlite] Bug Report SQLITE JDBC driver 3.7.2: problem calling "wasNull" function in the ResultSet.

2014-01-15 Thread Burkhard Losch
Hi, if the user calls "getObject" before calling wasNull then wasNull returns either the "wasNull" value of the previous called get call, or it throws an Exception, if it is called the first time. How to replicate this bug: DBConnection conn = DatabaseMetaData md = conn.getMetaData(); R

Re: [sqlite] Bug in SQLITE regarding HAVING?

2013-12-25 Thread Tobias Steinmann
Hi Simon, no its OK -- did not take anything personal. I think I stay with my SQL-statements... Thanks again for your hint, Tobias ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-user

Re: [sqlite] Bug: PRAGMA busy_timeout outputs the value, screws up html

2013-12-25 Thread Kees Nuyt
On Tue, 24 Dec 2013 22:55:32 -0500, dmitry babitsky wrote: >*bug description:* >Using PRAGMA busy_timeout outputs the value which in case of html output >screws up the display. >To be more precise, it creates an extra row/recordset with the timeout >value, which is what then shows on the html pag

Re: [sqlite] Bug in SQLITE regarding HAVING?

2013-12-25 Thread Simon Slavin
On 25 Dec 2013, at 8:54am, Tobias Steinmann wrote: > thanks for your hint. I needed some time to figure out, how to use this > mailing-list and I hope, you will get my answer. > > I tried the same im MySQL and it worked -- I know, that is no reason I just > wanted to say. > > I also tried, t

Re: [sqlite] Bug in SQLITE regarding HAVING?

2013-12-25 Thread Tobias Steinmann
Hi Simon, thanks for your hint. I needed some time to figure out, how to use this mailing-list and I hope, you will get my answer. I tried the same im MySQL and it worked -- I know, that is no reason I just wanted to say. I also tried, to rename one of the depth's to depth1 -- and then it al

[sqlite] Bug: PRAGMA busy_timeout outputs the value, screws up html

2013-12-24 Thread dmitry babitsky
*bug description:* Using PRAGMA busy_timeout outputs the value which in case of html output screws up the display. To be more precise, it creates an extra row/recordset with the timeout value, which is what then shows on the html page. There should be a way to say "set the pragma, but don't output

Re: [sqlite] Bug in SQLITE regarding HAVING?

2013-12-23 Thread James K. Lowden
On Mon, 23 Dec 2013 23:50:30 +0100 "E.Pasma" wrote: > > . See if you can make the simplest possible SELECT that comes up > > with unexpected results. > > select 0 as depth > from(select 1 as depth) > group by null > having depth < 1 > ; > This returns no rows. Thus the HAVING clause refer

Re: [sqlite] Bug in SQLITE regarding HAVING?

2013-12-23 Thread E.Pasma
Op 23 dec 2013, om 14:32 heeft Simon Slavin het volgende geschreven: General note: when making up a name for a calculation like 'depth', try to make sure it's not the name of any of the columns in the tables mentioned in your SELECT. This avoids ambiguity. . See if you can make the simp

Re: [sqlite] Bug in SQLITE regarding HAVING?

2013-12-23 Thread Simon Slavin
On 22 Dec 2013, at 11:12pm, Tobias Steinmann wrote: > SELECT node.id,node.lft, node.rgt, (COUNT(parent.id) - (sub_tree.depth + 1)) > AS depth FROM target_directory AS node, target_directory AS parent, > target_directory AS sub_parent, (SELECT node.id, (COUNT(parent.id) - 1) AS > depth FROM ta

<    4   5   6   7   8   9   10   11   12   13   >