Re: [sqlite] Detecting multiple CHECK failures

2014-10-08 Thread gwenn
Hello, I think that SQLite reports the first constraint which fails: http://sqlite.org/changes.html 2012-05-14 (3.7.12) Report the name of specific CHECK constraints that fail. sqlite> CREATE TABLE test (data TEXT CONSTRAINT notEmpty CHECK (length(data) > 0)); sqlite> INSERT INTO test VALUES

[sqlite] Missing db name with the SQLITE_ATTACH action callback

2015-01-04 Thread gwenn
Hello, I am trying to implement a cache of one connection metadata (databases, tables, columns, indexes). It seems possible to automatically update the cache by using an authorizer. But there is one problem with the SQLITE_ATTACH action: #define SQLITE_ATTACH 24 /* Filename

[sqlite] Regression with pragma index_list version 3.8.9

2015-04-10 Thread gwenn
Hello, There are two extra columns (origin, partial) in the result returned by pragma index_list. Just for your information, it causes a regression test failure because only 3 columns are expected: --- FAIL: TestTableIndexes (0.00s) meta_test.go:163: error listing indexes: incorrect argument count

[sqlite] sqlite_column_blob & invalid index

2015-04-12 Thread gwenn
Hello, Could you please tell me if sqlite3_errcode/sqlite3_errmsg should be called after each call to sqlite3_column_blob/text/int/... to check that the column index is valid ? I am confused by: > http://sqlite.org/rescode.html#range > The SQLITE_RANGE error indices that the parameter number

[sqlite] sqlite_column_blob & invalid index

2015-04-12 Thread gwenn
Thanks for reply. Could you please elaborate ? For me, there is no way to know if the specified column index is invalid by using the column value returned by sqlite3_column_blob/text/int . Regards. On Sun, Apr 12, 2015 at 11:50 AM, Stephan Beal wrote: > On Sun, Apr 12, 2015 at 11:48 AM, gw

[sqlite] sqlite_column_blob & invalid index

2015-04-12 Thread gwenn
Ok, Thanks. On Sun, Apr 12, 2015 at 2:08 PM, Stephan Beal wrote: > On Sun, Apr 12, 2015 at 2:04 PM, gwenn wrote: > >> Thanks for reply. >> Could you please elaborate ? >> For me, there is no way to know if the specified column index is >> invalid by u

[sqlite] Redundant link in documentation

2015-08-04 Thread gwenn
Hi, In the following page: http://sqlite.org/c3ref/bind_parameter_index.html there is a link to itself: sqlite3_bind_parameter_index(). Maybe it should have been a link to: http://sqlite.org/c3ref/bind_parameter_name.html ? Regards.

[sqlite] Name the arguments in the prototypes.

2015-12-06 Thread gwenn
Hello, Would you mind adding argument names in function prototypes ? http://www.sqlite.org/cgi/src/artifact/1248a78548024bdc SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); versus SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3 *db,

[sqlite] Name the arguments in the prototypes.

2015-12-06 Thread gwenn
Maybe because I am lazy. I can read all the documentation attached to the function prototype. But I can quickly glean what a function does from its prototype. And it helps autocompletion. Thanks. On Sun, Dec 6, 2015 at 12:16 PM, Richard Hipp wrote: > On 12/6/15, gwenn wrote: >> Hello,

[sqlite] Geting the errorcode in Java

2015-12-15 Thread gwenn
Hello, Your code looks good to me. You should report an issue here: https://github.com/xerial/sqlite-jdbc Regards. On Mon, Dec 14, 2015 at 8:38 PM, Cecil Westerhof wrote: > I have the following code: > import java.sql.Connection; > import java.sql.DriverManager; > import java.sql.Statement; >

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-30 Thread gwenn
Hello, sqlite3_stmt_busy returns true after sqlite3_step returns DONE. Here is the code: #include #include #include "sqlite3.h" int main(int argc, char **argv) { sqlite3 *db = NULL; sqlite3_stmt *stmt = NULL; char *zErrMsg = NULL; const char *z; int rc = 0; rc =

[sqlite] Strange behaviour of sqlite3_stmt_busy

2015-07-31 Thread gwenn
(except on SQLITE_ROW) ? Thanks. On Fri, Jul 31, 2015 at 12:02 PM, Clemens Ladisch wrote: > Stephan Beal wrote: >> On Thu, Jul 30, 2015 at 11:35 PM, Clemens Ladisch >> wrote: >>> gwenn wrote: >>>> sqlite3_stmt_busy returns true after sqlite3_step returns

