[sqlite] No diagnostic given for missing column (since 3.7.10 up to 3.8.8.3)

2015-03-03 Thread Andy Gibbs
Hi, The following is a reduced test-case of a problem I have observed: CREATE TABLE a(tid,pid); CREATE TABLE b(tid,pname); CREATE TEMP TABLE pidmap(newpid INTEGER,oldpid INTEGER); CREATE TEMP TABLE pnamemap(pid INTEGER,pname TEXT COLLATE BINARY); (Please note that the tables are usually

[sqlite] No diagnostic given for missing column (since 3.7.10 up to 3.8.8.3)

2015-03-03 Thread Andy Gibbs
On Tuesday, March 03, 2015 10:50 AM, Dan Kennedy wrote: > On 03/03/2015 03:57 PM, Andy Gibbs wrote: >> Hi, >> >> The following is a reduced test-case of a problem I have observed: >> >> CREATE TABLE a(tid,pid); >> CREATE TABLE b(tid,pname); >> CREATE TE

[sqlite] Virtual tables and foreign keys

2014-05-08 Thread Andy Gibbs
Hi, I need (and have attempted to add) limited support for foreign key constraints mapping to virtual tables. It seems this is not possible currently in sqlite, or at least, it gives me "foreign key mismatch" when I try. My use-case is this: create virtual table vtbl using vtblXYZ; create

[sqlite] Question about wal_checkpoint

2011-04-07 Thread Andy Gibbs
Hi, I've been running the latest version of (unreleased) sqlite 3.7.6 from http://www.sqlite.org/draft/download.html and in particular looking at the new improved "pragma wal_checkpoint". However, it doesn't seem to be doing what I hoped it would do. I was expecting that following a pragma

[sqlite] trigger efficiency question

2011-06-15 Thread Andy Gibbs
Hi, A quick question: which is better (in terms of speed of execution): CREATE TRIGGER x BEFORE INSERT ON y WHEN expr BEGIN SELECT RAISE(ABORT, 'message'); END; ... or ... CREATE TRIGGER x BEFORE INSERT ON y BEGIN SELECT RAISE(ABORT, 'message') WHERE expr; END; Or are the two, for

Re: [sqlite] Does sqlite always allow creating own field named 'rowid'?

2010-05-26 Thread Andy Gibbs
> While implementing a table that intended for arbitrary table storage, I > automatically named some field rowid not linking at the moment that it > will > have a name conflict with sqlite internal rowid name. Lately I discovered > this, and (not a big deal) recreated table with a different name.

Re: [sqlite] Does sqlite always allow creating own field named'rowid'?

2010-05-26 Thread Andy Gibbs
> Of course if you define a column "rowid integer primary key" then the > declared column and the internal rowid are one and the same... As an extension of this, if you are in the habit of relying on the internal rowid rather than having your own specifically declared "integer primary key"

Re: [sqlite] last_insert_rowid & INTEGER PRIMARY KEY columns

2010-06-08 Thread Andy Gibbs
>> [...] does >> >> db last_insert_rowid >> >> reliably return the_key of the most recently inserted database row, >> so that the returned value may safely (across vacuums etc) be used >> as a foreign reference to t's the_key column? > > Yes. Actually there *is* a caveat, which is that if the

Re: [sqlite] compiling in foreign key support

2010-06-10 Thread Andy Gibbs
On Wednesday, June 09, 2010 9:27 PM, Jay A. Kreibich wrote: > On Wed, Jun 09, 2010 at 03:15:32PM -0400, Sam Carleton scratched on the > wall: >> From looking at the compile page (http://www.sqlite.org/compile.html), I >> am >> not seeing any compile options to turn on foreign key support. Was

Re: [sqlite] SQLite 3.7.0 coming soon....

2010-07-01 Thread Andy Gibbs
On Wednesday, June 30, 2010 7:21 PM, D. Richard Hipp wrote: > We are in the final phases of development for SQLite version 3.7.0. > The key enhancement over version 3.6.23.1 is support for the use of > write-ahead logs for transaction control. See > http://www.sqlite.org/draft/wal.html > for

Re: [sqlite] Proposed new sqlite3_open_v3() interface

2010-07-01 Thread Andy Gibbs
On Monday, May 03, 2010 4:47 PM, D. Richard Hipp wrote: Subject: Proposed new sqlite3_open_v3() interface > Community feedback is requested for the following proposed new SQLite > C API: > >int sqlite3_open_v3(const char*, sqlite3**, int, const char*); > > The new database connection

Re: [sqlite] Proposed new sqlite3_open_v3() interface - offt

2010-07-01 Thread Andy Gibbs
Miha Vrhovnik wrote on 1/7/2010:> >Content analysis details: (10.3 points, 7.0 required)> >> > pts rule name description> > -- --> > 2.4 DNS_FROM_OPENWHOIS RBL: Envelope sender listed in

Re: [sqlite] Proposed new sqlite3_open_v3() interface - offt

2010-07-02 Thread Andy Gibbs
On Thursday, July 01, 2010 9:56 PM, Miha Vrhovnik wrote: > It's time to get rid of your current e-mail client ... > ... and start using si.Mail. > > It's small & free. ( http://www.simail.si/ ) A nice little advert and out of curiosity I went to the website and had a little look around. I

[sqlite] Bug found in memdb.test script

2010-07-16 Thread Andy Gibbs
Hi, There's a small bug in the memdb.test script, that produces the following error on v 3.6.23.1 when doing a make fulltest: memdb-3.3... Ok memdb-3.4... Ok memdb-4.0... Ok ./testfixture: couldn't set loop variable: "t1" while executing "ifcapable memorydb { # In the following sequence of

Re: [sqlite] Problem writing vector to blob

2010-07-20 Thread Andy Gibbs
On Tuesday, July 20, 2010 12:37 PM, Robert McVicar wrote: >I have some code which uses the sqlite3_blob_write() function, but I > observe some odd behaviour. > When I pass it a QVector (Qt vector class - similar to std::vector, > contiguous memory) of a class C (for example) when the vector is

[sqlite] Problems with 'make test' on 3.7.0

2010-07-22 Thread Andy Gibbs
Hi, Has anyone else had any problems building sqlite 3.7.0 out of the fossil repository? 'configure' and 'make' run fine, but 'make test' gives me: cc1: warnings being treated as errors src/test_demovfs.c: In function 'demoSync': src/test_demovfs.c:318: error: implicit declaration of function

Re: [sqlite] Problems with 'make test' on 3.7.0

2010-07-22 Thread Andy Gibbs
On Thursday, July 22, 2010 6:36 PM, Andy Gibbs wrote: > The configure command I'm using is: > > ./configure > CFLAGS="-std=c99 -Werror" --enable-threadsafe --enable-debug > --with-tcl=/usr/lib/tcl8.4 > Sorry, I should add, I'm running on Debian Linux Len

Re: [sqlite] Problems with 'make test' on 3.7.0

2010-07-22 Thread Andy Gibbs
On Thursday, July 22, 2010 8:21 PM, Richard Hipp wrote: >> > The configure command I'm using is: >> > >> > ./configure >> > CFLAGS="-std=c99 -Werror" --enable-threadsafe --enable-debug >> --with-tcl=/usr/lib/tcl8.4 >> > >> >> Sorry, I should add, I'm running on Debian Linux Lenny, with gcc 4.4.4,

Re: [sqlite] Couple of questions about WAL

2010-07-23 Thread Andy Gibbs
On Thursday, July 22, 2010 6:14 PM, Dan Kennedy wrote: > On the other hand, if the only client connected to a database > does not disconnect cleanly (i.e. it crashes, the system crashes, > or the client exits without calling sqlite3_close()), then it > leaves the *-wal file in place. In this

Re: [sqlite] Problems with 'make test' on 3.7.0

2010-07-26 Thread Andy Gibbs
On Friday, July 23, 2010 1:26 PM, Richard Hipp wrote: > You need TCL 8.5 or (even better) 8.6. TCL 8.4 is not adequate > to run the newer parts of the test suite. Again, thank you for your quick response. Please can I suggest that the configure scripts be updated to reflect this change in

[sqlite] Memory leak in sqlite 3.7.0

2010-07-26 Thread Andy Gibbs
Hi, I'm afraid I believe I have observed a memory leak when running the full test suite that is part of sqlite 3.7.0. I have a log file generated from running the test suite which I can send if it is of interest to the developers - it is 5Mb compressed so I didn't think it fair to just post

Re: [sqlite] Memory leak in sqlite 3.7.0

2010-07-27 Thread Andy Gibbs
On Monday, July 26, 2010 4:44 PM, Richard Hipp wrote: What do you get when you run: ./testfixture test/permutations.test journaltest test/memsubsys2.test ./testfixture test/permutations.test inmemory_journal test/memsubsys2.test Please find the log files attached as journaltest.log

Re: [sqlite] Memory leak in sqlite 3.7.0

2010-07-28 Thread Andy Gibbs
On Tuesday, July 27, 2010 6:43 PM, Richard Hipp wrote: >> [ ... ] >> >> However, I have also attached journaltest2.log which I think does >> demonstrate the memory leak. Having trawled through the full log file, >> it >> seems that the memory leak is coming from the FTS3 tests, so the >>

Re: [sqlite] Using variable is queries

2010-07-30 Thread Andy Gibbs
On Friday, July 30, 2010 2:40 PM, Igor Tandetnik wrote: > chris23879 wrote: >> I'm tring to create a paging function in sqlite. Is it possible to >> declare >> and use a variable in sqlite. > > No. But since SQLite is embedded in your

[sqlite] wal database reverts to 'delete' journal mode following vacuum

2010-08-02 Thread Andy Gibbs
Hi, It seems that following a vacuum on a wal-enabled database, the journal mode reverts to delete? Is this meant to happen? I couldn't find this stated as such in the documentation at www.sqlite.org/wal.html. $ sqlite3 test.db SQLite version 3.7.0 Enter ".help" for instructions Enter SQL

Re: [sqlite] VACUUM and WAL

2010-08-03 Thread Andy Gibbs
On Monday, August 02, 2010 4:25 AM, Nikolaus Rath wrote: Hi, Could someone clarify to me how the VACUUM command works if WAL is enabled? I would like to compact my database, but I am note sure if I should: 1) Run PRAGMA wal_checkpoint to get all outstanding commits into the database file

Re: [sqlite] VACUUM and WAL

2010-08-03 Thread Andy Gibbs
On Tuesday, August 03, 2010 2:09 PM, Andy Gibbs wrote: I've attached a patch to this email as a follow-up to this suggestion. Sorry, I think I forgot to attach the patch file. Hopefully its attached this time! Andy ___ sqlite-users mailing list

Re: [sqlite] VACUUM and WAL

2010-08-03 Thread Andy Gibbs
On Tuesday, August 03, 2010 2:15 PM, Simon Slavin wrote: > You can't attach files to messages to this forum. This is done > intentionally to stop the posts getting unacceptably long (people > with problems tend to attach their entire source code). Cunning! Ok, in that case, if anyone is

Re: [sqlite] "create table as" syntax

2010-09-09 Thread Andy Gibbs
On Thursday, September 09, 2010 10:56 AM, thomas veymont wrote: > hello, > > I'm trying to use the "CREATE TABLE AS" syntax to create a table and > insert > in the same time a default row. > > e.g : > > sqlite> CREATE TABLE test (x NUMERIC) AS (SELECT 25 AS x); > Error: near "AS": syntax error >

[sqlite] DELETE OR IGNORE statement?

2010-09-23 Thread Andy Gibbs
Hi, I've got a table with a primary key and then any number of additional tables with foreign keys that reference this primary key table with "ON DELETE RESTRICT" hence stopping the deletion of any row from the primary key table if there exists any rows in any of the foreign key tables that

Re: [sqlite] DELETE OR IGNORE statement?

2010-09-23 Thread Andy Gibbs
On Thursday, September 23, 2010 3:36 PM, Simon Slavin wrote: > On 23 Sep 2010, at 2:13pm, Andy Gibbs wrote: > >> I've got a table with a primary key and then any number of additional >> tables >> with foreign keys that reference this primary key table with "ON DEL

Re: [sqlite] DELETE OR IGNORE statement?

2010-09-24 Thread Andy Gibbs
On Friday, September 24, 2010 1:03 PM, Josh Gibbs wrote: > What's the chance that 2 people with the same surname would have > the same problem in the same week... > > [ ... ] I can only think its something in the name! I did actually see your thread moments after creating my own. I'd done a

[sqlite] Mistake in threadtest3.c

2010-11-02 Thread Andy Gibbs
Hi, I was looking at the diff to threadtest3.c in recent commit at http://www.sqlite.org/src/fdiff?v1=58df1e3c060f534f=d6d209190c7110f9, and I think I may have spotted an mistake in the code at the end of the function "static void dynamic_triggers(int nMs)". The code here runs as follows:

Re: [sqlite] Mistake in threadtest3.c

2010-11-02 Thread Andy Gibbs
On Tuesday, November 02, 2010 11:23 AM, Dan Kennedy wrote: > Fair question. But in this case no. The idea was to have one > thread modifying the triggers. Then several other reader threads > using the database with the reader threads using both shared and > unshared caches. > Then that's good.

Re: [sqlite] Question about SQLite features.

2010-11-10 Thread Andy Gibbs
On Tuesday, November 09, 2010 8:29 AM, Tran Van Hoc wrote: > Dear all. > > I'm using SQLite and many thanks for your supports. > > I have problem about SQLite features. > > That's I don't know SQLite have stored procedure support? > How're your C skills? If you are comfortable with the idea,

[sqlite] What is sqlite3_stmt_readonly for?

2010-12-07 Thread Andy Gibbs
Hi, I notice a new API function in sqlite 3.7.4, namely sqlite3_stmt_readonly. But what I wonder is, for what purpose it can be used? On the face of it, it seems very useful, but then as you read through the description you find a whole load of statement types that return an "undefined"

Re: [sqlite] What is sqlite3_stmt_readonly for?

2010-12-08 Thread Andy Gibbs
On Thursday, December 09, 2010 4:25 AM, Roger Binns wrote: > You are indeed correct. It was added and is called by Fossil after using > an > authorizer. I did (twice) raise these issues with the team before release > with no response. It looks like our calls did not go unheeded: it seems now

Re: [sqlite] Propose minor incompatible API change

2011-01-11 Thread Andy Gibbs
On Tuesday, January 11, 2011 1:54 AM, Richard Hipp wrote: > This is, technically, a compatibility break. But wasn't the original change also a compatibility break? But this time it may make it into the short-form software history at http://www.sqlite.org/changes.html? Having studied the

Re: [sqlite] Propose minor incompatible API change

2011-01-11 Thread Andy Gibbs
On Tuesday, January 11, 2011 1:35 PM, Jean-Denis Muys wrote: > Don't encumber SQLite with workarounds and special cases > to cater to bugs in client software. Isn't an accurate synopsis of the problem this: that Sqlite has *already* implemented a workaround in 3.7.0, and that this workaround

Re: [sqlite] Propose minor incompatible API change

2011-01-12 Thread Andy Gibbs
On Wednesday, January 12, 2011 10:08 AM, Philip Graham Willoughby wrote: > unfortunately 3.7.2 shipped in Ubuntu Maverick and > 3.6.23.1 shipped in a maintenance update for Fedora > Core 14. So lots of people already have both behaviours > in the wild. Actually, the first alteration happened

Re: [sqlite] Propose minor incompatible API change

2011-01-17 Thread Andy Gibbs
On Tuesday, January 11, 2011 1:54 AM, Richard Hipp wrote: > So the question to you, gentle reader, is should we make this change, and > break backwards compatibility, albeit in a very obscure way, or should we > be > hard-nosed and force hundreds or perhaps thousands of smartphone > application

Re: [sqlite] Patch to allow DISTINCT in multi-argument aggregatefunctions

2011-01-21 Thread Andy Gibbs
On Thursday, January 20, 2011 8:27 PM, Stephen Oberholtzer wrote: > Here's a quick diff. If people (in particular, DRH) think it's worth > it, I'll write up the test cases and submit a more formal patch. Great patch! I'd be interested in a more formal patch with test cases, if you have the

Re: [sqlite] uuid generation in sqlite

2011-01-24 Thread Andy Gibbs
On Monday, January 24, 2011 11:11 AM, Artur Reilin wrote: >> Hi, >> >> I have put together a simple uuid generation method in sqlite: >> >> select '{' || hex( randomblob(4)) || '-' || hex( randomblob(2)) >> || '-' || '4' || substr( hex( randomblob(2)), 2) || '-' >> ||

Re: [sqlite] stored procedures implementation for SQLite

2011-01-27 Thread Andy Gibbs
On Wednesday, January 26, 2011 5:38 PM, Chris Wolf wrote: > but if anyone is interested, I checked in my work on GitHub, including > pre-compiled > binaries for MacOS and Linux. > > http://chriswolf.heroku.com/articles/2011/01/26/adding-stored-procedures-to-sqlite/#extended > Yes, very

[sqlite] SQL syntax diagrams

2010-01-15 Thread Andy Gibbs
Hi, I really like the way the SQL syntax diagrams are done (e.g. at http://www.sqlite.org/syntaxdiagrams.html). What software did you use for it? Regards Andy _ We want to hear all your

[sqlite] Question about lemon

2010-03-10 Thread Andy Gibbs
Hello, Is it alright to ask a quick question about the lemon parser in this mailing list, or is there a dedicated one which I should post this to instead? I'm using lemon to create a parser for a simple c/basic-like grammar, and have among other rules, the following defined (I've trimmed it

Re: [sqlite] Question about lemon

2010-04-01 Thread Andy Gibbs
not an Sqlite question, but I don't know where else to post questions about Lemon. Thanks!!! Andy - Original Message - From: "Andy Gibbs" Sent: Wednesday, March 10, 2010 10:54 AM Subject: Question about lemon > Hello, > > Is it alright to ask a quick question abo

Re: [sqlite] Question about lemon

2010-04-12 Thread Andy Gibbs
Hi Allan, > Instead of adding the definition > > cmd ::= set_item. > > have you thought about defining the acceptable alternatives to "SET"? > For instance, > > set ::= SET. > set ::= . > cmd ::= set set_list. Thank you for the suggestion. I have just tried this and unfortunately, it doesn't

[sqlite] Recursive triggers

2010-04-26 Thread Andy Gibbs
Hi, I notice in the fossil repository that Sqlite is now moving towards version 3.7.0. According to the page http://www.sqlite.org/news.html#2009_sep_11, it is anticipated that recursive triggers will be enabled by default from version 3.7.0 (cf also

Re: [sqlite] Recursive triggers

2010-04-26 Thread Andy Gibbs
From: "Simon Slavin" Sent: Monday, April 26, 2010 2:31 PM > I don't know the answer to this question, but I have considered it in one > of my > programs. It simply issues a "PRAGMA recursive_triggers = 'on'", then > does a > "PRAGMA recursive_triggers" and looks to see what it gets back.

Re: [sqlite] Virtual tables

2010-05-06 Thread Andy Gibbs
I don't think there is anything in the vanilla sqlite to do this, but... Have a look at src/test8.c in the main (not amalgamation) source code... this may give you some ideas. I don't think it does what you want exactly, but a quick skim through makes me think it has some pointers in the right

Re: [sqlite] Read-only tables in in-memory database?

2010-05-06 Thread Andy Gibbs
How about hitting your injection problem from the other side? Perhaps you can validate the data that is going in to making up your query. I don't know what query in particular you are using, but it made me think and something that cannot work with parameterisation could be something like the

[sqlite] Returning column to default

2010-05-06 Thread Andy Gibbs
Hi, I hope I haven't missed something in the documentation, but I can't find a statement to return a column value to its default. If I have the following table: CREATE TABLE tab (col TEXT DEFAULT "some_default", ); I can insert with defaults using INSERT INTO tab DEFAULT VALUES But

Re: [sqlite] Returning column to default

2010-05-06 Thread Andy Gibbs
Thanks for the speedy response. Unfortunately, it's not seemingly possible to do... UPDATE tab SET col = (SELECT dflt_value FROM (PRAGMA table_info(tab))); ... which certainly does make it a pain. Plus this doesn't work anyway where dflt_value is not a constant, but an expression (e.g.

Re: [sqlite] Returning column to default

2010-05-06 Thread Andy Gibbs
> You could write a trigger that sets default value if NULL is inserted > or set via UPDATE. That's a great idea - thanks! It won't work in all the places since in some places 'NULL' is a valid value, but I'm sure I can think of a work-around. Thank you!!

Re: [sqlite] Returning column to default

2010-05-06 Thread Andy Gibbs
Adam, > Is there a primary key on the table? > > Is it possible to use insert or replace instead of update, and then not > reference the column you want to set as a default? An interesting idea. Unfortunately, I think in my case it would be too much of a performance hit since I would be

[sqlite] Behaviour of tables with same name

2010-05-07 Thread Andy Gibbs
Hi, I have tracked down a bug in some other software where two tables have the same name, where it seems that the one table was masking the other. I can demonstrate simply with the following (on v3.6.23.1): create table t(i); insert into t values (1); attach database "other.db" as other;

Re: [sqlite] Returning column to default

2010-05-07 Thread Andy Gibbs
). The patch is a mere 20 lines (including comments). I have tested it for standard tables, but not for virtual tables, etc. If anyone is interested in the patch, I would be very interested to hear how well it works. Regards Andy - Original Message - From: "Andy Gibbs&

Re: [sqlite] Behaviour of tables with same name

2010-05-07 Thread Andy Gibbs
> I think the bigger issue is that you probably shouldn't rely on > automatic resolution of names. ... If you're using multiple > databases-- even just temp and main-- the best solution is to > just qualify as much as you can. This is sound advice. Thank you, also, for the clarification of

Re: [sqlite] Behaviour of tables with same name

2010-05-07 Thread Andy Gibbs
> Since we are at this topic let me ask the question: Are the table names > case insensitive? Yes, I believe they are: as are all identifiers. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Returning column to default

2010-05-11 Thread Andy Gibbs
- Original Message - From: "Alexey Pechnikov" Newsgroups: gmane.comp.db.sqlite.general Sent: Saturday, May 08, 2010 2:27 PM Subject: Re: Returning column to default Please send to me this patch. I think it may be added to unofficial http://sqlite.mobigroup.ru repository. No

Re: [sqlite] About new ticket "Per page/region checksums"

2012-02-06 Thread Andy Gibbs
On 4th February 2012 12:51pm, Alexey Pechnikov wrote: > It's very important but there are some questions about > http://www.sqlite.org/src/info/72b01a982a > Some times ago DRH wrote that checksum calculation don't slow down > SQLite significantly. > But can be this realized in current SQLite 3.x

[sqlite] Patch to remove some "unused variable" warnings

2016-08-02 Thread Andy Gibbs
Hi, I've attached a very small patch that eliminates a few "unused variable" warnings that occur when compiled with various OMIT_* options. Cheers, Andy ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Patch to remove some "unused variable" warnings

2016-08-02 Thread Andy Gibbs
On Tuesday 02 Aug 2016 22:07:32 Andy wrote: > Hi, > > I've attached a very small patch that eliminates a few "unused variable" > warnings that occur when compiled with various OMIT_* options. > > Cheers, > Andy Sorry, this time with inline patch... Index: src/build.c

[sqlite] Checking gcc/clang compiler version (was: OS X/Xcode build error: use of unknown builtin)

2017-02-20 Thread Andy Gibbs
Hi, I spotted the compiler version checking changes in commits [810d2932] and [8d3f485d] and thought I'd drop in with some thoughts. I am not aware of everything that passes on this mailing list (I am only a sporadic reader) but I did try to go through and see where this change might have