Re: [sqlite] FTS3 bug with MATCH plus OR

2010-03-03 Thread Dan Kennedy
erface that not all queries that include MATCH operators can be implemented. In theory this particular case could be supported, but it would involve some difficult to test changes to the query planner. And there would still be other expressions with MATCH that would not work. Best approach is prob

Re: [sqlite] possible buffer over-read in sqlite3VXPrintf()

2010-03-04 Thread Dan Kennedy
his? I haven't studied the code to > check where it comes from), then I'd agree that this appears to > point to a bug in the caller rather than in sqlite itself. Not as confident as I was the other day. Now fixed here: http://www.sqlite.org/src/info/

Re: [sqlite] Fastest concurrent read-only performance (+ threads vs processes)

2010-03-04 Thread Dan Kennedy
d() calls etc. Each shared-cache has associated with it a mutex. The mutex is held for the duration of each sqlite3_step() call on a statement handle that accesses that shared-cache. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Porting Sqlite to MQX Operating system

2010-03-05 Thread Dan Kennedy
e statement journal here, not the db file. This file should have been opened with the pathname argument to the xOpen call set to NULL. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] sqlite3 delete does not delete everything?

2010-03-11 Thread Dan Kennedy
uld be 0. > > Do I have some fundamental misunderstanding about how sqlite stores > values > in database? Seems strange to me too. What version of SQLite? Does running "PRAGMA integrity_check" reveal any problems with the database file? Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] FTS3 (Version 2 .6.23) - Is the boolean operator "AND" no more available?

2010-03-14 Thread Dan Kennedy
f FTS3 is compiled with this option: -DSQLITE_ENABLE_FTS3_PARENTHESIS See: http://www.sqlite.org/fts3.html#section_2 Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Porting Sqlite to MQX OS: Question 2

2010-03-15 Thread Dan Kennedy
On Mar 15, 2010, at 10:04 PM, GeoffW wrote: > > Hi Kees > > Thanks for the response and giving me a clue to look at dot locking, > I had > missed the dot lock mechanism as I had concentrated mainly on the > osWin.c > file. I cant find any documentation other than the source code on > how th

Re: [sqlite] Porting Sqlite to MQX OS: Question 2

2010-03-15 Thread Dan Kennedy
On Mar 16, 2010, at 5:22 AM, GeoffW wrote: > > Hello Dan > > Thanks for your useful input. To answer your questions. > >> Do you have any file-locking primitives provided by the OS? > There are no file locking OS Primitives at all that I can use. > >> Do y

Re: [sqlite] Result_* functions

2010-03-17 Thread Dan Kennedy
On Mar 18, 2010, at 6:40 AM, Jean-Christophe Deschamps wrote: > Is it allowable/safe to invoke more than once any sqlite3_result_*() > function? In other terms, subsequent invokation of any result > function > will it harmlessly override a previous one? Yes and yes. _

Re: [sqlite] R*Tree and sqlite3_last_insert_rowid() API - possible bug?

