[sqlite] Questions regarding Lemon

2010-02-22 Thread Igmar Palsenberg
Hi, After a decode or so I've begun to program in C again. I've writing a parser, and Lemon seems like the right tool for the job. SQLite itself is an excellent read when starting with lemon. However, a few questions remain unanswered : - How do variables get initialized ? For example : %type

Re: [sqlite] Questions regarding Lemon

2010-02-22 Thread Wilson, Ronald
You have to initialize the variable yourself, e.g. %type course_plot { std::vectorunsigned long* } course_plot(V) ::= COURSE_PLOT_BEG course_plot_sector(A) . { V = new std::vectorunsigned long; V-push_back(A); } course_plot(V) ::= course_plot(L)

Re: [sqlite] Getting Full Readline Support on Mac OS X

2010-02-22 Thread Jeffrey Thompson
I'm compiling and installing sqlite-3.6.22 on Mac OS X and am failing to get the full readline capabilities (emacs editing and primarily reverse search for previous commands). I have installed the readline-6.1.tar.gz library and it appeared the standard config and make install used it but I still

Re: [sqlite] Questions regarding Lemon

2010-02-22 Thread Igmar Palsenberg
%type course_plot { std::vectorunsigned long* } course_plot(V) ::= COURSE_PLOT_BEG course_plot_sector(A) . { The issue is more what V is when the vector isn't created. Igmar ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] [Lemon] Jump to %syntax_error

2010-02-22 Thread Igmar Palsenberg
Hi, Can I somehow simulate a syntax error from within a rule action ? This parser looks up the token it receives, and I want to abort futher parsing in case that the lookup fails. as if there was a syntax error in the grammar. Regards, Igmr

Re: [sqlite] Getting Full Readline Support on Mac OS X

2010-02-22 Thread Simon de Bernard
I stumbled onto this this week end and I eventually got it working by providing the proper location of include and library files to the CPPFLAGS and LDFLAGS environment variables (by default sqlite will find the Mac OS X version of readline -- which is old -- and stick to it...) e.g: If

Re: [sqlite] Sqlite 2.1 - 3 migration

2010-02-22 Thread Filip Navara
On Wed, Feb 17, 2010 at 11:51 PM, Andreas Weller wel...@andreas-weller.de wrote: Hi. Unfortunately my Webhosting provider ceased sqlite 2 support. I downloaded the database file using FTP and tried to dump it on a debian PC with sqlite 2.8.17 This resulted in the following error message:

Re: [sqlite] Getting Full Readline Support on Mac OS X

2010-02-22 Thread P Kishor
On Mon, Feb 22, 2010 at 9:31 AM, Simon de Bernard dbern...@noos.fr wrote: I stumbled onto this this week end and I eventually got it working by providing the proper location of include and library files to the CPPFLAGS and LDFLAGS environment variables (by default sqlite will find the Mac OS X

Re: [sqlite] SQLite BUSY error - single-threaded app

2010-02-22 Thread Pavel Ivanov
All of the archive content on SQLITE_BUSY appears to assume multi-threaded database access; I have only a primary thread. There's also multi-process access. Is there any chance that there're several instances of your application running at the same time? What is your test case exactly? Is it

Re: [sqlite] Query plan of MAX (id) versus MAX (id) + 1 in a range

2010-02-22 Thread ArtemGr
Simon Slavin slav...@... writes: Just out of interest, and I know that theoretically this is not an optimal statement, but have you compared this with the results of putting the '+1' in the brackets ? Thanks for the pointer, Simon. Looking back to my analizys, I see that it was wrong. SELECT

Re: [sqlite] Query plan of MAX (id) versus MAX (id) + 1 in a range

2010-02-22 Thread Pavel Ivanov
Obvioulsy, SQLite already have a special case optimization for MAX (id), but optimization breaks with MAX (id) + 1, making it impractical for use in INSERT SELECT. Even not all kind of MAX(id) queries are optimized: http://www.sqlite.org/optoverview.html#minmax Pavel On Mon, Feb 22, 2010 at

Re: [sqlite] Questions regarding Lemon

2010-02-22 Thread Wilson, Ronald
%type course_plot { std::vectorunsigned long* } course_plot(V) ::= COURSE_PLOT_BEG course_plot_sector(A) . { The issue is more what V is when the vector isn't created. Igmar lemon is not going to initialize anything for you. You need to design your parser such that you

[sqlite] Order of triggers

2010-02-22 Thread Jens Frøkjær
Hi, I was wondering in what order triggers are executed. I'm using the after update, and have both column-based and row-based triggers. By column-based, i simply mean triggers that only fire if a specific column is updated. I did a bit of googling myself, and came up with [1]. It is pretty

Re: [sqlite] Order of triggers

2010-02-22 Thread Pavel Ivanov
I cannot find right now details on this in SQLite documentation but AFAIK order of triggers execution is undefined and you cannot rely on any of them. Pavel On Mon, Feb 22, 2010 at 3:15 PM, Jens Frøkjær j...@frokjaer.net wrote: Hi, I was wondering in what order triggers are executed. I'm

Re: [sqlite] Database is locked error

2010-02-22 Thread Trainor, Chris
Thanks for the response Pavel. The order that the events were getting logged wasn't accurate enough so I increased the timing precision for my logging. I didn't leave anything out, but some commands were logged slightly out of order. Thread1 is doing reads and writes for a while, with

Re: [sqlite] Database is locked error

2010-02-22 Thread Pavel Ivanov
Does that seem correct? Yes. If so, my options are: 1)  rollback/commit one of the transactions 2)  use begin exclusive That's correct, but it's better to be 'begin immediate' than 'exclusive'. I don't think the second one will work, since I need nested transactions and the savepoint

Re: [sqlite] Query plan of MAX (id) versus MAX (id) + 1 in a range

2010-02-22 Thread Jim Morris
Did you try something like: SELECT id + 1 FROM foo WHERE id= 100 AND id 200 and id = MAX (id); On 02/22/2010 7:02 AM, ArtemGr wrote: Simon Slavinslav...@... writes: Just out of interest, and I know that theoretically this is not an optimal statement, but have you compared this with

Re: [sqlite] Query plan of MAX (id) versus MAX (id) + 1 in a range

2010-02-22 Thread Pavel Ivanov
Did you try something like: SELECT  id + 1 FROM foo WHERE id= 100 AND id  200 and id = MAX (id); Probably you meant SELECT  id + 1 FROM foo WHERE id= 100 AND id  200 ORDER BY id DESC LIMIT 1; Otherwise it's incorrect SQL. Pavel On Mon, Feb 22, 2010 at 5:27 PM, Jim Morris

[sqlite] Bug in porter stemmer

2010-02-22 Thread James Berry
I'm writing to report a bug in the porter-stemmer algorithm supplied as part of the FTS3 implementation. The stemmer has an inverted logic error that prevents it from properly stemming words of the following form: dry - dri cry - cri This means, for instance, that the

[sqlite] how to get the sqlite test case?

2010-02-22 Thread xuecaili
Hello! I'm a sqlite user and I want to use sqlite to develop a software. But at first, I'd like to test sqlite. It is declared in the official web site that how sqlite is tested. I want to get the test case you test the sqlite, especially 7.2 million queries run with the SQL TEST

Re: [sqlite] how to get the sqlite test case?

2010-02-22 Thread Jay A. Kreibich
On Tue, Feb 23, 2010 at 08:55:31AM +0800, xuecaili scratched on the wall: Hello! I'm a sqlite user and I want to use sqlite to develop a software. But at first, I'd like to test sqlite. It is declared in the official web site that how sqlite is tested. I want to get the test case