[sqlite] Different behaviour of auxiliary data between 3.7.17 and 3.8.0

2014-02-09 Thread gwenn
Hello, I am not sure but it seems there is a regression between versions 3.7.17 and 3.8.0. It's impacting custom/user declared function and auxiliary data. sqlite-amalgamation-3071700 gwen$ gcc -I/usr/local/Cellar/glib/2.38.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.38.2/lib/glib-2.0/include

Re: [sqlite] Different behaviour of auxiliary data between 3.7.17 and 3.8.0

2014-02-09 Thread gwenn
or the false alarm. I will try to find another strategy to keep the compiled regexp... Regards. On Sun, Feb 9, 2014 at 7:34 PM, Richard Hipp <d...@sqlite.org> wrote: > Can you provide an example program that omits the glib.h dependency? > > > On Sun, Feb 9, 2014 at 10:50 AM, gwenn

Re: [sqlite] Different behaviour of auxiliary data between 3.7.17 and 3.8.0

2014-02-09 Thread gwenn
t; So as far as I can tell, the current implementation is doing what it is > suppose to do. Or did I misunderstand the complaint? > > > > > > On Sun, Feb 9, 2014 at 10:50 AM, gwenn <gwenn.k...@gmail.com> wrote: > >> Hello, >> I am not sure but it seems there is a regres

[sqlite] Unqualified table name and pragma

2014-05-03 Thread gwenn
Hello, SQLite behaviour is consistent (temp database is searched first): create table test (main text); create temporary table test (temporary text); insert into test values ('unqualified'); -- in temp table select * from test; -- temp table -- unqualified pragma table_info("test"); -- temp table

[sqlite] Retrieve a int or a sqlite_int64

2014-05-13 Thread gwenn
Hello, Is there any way to differentiate one value persisted with sqlite3_bind_int from another persisted with sqlite3_bind_int64 ? How to know which method between sqlite3_value_int and sqlite3_value_int64 should be used to retrieve the value back ? Regards.

Re: [sqlite] Retrieve a int or a sqlite_int64

2014-05-13 Thread gwenn
Ok, Thanks. On Tue, May 13, 2014 at 11:59 PM, Teg wrote: > Hello Charles, > > Tuesday, May 13, 2014, 3:12:09 PM, you wrote: > > CS> Load it with sqlite3_value_int64 every time. If the number fits in a 32 > bit > CS> integer, then you can store it in one. > > This is what I do.

[sqlite] Shared-Cache Mode

2014-05-17 Thread gwenn
Hello, Is there any way to known if one connection participate to shared-cache mode ? I've read http://sqlite.org/sharedcache.html which specifies how to set but not how to get the mode! Regards. ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Small bug with .import shell command

2014-05-24 Thread gwenn
Hello, When the first value of the first line is empty, .import fails: $ echo '|test' > ko.csv $ echo '""|test' > ok.csv $ sqlite3 SQLite version 3.8.4.3 2014-04-03 16:53:12 sqlite> .import ko.csv test ko.csv: empty file sqlite> .import ok.csv test sqlite> An error happens also when the table

Re: [sqlite] Small bug with .import shell command

2014-05-26 Thread gwenn
}else if( !p->z && c==cSep ){ - csv_append_char(p, 0); } p->cTerm = c; } Regards. On Sat, May 24, 2014 at 9:46 AM, gwenn <gwenn.k...@gmail.com> wrote: > Hello, > When the first value of the first line is empty, .import fails: > $ echo '|test' > ko.csv > $ echo '"&

Re: [sqlite] importing CSV with a random empty line at the end

2014-06-02 Thread gwenn
Hello, I doesn't fail for me (it may depend on the constraints on the target table) but the behaviour is unexpected: $ echo "1|test > " > empty.csv $ sqlite3 SQLite version 3.8.4.3 2014-04-03 16:53:12 sqlite> create table test(opt text, data text not null); sqlite> .import empty.csv test

[sqlite] Statement cache does not play well with sqlite3_stmt_readonly

2014-06-03 Thread gwenn
Hello, The function "sqlite3_stmt_readonly" returns true/1 for the statement "DROP TABLE IF EXISTS test" when the table "test" does not exist. But, if this drop statement is cached, "sqlite3_stmt_readonly" still returns true even after creating the table "test". The only way I've found to make

