Re: [sqlite] Bug in query planner / optimizer

2013-07-08 Thread Richard Hipp
On Mon, Jul 8, 2013 at 8:52 AM, Klaus Keppler wrote: > Hi again, > > we've stumbled upon another hard to reproduce bug in SQLite. This has most > propably something to do with the query planner optimizations since 3.7.16. > If you compile with SQLITE_DEBUG=1 then you get an assertion fault begin

[sqlite] Bug in query planner / optimizer

2013-07-08 Thread Klaus Keppler
Hi again, we've stumbled upon another hard to reproduce bug in SQLite. This has most propably something to do with the query planner optimizations since 3.7.16. We have a complex SQL query which should return 4 result rows. When executing the whole statement (see below), no results are retur

Re: [sqlite] BUG REPORT: function instr() with chinese characters

2013-07-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/07/13 01:20, ?? wrote: > I am using the sqlite-shell-win32-x86-3071700, in WindowsXP SP3 I did the same queries on Linux and got very different answers that appear to be correct. I'd suggest using SQLite programmatically since the Windows c

[sqlite] BUG REPORT: function instr() with chinese characters

2013-07-06 Thread ??????
Hello, I am using the sqlite-shell-win32-x86-3071700, in WindowsXP SP3 The operation is like the following: .. F:\>sqlite3.exe 1.db SQLite version 3.7.17 2013-05-20 00:56:22 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> create table a (b int, c int); sqlite>

Re: [sqlite] Bug: on opening the same database twice

2013-06-26 Thread Israel Lins Albuquerque
Ok, Then let me explain my problem to see if I done the best solution! I have an replication system using sqlite where: - I have 2 databases: one for output* and other for input*; - I have 2 process accessing booth: The first is the replicator: - Get the data on server and write on input dat

Re: [sqlite] Bug: on opening the same database twice

2013-06-26 Thread Richard Hipp
On Wed, Jun 26, 2013 at 1:24 PM, Israel Lins Albuquerque < israelin...@yahoo.com.br> wrote: > I open an database twice times in same process and same thread one in > readonly mode, and the other read write. > With shared_cache enable. > Opening first the readonly mode and after readwrite mode, the

[sqlite] Bug: on opening the same database twice

2013-06-26 Thread Israel Lins Albuquerque
I open an database twice times in same process and same thread one in readonly mode, and the other read write. With shared_cache enable. Opening first the readonly mode and after readwrite mode, the second connection works as read only too. Then I looked to sqlite code and I see the problem in:

Re: [sqlite] Bug in Apress SQLite book. Was: Different result set of query in examples of SQLite book

2013-06-15 Thread Mike Owens
It seems to me that this should be invalid as COUNT(id) does not refer to a valid field in the subquery's column list. I would vote for throwing an error as it seems that wrong. Since its been over six years since I wrote that query, I don't know what I was thinking at the time. Sent from my iPhon

Re: [sqlite] Bug in Apress SQLite book. Was: Different result set of query in examples of SQLite book

2013-06-13 Thread Darren Duncan
On 2013.06.13 7:22 PM, Yongil Jang wrote: Thank you, Richard and James. 2013/6/14 James K. Lowden Why not simply SELECT f.name, count(e.food_id) as 'episodes' FROM foods as f OUTER JOINfoods_episodes as e ON f.id = e.food_id GROUP BY f.name ORDER BY episodes DESC LIMIT 10;

Re: [sqlite] Bug in Apress SQLite book. Was: Different result set of query in examples of SQLite book

2013-06-13 Thread Yongil Jang
Thank you, Richard and James. 2013/6/14 James K. Lowden > > > Why not simply > > SELECT f.name, count(e.food_id) as 'episodes' > FROM foods as f > OUTER > JOINfoods_episodes as e > ON f.id = e.food_id > GROUP BY f.name > ORDER BY episodes DESC LIMIT 10; > > In my opinion, That ex

Re: [sqlite] Bug in Apress SQLite book. Was: Different result set of query in examples of SQLite book

2013-06-13 Thread James K. Lowden
On Thu, 13 Jun 2013 08:13:29 -0400 Richard Hipp wrote: > SELECT > name, > (SELECT COUNT(food_id) FROM foods_episodes WHERE food_id=f.id) count > FROM > foods f > ORDER BY count DESC LIMIT 10; ... > SELECT > name, > (SELECT COUNT(*) FROM foods_episodes WHERE food_id=f.id) count > FROM >

[sqlite] Bug in Apress SQLite book. Was: Different result set of query in examples of SQLite book

