Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Keith Medcalf
Hehehe. I didn't even notice the floating point equality test Richard, so here we go: Try this one as 1e-13 is 1 ulp at a scale of 1000.0 ... which should be more than accurate enough in this case ... WITH GbC AS ( SELECT c.Country, c.CustomerId,

Re: [sqlite] Error when reading from pre-populated SQLite database in Ionic project

2018-09-05 Thread Chris Brody
Check the results of cordova plugin ls A common pitfall is that you have to use cordova-sqlite-ext plugin to get pre-populated database functionality. Commonly used cordova-sqlite-storage plugin does not support this feature. Second pitfall is if you have multiple Cordova sqlite plugins

Re: [sqlite] Error when reading from pre-populated SQLite database in Ionic project

2018-09-05 Thread Chris Locke
When SQLite creates an empty .db file, which directory is it in? With all your tweaking, etc, is the new database always in the same directory? Thanks, Chris On Wed, Sep 5, 2018 at 3:23 PM Robert Helmick wrote: > I'm receiving an error when I try to read from a pre-populated SQLite >

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Richard Hipp
On 9/3/18, Edson Poderoso wrote: > WHERE outerr.spent = (SELECT spent ...) The "spent" column holds a floating-point number. Depending on the order of operations, the values might be off by an epsilon, resulting in different floating point values and a failed comparison. This is why you should

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread David Raymond
Ok, now I'm seeing the 25 you're talking about. So we're saying that if you do with A as (something 1), B as (something 2) select foo from A, B you get something different than create temp table A as (something 1); create temp table B as (something 2); select foo from A, B That does

[sqlite] Error when reading from pre-populated SQLite database in Ionic project

2018-09-05 Thread Robert Helmick
I'm receiving an error when I try to read from a pre-populated SQLite database: `sqlite3_prepare_v2 failure: no such table 'plant'` From what I understand SQLite looks for the mydb.db file in the /www folder by default, then creates an empty database when it doesn't find the pre-populated mydb.db

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread David Raymond
From the downloads page linked in the original email I'm using Chinook_Sqlite.sqlite File size: 1,067,008 Customer table: 59 records Invoice table: 412 records Confirmed I got the same results when loading a new empty database with their Chinook_Sqlite.sql script. Query below copied and pasted

Re: [sqlite] Known Defects/Anomalies for SQLite version 3.7.13

2018-09-05 Thread Donald Griggs
Greetings, Srinath, Regarding: * We are using SQLite version 3.7.13 in our project. We need the list of known Defects/Anomalies in SQLite version 3.7.13 for validation. Could you please share the list of known Defects/Anomalies for SQLite version 3.7.13.* As to SQLite version 3.7.13

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Richard Hipp
On 9/3/18, Edson Poderoso wrote: > Using the chinook database available at: > https://github.com/lerocha/chinook-database > > The following query should return 26 rows, instead I returns 15. How do you know that the correct answer is 26 rows instead of 15? I tried to download the SQLite and

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Keith Medcalf
Seems to return 26 rows for the current tip, what version are you experiencing the issue with? SQLite version 3.25.0 2018-09-03 17:11:11 Enter ".help" for usage hints. sqlite> .version SQLite 3.25.0 2018-09-03 17:11:11 f1138a38bd23f201a35621a71e82c5718abddb42ab82938e9516ab9d43e4alt2 zlib

Re: [sqlite] Is there permanent link to the latest SQLite amalgamation source?

2018-09-05 Thread Stephen Chrzanowski
I don't do the compiling, but I run this daily: #!/bin/bash cd /mnt/drobo/Development/SQLite3 wget --no-check-certificate -q -O - https://sqlite.org/download.html | grep "win32\|amalgamation" | grep ";" | cut -f4 -d\' > sqlite.list wget --no-check-certificate --no-clobber -i sqlite.list -o

Re: [sqlite] CAST AS STRING always returns 0 for STRING columns

