Re: [sqlite] Proposition: introduce a new SQLITE_READ_TABLE Authorizer Action Code

2017-05-09 Thread Gwendal Roué
> Le 9 mai 2017 à 08:23, Gwendal Roué a écrit : > > As a reminder, I intend to use the authorisation system in order to tell if a > statement has an opportunity to impact on another statement, as a support for > a general database observation feature. > > Here is the general process: > > 1.

[sqlite] The cli truncates values containing null chars

2017-05-09 Thread Father Chrysostomos
While the SQLite database itself supports embedded nulls without any problems, the command-line utility truncates values at the first null character, which can be very confusing if a field begins with a null character. (I spent an hour debugging my code, trying to figure out why it was not writi

[sqlite] Report misprint in Documentation

2017-05-09 Thread Juan Francisco Benítez López
I want to report that in your documentation for the last version of SQLite exists a misprint. On the following website: http://sqlite.org/datatype3.html , in the 4 appendage, the first line: "SQLite version 3 has the usual set of SQL comparison operators including "=", "==", "<", "<=", ">", ">=", "

Re: [sqlite] The cli truncates values containing null chars

2017-05-09 Thread Hick Gunter
This is well documented. The result of expressions involving strings with embedded NUL characters is undefined. The conversion BLOB -> TEXT will check for and stop at the first embedded NUL; in none occurs, a terminating NUL is added. You may store any sequence of bytes in a BLOB, but please do

Re: [sqlite] Report misprint in Documentation

2017-05-09 Thread Klaas Van B.
Indeed, in the page you refer to is missing the operator "<>" documented here: http://sqlite.org/rowvalue.html#syntax Juan Francisco Benítez López wrote on Tue, 9 May 2017 12:35:38 +0200: >... >"SQLite version 3 has the usual set of SQL comparison operators including >"=", "==", "<", "<=", ">",

Re: [sqlite] Proposition: introduce a new SQLITE_READ_TABLE Authorizer Action Code

2017-05-09 Thread Simon Slavin
On 9 May 2017, at 7:23am, Gwendal Roué wrote: > As a reminder, I intend to use the authorisation system in order to tell if a > statement has an opportunity to impact on another statement, as a support for > a general database observation feature. I’ve read your proposed mechanism. Providing

Re: [sqlite] Proposition: introduce a new SQLITE_READ_TABLE Authorizer Action Code

2017-05-09 Thread Gwendal Roué
> Le 9 mai 2017 à 15:02, Simon Slavin a écrit : > > On 9 May 2017, at 7:23am, Gwendal Roué > wrote: > >> As a reminder, I intend to use the authorisation system in order to tell if >> a statement has an opportunity to impact on another statement, as a support >

Re: [sqlite] Proposition: introduce a new SQLITE_READ_TABLE Authorizer Action Code

2017-05-09 Thread Dominique Devienne
On Tue, May 9, 2017 at 3:02 PM, Simon Slavin wrote: > On 9 May 2017, at 7:23am, Gwendal Roué wrote: > > As a reminder, I intend to use the authorisation system in order to tell > if a statement has an opportunity to impact on another statement, as a > support for a general database observation f

Re: [sqlite] The cli truncates values containing null chars

2017-05-09 Thread Jens Alfke
> On May 9, 2017, at 4:21 AM, Hick Gunter wrote: > > You may store any sequence of bytes in a BLOB, but please do not expect a > data storage layer library to handle opaque objects. This sounds like a typo? I definitely _do_ expect a data storage library to handle opaque/binary objects. > If

Re: [sqlite] The cli truncates values containing null chars

2017-05-09 Thread petern
Some output modes of shell.c already automatically hex print BLOB's: static void output_hex_blob(FILE *out, const void *pBlob, int nBlob){ int i; char *zBlob = (char *)pBlob; raw_printf(out,"X'"); for(i=0; i That function is called within the output loop switch statement: case MODE_

[sqlite] WITH inside trigger in 3.16.2

2017-05-09 Thread Roman Fleysher
Dear SQLiters, I am trying to create a trigger with body: WITH ... DELETE FROM ... and it does not seem to work (Error: near "DELETE": syntax error). But I can execute the body itself without errors. Does it mean that WITH clause is not supported within trigger? I use SQLite version 3.16.22.

[sqlite] SQLite DB on external USB HD - is it safe?

2017-05-09 Thread Wolfgang Enzinger
Dear group members, since it's wise to store SQLite databases on local HDs (as opposed to network filesystems) in order to avoid corruption, I would like to have my program check if this requirement is fulfilled. I'm on Windows so I use GetDriveType() for testing the DB path. Now I noticed that th

Re: [sqlite] WITH inside trigger in 3.16.2

2017-05-09 Thread Roman Fleysher
My apology, I can not read. http://sqlite.org/lang_createtrigger.html clearly states that CTE is not supported in triggers. Roman From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of Roman Fleysher [roman.fleys...@einstein.yu.ed

Re: [sqlite] SQLite DB on external USB HD - is it safe?

2017-05-09 Thread Keith Medcalf
On Tuesday, 9 May, 2017 15:02, Wolfgang Enzinger enquired, > since it's wise to store SQLite databases on local HDs (as opposed to > network filesystems) in order to avoid corruption, As long as you understand what a "network filesysem" is. A "network filesystem" is a filesystem that is remo

Re: [sqlite] The cli truncates values containing null chars

2017-05-09 Thread Richard Hipp
On 5/9/17, Jens Alfke wrote: > > It has always annoyed me that the CLI just dumps blobs directly to stdout. Have you tried setting ".mode quote"? Perhaps add that to your ~/sqlite.rc file? -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing l

Re: [sqlite] Fwd: SELECT Max(IndexedField) doesn't use partial index

2017-05-09 Thread jose isaias cabrera
Scott Robison wrote... On Mon, May 8, 2017 at 11:40 AM, Paul van Helden wrote: Hi, I use a lot of indexes on fields that typically contain lots of NULLs, so the WHERE NOT NULL partial indexing seems very useful. However when I compare the "EXPLAIN QUERY PLAN" with a partial index vs. a norm

Re: [sqlite] Fwd: SELECT Max(IndexedField) doesn't use partial index

2017-05-09 Thread Scott Robison
On May 9, 2017 9:07 PM, "jose isaias cabrera" wrote: Scott Robison wrote... On Mon, May 8, 2017 at 11:40 AM, Paul van Helden wrote: > Hi, >> >> I use a lot of indexes on fields that typically contain lots of NULLs, so >> the WHERE NOT NULL partial indexing seems very useful. >> >> However whe

[sqlite] foreign key constraint failure

2017-05-09 Thread Mark Wagner
Is there a way to get sqlite to tell which foreign key constraint is causing a failure? Some kind of verbose mode? Thanks! sqlite> delete from t; Error: FOREIGN KEY constraint failed sqlite> ___ sqlite-users mailing list sqlite-users@mailinglists.sqli

Re: [sqlite] foreign key constraint failure

2017-05-09 Thread Clemens Ladisch
Mark Wagner wrote: > Is there a way to get sqlite to tell which foreign key constraint is > causing a failure? No; to make the implementation of deferred constraints easier, it keeps track only of the number of remaining foreign key failures, not of their origin. Regards, Clemens ___

Re: [sqlite] foreign key constraint failure

2017-05-09 Thread nomad
On Wed May 10, 2017 at 08:34:42AM +0200, Clemens Ladisch wrote: > Mark Wagner wrote: > > Is there a way to get sqlite to tell which foreign key constraint is > > causing a failure? > > No; to make the implementation of deferred constraints easier, it keeps > track only of the number of remaining f

Re: [sqlite] foreign key constraint failure

2017-05-09 Thread Gwendal Roué
There is a way, but it requires some effort: First let's define a schema that reproduces your error: CREATE TABLE t1 ( id INTEGER PRIMARY KEY); CREATE TABLE t2 ( id INTEGER PRIMARY KEY, id1 INTEGER REFERENCES t1(id) ON DELETE RESTRICT); INSERT INTO t1 (id) VALUES (12