Re: [sqlite] Confused with type mismatch in Tcl interface

2019-02-27 Thread Jean-Baptiste Gardette
Sorry for my late reply. Yes, your proposal would definitively solve our problem. (our Tcl dictionnaries are allways filled with values sharing the same type) PS : on wich OS did you run the test script ? (the different outputs between the two computers gives unconfortable feeling)

Re: [sqlite] sqlite3AtoF giving incorrect results

2019-02-27 Thread Jim Borden
Basically a variant of the final idea you had is what we went with. Thanks for the suggestions! Jim Borden Privacy Policy Marketing Preferences ___

Re: [sqlite] sqlite3AtoF giving incorrect results

2019-02-27 Thread Richard Hipp
On 2/27/19, Jim Borden wrote: > For reference here > was the query that I was working with: > > SELECT fl_result(prediction('EchoModel', dict_of('max_double', > 1.7976931348623153e+308))) FROM kv_default AS _doc WHERE (_doc.flags & 1 = > 0); > As a work-around, you could code up a UDF

Re: [sqlite] sqlite3AtoF giving incorrect results

2019-02-27 Thread Jim Borden
The platforms exhibiting the behavior have so far been MSVC Windows 10 64-bit (both 32 and 64 bit processes), and Android x86. iOS 64-bit was not affected and iOS 32-bit was not testable due to outside factors but my guess is that it is not affected. macOS 64-bit was not affected. I tried to

Re: [sqlite] sqlite3AtoF giving incorrect results

2019-02-27 Thread Richard Hipp
On 2/27/19, Jim Borden wrote: > > My theory as to why this varies by platform is because of the use of long > double during this calculation, which can vary in size. On the failing > platforms they are the same size as regular double. This results in a > rounding error of the "scale" portion of

Re: [sqlite] sqlite3AtoF giving incorrect results

2019-02-27 Thread Richard Hipp
On 2/27/19, Jim Borden wrote: > Hello, > > I’ve been tracking down an odd problem where some of our results from an > application defined SQLite function are coming back as infinity on some > platforms (notably 32-bit Android, and all Windows). I’ve narrowed it down > to the following: > > Given

Re: [sqlite] sqlite3_mprintf not handling positional referencing / conversion

2019-02-27 Thread Richard Hipp
On 2/27/19, lnksz wrote: > 2) If not, a mention in the docs under disadvantages would be a nice > information Docs have now been updated. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

[sqlite] sqlite3AtoF giving incorrect results

2019-02-27 Thread Jim Borden
Hello, I’ve been tracking down an odd problem where some of our results from an application defined SQLite function are coming back as infinity on some platforms (notably 32-bit Android, and all Windows). I’ve narrowed it down to the following: Given the example input

Re: [sqlite] LIKE Query with ESCAPE character

2019-02-27 Thread Richard Hipp
On 2/27/19, julian robichaux wrote: > Am I doing something wrong here, or perhaps misunderstanding the > documentation? My expectation is that both LIKE queries will use the > index, but the EXPLAIN QUERY PLAN results tell me something different. There was an issue with the LIKE optimization

[sqlite] LIKE Query with ESCAPE character

2019-02-27 Thread julian robichaux
Hi, I hope this is a simple question that someone can answer without a lot of trouble (maybe I am simply misunderstanding something). According to https://www.sqlite.org/optoverview.html#the_like_optimization , a LIKE query can use an ESCAPE character and still be optimized as long as the

[sqlite] sqlite3_mprintf not handling positional referencing / conversion