2018-09-05 Thread Keith Medcalf
"STRING" is not a known affinity and equates to NUMERIC affinity/storage class. That means that your code is the equivalent of: create table a(col1 NUMERIC); insert into a values ('asdf'); select cast(col1 as NUMERIC) from a; Which will, of course, return the value 0. This is because: 1)

Re: [sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Simon Slavin
On 3 Sep 2018, at 2:32pm, Edson Poderoso wrote: > The following query should return 26 rows, instead I returns 15. Which version of SQLite ? Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] CAST AS STRING always returns 0 for STRING columns

2018-09-05 Thread Jay Kreibich
> On Sep 4, 2018, at 9:30 AM, Ben Caine wrote: > > CAST AS STRING always returns 0 for columns that are already of STRING type. “STRING” is not a known type affinity. Use “TEXT” https://www.sqlite.org/lang_expr.html#castexpr > > Steps to

Re: [sqlite] sqlite3_column_* with error handling

2018-09-05 Thread Simon Slavin
On 5 Sep 2018, at 11:22am, Richard Hipp wrote: > Just call sqlite3_errcode(). It will return SQLITE_OK if the > sqlite3_column function was successful. In respect of the above, I observe the second sentence of If the most recent API call was

[sqlite] Known Defects/Anomalies for SQLite version 3.7.13

2018-09-05 Thread Srinath Sundaravadivel
Hi We are using SQLite version 3.7.13 in our project. We need the list of known Defects/Anomalies in SQLite version 3.7.13 for validation. Could you please share the list of known Defects/Anomalies for SQLite version 3.7.13. Thanks, Srinath S ::DISCLAIMER::

[sqlite] CAST AS STRING always returns 0 for STRING columns

2018-09-05 Thread Ben Caine
CAST AS STRING always returns 0 for columns that are already of STRING type. Steps to reproduce: sqlite> CREATE TABLE A(col1 STRING); sqlite> INSERT INTO A VALUES('asdf'); sqlite> SELECT CAST(col1 AS STRING) FROM A; 0 We are generating SQL code programmatically, and it would be useful to not

[sqlite] Incorrect result when using WHERE with with correlated sub-select query

2018-09-05 Thread Edson Poderoso
Using the chinook database available at: https://github.com/lerocha/chinook-database The following query should return 26 rows, instead I returns 15. WITH GbC AS ( SELECT c.Country, c.CustomerId, SUM(i.total) spent FROM Customer c JOIN Invoice i ON i.CustomerId = c.CustomerId GROUP BY 1, 2),

Re: [sqlite] Is there permanent link to the latest SQLite amalgamation source?

2018-09-05 Thread John Found
On Wed, 5 Sep 2018 10:42:04 +0200 "E.Pasma" wrote: > John Found wrote: > > In order to write an autoupdater, I need to download the latest SQLite > > amalgamation. > > Is there a permanent link to the subject, or the only way is to parse the > > download page > > for links to

Re: [sqlite] sqlite3_column_* with error handling

2018-09-05 Thread Richard Hipp
On 9/4/18, Brian Vincent wrote: > Hi, I'm currently writing a Go sqlite package, go-sqlite-lite. I think it > provides a good "pure" SQLite experience with Go. > > If I want to make sure that the sqlite3_column_* functions never provide a > false answer due to an error condition, like a memolry

Re: [sqlite] Is there permanent link to the latest SQLite amalgamation source?

2018-09-05 Thread E.Pasma
John Found wrote: > In order to write an autoupdater, I need to download the latest SQLite > amalgamation. > Is there a permanent link to the subject, or the only way is to parse the > download page > for links to "sqlite-amalgamation-*.zip" or to build it from the fossil > checkout? The apsw

Re: [sqlite] sqlite3_column_* with error handling

2018-09-05 Thread Clemens Ladisch
Keith Medcalf wrote: > In the case of a BLOB if a NULL pointer is returned the error code must > be retrieved and then if and only if the bytes counter is greater than > 0 is the error valid. > > Does this mean that if you are retrieving the value of a blob via the > colmn_blob interface you