2010-03-19 Thread Dan Kennedy
On Mar 19, 2010, at 11:04 PM, Minář Petr wrote: > Hi, > I was experimenting a bit with R*Tree extension in my project and I > encountered weird behavior. Consider following code: > > CREATE VIRTUAL TABLE table USING rtree > ( > Id INTEGER NOT NULL PRIMARY KEY, > MinXREAL, >

Re: [sqlite] R*Tree and sqlite3_last_insert_rowid() API - possible bug?

2010-03-21 Thread Dan Kennedy
On Mar 22, 2010, at 4:16 AM, Wanadoo Hartwig wrote: > Hi Minar, hi Dan, > > there is a similar bug in the FTS3 module. But here the > sqlite_last_rowid may return a wrong value. How do we reproduce this bug? Dan. ___ sqlite-users

Re: [sqlite] regression in FTS3 offsets function in 3.6.23

2010-03-24 Thread Dan Kennedy
column contains > an empty > string and the tokenizer returns SQLITE_DONE. It's a bug alright. Now fixed here: http://www.sqlite.org/src/ci/d37034f7fc Thanks for working on this. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] BUG: Sqlite 3.6.23. Optimizer does not use indexes when a table is joined with a fts3 table

2010-03-27 Thread Dan Kennedy
> ### PROBLEM > > With Sqlite 3.6.17 the following query executes in 12ms. > > --- > SELECT a.number > FROM a, fts > WHERE > a.number=fts.docid > ORDER BY a.date desc > LIMIT 20 > --- > > > With Sqlite version 3.6.23 the same q

Re: [sqlite] Berkeley DB adds SQL using SQLite API !!

2010-03-28 Thread Dan Kennedy
On Mar 29, 2010, at 10:48 AM, P Kishor wrote: > On Sun, Mar 28, 2010 at 10:45 PM, Roger Binns > wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> sub sk79 wrote: >>> How So? Is SQLite getting a high concurrency module from BDB in >>> exchange for its SQL API? >> >> I believe the

Re: [sqlite] sqlite bug with collating sequences?

2010-03-29 Thread Dan Kennedy
On Mar 29, 2010, at 4:55 PM, Rickard Utgren wrote: > I've managed to break a database, and I think it's related to defining > new text collating sequences in Tcl. If I run "VACUUM" on it, it works > fine again. I was told that this would likely be a bug in SQLite. This database was created with

Re: [sqlite] Preserving column size

2010-03-29 Thread Dan Bishop
Kevin M. wrote: > I have a C/C++ application in which I want to store data from a struct into a > table (using SQLite 3.6.23) and later retrieve data from the table and store > it back in the struct. But, I need a general interface for this as there are > many types of structs used. So, what I

Re: [sqlite] Sqlite3 crashing on multithreaded program

2010-03-30 Thread Dan Kennedy
On Mar 30, 2010, at 7:37 PM, Periasamy, Karthikeyan wrote: > Hi, > > Our application is a multithreaded program running on Powerpc e300 > mpc8343 embedded board. There are 8 threads running which are > querying and updating DB parallelly and continuously. We are using > libdbi-0.8.2 and sq

Re: [sqlite] Segfault and incorrect result in last_insert_rowid() function

2010-03-30 Thread Dan Kennedy
On Mar 30, 2010, at 6:29 PM, Alexey Pechnikov wrote: > Hello! > > CREATE TABLE test ( > id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL > ); > CREATE VIEW view_test as select * from test; > CREATE TRIGGER view_test_insert instead of insert on view_test > begin > insert into test (id) values (NULL

Re: [sqlite] Segfault and incorrect result in last_insert_rowid() function

2010-03-30 Thread Dan Kennedy
On Mar 30, 2010, at 8:53 PM, Pavel Ivanov wrote: >> The segfault is now fixed here: >> >> http://www.sqlite.org/src/info/ca359a3e80 > > Does the comment to commit mean that in the same test case if view has > no triggers then compilation of the statement will still segfault? No. _

[sqlite] Fwd: Sqlite3 crashing on multithreaded program

2010-03-31 Thread Dan Kennedy
Begin forwarded message: > From: "Periasamy, Karthikeyan" > Date: March 31, 2010 7:52:55 PM GMT+07:00 > To: "danielk1...@gmail.com" > Subject: Re: [sqlite] Sqlite3 crashing on multithreaded program > > Hi, > > Thanks for your reply. > > In our application the block of code which access the DB

Re: [sqlite] bug: output contains values of a column not listed in SELECT

2010-03-31 Thread Dan Kennedy
OM my_table ... GROUP BY 1 > That is, instead of values of col_x, I'm getting values of col_y, > which > is not in the SELECT clause. http://www.sqlite.org/src/info/883034dcb5 Should be fixed now: http://www.sqlite.org/src/ci/ffc23409c7 Please test out the change in your a

Re: [sqlite] Table is locked error

2010-04-01 Thread Dan Kennedy
On Apr 1, 2010, at 2:39 PM, Radovan Antloga wrote: > I did not find any info about my situation in page > http://www.sqlite.org/lockingv3.html > > I would just like a confirmation if this is expected > behaviour. > > I have locking mode = normal. Steps are: > > 1. open database > 2. open statemen

Re: [sqlite] Exposing sqlite3BtreeCommitPhaseOne

2010-04-06 Thread Dan Kennedy
> Would it be possible to expose this first phase via a C or SQL API? It's not an unreasonable suggestion, but it seems like the kind of thing that won't happen to me. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.o

Re: [sqlite] Lemon parser

2010-04-06 Thread Dan Kennedy
On Apr 7, 2010, at 3:23 AM, Chris verBurg wrote: > Hehe, okay, here I go. :) > > > I'm trying to replace an existing flex/bison parser with an re2c/lemon > parser, but I'm running into a methodological problem. I have a > hypothetical grammar like this: > > file ::= FOO str . > file ::= BAR s

Re: [sqlite] copy one row to another

2010-04-07 Thread Dan Kennedy
o > the FTS tables should get updated by the triggers without any problem. > Maybe REPLACE gets treated as an INSERT, I think this is correct. The 'on conflict' clause of a DML statement (in this case REPLACE) is not passed to virtual tables. To virtual tables, REPLACE==INSERT.

Re: [sqlite] Concurrency for in-memory scenarios

2010-04-08 Thread Dan Kennedy
On Apr 8, 2010, at 3:38 PM, Kent Boogaart wrote: > BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; > }Thanks to all respondents. > A RAM disk is a good idea, but would require me to jump through too > many hoops to get it approved. Corporate environment, you see :( > For now, I'

Re: [sqlite] SQLite parsing of a .sql file

2010-04-09 Thread Dan Kennedy
gt; use that to parse multiple statements. >> >> >> >> Does anyone have any suggestions? See also the 5th parameter to sqlite3_prepare_v2(). This API allows you to compile the first statement in an SQL script and returns a pointer to the start of the next statement i

Re: [sqlite] Index not used in simple look-up-value query

2010-04-13 Thread Dan Kennedy
On Apr 14, 2010, at 1:05 AM, wrote: > Hello, > > I have a question regarding the query-optimizer. I've tested SQLite > with the following situation: > > 1 table defined as > > CREATE TABLE MyTable (ElementID INTEGER CONSTRAINT ElementID_PK > PRIMARY KEY AUTOINCREMENT, Label VARCHAR(255)) > >

Re: [sqlite] Index not used in simple look-up-value query

2010-04-15 Thread Dan Kennedy
FROM > MyDataTable, MyIntermediateTable > WHERE > MyIntermediateTable.ID1 = @ID1 AND > MyIntermediateTable.ID2 = @ID2 AND > MyIntermediateTable.RecordID = MyDataTable.RecordID; Maybe there are no rows in MyIntermediateTable that match the WHERE conditions. Da

Re: [sqlite] Quoting strings for SQLite

2010-04-17 Thread Dan Bishop
Simon Slavin wrote: > I am using a particular program which needs to be able to mess with an > already-established database. It has to issue UPDATE and INSERT commands > using one string for the entire command: no opportunity for binding. So it > has to assemble commands by concatenation. In

Re: [sqlite] Quoting strings for SQLite

2010-04-18 Thread Dan Bishop
Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 04/17/2010 07:12 PM, Dan Bishop wrote: > >> Newlines, backslashes, and double quotes can be included literally. The >> only other character you need to worry about is NUL. >> >

Re: [sqlite] Quoting strings for SQLite

2010-04-20 Thread Dan Bishop
Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 04/18/2010 11:03 PM, Dan Bishop wrote: > >> I've written a quoting routine too, in C++. I just truncated strings at >> the first NUL character because I didn't think that SQLi

[sqlite] String interning using foreign keys: How to write an INSERT trigger?

2010-04-22 Thread Dan Bishop
We have a e-mail program that uses a table like: CREATE TABLE Emails ( MessageID TEXT, FromAddr TEXT, ToAddr TEXT, -- ... ); The database takes up hundreds of megabytes of disk space. In order to avoid the duplication of storing the same addresses thousands of times, I'm planning t

Re: [sqlite] Is there any memory leak in the code ?

2010-04-23 Thread Dan Kennedy
On Apr 23, 2010, at 2:34 PM, liubin liu wrote: > > Is there any memory leak in the code? The buffers returned by sqlite3_mprintf(). ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] page_size