2013-06-13 Thread Richard Hipp
On Thu, Jun 13, 2013 at 12:24 AM, Yongil Jang wrote: > Dear all, > > Following select query returns different result data between v3.7.11 and > v3.7.13~. > > CREATE TABLE foods( > id integer primary key, > type_id integer, > name text ); > CREATE TABLE foods_episodes( > food_id integer, >

Re: [sqlite] Bug in SQLite 3.7.15-3.7.17 regarding group by query after joining two table with primary key index

2013-06-05 Thread Chen, Mi
e.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp Sent: Wednesday, June 05, 2013 6:21 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Bug in SQLite 3.7.15-3.7.17 regarding group by query after joining two table with primary key index On Tue, Jun 4, 2013 at

Re: [sqlite] Bug in SQLite 3.7.15-3.7.17 regarding group by query after joining two table with primary key index

2013-06-05 Thread Richard Hipp
On Tue, Jun 4, 2013 at 2:42 PM, Chen, Mi wrote: > All, I encountered a likely bug during development with latest SQL > versions (3.7.17)... It appears to be affecting the result of queries with > GROUP BY clause with partial join over two primary keys. > Your test case has been added here:

[sqlite] Bug in SQLite 3.7.15-3.7.17 regarding group by query after joining two table with primary key index

2013-06-05 Thread Chen, Mi
All, I encountered a likely bug during development with latest SQL versions (3.7.17)... It appears to be affecting the result of queries with GROUP BY clause with partial join over two primary keys. SQL Version 3.7.14 does not have this behavior, and SQL Version 3.7.15 - 3.7.17 are all affected

Re: [sqlite] BUG joining two views (3.7.16)

2013-05-24 Thread Richard Hipp
On Thu, May 23, 2013 at 3:59 PM, Chris King wrote: > Download > http://www.fstutoring.com/~**chris/temp/bug.sqlite3or > load the .dump below the ---snip---; then perform the following: > > $ sqlite3 -header bug.sqlite3 > > sqlite> select * from

[sqlite] BUG joining two views (3.7.16)

2013-05-24 Thread Chris King
Download http://www.fstutoring.com/~chris/temp/bug.sqlite3 or load the .dump below the ---snip---; then perform the following: $ sqlite3 -header bug.sqlite3 sqlite> select * from marking_next; transition|place|marking t1|p1|0 t1|p3|3 t1|p4|1 t2|p1|2 t2|p3|1 t2|p4|2 sqlite> select * from marki

[sqlite] Bug: Random crashes while preparing a statement (Valgrind always complains, reproducing code)

2013-05-06 Thread Jerome St-Louis
Hi guys, I found this crash in SQLite. Tested with latest amalgamation ( sqlite-autoconf-307160 ). Please assist. Thanks, Jerome #include #include #include int main() { sqlite3_stmt * stmt = NULL; sqlite3 * db = NULL; sqlite3_open_v2("test.sqlite"

Re: [sqlite] Bug report: query parser should trigger an error if a subquery selects unknown columns from table

2013-05-02 Thread Hick Gunter
Because then you would lose automatic matching of unique field names everywhere else... -Ursprüngliche Nachricht- Von: Thomas Krueger [mailto:tom.krue...@gmail.com] Gesendet: Donnerstag, 02. Mai 2013 13:15 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Bug report: query

Re: [sqlite] Bug report: query parser should trigger an error if a subquery selects unknown columns from table

2013-05-02 Thread Thomas Krueger
I ran into a similar issue: DELETE FROM ATable WHERE EXISTS(SELECT 1 FROM TMPTable AS t WHERE id = t.id) ; Syntactically I was expecting id to be the ATable.id as I had aliased the TMPTable with t. But the result was a non-correlated subquery, id = t.id was always true. The fix is clear, yet a

Re: [sqlite] Bug report: query parser should trigger an error if a subquery selects unknown columns from table

2013-05-01 Thread Richard Hipp
On Wed, May 1, 2013 at 3:23 PM, Anderson Medeiros Gomes wrote: > Hi. I think I found a bug in SQLite, so I'm reporting it in this message. > > The print screen I have attached shows a query that SQLite executes and > brings no results. I believe SQLite should trigger an error while parsing > my in

Re: [sqlite] Bug report: query parser should trigger an error if a subquery selects unknown columns from table

2013-05-01 Thread Nico Williams
On Wed, May 1, 2013 at 2:23 PM, Anderson Medeiros Gomes wrote: > Hi. I think I found a bug in SQLite, so I'm reporting it in this message. I do't think it's a bug. Correlated sub-queries can refer to columns from table sources outside them. Your example query is silly, no doubt, but it is not i

[sqlite] Bug report: query parser should trigger an error if a subquery selects unknown columns from table

2013-05-01 Thread Anderson Medeiros Gomes
Hi. I think I found a bug in SQLite, so I'm reporting it in this message. The print screen I have attached shows a query that SQLite executes and brings no results. I believe SQLite should trigger an error while parsing my input, because I used an unknown column in the subquery. This is the print

Re: [sqlite] Bug in resolving aliases with parentheses in join

2013-04-29 Thread Lucas Clemente
Ah, I overlooked that and just assumed it was correct since sqlite accepted it. Thanks for your help! The reason we need this is that we're procedurally generating SQL queries, and it's easier to insert parentheses everywhere than just in the (very) few join clauses where they are actually need

Re: [sqlite] Bug in resolving aliases with parentheses in join

2013-04-28 Thread James K. Lowden
On Sun, 28 Apr 2013 12:23:42 +0200 Lucas Clemente wrote: > SELECT * FROM (t1 AS a) JOIN (t2 AS b) USING(k) WHERE a.k = 1; ... > Looks like this is due to some problem with resolving the alias in > the parantheses. Now, as far as I understand SQL this should just > work since the () don't introduc

[sqlite] Bug in resolving aliases with parentheses in join

2013-04-28 Thread Lucas Clemente
Hi, I hit something that looks like a bug when working with aliases in parentheses: CREATE TABLE t1 (k); CREATE TABLE t2 (k); This works as expected: SELECT * FROM (t1 AS a) JOIN (t2 AS b) USING(k) WHERE a.k = 1; But chaging the a to b in the WHERE clause causes the following query to error (

[sqlite] Bug report: small bug in shell.c

2013-04-17 Thread Eric Koldeweij
I have found that the following command in my opinion returns an incorrect exit code: eric@sirius:~/src/sqlite-amalgamation-3071602$ ./sqlite3 appl.db .quit eric@sirius:~/src/sqlite-amalgamation-3071602$ echo $? 2 This should (in my opinion) return 0 for success instead of 2. In interactive mo

Re: [sqlite] Bug or some misunderstanding?

2013-04-03 Thread Dominique Devienne
On Wed, Apr 3, 2013 at 1:54 AM, Support wrote: > Hi > I have a database which has an entry "USE" in a table called airports with > column LocationID. > When I call > sqlite3 -line ~/Desktop/maps.db 'select * from airports where LocationID > like "USE%";' > I get correct result. > > But when I cal

Re: [sqlite] Bug or some misunderstanding?

2013-04-03 Thread Jay A. Kreibich
On Wed, Apr 03, 2013 at 02:28:07PM +0200, Dominique Devienne scratched on the wall: > On Wed, Apr 3, 2013 at 1:54 AM, Support wrote: > > > sqlite3 -line ~/Desktop/maps.db 'select * from airports where LocationID > > like "USE%";' > > I get correct result. > > > > But when I call > > sqlite3 -lin

Re: [sqlite] Bug or some misunderstanding?

2013-04-03 Thread Richard Hipp
On Tue, Apr 2, 2013 at 7:54 PM, Support wrote: > Hi > I have a database which has an entry "USE" in a table called airports with > column LocationID. > When I call > sqlite3 -line ~/Desktop/maps.db 'select * from airports where LocationID > like "USE%";' > I get correct result. > > But when I cal

Re: [sqlite] Bug or some misunderstanding?

2013-04-03 Thread Dominique Devienne
On Wed, Apr 3, 2013 at 1:54 AM, Support wrote: > sqlite3 -line ~/Desktop/maps.db 'select * from airports where LocationID > like "USE%";' > I get correct result. > > But when I call > sqlite3 -line ~/Desktop/maps.db 'select * from airports where > LocationID=="USE";' > SQL uses =, not == (and st

Re: [sqlite] Bug or some misunderstanding?

2013-04-03 Thread Donald Griggs
Hello, "Z", Have you made sure you don't have a trailing space or other invisible character at the end of the field? As a first step, you might try a query such as the following: * select '(' || LocationID || ')' , *from airports where LocationID like 'USE%'* Maybe this helps,

[sqlite] Bug or some misunderstanding?

2013-04-03 Thread Support
Hi I have a database which has an entry "USE" in a table called airports with column LocationID. When I call sqlite3 -line ~/Desktop/maps.db 'select * from airports where LocationID like "USE%";' I get correct result. But when I call sqlite3 -line ~/Desktop/maps.db 'select * from airports whe

Re: [sqlite] Bug on real operations

2013-03-26 Thread Israel Lins Albuquerque
>> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin >> Sent: Friday, March 08, 2013 1:37 PM >> To: General Discussion of SQLite Database >> Subject: Re: [sqlite] Bug on real operations >> >> >> On 8 Mar 2013, at 6:24pm, Israel Lins Albuquer

Re: [sqlite] Bug on real operations

2013-03-10 Thread James K. Lowden
On Fri, 8 Mar 2013 15:06:31 -0300 Israel Lins Albuquerque wrote: > The problem is not comparisons the problem is when I do something > like this: CREATE TABLE tb (a REAL); > INSERT INTO tb (a) VALUES(0); > UPDATE tb SET a = a + 5.45; > UPDATE tb SET a = a + 16.9; > > SELECT a FROM tb; > > Give

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
allmoney. > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin > Sent: Friday, March 08, 2013 1:37 PM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Bug on real

Re: [sqlite] Bug on real operations

2013-03-08 Thread Marc L. Allen
ution for MS SQL was conversion to smallmoney. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: Friday, March 08, 2013 1:37 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Bug on real operat

Re: [sqlite] Bug on real operations

2013-03-08 Thread Simon Slavin
On 8 Mar 2013, at 6:24pm, Israel Lins Albuquerque wrote: > I don't know how postgres handle this, may be I can check Postgres has special datatypes used especially to handle problems like this. It has both artbitrary precision and monetary datatypes. If you present your problem to postgres

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
I know that very well. I don't know how postgresql handle this, may be I can check, I just charring by problem to brainstorm if sqlite may do or not what postgresql do. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-b

Re: [sqlite] Bug on real operations

2013-03-08 Thread Simon Slavin
On 7 Mar 2013, at 6:03pm, Israel Lins Albuquerque wrote: > But in sqlite for some reason they are: > 3.5527136788005e-15, 0, -3.5527136788005e-15 > > I thing this can be a bug on calculation of doubles. Please read these:

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
intf("%e\n",d); >> } >> On both MS Visual C and gcc on a Linux system: >> 0.00 >> 3.55271e-015 >> 3.552714e-015 >> >> -Original Message- >> From: sqlite-users-boun...@sqlite.org >> [mailto:sqlite-users-boun...@sqlite.org

Re: [sqlite] Bug on real operations

2013-03-08 Thread Michael Black
98 (gdb) cont Continuing. 22.35 22.35 2.235000e+001 2.235000e+001 -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins Albuquerque Sent: Friday, March 08, 2013 12:07 PM To: General Discussion of SQLite Database Subject: R

Re: [sqlite] Bug on real operations

2013-03-08 Thread Richard Hipp
On Fri, Mar 8, 2013 at 1:06 PM, Israel Lins Albuquerque < israelin...@yahoo.com.br> wrote: > The problem is not comparisons the problem is when I do something like > this: > CREATE TABLE tb (a REAL); > INSERT INTO tb (a) VALUES(0); > UPDATE tb SET a = a + 5.45; > UPDATE tb SET a = a + 16.9; > The

Re: [sqlite] Bug on real operations

2013-03-08 Thread Michael Black
+ 16.9),14), round((5.45 + 16.9) - 22.35,14); 0.0|1|0.0 -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins Albuquerque Sent: Thursday, March 07, 2013 12:04 PM To: sqlite-users@sqlite.org Subject: [sqlite] Bug on

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
"%e\n",d); > } > On both MS Visual C and gcc on a Linux system: > 0.00 > 3.55271e-015 > 3.552714e-015 > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins > Albuquerque > Sen