Re: [sqlite] Statement cache does not play well with sqlite3_stmt_readonly

2014-06-03 Thread gwenn
Ok, Thanks. On Tue, Jun 3, 2014 at 8:42 PM, Richard Hipp <d...@sqlite.org> wrote: > On Tue, Jun 3, 2014 at 2:27 PM, gwenn <gwenn.k...@gmail.com> wrote: > >> Hello, >> The function "sqlite3_stmt_readonly" returns true/1 for the statement >> "DR

[sqlite] FTS module and DB close

2014-06-07 Thread gwenn
Hello, How do you prevent double free/finalize of statements created by the FTS module ? I am using sqlite3_next_stmt to finalize all dangling statements before closing the connection but the program crashes because the FTS module finalizes them too when sqlite3_close is called... May be I should

Re: [sqlite] FTS module and DB close

2014-06-08 Thread gwenn
, gwenn <gwenn.k...@gmail.com> wrote: > Hello, > How do you prevent double free/finalize of statements created by the > FTS module ? > I am using sqlite3_next_stmt to finalize all dangling statements > before closing the connection but the program crashes because the FTS > m

Re: [sqlite] importing CSV with a random empty line at the end

2014-06-15 Thread gwenn
lling the rest with NULL\n", sCsv.zFile, startLine, nCol, i+1); i++; - while( i wrote: > gwenn, thanks for this. I did not understand what you saw, and then I > realized my shell exe was probably too old. > I downloaded the new exe and this solv

Re: [sqlite] JDBC and savepoints

2014-06-30 Thread gwenn
Hello, Are you sure? http://docs.oracle.com/javase/7/docs/api/java/sql/Connection.html#setSavepoint() Regards. On Sun, Jun 29, 2014 at 12:15 PM, hala wrote: > JDBC does not support savepoints from SQLite > > is there any replacement for savepoints? > > if not what to

[sqlite] 64-bit length BLOB

2015-11-09 Thread gwenn
Hello, Could you please confirm that BLOBs created by sqlite3_bind_blob64()/sqlite3_bind_zeroblob64() can still be read with sqlite3_blob_read()/sqlite3_blob_bytes() or sqlite3_column_blob /sqlite3_column_bytes() because their size can never exceed the limit specified here:

[sqlite] Redundant link in documentation

2015-09-19 Thread gwenn
Maybe I should have sent a patch: diff src/sqlite.h.in.bak src/sqlite.h.in 3629c3629 < ** [sqlite3_bind_parameter_index()]. --- > ** [sqlite3_bind_parameter_name()]. Regards. On Tue, Aug 4, 2015 at 8:14 PM, gwenn wrote: > Hi, > In the following page: > http://s

[sqlite] How to know when a sqlite3_stmt has been recompiled ?

2015-09-19 Thread gwenn
Hello, Is there any way to know when a prepared statement is recompiled ? For example: rc = sqlite3_prepare_v2(db, "SELECT * FROM test", -1, , NULL); ... cc = sqlite3_column_count(stmt); ... rc = sqlite3_exec(db, "ALTER TABLE test ADD COLUMN data DEFAULT 'missing'", NULL, NULL, NULL); ... rc =

[sqlite] How to know when a sqlite3_stmt has been recompiled ?

2015-09-19 Thread gwenn
nsure that the internal cache of the schema used when compiling the SQL query matches the schema of the database against which the compiled query is actually executed." Is there a better solution ? Thanks. On Sat, Sep 19, 2015 at 3:21 PM, Kees Nuyt wrote: > On Sat, 19 Sep 2015 11:29:37 +0200, g

[sqlite] How to know when a sqlite3_stmt has been recompiled ?

2015-09-20 Thread gwenn
, 2015 at 10:14 PM, R.Smith wrote: > > > On 2015-09-19 06:41 PM, gwenn wrote: >> >> SQLITE_SCHEMA is returned only on failure. >> But, here, there is not failure. >> >> Maybe I should not store the column count ? >> Maybe I should look at sch

[sqlite] How to know when a sqlite3_stmt has been recompiled ?

2015-09-21 Thread gwenn
>> > On Sun, Sep 20, 2015 at 4:10 PM, Igor Tandetnik >> wrote: >> > >> >> On 9/20/2015 9:55 AM, gwenn wrote: >> >> >> >>> If there is no way to know that the statement has been recompiled, I >> >>> guess that the col