2010-04-25 Thread Dan Kennedy
d integers to store various offsets (in bytes) to cells and free-blocks within a page. So it definitely won't work with greater than 64KB pages. Not sure if 64KB would work or not. Since it hasn't been tested, the answer is probably "No.". Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] CHECK constraints and type affinity

2010-04-27 Thread Dan Bishop
If I write sqlite> CREATE TABLE T1 (N INTEGER CHECK(N >= 0)); the constraint is applied AFTER converting N to an integer. sqlite> INSERT INTO T1 VALUES('42'); sqlite> INSERT INTO T1 VALUES('-5'); SQL error: constraint failed But if I write sqlite> CREATE TABLE T2 (N INTEGER CHECK(TYPEOF(N) = '

Re: [sqlite] releasing EXCLUSIVE lock after writing dirty pages from the memory cache into the DB ?

2010-04-28 Thread Dan Kennedy
On Apr 28, 2010, at 10:20 PM, Guillaume Duranceau wrote: > Hello all, > > While running a SQLite transaction writing into the DB (thus holding > the > RESERVED lock), in case the memory cache becomes full, SQLite will > try to > write the content of a dirty page into the DB. To do so, it prom

Re: [sqlite] Reusing stmt and erroneous constraint failure

2010-04-29 Thread Dan Kennedy
Now fixed here: http://www.sqlite.org/src/ci/f660be615a For those playing at home, this is an example of how to write a great bug report. Clear, concise explanation and a self-contained minimal example. Dan. On Apr 30, 2010, at 8:51 AM, Roger Binns wrote: > -BEGIN PGP SIG

[sqlite] Problem with conflict resolution in triggers

2010-04-30 Thread Dan Bishop
I'm trying to implement a string pool using views and triggers: CREATE TABLE StringPool ( ID INTEGER PRIMARY KEY AUTOINCREMENT, Val TEXT UNIQUE ); CREATE TABLE T ( KeyTEXT PRIMARY KEY, ValRef INTEGER REFERENCES StringPool(ID) ); CREATE VIEW V

[sqlite] Implementing a CREATE_FUNCTION function

2010-05-04 Thread Dan Bishop
It's convenient to be able to define new functions in C. But sometimes, it would be *more* convenient to be able to define new functions in SQL. This could be done by registering a CREATE_FUNCTION() function; then you could write something like: SELECT CREATE_FUNCTION('LEFT', 2, 'SUBSTR(?1, 1

Re: [sqlite] I don't understand locking

2010-05-05 Thread Dan Kennedy
On May 5, 2010, at 8:32 PM, myomancer wrote: > Dear Users > > I've spent hours reading various web-based documents, examined lots of > code snippets, written some code of my own, but I still patently do > not understand SQLite locks. 4th paragraph of this page (The presence of a busy...) describ

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-05 Thread Dan Bishop
BareFeetWare wrote: > On 04/05/2010, at 3:14 AM, Stefan Keller wrote: > > >> But in SQLite if a view column comes from a function result or some >> computation, then the column type is NULL...!? It's not taking the >> result-type as mentioned in the manual >> (http://www.sqlite.org/lang_select

Re: [sqlite] Computed columns in VIEWs return NULL but should be able to be typed! Any ideas?

2010-05-06 Thread Dan Bishop
Stefan Keller wrote: > Thank you, Tom and Dan, for your constructive answers. > > To Pavel: My application reads the column types out in order to pretty > print the values - as mentioned by Tom - but also to generate a dialog > for entering new data (of course combined with INST

Re: [sqlite] DB files are different between PC side and instrument side.

2010-05-11 Thread Dan Kennedy
On May 11, 2010, at 2:54 PM, Lei, Rick (GE EntSol, SensInsp) wrote: > > Hi, > > I ported Sqlite3 to my instrument. The database file is stored in a > SDHC > card. Sqlite3 runs ok. However I found the database file generated on > instrument side is much bigger than the file on PC side. I checked

Re: [sqlite] Can an online backup happen during a nested transaction?

2010-05-11 Thread Dan Kennedy
On May 12, 2010, at 2:53 AM, Shaun Seckman (Firaxis) wrote: > Hello, > >I'm attempting to save a backup of my in-memory > database > using the online backup routines. I noticed that I cannot seem to > make > backups of the database when there is a pending save point. The err

Re: [sqlite] sqlite3_prepare_v2 && SQLITE_BUSY

2010-05-17 Thread Dan Kennedy
On May 18, 2010, at 10:18 AM, Sam Carleton wrote: > For those of you following along my life (which I hope none of you > are), I > am working on cleaning up my code to handle SQLITE_BUSY correctly. > The > first issue I think I just successfully overcame was how to lock the > DB to > get m

Re: [sqlite] Index not used in simple alias-like views

2010-05-24 Thread Dan Kennedy
On May 24, 2010, at 6:14 PM, Edzard Pasma wrote: > Hello, I found a blind spot of the query optimizer. This appears when > a table is accessed as a view. I think the problem can be phrased as > "the optimizer failing to push an outer join predicate into a > view"... This simply means that the fol

Re: [sqlite] File locking with BEGIN/END

2010-05-25 Thread Dan Kennedy
On May 25, 2010, at 10:24 PM, Nick Shaw wrote: > Hi all, > > > > I've got a database that is accessed by two processes on the same PC. > When I add a large number of records to a table from one process (all > records wrapped in a BEGIN DEFERRED / END so it's committed to disk > all > at once; a

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-27 Thread Dan Kennedy
On May 27, 2010, at 8:07 PM, Pavel Ivanov wrote: >> That's true, except for the case when exclusive lock fails; at >> least that's >> what Dan Kennedy says to my question from a couple of years ago: >> http://old.nabble.com/changes-in-cache-spill-locking-sinc

Re: [sqlite] SQLITE_OMIT_WSD (3.6.23.1)

2010-05-28 Thread Dan Kennedy
On May 28, 2010, at 1:11 AM, Kim, Albert wrote: > Hi, > > We are compiling sqlite 3.6.23.1 with the SQLITE_OMIT_WSD compile > time flag turned on. We are using the amalgamation. We found that > this didn't completely eliminate the writable static data in our > binary, and some investigat

Re: [sqlite] Using cache stats to balance transaction size for optimal performance

2010-05-28 Thread Dan Kennedy
On May 28, 2010, at 5:42 PM, Pavel Ivanov wrote: >> It will retry the EXCLUSIVE lock each time a page that is not >> in the cache is required by SQLite (a "cache-miss"). > > If SQLite doesn't require to read any pages but only adds new pages to > the file does it count as cache-miss? Yes. _

Re: [sqlite] No conflict clause in foreign key clause?

2010-05-29 Thread Dan Kennedy
On May 28, 2010, at 10:54 PM, Robert Nickel wrote: > I notice that the foreign key clause > (http://www.sqlite.org/syntaxdiagrams.html#foreign-key-clause) does > not > include a conflict clause > (http://www.sqlite.org/syntaxdiagrams.html#conflict-clause). I always > specify "ON CONFLICT ROLLBA

Re: [sqlite] SQLITE_OMIT_WSD (3.6.23.1)

2010-05-29 Thread Dan Kennedy
On May 29, 2010, at 10:19 AM, Albert Kim wrote: > > Hi Dan, > It doesn't matter that it will never be written to. Since the > variable is a > non-const static it will get mapped into the WSD portion of memory. Is a problem in pra

Re: [sqlite] on delete no action

2010-06-01 Thread Dan Kennedy
ON DELETE rule itself (example 2 below) > equivalent to specifying "ON DELETE NO ACTION?" What concept am I > missing from the docs? ;) Could be that you need SQLite version 3.6.19 or later. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bug and possible fix: Access violation in rtree.c:nodeGetRowid()

2010-06-02 Thread Dan Kennedy
ations. Better than crashing anyhow. On the other hand, it isn't a particularly pleasant thought that this can happen... Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bug and possible fix: Access violation in rtree.c:nodeGetRowid()

2010-06-02 Thread Dan Kennedy
On Jun 2, 2010, at 7:19 PM, Simon Slavin wrote: > > On 2 Jun 2010, at 10:12am, Dan Kennedy wrote: > >> The fix you propose would ignore the (suspected) corruption >> and continue without reporting it to the user. Which might be >> the best thing for some > > bu

Re: [sqlite] database corruption problem

2010-06-08 Thread Dan Kennedy
On Jun 8, 2010, at 10:54 PM, Daniel Stutzbach wrote: > On Tue, Jun 8, 2010 at 10:02 AM, Simon Slavin > wrote: > >> I'm not sure whether a power-cut at a particularly bad time could >> cause >> something like this. The journaling mechanism built into SQLite >> should be >> avoiding it, but

Re: [sqlite] database corruption problem

2010-06-08 Thread Dan Kennedy
On Jun 9, 2010, at 12:51 AM, Dave Segleau wrote: > > On 6/8/2010 9:25 AM, Dan Kennedy wrote: >> >> Those pragmas should not cause a problem. Simon's referring >> to "PRAGMA synchronous". The docs for which explain the >> risks assumed b

Re: [sqlite] FTS3 - NEAR operator

2010-07-03 Thread Dan Kennedy
On Jul 3, 2010, at 2:37 AM, Patel, Vinit wrote: > Hi : > > I was wondering how the NEAR operator works for the SQL database. > In the SQLite test suite, in test file fts3near.test, One of the > test case is as follows > > //fts3near-3.1 test case > > db eval { > DELETE FROM t1; > INSERT INTO

Re: [sqlite] Documentation error in explanation of "IN subquery" (lang_expr.html)

2010-07-14 Thread Dan Kennedy
On Jul 15, 2010, at 12:25 AM, Simon Slavin wrote: > > On 14 Jul 2010, at 5:13pm, Richard Hipp wrote: > >> Improvements to the IN operator documentation can be found here: >> >>http://www.sqlite.org/draft/lang_expr.html#in_op > > I find that table difficult to understand: you have some mutuall

Re: [sqlite] SQLITE_CANTOPEN returned from sqlite3_step

2010-07-15 Thread Dan Kennedy
On Jul 15, 2010, at 8:35 PM, Yoav Apter wrote: > Hi > > We are building a Windows application using a read-only Sqlite > database. When executing many queries in a short time, we sometimes > get SQLITE_CANTOPEN from sqlite3_step. Checking GetLastError gives > us error code 123: The filename

Re: [sqlite] sqlite database handle caching and write permissions

2010-07-15 Thread Dan Kennedy
On Jul 16, 2010, at 6:33 AM, JT Olds wrote: > I really would rather not depend on what is in the SQL itself, as the > concern I have has nothing to do with whether or not the user runs > SELECT, but whether or not this will cause the library to write to > disk. I'd love to decouple those two thin

Re: [sqlite] sqlite database handle caching and write permissions

2010-07-16 Thread Dan Kennedy
On Jul 16, 2010, at 2:05 PM, JT Olds wrote: >> Unsafe. Using the authorizer callback instead to figure out if a >> statement may write the database is a better way: >> >> http://www.sqlite.org/c3ref/c_alter_table.html >> http://www.sqlite.org/c3ref/set_aut

Re: [sqlite] Nested set "make space" query, sum(column) returns NULL with no match

2010-07-18 Thread Dan Kennedy
On Jul 17, 2010, at 8:17 PM, Graham Leggett wrote: > Hi all, > > I have been trying to find an efficient way of shifting the left and > right values for multiple insertions of new nodes in the nested set > model in one go, and I have been struggling to do this with sqlite. > > I have populated a

Re: [sqlite] "Unable to Open DB" on Win-7 & Vista (64 bitt) on UAC -ON

2010-07-20 Thread Dan Kennedy
On Jul 21, 2010, at 11:12 AM, wrote: > > In my case, the DB is created by the older version of application and > now the new version of application is installed and End user has > option > to see old data with selecting old version of DB so its completely on > end user wish to choose the loc

Re: [sqlite] SQLite version 3.7.0

2010-07-22 Thread Dan Kennedy
ns would continue writing without causing an error. You cannot delete a file while it is open on windows, so this doesn't come up on win32. This happened with a couple of Tcl tests too. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Couple of questions about WAL

2010-07-22 Thread Dan Kennedy
On Jul 22, 2010, at 6:07 PM, Alan Chandler wrote: > I have been reading about WAL, and there are a few questions I would > like to ask. > > 1) I am slightly confused about readers building the WAL index. It > says > way down the page > > quote: > > Using an ordinary disk file to provide shared

Re: [sqlite] Couple of questions about WAL

2010-07-22 Thread Dan Kennedy
> If I do a BEGIN, SELECT1 and at that point a writer does BEGIN > IMMEDIATE, SELECT3, UPDATE, COMMIT, and then I continue with SELECT2 > COMMIT, will SELECT1 and SELECT2 have a consistent view of the > database > unaffected by the UPDATE in the middle. In other words, is the > Readers > view

Re: [sqlite] Couple of questions about WAL

2010-07-23 Thread Dan Kennedy
On Jul 23, 2010, at 8:56 PM, Doug wrote: > Thanks for your explanations Dan. The new WAL feature sounds great > and I'm > excited to try it. Two questions below: > >> When in WAL mode, clients use file-locks to implement a kind of >> robust (crash-proof) referen

Re: [sqlite] [PATCH] Verify number of arguments in icuRegexpFunc

2010-07-29 Thread Dan Kennedy
On Jul 30, 2010, at 8:39 AM, Paweł Hajdan, Jr. wrote: > I'm attaching a suggested patch to verify number of arguments > in icuRegexpFunc. Please review it. > > This is upstreaming of > http://src.chromium.org/viewvc/chrome/trunk/src/third_party/sqlite/icu-regexp.patch?revision=34807&view=markup >

Re: [sqlite] [PATCH] Verify number of arguments in icuRegexpFunc

2010-07-29 Thread Dan Kennedy
On Jul 30, 2010, at 12:44 PM, Scott Hess wrote: > On Thu, Jul 29, 2010 at 10:05 PM, Dan Kennedy > wrote: >> On Jul 30, 2010, at 8:39 AM, Paweł Hajdan, Jr. wrote: >>> I'm attaching a suggested patch to verify number of arguments >>> in icuRegexpFunc

Re: [sqlite] WAL still detects deadlock

2010-07-31 Thread Dan Kennedy
On Jul 31, 2010, at 12:02 AM, Edzard Pasma wrote: > Hello, > > The following scenario raises a BUSY error immediately > > process A. keeps a write lock > process B keeps a read-lock and tries to promote this to a write-lock > > This is the traditional SQLite deadlock situation, detected by the >

Re: [sqlite] WAL still detects deadlock

2010-07-31 Thread Dan Kennedy
On Jul 31, 2010, at 10:47 PM, Edzard Pasma wrote: > Op 31-jul-2010, om 14:16 heeft Dan Kennedy wrote: > >> >> On Jul 31, 2010, at 12:02 AM, Edzard Pasma wrote: >> >>> Hello, >>> >>> The following scenario raises a BUSY error immediately >>

Re: [sqlite] "database disk image is malformed" while using WAL

2010-08-02 Thread Dan Kennedy
checkpoint finished. Thanks for this report. If possible, can you try your test with the latest from fossil (newer than e75b52d156)? Thanks. http://www.sqlite.org/src/zip/SQLite-016486c7d544dcf9.zip?uuid=016486c7d544dcf9b7422cb0fb9804aa1c418f68 Please post if you need an ama

Re: [sqlite] "database disk image is malformed" while using WAL

2010-08-02 Thread Dan Kennedy
On Aug 2, 2010, at 6:13 PM, Dan Kennedy wrote: > > On Aug 2, 2010, at 1:42 PM, Yoni Londner wrote: > >> Hi, >> Forgot to mention that the inserting should be inside a >> transactions, so >> complete repro steps are: >> 1. open sqlite connection. >

Re: [sqlite] how to clone revision 3.2.6 using fossil

2010-08-03 Thread Dan Kennedy
On Aug 3, 2010, at 1:38 PM, Belisko Marek wrote: > Hi, > > I will need to clone sqlite3 version 3.2.6. > Could you please give me some commands how to do it in fossil? fossil clone http://www.sqlite.org/src sqlite.fossil fossil open sqlite.fossil fossil update 1cdfe66714 __

Re: [sqlite] Backup API, .backup command, and writing to handle live backups?

2010-08-08 Thread Dan Kennedy
On Aug 9, 2010, at 11:17 AM, David Barrett wrote: > I *think* I know the answers these questions, but can you please > confirm > them for me? > > 1) Does the sqlite3 command-line app .backup command use the > http://www.sqlite.org/backup.html API, and thus only read-lock the > database for brie

Re: [sqlite] Write-ahead logging and database locking

2010-08-08 Thread Dan Kennedy
On Aug 9, 2010, at 11:30 AM, David Barrett wrote: > I'm reading up on the new write-ahead logging feature, and I'm unclear > on one point: does WAL only help alleviate multi-threaded locking (by > allowing other threads to continue reading while one is writing), or > does WAL also help between mu

Re: [sqlite] Write-ahead logging and database locking

2010-08-08 Thread Dan Kennedy
On Aug 9, 2010, at 12:07 PM, Dan Kennedy wrote: > > On Aug 9, 2010, at 11:30 AM, David Barrett wrote: > >> I'm reading up on the new write-ahead logging feature, and I'm >> unclear >> on one point: does WAL only help alleviate multi-threaded locking (by

Re: [sqlite] foreign key the true error - sqlite 3.7.0.1

2010-08-09 Thread Dan Kennedy
conclusion of your two insert statements, table "a" contains (1, 1) and table "b" contains (1, 2). Since the contents of table "b" violate the FK constraint, an exception is thrown. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Process memory space exhausted in 3.7.0

2010-08-10 Thread Dan Kennedy
suppose. > If you break up the insert into chunks > _and_close_the_connection_between_chunks_ then the error does not > occur. Does this imply that if you add an sqlite3_exec("COMMIT;BEGIN") every 10,000 inserts the program still does not run to completion? Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] performance, transactions and wal checkpoints

2010-08-10 Thread Dan Kennedy
tion (but in the same thread). > It only worked if I do the checkpoint on the same connection. You cannot run a checkpoint from within a transaction. If you are in shared-cache mode, this means you cannot run a checkpoint while any connection to the same database has an open transaction. Does tha

Re: [sqlite] performance, transactions and wal checkpoints

2010-08-10 Thread Dan Kennedy
pens as part of the first SQL statement run). Are things any different if you change the sqlite3_wal_checkpoint() to sqlite3_exec(conn, "PRAGMA wal_checkpoint", 0, 0, 0)? Dan. > #include "sqlite3.h" > #include "stdio.h" > #include "stdlib.h&

Re: [sqlite] Backup API, .backup command, and writing to handle live backups?

2010-08-10 Thread Dan Kennedy
On Aug 11, 2010, at 1:25 AM, David Barrett wrote: > On 08/08/2010 10:00 PM, Dan Kennedy wrote: >> >> On Aug 9, 2010, at 11:17 AM, David Barrett wrote: >>> 3) When an application performs read/write queries on the database >>> in >>> parallel to the