2019-02-27 Thread lnksz
Dear all, I noticed that with the latest (3.27.2) version of sqlite3 if I try to use sqlite3_mprintf("SELECT * FROM [%1$s];", "table_name"); The "standard" printf family functions support this feature. (See http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html

Re: [sqlite] Confused with type mismatch in Tcl interface

2019-02-27 Thread Richard Hipp
On 2/27/19, Peter da Silva wrote: > One nasty thing you might be able to do in the interim is to shimmer the > object to the type you want by doing something like [set x [expr {double > $x}]] to make it double. The new optional -returntype TYPE option is now available on the SQLite trunk. The

Re: [sqlite] Confused with type mismatch in Tcl interface

2019-02-27 Thread Peter da Silva
One nasty thing you might be able to do in the interim is to shimmer the object to the type you want by doing something like [set x [expr {double $x}]] to make it double. On Wed, Feb 27, 2019 at 9:31 AM Richard Hipp wrote: > On 2/27/19, Jean-Baptiste Gardette wrote: > > have you any

Re: [sqlite] Documentation is lying to me

2019-02-27 Thread Joshua Thomas Wise
I’ve updated SQLite3 to version 3.27.2, and the previous error has gone away. However, the docs are still lying, because information_schema.tables cannot be implemented (evidence below). It seems that we need a pragma_table_list() function, which takes a schema as a parameter (similar to

Re: [sqlite] Getting data from two JOIN tables

2019-02-27 Thread Keith Medcalf
Using JOIN ON is exactly the same as merely listing the tables and pushing the ON into the where clause. In fact, except for OUTER JOIN operations, the ON clause is always processed by "pushing" the conditions specified in the ON clause to the WHERE clause (or you may just think of it as

Re: [sqlite] Documentation is lying to me

2019-02-27 Thread Joshua Wise
Ahh that’s very interesting. I suspect this is the relevant entry in the release notes: SQLite Release 3.26.0 On 2018-12-01 Enhanced triggers so that they can use table-valued functions that exist in schemas other than the schema where the trigger is defined. Although, we’re talking about

Re: [sqlite] Documentation is lying to me

2019-02-27 Thread David Raymond
For me it gives an error up through 3.25.3 and starts working at 3.26.0 -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Joshua Wise Sent: Wednesday, February 27, 2019 2:13 PM To: SQLite mailing list Subject: Re: [sqlite]

Re: [sqlite] Exitcode and savepoint problems during archiving

2019-02-27 Thread danielnagy
Hi, I have noticed that most of my suggested patch has been applied. However, the part of if( 0 == nIn ) { sqlite3_result_zeroblob(ctx, 0); fclose(in); return; } got left out somehow. As a result sqlite now throws an out-of-memory error when dealing with empty files:

Re: [sqlite] Documentation is lying to me

2019-02-27 Thread Joshua Wise
I can confirm that it also doesn’t work with SQLite version 3.24.0 on a completely different machine. > On Feb 27, 2019, at 9:23 AM, Joshua Thomas Wise > wrote: > > Joshuas-MBP:sqldark josh$ sqlite3 > SQLite version 3.25.0 2018-09-15 04:01:47 > Enter ".help" for usage hints. > Connected to a

Re: [sqlite] Database backup with writers present?

2019-02-27 Thread Simon Slavin
On 27 Feb 2019, at 4:16pm, Richard Hipp wrote: > On 2/27/19, Stephen Chrzanowski wrote: >> Does write blocking still come into play when using "vaccum into", > > The VACUUM INTO command is a reader. So (in WAL mode) some other > process can continue writing while the VACUUM INTO is running.

Re: [sqlite] Database backup with writers present?

2019-02-27 Thread Richard Hipp
On 2/27/19, Stephen Chrzanowski wrote: > Does write blocking still come into play when using "vaccum into", The VACUUM INTO command is a reader. So (in WAL mode) some other process can continue writing while the VACUUM INTO is running. -- D. Richard Hipp d...@sqlite.org

Re: [sqlite] Database backup with writers present?

2019-02-27 Thread Stephen Chrzanowski
Does write blocking still come into play when using "vaccum into", or are writes put into the WAL file? I know that with the regular backup API, any writes to the DB restarts the backup process, but I hadn't thought about putting either into a transaction. (I'm an I-D-TEN-T, I know) On Wed, Feb

Re: [sqlite] Confused with type mismatch in Tcl interface

2019-02-27 Thread Richard Hipp
On 2/27/19, Jean-Baptiste Gardette wrote: > have you any explanation why the typof() output of > "SELECT DerefDict_SQL('A'), typeof(DerefDict_SQL('A'))" > gives "text" in Sequence A and "real" in Sequence B ? > No. The code that determines the return type of a TCL UDF is here:

Re: [sqlite] Getting data from two JOIN tables

2019-02-27 Thread Jose Isaias Cabrera
SQL, the language of the free... choices: JOIN or commas (,)... ;-) From: sqlite-users on behalf of Dominique Devienne Sent: Wednesday, February 27, 2019 09:47 AM To: SQLite mailing list Subject: Re: [sqlite] Getting data from two JOIN tables On Wed, Feb 27, 2019 at 3:42 PM Jose Isaias

Re: [sqlite] Database backup with writers present?

2019-02-27 Thread Richard Hipp
On 2/27/19, Daniel Polski wrote: > > Is there some way to take a snapshot of a database regardless if there > comes new writes / transactions while doing the backup, and just write a > copy of that snapshot as it was into a new database file? I assume you are using WAL mode? If not, you should

Re: [sqlite] Vtab scalar function overloading in aggregate queries

2019-02-27 Thread Dan Kennedy
On 27/2/62 05:47, Jake Thaw wrote: This may not strictly be a bug, but currently (3.27.2) a vtab cannot overload scalar functions in aggregate queries. Adding a check for TK_AGG_COLUMN in sqlite3VtabOverloadFunction makes my use case function as expected. I think it has always been this way.

[sqlite] Database backup with writers present?

2019-02-27 Thread Daniel Polski
Hello, When reading the docs I don't get a clear understanding on what strategy I could/should use to backup a heavily used database (with frequent reads & writes). I have one application (A) with multiple threads reading & writing to the database. Application (A) handles write locking

Re: [sqlite] Confused with type mismatch in Tcl interface

2019-02-27 Thread Jean-Baptiste Gardette
Le 27/02/2019 à 14:55, Richard Hipp a écrit : On 2/27/19, Richard Hipp wrote: The modified script can be downloaded from https://sqlite.orge/tmp/tcl-sqlite-testcase-20190227125331.txt Typo: "sqlite.org", not "sqlite.orge".

Re: [sqlite] Getting data from two JOIN tables

2019-02-27 Thread Dominique Devienne
On Wed, Feb 27, 2019 at 3:42 PM Jose Isaias Cabrera wrote: > Thanks, David. I actually like the comma (,) than the words (JOIN, > etc). Less wordy and, to me, more logically flow-y. > Just the reverse as myself. I much prefer explicit join-on, to separate filtering from join-conditions in the

Re: [sqlite] Getting data from two JOIN tables

2019-02-27 Thread Jose Isaias Cabrera
Thanks, David. I actually like the comma (,) than the words (JOIN, etc). Less wordy and, to me, more logically flow-y. josé From: sqlite-users on behalf of David Raymond Sent: Wednesday, February 27, 2019 09:31 AM To: SQLite mailing list Subject: Re: [sqlite] Getting data from two JOIN

Re: [sqlite] Getting data from two JOIN tables

2019-02-27 Thread David Raymond
I believe a comma is basically an inner join with no ON clause. I think this covers it https://www.sqlite.org/lang_select.html#fromclause "If the join-operator is "CROSS JOIN", "INNER JOIN", "JOIN" or a comma (",") and there is no ON or USING clause, then the result of the join is simply the

Re: [sqlite] Documentation is lying to me

2019-02-27 Thread Joshua Thomas Wise
Joshuas-MBP:sqldark josh$ sqlite3 SQLite version 3.25.0 2018-09-15 04:01:47 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME" to reopen on a persistent database. sqlite> SELECT sqlite_version(); 3.25.0 sqlite> ATTACH ':memory:' AS

Re: [sqlite] Getting data from two JOIN tables

2019-02-27 Thread Jose Isaias Cabrera
Thanks, Dominique. From: sqlite-users on behalf of Dominique Devienne Sent: Wednesday, February 27, 2019 09:06 AM To: SQLite mailing list Subject: Re: [sqlite] Getting data from two JOIN tables On Wed, Feb 27, 2019 at 2:18 PM Jose Isaias Cabrera wrote: > Thanks. This is exactly what I

Re: [sqlite] Getting data from two JOIN tables

2019-02-27 Thread Dominique Devienne
On Wed, Feb 27, 2019 at 2:18 PM Jose Isaias Cabrera wrote: > Thanks. This is exactly what I needed. So, there is really no JOIN here, > or is the "from t outer_t, z outer_z" a JOIN like statement? Where can I > read more about this? And yes, your assessment of t(a, idate) and z(f, > idate)

Re: [sqlite] Site search bug - https://sqlite.org/

2019-02-27 Thread Richard Hipp
On 2/27/19, Chris Locke wrote: > The link you quote mentions SQLite 3.24 though... ? The problem Niki reported was real. I just have already fixed it. https://www.sqlite.org/docsrc/info/0a969667a740e806 -- D. Richard Hipp d...@sqlite.org ___

Re: [sqlite] Confused with type mismatch in Tcl interface

2019-02-27 Thread Richard Hipp
On 2/27/19, Richard Hipp wrote: > The modified script can be downloaded from > > https://sqlite.orge/tmp/tcl-sqlite-testcase-20190227125331.txt > Typo: "sqlite.org", not "sqlite.orge". https://sqlite.org/tmp/tcl-sqlite-testcase-20190227125331.txt -- D. Richard Hipp d...@sqlite.org

Re: [sqlite] Site search bug - https://sqlite.org/

2019-02-27 Thread Chris Locke
The link you quote mentions SQLite 3.24 though... ? Thanks, Chris On Wed, Feb 27, 2019 at 12:44 PM niki wrote: > This link demonstrates the problem: > > https://sqlite.org/search?s=c=3.24 > > Best regards, > > Niki > > ___ > sqlite-users mailing

Re: [sqlite] Getting data from two JOIN tables

2019-02-27 Thread Jose Isaias Cabrera
Thanks. This is exactly what I needed. So, there is really no JOIN here, or is the "from t outer_t, z outer_z" a JOIN like statement? Where can I read more about this? And yes, your assessment of t(a, idate) and z(f, idate) being unique are true. From: sqlite-users on behalf of Keith

Re: [sqlite] Confused with type mismatch in Tcl interface

2019-02-27 Thread Richard Hipp
On 2/26/19, Jean-Baptiste Gardette wrote: > the type of a value returned by one UDF > dereferencing a tcl dictionnary : the type is changing depending from > the context. I am unable to reproduce the behavior you observe. I did a copy/paste of your script with simple changes: (1) The "#

[sqlite] Site search bug - https://sqlite.org/

2019-02-27 Thread niki
This link demonstrates the problem: https://sqlite.org/search?s=c=3.24 Best regards, Niki ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] (Info) Shox96 Compression as SQLite UDF

2019-02-27 Thread Arun - Siara Logics (cc)
Shox96 is a compression technique for Short Strings. It can achieve upto 65% compression. This technique is available for compressing text columns in SQLite as loadable extension in the repository https://github.com/siara-cc/Shox96_Sqlite_UDF. Output screenshot:

[sqlite] Confused with type mismatch in Tcl interface

2019-02-27 Thread Jean-Baptiste Gardette
Win 7, SQLite 3.24.0, Tcl 8.6.9 We don't know if it is a problem about SQLite or Tcl, apologies if it is the wrong list. Our main concern is the type of a value returned by one UDF dereferencing a tcl dictionnary : the type is changing depending from the context. We observed that a