Re: [sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
printf("%e\n",d); > } > On both MS Visual C and gcc on a Linux system: > 0.00 > 3.55271e-015 > 3.552714e-015 > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins > Albuquer

Re: [sqlite] Bug on real operations

2013-03-08 Thread Michael Black
ers-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Israel Lins Albuquerque Sent: Thursday, March 07, 2013 12:04 PM To: sqlite-users@sqlite.org Subject: [sqlite] Bug on real operations An example speaks more than words: Execute this: SELECT 22.35 - (5.45 + 16.9), 22.35 = (5

Re: [sqlite] Bug on real operations

2013-03-08 Thread Michael Black
ite.org] On Behalf Of Israel Lins Albuquerque Sent: Thursday, March 07, 2013 12:04 PM To: sqlite-users@sqlite.org Subject: [sqlite] Bug on real operations An example speaks more than words: Execute this: SELECT 22.35 - (5.45 + 16.9), 22.35 = (5.45 + 16.9), (5.45 + 16.9) - 22.35; The expected result on

[sqlite] Bug on real operations

2013-03-08 Thread Israel Lins Albuquerque
An example speaks more than words: Execute this: SELECT 22.35 - (5.45 + 16.9), 22.35 = (5.45 + 16.9), (5.45 + 16.9) - 22.35; The expected result on almost databases is: 0.0, true or 1, 0.0 But in sqlite for some reason they are: 3.5527136788005e-15, 0, -3.5527136788005e-15 I thing this can be a