Re: [sqlite] Reserve database pages

2010-08-13 Thread Dan Kennedy
On Aug 13, 2010, at 8:41 PM, Max Vlasov wrote: > On Fri, Aug 13, 2010 at 1:38 PM, Max Vlasov > wrote: > >> >> I can approximately calculate, how big the new database will grow. Is >>> there a way to tell SQLite to reserve an inital space or numer of >>> pages >>> instead of letting the datab

Re: [sqlite] Is there a table that show all the available function from sqlite3?

2010-08-13 Thread Dan Kennedy
On Aug 13, 2010, at 11:37 PM, Peng Yu wrote: > Hi, > > http://www.sqlite.org/docs.html > > I don't see a table that shows all the available functions in sqlite3. > Would you please let me know if there is such a table? http://www.sqlite.org/lang_corefunc.html http://www.sqlite.org/lang_dat

Re: [sqlite] Distinct Bug

2010-08-13 Thread Dan Kennedy
into t_distinct_bug values ('1', '3', 'f'); > > select a > from (select distinct a, b > from t_distinct_bug) > => 1 > > I'd have thought it should return > 1 > 1 > 1 Thanks for this report. Now fixed in fossil tip. Bug here: http://www.sqlite.org/src/info/e4b8a2ba6e Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Why the deadlock?

