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] 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] 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] 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] 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-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] 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] 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] 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] 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] 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] 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] 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] 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

[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

[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

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

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

[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] 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

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

[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] 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

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-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] 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] 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] 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] 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] 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] 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] 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] 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] 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

[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] 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. _

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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] Maximum database size?

2010-03-03 Thread Dan Kennedy
p partition perhaps. See pragma temp_store_directory: http://www.sqlite.org/pragma.html#pragma_temp_store_directory Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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

2010-03-02 Thread Dan Kennedy
memory page, and the > following page is unallocated. (This was encountered when running > under Guard Malloc.) Shouldn't escarg[] contain a nul-terminated string? How did you provoke the error under Guard Malloc? Do you have a stack trace? I'm thinking the error might be caused by some bug in the caller. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] dynamic typing misunderstanding

2010-03-01 Thread Dan Kennedy
On Mar 1, 2010, at 6:08 PM, Alexey Pechnikov wrote: >> It would seem to me that asking [1='1'] *should* return false >> because the >> numeric and character string value domains are logically disjoint, >> so no value >> from one could ever equal a value from another, and so SQLite's >> answ

Re: [sqlite] Diagrams and ROLLBACK TO

2010-02-26 Thread Dan Kennedy
> update That's correct. But savepoint B is opened as well. That's the point of the excerpt - that savepoint B remains open. The difference is: BEGIN; ROLLBACK; /* Database state restored, transaction is no longer open */ vs: SAVEPO

Re: [sqlite] dynamic typing misunderstanding

2010-02-25 Thread Dan Bishop
Igor Tandetnik wrote: > eternelmangekyosharingan > > wrote: > >> I create the following table: >> sqlite> create table t1(a); >> sqlite> insert into t1 values(123456789.123456789); >> >> I ran the following commands: >> sqlite> select * from t1; >> 123456789.123457 >> sqlite> select typeof(a)

Re: [sqlite] File locking to harsh?

2010-02-19 Thread Dan Kennedy
On Feb 18, 2010, at 11:44 PM, Ian Jackson wrote: > Marian Aldenhoevel writes ("[sqlite] File locking to harsh?"): >> ~ # sqlite3 /test "create table A (B integer);" >> Error: database is locked >> >> An strace of that command is attached. The problem surfaces here, I >> think: >> >> open("/test

Re: [sqlite] SQLite 3.6.22 ATTACH no longer works for files outside the current working directory

2010-02-16 Thread Dan Kennedy
Y IS a string, then > it makes no > sense to call sqlite3ResolveExprNames() which CANNOT HANDLE a string. ResolveExprNames() should be a no-op on a string expression. So the call is not helpful, but shouldn't be causing you any problems. Dan. ___ sqlite-users m

Re: [sqlite] Crash in Rtree

2010-02-16 Thread Dan Kennedy
the on-disk node-size when connecting to an existing rtree structure. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Strange sqlite behaviour when calling from C

2010-02-16 Thread Dan Kennedy
o open or create a journal or temporary file. First guess is that you do not have permission to create a journal file. To write to a database sqlite requires permission to write to the directory the database file resides in, not just to write to the database file itself. Dan. > > Erik >

Re: [sqlite] very simple update query failure...

2010-02-11 Thread Dan Kennedy
On Feb 11, 2010, at 12:08 PM, jflaming wrote: > > I'm new to SQLITE. > I'm trying to update a series of text entries for book titles that > were > entered with underscores. I want to convert them to spaces. > I can run the query: > > select replace(title, '_', ' ') from books; > > and see the

Re: [sqlite] FTS3 segfaults and performance problems in the SQLite 3.6.22

2010-02-09 Thread Dan Kennedy
the returned snippet - but in your example it looks like the snippet would be near the end of the document anyhow). Case (2) unfortunately cannot be done entirely with info from the full-text index, as the full-text index only indexes terms by token position within each document, not by byte of

Re: [sqlite] Foreign keys and Temp Tables