Re: [sqlite] BUG? sqlite not reporting error like "more than one row returned by a subquery used as an expression"

2013-02-20 Thread Petite Abeille
On Feb 20, 2013, at 9:35 PM, "Jay A. Kreibich" wrote: > Not covert... works as documented: "Let us be charitable, and call it a misleading feature" -- Larry Wall > Not random either... at least, not any more random than any other > query. Result order is never meaningful unless there is an

Re: [sqlite] BUG? sqlite not reporting error like "more than one row returned by a subquery used as an expression"

2013-02-20 Thread Petite Abeille
On Feb 20, 2013, at 9:29 PM, Richard Hipp wrote: > On Wed, Feb 20, 2013 at 3:25 PM, Petite Abeille > wrote: > >> >> On Feb 20, 2013, at 2:15 PM, Richard Hipp wrote: >> >>> SQLite automatically adds a LIMIT 1 to a scalar subquery. >> >> Yeah… that's a bit of a death trap though… would be mu

Re: [sqlite] BUG? sqlite not reporting error like "more than one row returned by a subquery used as an expression"

2013-02-20 Thread Jay A. Kreibich
On Wed, Feb 20, 2013 at 09:25:54PM +0100, Petite Abeille scratched on the wall: > On Feb 20, 2013, at 2:15 PM, Richard Hipp wrote: > > > SQLite automatically adds a LIMIT 1 to a scalar subquery. > > Yeah? that's a bit of a death trap though? would be much more productive > if SQLite would raise