2010-08-16 Thread Dan Kennedy
On Aug 17, 2010, at 1:48 AM, Nikolaus Rath wrote: > Hello, > > The script below fails with > > Deadlock detected when executing 'DELETE FROM foo WHERE id=2' > > What I think should be happening instead is this: > > - When executing statement 1, the main thread obtains a SHARED lock. > > - When ex

Re: [sqlite] Why the deadlock?

2010-08-16 Thread Dan Kennedy
statement 4. After that it releases all locks. Cannot obtain the required EXCLUSIVE lock, due to the PENDING lock held by thread 2. http://www.sqlite.org/lockingv3.html#pending_lock > - Now thread 2 can execute statement 3. This would be true, but we don't get t

Re: [sqlite] EXTERNAL: Record corruption on Mac OS X 10.6 (Snow Leopard)

2010-08-17 Thread Dan Kennedy
> I'm using SQLITE_STATIC since the memory buffer returned by > cStringUsingEncoding should be valid until the object is deallocated, > which doesn't happen until after the statement is executed. You could try using SQLITE_TRANSIENT instead to verify this. Or just go straight to valgrind. Good

Re: [sqlite] Bug in FTS3 when trying to rename table within a transaction

2010-08-18 Thread Dan Kennedy
. For now, fts3 tables should only renamed outside of transactions. Dan. > > See below: > > D:\temp>sqlite3 tmp.db > SQLite version 3.6.23.1 > Enter ".help" for instructions > Enter SQL statements terminated with a ";" > sqlite> create table NonF