2010-02-08 Thread Dan Kennedy
On Feb 9, 2010, at 8:54 AM, Paul Vercellotti wrote: > > > Hi there, > > Are there any restrictions in SQLite on foreign key references in > temporary tables? Is referential integrity enforced between temp > tables and persistent ones? (That is, does the referential integrity > checking ta

Re: [sqlite] How to discover the state of a statement

2010-02-05 Thread Dan Kennedy
On Feb 5, 2010, at 8:09 PM, Israel Lins Albuquerque wrote: > I want to now if a statement are in a valid row. I think the test is (sqlite3_data_count(pStmt)>0). http://www.sqlite.org/c3ref/data_count.html ___ sqlite-users mailing list sqlite-users

Re: [sqlite] Change in index optimizer bug with FTS3 between 3.6.21 and 3.6.22?

2010-02-05 Thread Dan Kennedy
pposed > to narrow down by docid first. That's true. And your proposal would improve performance for this kind of query. Because of the way FTS3 works internally, it's not quite as easy to implement as it should be though. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Having trouble with "Update"

2010-02-03 Thread Dan Kennedy
On Feb 4, 2010, at 5:20 AM, Ron Hudson wrote: > Pavel Ivanov wrote: >> String constants should be enclosed in single quotes. Double quotes >> are for identifiers. So in your case you make perfectly legal no-op >> action - update field R with value of field R, i.e. leave field R >> unchanged. >> >

Re: [sqlite] Bug Report

2010-01-30 Thread Dan Kennedy
> RecNo cid name typenotnull dflt_value pk > - --- -- --- --- -- -- >1 0 ID CHAR(32)0 (null) 0 >2 1 Active BOOLEAN 0 (null) 0 >3 2 Name VARCHAR(64) 0

Re: [sqlite] what are the limitations for IN() lists?

2010-01-29 Thread Dan Kennedy
On Jan 29, 2010, at 8:10 PM, Tim Romano wrote: > Dan, > Thanks for that detail about the b-tree for IN-list queries. When I > examine a query plan for a query like the one below: > > explain query plan > select * from title where id IN(10,20,30,40) > > the plan indicat

Re: [sqlite] sqlite3_finalize(transaction_stmt) nonsense ?

2010-01-28 Thread Dan Kennedy
for COMMIT_stmt and BEGIN_stmt. > Indeed performing these lines crashes the litelineup. Is it true, that > we must not finalize a statement prepared by > > sqlite3_prepare_v2(self->conn, "COMMIT ;", -1, &self->COMMIT_stmt, > NULL); > > or BEGIN IMMEDIATE ? No. Same rules apply as for all other statements. Each successful call to sqlite3_prepare_v2() must be matched by an sqlite3_finalize(). Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] what are the limitations for IN() lists?

2010-01-28 Thread Dan Kennedy
nd why the IN-list should have > to be avoided. It creates a temporary b-tree structure and inserts all the values in the IN(...) clause into it. Then for each row evaluating "? IN (...)" can be done with a single lookup in the b-tree. Dan. __

Re: [sqlite] what are the limitations for IN() lists?

2010-01-26 Thread Dan Kennedy
? I guess technically no. Temp tables are stored in a temporary file created in (and automatically removed from) the filesystem. If you drop a table the space will not be reclaimed until the connection is closed. It will be reused if you put data into another

Re: [sqlite] Append data to a BLOB field

2010-01-26 Thread Dan Kennedy
On Jan 26, 2010, at 4:15 PM, cp wrote: > I'd like to be able to append some data to a binary field (BLOB) > without reading the original data, concatenating it, and then setting > it all back. Is this possible? Append is not possible. But if you preallocate space using zeroblob() or similar, you

Re: [sqlite] Crash inside sqlite3_step

2010-01-25 Thread Dan Kennedy
On Jan 26, 2010, at 6:16 AM, Kavita Raghunathan wrote: > Following Sql query crashes in allocateCursor inside of sqlite3_step > > INSERT INTO EntityTbl (AttrName, AttrEnum, AttrType, AttrValue, > ReadWrite, Entity_id) VALUES(‘image_crc’, 6008, 16, ‘0’, 1, 34013184); > > I’m not able to get an u

Re: [sqlite] Possible memory-leaks in shell / FTS3

2010-01-22 Thread Dan Kennedy
e... > > Line numbers should correlate to version 3.6.22, but I've included the > name of the function the line is contained in just in case > > fts3_tokenizer1.c, function simpleNext, line 186 > fts3_porter.c, function porterNext, line 609 Thanks. Fixed here:

Re: [sqlite] fastest way to get the min/max

2010-01-20 Thread Dan Kennedy
On Jan 21, 2010, at 1:54 AM, Pavel Ivanov wrote: >> Why the difference in search time between searching individually and >> searching together? > > Apparently SQLite is not smart enough to optimize the search for both > min and max to make double entrance to the index - first from the > beginning

Re: [sqlite] rtree_i32

2010-01-18 Thread Dan Kennedy
on't be removed. It should be documented. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQL syntax diagrams

2010-01-15 Thread Dan Kennedy
On Jan 15, 2010, at 9:10 PM, Andy Gibbs wrote: > > 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? http://wiki.tcl.tk/21708 > > Regards > Andy > >

Re: [sqlite] Writes during sleep of backup_step

2010-01-13 Thread Dan Kennedy
;re backing up (i.e. is pDb in-memory)? I have a feeling that statement won't apply if the source db is an in-memory database. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] graphs and sql

2010-01-10 Thread Dan Bishop
Robert Citek wrote: > Hello all, > > Does anyone have any recommendations for books or other resources that > deal with working with graphs (i.e. vertexes and edges) using sql? > > For example, if I could store a graph in a sqlite database, I'd like > to query the database to know if the graph cont

Re: [sqlite] Import a other database. Search for the fastes way

2010-01-09 Thread Dan Bishop
Carsten Giesen wrote: > Now my question. > > I work on a way to have a cache DB from the Main Server on the PC of my > client. > In the case the server is down they can go on working. (Like Outlook and > Exchange) > > > > For the first time I have to copy a lot of data from the main server. > > I

Re: [sqlite] temp directory?

2010-01-07 Thread Dan Kennedy
> always > on disk regardless of settings. > Kinda makes the whole memory only temp_store useless. Hopefully this was fixed for 3.6.14: http://www.sqlite.org/src/info/38f8c5a14cd221af9e115a0fea689f2ff39e30e5 If you test it and find that the problem still exists, please send a "BUG:&

Re: [sqlite] BUG REPORT: 3.6.21;

2010-01-04 Thread Dan Kennedy
gt; I was trying to get the test triggerC-1.11 in triggerC.test to work > correctly; > The assert in btree.c at line 3699 in the routine sqlite3BtreeRollback > was > failing returning a 2000, rather than 0 > > assert( countWriteCursors(pBt)==0 ); How did you make this happen? Dan.

Re: [sqlite] BUG Report on sqlite 3.6.20 "Error in SQL parser between sqlite3.3.4 and sqlite3.6.20"

2009-12-29 Thread Dan Kennedy
On Dec 30, 2009, at 4:52 AM, Wilson, Ronald wrote: > I get the same error in 3.6.18, so probably the same solution > applies in 3.6.20. I got the query to work with a sub-select. Changed between 3.6.6 and 3.6.7 from the looks of things. > > SQLite version 3.6.18 > Enter ".help" for instruc

Re: [sqlite] fts3 issue with tokenizing of content during a query

2009-12-29 Thread Dan Kennedy
full-text index doesn't actually store the byte offsets returned by the tokenizer xNext() call, just the token number. So you have to re-tokenize to figure out the byte offsets required by snippet() or offsets(). Dan. > I expected the fts index to retain all of the token offsets/si

Re: [sqlite] SELECT from fts3 tokens, is it possible?

2009-12-28 Thread Dan Kennedy
a LOT > faster. FWIW, new versions do that. If you only read the docid/rowid column, the %_content table is not used by an FTS3 query. Dan. > > -scott > > > On Thu, Dec 24, 2009 at 12:30 AM, Max Vlasov > wrote: >> Thanks, Scott, >> >> I see proble

Re: [sqlite] A question

2009-12-25 Thread Dan Kennedy
On Dec 25, 2009, at 1:45 AM, wrote: > Hey Dan, > Please be patient with my English. I wonder if you would like to > tell me what > I am doing wrong. I use Borland C++ Builder 3.0, but it seems > impossible to me > to get sqlite3 up and running. I have included the sqlite