Re: [sqlite] BUG? sqlite not reporting error like "more than one row returned by a subquery used as an expression"

2013-02-20 Thread Richard Hipp
On Wed, Feb 20, 2013 at 3:25 PM, Petite Abeille wrote: > > On Feb 20, 2013, at 2:15 PM, Richard Hipp wrote: > > > SQLite automatically adds a LIMIT 1 to a scalar subquery. > > Yeah… that's a bit of a death trap though… would be much more productive > if SQLite would raise an exception instead of

Re: [sqlite] BUG? sqlite not reporting error like "more than one row returned by a subquery used as an expression"

2013-02-20 Thread Petite Abeille
On Feb 20, 2013, at 2:15 PM, Richard Hipp wrote: > SQLite automatically adds a LIMIT 1 to a scalar subquery. Yeah… that's a bit of a death trap though… would be much more productive if SQLite would raise an exception instead of doing something covert and random... ___

Re: [sqlite] BUG? sqlite not reporting error like "more than one row returned by a subquery used as an expression"

2013-02-20 Thread Simon Slavin
On 20 Feb 2013, at 12:17pm, Marcin Kałuża wrote: > sqlite> select * from t where v = (select v from t); > 1 There is no definition for what this means under SQL. Any SQL implementation might consider it an error, or always evaluate (item = list) as false, or do anything else. I don't think

Re: [sqlite] BUG? sqlite not reporting error like "more than one row returned by a subquery used as an expression"

2013-02-20 Thread Richard Hipp
On Wed, Feb 20, 2013 at 7:17 AM, Marcin Kałuża wrote: > We've encountered strange sqlite behavior: > > SQLite version 3.7.15.2 2013-01-09 11:53:05 > Enter ".help" for instructions > Enter SQL statements terminated with a ";" > sqlite> create table t(v int4); > sqlite> insert into t values (1),(2),

[sqlite] BUG? sqlite not reporting error like "more than one row returned by a subquery used as an expression"

2013-02-20 Thread Marcin Kałuża
We've encountered strange sqlite behavior: SQLite version 3.7.15.2 2013-01-09 11:53:05 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> create table t(v int4); sqlite> insert into t values (1),(2),(3); sqlite> select * from t where v = (select v from t); 1 sqlite>

Re: [sqlite] Bug in table_info

2013-02-14 Thread Richard Hipp
On Thu, Feb 14, 2013 at 3:52 AM, Filip Arlet wrote: > When you open sqlite db with two processes then add column to table from > one. Both processes returns different number of columns if you call PRAGMA > table_info('table_name'); new column is not added to connection where > column wasn't creat

[sqlite] Bug in table_info