Re: [sqlite] errors running test suite (couldn't execute "testfixture")

2010-08-20 Thread Dan Kennedy
d I do to make it pass? Either add "." to the PATH variable or do another update. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Why the deadlock?

2010-08-25 Thread Dan Kennedy
fulness of > the statement. Maybe somebody somewhere forgot to set autocommit to 0 > when select started executing? > > Dan, can you shed some light on this strange behavior? When you commit a transaction, SQLite upgrades to an EXCLUSIVE lock so that it can write to the database file. Once it

Re: [sqlite] Why the deadlock?

2010-08-25 Thread Dan Kennedy
On Aug 25, 2010, at 11:04 PM, Pavel Ivanov wrote: >> Prior to version 3.6.5 SQLite used to delay committing the >> transaction until all SELECT statements had finished. But that >> behavior was deemed to be less intuitive. > > But this is the current 3.7.1 documentation > (http://www.sqlite.org/l

Re: [sqlite] Asynchronous I/O Module For SQLite vs Single Thread mode

2010-08-29 Thread Dan Kennedy
.sqlite.org/threadsafe.html) or does this necessarily mean > that the > Multi-threads or serialized modes must be used? I think it's Ok to have SQLite in single-thread mode. At least, I can't see why not. Dan. ___ sqlite-users mailing list

Re: [sqlite] Upon table creation, multiple CHECK constraints do not work with FTS3

2010-08-29 Thread Dan Kennedy
uctor failed Maybe it thinks the two "CHECK(1)" identifiers represent a duplicate column name. CHECK constraints will not work with either fts3 or rtree virtual tables. If they are parsed at all, they will probably not do what you are expecting. Dan. _

Re: [sqlite] upstreaming Chromium patches for file handle passing support

2010-09-01 Thread Dan Kennedy
or where to create a master journal file if the client writes to the database? Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] iCalendar (*.ics) import ?

2010-09-02 Thread Dan White
I have Google-ed references to a utility called ical2sqlite, which claims to be able to make a database out of an iCalendar data file. Anyone on this list have any experience with it ? “Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it h

Re: [sqlite] FTS3 finds too much: Slash special meaning? Something else?

2010-09-03 Thread Dan Kennedy
On Sep 2, 2010, at 6:37 PM, Lukas Haase wrote: > Hi, > > I use FTS3 (SQLITE_ENABLE_FTS3) with enhanced query syntax > (SQLITE_ENABLE_FTS3_PARENTHESIS). > > Now if I search for a string like '2002/91/AH' there are lots of items > which do NOT contain this string. This is a query: > > SELECT rowid,

Re: [sqlite] memory wasted shm mapped file (3.7.2)

2010-09-09 Thread Dan Kennedy
On Sep 9, 2010, at 1:12 PM, Michele Pradella wrote: > Hi, do you have some news about the wasted memory? have you found the > reason for the windows backend? Fixed here: http://www.sqlite.org/src/ci/f213e133f6 Does the problem still show up for you using fossil tip? > do you think it

<    2   3   4   5   6   7   8   9   10   11   >