[sqlite] Pre-compiled x64 dll

2016-01-25 Thread gwenn
Hello, What is the difference between the dll included in: http://sqlite.org/2015/sqlite-dll-win64-x64-3090200.zip And the one included in: http://sqlite.org/2016/sqlite-uap-3100200.vsix Redist/Retail/x64/sqlite3.dll ? The first one works with libffi, the second doesn't. Is there a

[sqlite] Delete an existing module

2016-05-03 Thread gwenn
Hello, Is it possible to delete a module and the associated client data ? I tried to pass a NULL pointer as the third parameter of sqlite3_create_module_v2, sqlite3_create_module_v2( db, zName, NULL, NULL, NULL ); but I got a SQLITE_MISUSE error. Thanks.

[sqlite] Illegal hexadecimal number literal

2016-05-15 Thread gwenn
Hello, SQLite version 3.8.10.2 2015-05-20 18:17:19 sqlite> select 0x1g; 1 sqlite> select 1g; Error: unrecognized token: "1g" The illegal number 0x1g is not rejected. Maybe, in tokenice.c, This block should not return directly but check that z[i] is not an IdChar if( z[0]=='0' &&

[sqlite] [csv extension] Error while reading long lines

2010-04-19 Thread gwenn
Hello, There is a little bug/typo in the csv extension when lines exceed 100 characters: *** glibc detected *** sqlite3: realloc(): invalid pointer: 0x00ad1a78 *** === Backtrace: = /lib/libc.so.6[0x7f6dab009d16] /lib/libc.so.6(realloc+0x321)[0x7f6dab00fda1]

[sqlite] [csv extension] Error while reading long lines

2010-04-21 Thread gwenn
GMT 2010, Shane Harrelson wrote: > Thanks for the report. The extension is still very a much a > work-in-progress and any feedback is greatly appreciated. > > -Shane > > > On Sun, Apr 18, 2010 at 12:51 PM, gwenn wrote: > > Hello, > > There is a little bug/typo in th

Re: [sqlite] [csv extension] Error while reading long lines

2010-04-24 Thread gwenn
http://www2.sqlite.org/src/dir?name=ext/csv On Sat, Apr 24, 2010 at 9:43 AM, Jan <janus...@gmx.net> wrote: > This sounds very useful. But where can I get this extension? > > Sorry, I could not find anything. > > Jan > > Am 21.04.2010 20:22, schrieb gwenn: > >

Re: [sqlite] [csv extension] Error while reading long lines

2010-05-08 Thread gwenn
DER_ROW) " +} {} ADDEDext/csv/test4.csv col 1,col.2,col-3,col!4,c...@5,col;6,col%7,col*8,col=9,col'10 123456789,123456789,123456789,123456789,123456789,123456789,123456789,123456789,123456789,123456789 I tried to handle double-quoted fields with embedded line breaks without success but I am not stuck yet. Regards. On Wed, Apr 21, 2010 at 8:22 PM, gwenn <gwenn.k...@gmail.com&g

Re: [sqlite] [csv extension] Error while reading long lines

2010-05-08 Thread gwenn
pCSV ); return SQLITE_ERROR; } - zSql = sqlite3_mprintf("%s%s%s", zTmp, zCol, zTail); + zSql = sqlite3_mprintf("%s\"%s\"%s", zTmp, zCol, zTail); }else{ zSql = sqlite3_mprintf("%scol%d%s", zTmp, i+1, zTail); } sqlite3_f

Re: [sqlite] [csv extension] Error while reading long lines