2013-02-14 Thread Filip Arlet
As I reported on sqlite page (and the ticket was deleted - this is my first bug report for sqlite, so I don't have experience with this), there is a problem with PRAGMA table_info('table_name'); (even on latest version - 3.7.15.2). When you open sqlite db with two processes then add column to table

Re: [sqlite] sqlite bug? Subquery containing like-expression in where clause with starting '%' returns no rows, but without '%' does

2013-02-03 Thread Keith Medcalf
, not as I say". Sent from Samsung Mobile Original message From: Petite Abeille Date: To: General Discussion of SQLite Database Subject: Re: [sqlite] sqlite bug? Subquery containing like-expression in where clause with starting '%' returns no rows,

Re: [sqlite] sqlite bug? Subquery containing like-expression in where clause with starting '%' returns no rows, but without '%' does

2013-02-03 Thread Petite Abeille
On Feb 3, 2013, at 10:38 PM, Thomas Mittelstaedt wrote: >> Firstly, are you sure you shouldn't be saying IN rather that = ? > > Yep. Correct. Thanks, Keith. No bug! Yeah… perhaps not a "bug" per se, but definitively one of these SQLite "deathtrap"… scalar queries are meant to return one, and

Re: [sqlite] sqlite bug? Subquery containing like-expression in where clause with starting '%' returns no rows, but without '%' does

2013-02-03 Thread Thomas Mittelstaedt
Am Sonntag, den 03.02.2013, 14:00 -0700 schrieb Keith Medcalf: > > SELECT moz_places.id, moz_places.url, moz_places.title, moz_bookmarks.parent > > FROM moz_places, moz_bookmarks > > WHERE moz_places.id = moz_bookmarks.fk > >and moz_bookmarks.parent = (select id > >

Re: [sqlite] sqlite bug? Subquery containing like-expression in where clause with starting '%' returns no rows, but without '%' does

2013-02-03 Thread Keith Medcalf
> SELECT moz_places.id, moz_places.url, moz_places.title, moz_bookmarks.parent > FROM moz_places, moz_bookmarks > WHERE moz_places.id = moz_bookmarks.fk >and moz_bookmarks.parent = (select id > from moz_bookmarks > where titl

[sqlite] sqlite bug? Subquery containing like-expression in where clause with starting '%' returns no rows, but without '%' does

2013-02-03 Thread Thomas Mittelstaedt
Could this be a bug? SELECT moz_places.id, moz_places.url, moz_places.title, moz_bookmarks.parent FROM moz_places , moz_bookmarks WHERE moz_places.id = moz_bookmarks.fkand moz_bookmarks.parent = (select id from moz_bookmarks where title like '%arbeit%') returns n

Re: [sqlite] bug report: out of memory error for most operations on a large database

2013-01-29 Thread ammon_lymphater
Of Richard Hipp Sent: Monday, January 28, 2013 6:18 AM To: ammon_lympha...@hotmail.com; General Discussion of SQLite Database Cc: Michael Black Subject: Re: [sqlite] bug report: out of memory error for most operations on a large database On Sun, Jan 27, 2013 at 2:57 PM, ammon_lymphater

Re: [sqlite] bug report: out of memory error for most operations on a large database

2013-01-28 Thread Richard Hipp
On Sun, Jan 27, 2013 at 2:57 PM, ammon_lymphater < ammon_lympha...@hotmail.com> wrote: > > I think I localized the bug - potential query memory use with larger cache > sizes > > Details > - created a database and started in a loop 10 times { import 1m > records; run query} > - for

Re: [sqlite] bug report: out of memory error for most operations on a large database

2013-01-28 Thread ammon_lymphater
- From: ammon_lymphater [mailto:ammon_lympha...@hotmail.com] Sent: Friday, January 25, 2013 1:40 PM To: 'Michael Black'; 'General Discussion of SQLite Database' Subject: RE: [sqlite] bug report: out of memory error for most operations on a large database To answer your que

Re: [sqlite] bug report: out of memory error for most operations on a large database

2013-01-26 Thread Teg
CL> This looks as if all temporary data is stored in memory (of which you CL> don't have too much in a 32-bit process.) Yeah, this. Typically you only have 2 gigs of address space to work with, in 32 bit windows. I've run out of RAM by having "temp_store=memory" before. I also have 30-60 GB DB fi

Re: [sqlite] bug report: out of memory error for most operations on a large database

2013-01-26 Thread Clemens Ladisch
ammon_lymphater wrote: > - during import the memory growth up to 800 mb (the cache size) > - during select count(*) it goes up to 1.5gb > - when starting select ... group by the memory it goes up to 1.6 gb > for successful imports, up to 2gb for out of memory condition This looks as if all tempo

Re: [sqlite] bug report: out of memory error for most operations on a large database

2013-01-26 Thread ammon_lymphater
25, 2013 5:41 AM To: ammon_lympha...@hotmail.com; 'General Discussion of SQLite Database' Subject: RE: [sqlite] bug report: out of memory error for most operations on a large database How much free disk space do you have? Your temp tables might be exceeding capacity. -Origin

Re: [sqlite] bug report: out of memory error for most operations on a large database

2013-01-25 Thread Michael Black
: [sqlite] bug report: out of memory error for most operations on a large database Summary: except for select count(*) , all operations on a large table (500m rows/80gb) result in out-of-memory error Details: a. Using SQLite3 ver 3.7.15.2, Windows 7 64 bit AMD(but the error also in 3.6

[sqlite] bug report: out of memory error for most operations on a large database

2013-01-25 Thread ammon_lymphater
Summary: except for select count(*) , all operations on a large table (500m rows/80gb) result in out-of-memory error Details: a. Using SQLite3 ver 3.7.15.2, Windows 7 64 bit AMD(but the error also in 3.6.xx and on other Windows platforms) b. Created a table (schema attached), imp

[sqlite] [bug] neither NOT NULL, nor CHECK(pk IS NOT NULL) works for INTEGER PRIMARY KEY

2012-12-30 Thread Yuriy Kaminskiy
sqlite> CREATE TABLE t(id INTEGER PRIMARY KEY NOT NULL); sqlite> INSERT INTO t VALUES (NULL); -- No error generated sqlite> CREATE TABLE tt(id INTEGER PRIMARY KEY CHECK (id IS NOT NULL)); sqlite> INSERT INTO tt VALUES (NULL); -- No error generated either sqlite> CREATE TRIGGER trg1 BEFORE INSERT ON

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-28 Thread Warren Young
On 12/27/2012 21:17, Joe Mistachkin wrote: I just looked at the patch briefly and I'm wondering if we could use the existing GetTempPath[A/W] as another fallback directory? The way I see it is, we are migrating from a hybrid Windows/Cygwin mode toward a purer POSIX style. Eventually, I want

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-27 Thread Joe Mistachkin
Warren Young wrote: > > Here's the patch, for those with strong stomachs: > >http://etr-usa.com/cygwin/sqlite3/src.patch > > If you can come up with a cleaner patch, by all means, lay it on me. > Disclaimer: I'm not an expert on Cygwin. I just looked at the patch briefly and I'm wondering

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-27 Thread Warren Young
On 12/27/2012 18:08, Daniel Colascione wrote: Yes, we have to accept the minuses we can't easily fix, but this one, we can can. Porting the Unix-mode temporary file logic to the Windows build seems workable enough. "Who is this 'we,' kemosabe?" You think it's easy, try it. You'll find that yo

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-27 Thread Daniel Colascione
On 12/27/12 5:04 PM, Warren Young wrote: > On 12/27/2012 17:43, Daniel Colascione wrote: >> Yep: there was recently a long thread on the Cygwin mailing list >> about which mode to use for the official sqlite3 package: > > Yeah, I know, I was there. > > (Hello from the Cygwin SQLite package mainta

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-27 Thread Warren Young
On 12/27/2012 17:43, Daniel Colascione wrote: Yep: there was recently a long thread on the Cygwin mailing list about which mode to use for the official sqlite3 package: Yeah, I know, I was there. (Hello from the Cygwin SQLite package maintainer.) I hope you'll be able to fix this bug. In t

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-27 Thread Daniel Colascione
On 12/27/12 4:39 PM, Warren Young wrote: > On 12/26/2012 22:19, Daniel Colascione wrote: >> The reason this operation fails is that SQLite cannot create a >> temporary file in "C:\Windows", > > ...unless you run as Admin, which is why you don't hear this > complaint come up more often. It's a sha

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-27 Thread Warren Young
On 12/26/2012 22:19, Daniel Colascione wrote: The reason this operation fails is that SQLite cannot create a temporary file in "C:\Windows", ...unless you run as Admin, which is why you don't hear this complaint come up more often. Thanks for diagnosing this in any case. It's clarified some

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-26 Thread Pavel Ivanov
On Wed, Dec 26, 2012 at 9:55 PM, Daniel Colascione wrote: > On 12/26/12 9:54 PM, Pavel Ivanov wrote: >> I believe you can get this functionality now by compiling SQLite code >> using cygwin compiler, not a Win32 one (and not downloading dll >> library from sqlite.org website). > > The latest sourc

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-26 Thread Daniel Colascione
On 12/26/12 9:54 PM, Pavel Ivanov wrote: > I believe you can get this functionality now by compiling SQLite code > using cygwin compiler, not a Win32 one (and not downloading dll > library from sqlite.org website). The latest sources I checked still have the bug. signature.asc Description: Ope

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-26 Thread Pavel Ivanov
I believe you can get this functionality now by compiling SQLite code using cygwin compiler, not a Win32 one (and not downloading dll library from sqlite.org website). Pavel On Wed, Dec 26, 2012 at 9:19 PM, Daniel Colascione wrote: > Creating temporary tables fails in Cygwin SQLite: > > sqlite>

[sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-26 Thread Daniel Colascione
Creating temporary tables fails in Cygwin SQLite: sqlite> CREATE TEMPORARY TABLE foo (bar INT); Error: unable to open database file The reason this operation fails is that SQLite cannot create a temporary file in "C:\Windows", which GetTempPathW reports as the system temporary directory. GetTempP

Re: [sqlite] BUG:"insert or replace" doesn't works for External Content FTS4 Tables

2012-12-07 Thread Dan Kennedy
On 12/07/2012 11:17 PM, Alexey Pechnikov wrote: What does the following: SELECT * FROM view_address_exists WHERE rowid=64402; sqlite>SELECT "sys_title:hash" FROM view_address_exists WHERE rowid=64402; "sys_title:hash" e9b4d0bcb5 But what does "SELECT * FROM ..." return? According to

Re: [sqlite] BUG:"insert or replace" doesn't works for External Content FTS4 Tables

2012-12-07 Thread Alexey Pechnikov
> What does the following: > > SELECT * FROM view_address_exists WHERE rowid=64402; > sqlite> SELECT "sys_title:hash" FROM view_address_exists WHERE rowid=64402; "sys_title:hash" e9b4d0bcb5 About documented "When a row is deleted from an external content FTS4 table, FTS4 needs to retrieve the

Re: [sqlite] BUG:"insert or replace" doesn't works for External Content FTS4 Tables

2012-12-07 Thread Dan Kennedy
On 12/07/2012 06:17 PM, Alexey Pechnikov wrote: "insert or replace" doesn't trigger updating of the FTS index but only 'rebuild' do it: sqlite> .s address_fts0 CREATE VIRTUAL TABLE "address_fts0" USING fts4(content="view_address_exists", "sys_title:hash"); sqlite> select rowid,"sys_title:hash

[sqlite] BUG:"insert or replace" doesn't works for External Content FTS4 Tables

2012-12-07 Thread Alexey Pechnikov
"insert or replace" doesn't trigger updating of the FTS index but only 'rebuild' do it: sqlite> .s address_fts0 CREATE VIRTUAL TABLE "address_fts0" USING fts4(content="view_address_exists", "sys_title:hash"); sqlite> select rowid,"sys_title:hash" from address_fts0 where "sys_title:hash" match 'e7

Re: [sqlite] Bug: Segmentation fault in libsqlite3.so.0.8.6[b69a4000+ac000]

2012-12-04 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 04/12/12 14:43, Paul Menzel wrote: > The following code caused the segmentation fault. By far the most likely cause is some other library or the app itself stomping on SQLite's memory. SQLite is on every Android device, every iOS device, virtually

Re: [sqlite] Bug: Segmentation fault in libsqlite3.so.0.8.6[b69a4000+ac000]

2012-12-04 Thread Larry Brasfield
To provide the most useful evidence of a SQLite bug, you need to create some SQL that will crash the SQLite shell, or which will crash a C program that is so simple that its correctness is apparent from some reasonably small effort. In all likelihood, you will be unable to create such a reprod

Re: [sqlite] Bug: Segmentation fault in libsqlite3.so.0.8.6[b69a4000+ac000]

2012-12-04 Thread Paul Menzel
Am Sonntag, den 02.12.2012, 22:49 +0100 schrieb Paul Menzel: > using Debian Sid/unstable with self-built Evolution 3.4.4 and > libsqlite3-0 3.7.14.1-1, Evolution crashed with a segmentation fault. > > pool[15522]: segfault at 5 ip b69bafe3 sp 8acf0850 error 6 in > libsqlite3.so.0.8.6[b69

Re: [sqlite] Bug: Segmentation fault in libsqlite3.so.0.8.6[b69a4000+ac000]

2012-12-04 Thread Richard Hipp
On Tue, Dec 4, 2012 at 9:35 AM, Paul Menzel < paulepan...@users.sourceforge.net> wrote: > > Could this please be added to the bug tracker? Unfortunately this > backtrace is all I have got. > Just because SQLite appears in a stack trace does not mean that SQLite is at fault here. In fact, far mor

Re: [sqlite] Bug: Segmentation fault in libsqlite3.so.0.8.6[b69a4000+ac000]

2012-12-04 Thread Paul Menzel
Dear SQLite folks, Am Sonntag, den 02.12.2012, 22:49 +0100 schrieb Paul Menzel: > using Debian Sid/unstable with self-built Evolution 3.4.4 and > libsqlite3-0 3.7.14.1-1, Evolution crashed with a segmentation fault. > > pool[15522]: segfault at 5 ip b69bafe3 sp 8acf0850 error 6 in > li

[sqlite] Bug: Segmentation fault in libsqlite3.so.0.8.6[b69a4000+ac000]

2012-12-02 Thread Paul Menzel
Dear SQLite folks, using Debian Sid/unstable with self-built Evolution 3.4.4 and libsqlite3-0 3.7.14.1-1, Evolution crashed with a segmentation fault. pool[15522]: segfault at 5 ip b69bafe3 sp 8acf0850 error 6 in libsqlite3.so.0.8.6[b69a4000+ac000] The backtrace from the core dump file

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-12 Thread stahlhut
Quoting Igor Tandetnik : stahl...@dbs.uni-hannover.de wrote: SQLite's behavior makes sense, because *every* column type may be left out. However, I think that in the case of FK-definitions (like the one in 'tab2') assigning the default type is not the right thing to do. Why should one clause

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-11 Thread Igor Tandetnik
stahl...@dbs.uni-hannover.de wrote: > Quoting Igor Tandetnik : >> stahl...@dbs.uni-hannover.de wrote: >>> Consider these two tables: >>> >>> CREATE TABLE tab1 (x INTEGER PRIMARY KEY); >>> CREATE TABLE tab2 (x PRIMARY KEY REFERENCES tab1); >>> >>> Assuming they contain the same rows, I exp

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-11 Thread stahlhut
Quoting Simon Slavin : On 10 Nov 2012, at 7:21pm, stahl...@dbs.uni-hannover.de wrote: Consider these two tables: CREATE TABLE tab1 (x INTEGER PRIMARY KEY); CREATE TABLE tab2 (x PRIMARY KEY REFERENCES tab1); Assuming they contain the same rows, I expect any query against 'tab1' to retu

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-11 Thread stahlhut
Quoting Igor Tandetnik : stahl...@dbs.uni-hannover.de wrote: Consider these two tables: CREATE TABLE tab1 (x INTEGER PRIMARY KEY); CREATE TABLE tab2 (x PRIMARY KEY REFERENCES tab1); Assuming they contain the same rows, I expect any query against 'tab1' to return the same rows as agains

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-10 Thread Keith Medcalf
On Saturday, 10 November, 2012 13:09 Igor Tandetnik wrote: > > However with SQLite there are queries which yield incoherent results: > Define "incoherent". As far as I can tell, you use this term to mean "results > you personally dislike". The results SQLite produces are in agreement - in > oth

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-10 Thread Simon Slavin
On 10 Nov 2012, at 7:21pm, stahl...@dbs.uni-hannover.de wrote: > Consider these two tables: > > CREATE TABLE tab1 (x INTEGER PRIMARY KEY); > CREATE TABLE tab2 (x PRIMARY KEY REFERENCES tab1); > > Assuming they contain the same rows, I expect any query against 'tab1' to > return the same

<    6   7   8   9   10   11   12   13   14   15   >