Re: [sqlite] sqlite3_prepare_v2

2009-12-24 Thread Dan Kennedy
On Dec 24, 2009, at 5:46 PM, Nick Shaw wrote: > I'd suggest having your own sqlite3.dll in your own application's > working folder, rather than relying on an existing version somewhere > on the PC already which could be any version! > > If you created your own DLL, why would you then want to

Re: [sqlite] FTS3 performance rowid vs docid

2009-12-20 Thread Dan Kennedy
ile in the other one it's read > from > the fts_content table, is this correct? Exactly correct. This was fixed after 3.6.21 was released: http://www.sqlite.org/src/ci/48c0db0eb2 Dan. > > Thanks! > Eric > >

Re: [sqlite] valgrind report (uninitialized byte) while committing large transaction

2009-12-18 Thread Dan Kennedy
Is this a known issue? At first glance this looks harmless. Might be nice to try to fix though. Does it happen with 3.6.21? If so, are you able to post an SQL script to reproduce the problem? Thanks, Dan. > > > > Thanks > > Vincent > > > > ==15065== > >

Re: [sqlite] custom fts3 tokenizer, used in read-only?

2009-12-18 Thread Dan Kennedy
; tokenizer I used to index the XHTML data. > > Does that seem reasonable? Probably. If you really can't use the same tokenizer in both for some reason. The tokens returned by parsing the RHS of the match operator will be compared using memcmp() to the tokens returned when parsing the in

Re: [sqlite] BUG: FTS3 in 3.6.21

2009-12-18 Thread Dan Kennedy
query is asking for the number of documents in > which > the two tokens appear in sequence (any column). > >> sqlite> select count(*) from file_text where file_text match >> 'content:"мтс-коннект"'; >> Error: SQL logic error or missing database

Re: [sqlite] Import feature requests

2009-12-13 Thread Dan Bishop
Simon Slavin wrote: > On 14 Dec 2009, at 5:13am, Walter Dnes wrote: > > >> The following might be options (compile time, config file, set manually; >> I don't care), but they should be available... >> > > It might be worth writing a separate sqlite3 import facility which just reads > a .c

Re: [sqlite] BUG: The FTS3 is broken in reliase 3.6.21

2009-12-10 Thread Dan Kennedy
logic error or missing database > > sqlite> select 1 from file_text where docid=1 and file_text match > 'document'; > Error: SQL logic error or missing database > > In previous versions these work fine. Thanks. Fixed here: http

Re: [sqlite] undefined reference to sqlite3_mutex_held

2009-12-09 Thread Dan Kennedy
ollect2: ld returned 1 exit status sqlite3_mutex_held() is only defined if SQLite is built with SQLITE_DEBUG defined. Looks like this was not the case when the library linked to by -lsqlite3 above was compiled. Dan. > > -- > Mierswa, Daniel > > If you still don't like it, that&#x

Re: [sqlite] USING bug

2009-12-09 Thread Dan Kennedy
quot; sqlite> CREATE TABLE t1(a int); sqlite> CREATE TABLE t2(a int); sqlite> CREATE TABLE t3(a int, b int); sqlite> INSERT INTO t1 VALUES(1); sqlite> INSERT INTO t2 VALUES(1); sqlite> INSERT INTO t3 VALUES(1, 1); sqlite> SELECT * FROM t1 LEFT

Re: [sqlite] Better example of fk mismatch problem

2009-12-06 Thread Dan Kennedy
]) REFERENCES [P_item] ([ColumnID]) ON UPDATE CASCADE ON DELETE FOREIGN KEY([ParentID]) REFERENCES [P_item] ([ItemID]) ON UPDATE CASCADE ON DELETE CASCADE, Dan. >> On Sun, 06 Dec 2009 00:05:28 -0700, Paul Shaffer >> wrote: >> >>> I found where I was g

Re: [sqlite] The next release of SQLite....

2009-12-03 Thread Dan Kennedy
FTS3 table behaves in the same way as the rowid column of an ordinary SQLite table, except that the values stored in the rowid column of an FTS3 table remain unchanged if the database is rebuilt using the VACUUM command." Dan. > > - John Brooks > > On T

<    7   8   9   10   11   12   13   14   15   16   >