2010-05-13 Thread gwenn
csvRelease( pCSV ); return SQLITE_ERROR; } - zSql = sqlite3_mprintf("%s%s%s", zTmp, zCol, zTail); + zSql = sqlite3_mprintf("%s\"%s\"%s", zTmp, zCol, zTail); }else{

Re: [sqlite] [csv extension] Error while reading long lines

2010-05-18 Thread gwenn
,123456789,123456789,123456789,123456789,123456789,123456789,123456789 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 "123456789 "," ","","123456789 ","1234\\567'89 ","123456""789 ","123"

[sqlite] VTab & xRename

2012-10-23 Thread gwenn
Hello, The documentation says the xRename function is mandatory: http://sqlite.org/vtab.html#xrename "The xRename method is required for every virtual table implementation." But it seems possible to not specify it: static const sqlite3_module fts3aux_module = { ... 0,

Re: [sqlite] VTab & xRename

2012-10-24 Thread gwenn
M, Jay A. Kreibich <j...@kreibi.ch> wrote: > On Tue, Oct 23, 2012 at 10:16:07PM +0200, gwenn scratched on the wall: >> Hello, >> >> The documentation says the xRename function is mandatory: >> http://sqlite.org/vtab.html#xrename >> "The xRename method is req

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

2012-11-08 Thread gwenn
If you want, you can verify automatically that all the FK columns have a type matching the referenced columns by using (and tweaking) an old tool whose name is 'genfkey' (see http://www.sqlite.org/faq.html#q22 but the 'readme' link is broken). Regards. On Thu, Nov 8, 2012 at 6:29 PM, Simon

Re: [sqlite] How to verify referential integrity of SQLite database

2012-12-13 Thread gwenn
Hello, You can give the following tool a try if you want: https://github.com/gwenn/checkfkey But I'm not sure that it correctly handles composite. Regards. On Thu, Dec 13, 2012 at 4:22 PM, Jean-Christophe Deschamps <j...@antichoc.net> wrote: > >> Jay A. Kreibich wrote: >&g

[sqlite] Timezone is supported by date/time functions but is not documented

2013-05-01 Thread gwenn
Hello, SQLite datetime function correctly parses timestring with timezone: sqlite> select datetime('2013-04-30T18:38:54Z'); 2013-04-30 18:38:54 sqlite> select datetime('2013-04-30T20:38:54+02:00'); 2013-04-30 18:38:54 But this is not documented: http://sqlite.org/lang_datefunc.html

Re: [sqlite] sqlite3: .import command handles quotation incorrectly

2013-06-30 Thread gwenn
Hello, I've tested the improved ".import" command and it seems that there is a bug with empty not-quoted field: $ cat empty.csv A|B | $ ./a.out SQLite version 3.8.0 2013-06-28 23:55:45 sqlite> .import empty.csv test empty.csv:2: expected 2 columns but found 1 - filling the rest with NULL sqlite>

Re: [sqlite] Any tool to create erd from sqlite database?

2013-09-20 Thread gwenn
Hello, There is a minimalist one here: https://github.com/gwenn/sqliterd It depends on c/go compilers and the graphviz dot command... Regards. On Fri, Sep 20, 2013 at 2:26 PM, Jason H <scorp...@yahoo.com> wrote: > Don't forget about ODBC tools... Just use ta SQLite OD

[sqlite] sqlite3_set_auxdata & invalid pointer

2012-01-14 Thread gwenn
Hello, I am trying to add custom aggregation function support in a golang driver (scalar functions are ok). While testing, I got this: *** glibc detected *** ./6.out: realloc(): invalid pointer: 0x02daa1c5 *** === Backtrace: =

Re: [sqlite] sqlite3_set_auxdata & invalid pointer

2012-01-17 Thread gwenn
aggregate_context". Sorry for the disturbance. On Sat, Jan 14, 2012 at 10:36 PM, gwenn <gwenn.k...@gmail.com> wrote: > > Hello, > I am trying to add custom aggregation function support in a golang driver > (scalar functions are ok). > While testing, I got this: > ***

[sqlite] Tiny correction

2012-02-12 Thread gwenn
Hello, It seems that the icuFunctionError can be simplified: char zBuf[128]; sqlite3_snprintf(128, zBuf, "ICU error: %s(): %s", zName, u_errorName(e)); zBuf[127] = '\0'; // <- useless In the documentation: "As long as the buffer size is greater than zero, sqlite3_snprintf() guarantees that

[sqlite] Typo in source code comment

2012-03-01 Thread gwenn
/*** EXPERIMENTAL *** ** ** Register a function to be invoked when a transaction comments. ** If the invoked function returns non-zero, then the commit becomes a ** rollback. */ SQLITE_API void *sqlite3_commit_hook( :s/comments/commits/ ___ sqlite-users

[sqlite] SQLite & JDBC & generated key

2012-04-04 Thread gwenn
* In JDBC API, there is a method to retreive the generated key during an insert: http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#getGeneratedKeys() * With SQLite API, there is: sqlite3_last_insert_rowid. Let suppose that: - the primary key is correctly declared to make it an

Re: [sqlite] SQLite & JDBC & generated key

2012-04-05 Thread gwenn
Thanks for your replies. I will add a tweak to ignore column access by name when running "SELECT last_insert_rowid();" On Thu, Apr 5, 2012 at 2:17 AM, Kees Nuyt <k.n...@zonnet.nl> wrote: > On Wed, 4 Apr 2012 21:08:24 +0200, gwenn <gwenn.k...@gmail.com> wr

[sqlite] Jdbc & Blob & Incremental I/O

2012-08-26 Thread gwenn
ting...) Thanks. (the driver is here: https://github.com/gwenn/sqlite-jna/tree/master/src/main/java/org/sqlite/driver) ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] The upcoming "pi" release of SQLite

2016-07-24 Thread gwenn
Hello, It seems that the problem reported here: http://www.mail-archive.com/sqlite-users%40mailinglists.sqlite.org/msg97627.html is not fixed. SQLite version 3.14.0 2016-07-23 05:22:02 sqlite> select 0x1g; 1 sqlite> Regards. On Sat, Jul 23, 2016 at 5:16 PM, Richard Hipp wrote:

[sqlite] Different error messages for the same syntax error

2016-07-04 Thread gwenn
Hello, SQLite version 3.13.0 2016-05-18 10:57:30 sqlite> create table test (name text default ''); sqlite> insert into test values (); Error: near ")": syntax error sqlite> insert into test values (''), (); Error: no tables specified Maybe the parser rule is too permissive: values(A) ::=

[sqlite] SQL parsing logic for triggers

2016-10-09 Thread gwenn
Hello, I am just looking for information (I am not asking for any change): It is for (auto) completion hints. 1) it seems not possible to insert default values in trigger command: // INSERT trigger_cmd(A) ::= insert_cmd(R) INTO trnm(X) idlist_opt(F) select(S). versus //

Re: [sqlite] SQL parsing logic for triggers

2016-10-09 Thread gwenn
On Sun, Oct 9, 2016 at 12:14 PM, Richard Hipp <d...@sqlite.org> wrote: > On 10/9/16, gwenn <gwenn.k...@gmail.com> wrote: >> Hello, >> I am just looking for information (I am not asking for any change): >> It is for (auto) completion hints. >> >> 1) i

Re: [sqlite] SQL parsing logic for triggers

2016-10-09 Thread gwenn
Sorry, I've just found the answer to the first question here: http://www.sqlite.org/lang_insert.html Regards. On Sun, Oct 9, 2016 at 10:34 AM, gwenn <gwenn.k...@gmail.com> wrote: > Hello, > I am just looking for information (I am not asking for any change): > It is for (auto) c

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread gwenn
Sorry, I mean that there are impacts on SQLite wrappers: https://github.com/xerial/sqlite-jdbc/commit/42557128d56da563126003180fd8b8e8978ec818#diff-5a06ee6e8dbd2f4087ab8d361df52832 https://github.com/gwenn/gosqlite/commit/ac9891a74d94fb57679407bd36b80a5be218c6d6 https://github.com/gwenn/sqlite-jna

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread gwenn
Hello, You should try executing a PRAGMA with no result such as: PRAGMA table_info('no_such_table'); Before 3.16, sqlite3_step returns SQLITE_DONE and sqlite3_column_count returns 0 After 3.16, sqlite3_step returns SQLITE_DONE and sqlite3_column_count does not return 0 but 6 Regards. On Fri,

[sqlite] Extract all SQL commands from the test suite

2017-07-14 Thread gwenn
Hello, I would like to extract all SQL commands from sqlite-src/test/*.test. For example, extract: PRAGMA cache_size=10; CREATE TABLE t1(x); INSERT INTO t1 VALUES(randomblob(2)); BEGIN; DELETE FROM t1; INSERT INTO t1 VALUES(randomblob(15000)); ... from 8_3_names.test.

[sqlite] List of subdomains/tools/drivers

2017-07-14 Thread gwenn
Hello, Is there a web page listing all the SQLite related fossil repositories ? https://www.sqlite.org/sqlar/ http://sqlite.org/sqllogictest/ https://www.sqlite.org/android/ http://system.data.sqlite.org/ http://lua.sqlite.org/ ... Thanks. ___

[sqlite] PRAGMA table_info and not nullable rowid alias

2017-07-16 Thread gwenn
Hello, PRAGMA table_info reports that a rowid alias is nullable: sqlite> .headers on sqlite> CREATE TABLE test (id INTEGER PRIMARY KEY); sqlite> pragma table_info("test"); cid|name|type|notnull|dflt_value|pk 0|id|INTEGER|0||1 sqilte> --0|id|INTEGER|1||1 expected sqlite> INSERT INTO test (id)

[sqlite] invalid column constraint ignored

2017-06-12 Thread gwenn
Hello, I suppose it is a trade-off to make the parser light and fast. But invalid column constraints are ignored. sqlite> create table tbl (data text constraint x); postgres=# create table tbl (data text constraint x); ERROR: syntax error at or near ")" at character 41 sqlite> create table tbl

Re: [sqlite] parser.y and SQLITE_OMIT_ATTACH

2017-06-11 Thread gwenn
Sorry, I didn't know that VACUUM uses ATTACH. On Sun, Jun 11, 2017 at 1:03 PM, Richard Hipp <d...@sqlite.org> wrote: > Have you tried this? I don't think it will work. IIRC, VACUUM uses > ATTACH internally. > > On 6/11/17, gwenn <gwenn.k...@gmail.com> wrote:

[sqlite] parser.y and SQLITE_OMIT_ATTACH

2017-06-11 Thread gwenn
Hello, %ifndef SQLITE_OMIT_VACUUM %ifndef SQLITE_OMIT_ATTACH cmd ::= VACUUM.{sqlite3Vacuum(pParse,0);} cmd ::= VACUUM nm(X). {sqlite3Vacuum(pParse,);} %endif SQLITE_OMIT_ATTACH %endif SQLITE_OMIT_VACUUM should be %ifndef SQLITE_OMIT_VACUUM cmd ::= VACUUM.

[sqlite] carray module and

2018-06-10 Thread gwenn
Hi, I guess there is a typo in the carray documentation: diff --git a/ext/misc/carray.c b/ext/misc/carray.c index b39904ae1..32fec3406 100644 --- a/ext/misc/carray.c +++ b/ext/misc/carray.c @@ -24,7 +24,7 @@ ** **static int aX[] = { 53, 9, 17, 2231, 4, 99 }; **int i =

[sqlite] Import zipped csv file

2018-04-06 Thread gwenn
Hello, Is it possible to mix zipfile and csv extensions ? sqlite> SELECT data FROM zipfile('csv_file.zip'); works. sqlite> .shell unzip csv_file.zip sqlite> CREATE VIRTUAL TABLE test USING csv(filename='csv_file.csv'); works. How to pass the data extracted by zipfile to csv extension ? Thanks.

[sqlite] Typo

2018-12-25 Thread gwenn
Hi, There is a typo here: https://sqlite.org/session/sqlite3changeset_op.html > If pbIncorrect is not NULL, then *pbIndirect is set to true Should be pbIndirect instead of pbIncorrect. Regards. ___ sqlite-users mailing list

[sqlite] Typo in Session extension documentation

2019-01-13 Thread gwenn
Hi, https://sqlite.org/session/sqlite3changegroup_add_strm.html int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ should be int eConflict, /* DATA, NOTFOUND, CONFLICT, CONSTRAINT, FOREIGN_KEY */ based on https://sqlite.org/session/c_changeset_conflict.html Regards.

Re: [sqlite] json path escaping with double quote

2019-06-15 Thread gwenn
Thu, Jun 13, 2019 at 6:45 PM gwenn wrote: > > Hello, > With the json1 extension, we can escape special characters like '[' > from being interpreted as an array index by wrapping the path in > double quotes. But sometimes, it does not work: > > sqlite> CREATE TABLE test (d

[sqlite] json path escaping with double quote

2019-06-13 Thread gwenn
Hello, With the json1 extension, we can escape special characters like '[' from being interpreted as an array index by wrapping the path in double quotes. But sometimes, it does not work: sqlite> CREATE TABLE test (data TEXT); sqlite> INSERT INTO test (data) VALUES ('{}'); sqlite> UPDATE test SET

Re: [sqlite] json path escaping with double quote

2019-06-16 Thread gwenn
$ make quicktest is ok with the patch. I will try to provide some additional test cases. On Sat, Jun 15, 2019 at 10:37 AM gwenn wrote: > > Ok, > I tried to patch this line: > > diff --git a/ext/misc/json1.c b/ext/misc/json1.c > index d99d360b2..0bb4e1cee 100644 > --- a/ext