Re: [sqlite] Using sqlite in multi fork() without threads

2013-01-07 Thread Dan Kennedy
On 01/07/2013 03:22 PM, Eduardo Morras wrote: Hi, I use sqlite in some of my projects. In one it follows a parent/multichild model (multifork). The database is managed by the parent, open close backups etc, opened before the fork, and after it the childs use the database connection. I don't

Re: [sqlite] Problems (maybe a bug) when creating a backup using the command line interface '.backup' command

2013-01-02 Thread Dan Kennedy
On 01/02/2013 03:27 PM, Marco ten Thije wrote: On 12/21/2012 05:18 PM, Dan Kennedy wrote: Thanks. I think it's this: http://www.sqlite.org/src/info/0cfd98ee20 Dan. Thanks. I have looked into ticket, but we also see this problem when the backup is written and read by the same SQLite version

Re: [sqlite] SQLite4 Performance

2013-01-01 Thread Dan Kennedy
On 01/31/2013 11:13 PM, Michael Black wrote: Do we still get to report bugs? I checked out the fossil repository fossil clone http://www.sqlite.org/src4 sqlite4.fossil I tried my insert test and ran into a problem. I'm running Redhat 5.7 gcc 4.4.4 This program dies (showing inserts/sec)

Re: [sqlite] SQLite4 Performance

2012-12-31 Thread Dan Kennedy
On 12/31/2012 11:03 AM, Cory Isaacson wrote: We are doing some basic tests of SQLite4, and the performance seems slow. We also tested LSM directly and got about the same results. The test is using an INSERT of two integers, or 2 strings in LSM. It starts at around 9000 INSERTs/second, then

Re: [sqlite] Problems (maybe a bug) when creating a backup using the command line interface '.backup' command

2012-12-21 Thread Dan Kennedy
On 12/21/2012 10:54 PM, Marco ten Thije wrote: What is the size of the two database files? The size of both files is 160768 bytes. Also, can we have the first 6 lines of each hex dump (i.e. enough to see the first 100 bytes)? The first bytes of the original database: 000 5153 694c

Re: [sqlite] Problems (maybe a bug) when creating a backup using the command line interface '.backup' command

2012-12-21 Thread Dan Kennedy
On 12/21/2012 08:46 PM, Marco ten Thije wrote: It returns 'ok': ./sqlite3 energy.sqlite SQLite version 3.7.15.1 2012-12-19 20:39:10 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> pragma integrity_check; ok sqlite> So, the original database looks ok. I have

Re: [sqlite] SQLite Version 3.7.15.1

2012-12-20 Thread Dan Kennedy
On 12/20/2012 01:26 PM, Patrik Nilsson wrote: Thank you for the release! I can't find sqlite-shell-linux-x86-3071501.zip and sqlite-doc-3071501.zip. Thanks. They are there now. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] BUG:"insert or replace" doesn't works for External Content FTS4 Tables

2012-12-07 Thread Dan Kennedy
On 12/07/2012 11:17 PM, Alexey Pechnikov wrote: What does the following: SELECT * FROM view_address_exists WHERE rowid=64402; sqlite>SELECT "sys_title:hash" FROM view_address_exists WHERE rowid=64402; "sys_title:hash" e9b4d0bcb5 But what does "SELECT * FROM ..." return? According to

Re: [sqlite] BUG:"insert or replace" doesn't works for External Content FTS4 Tables

2012-12-07 Thread Dan Kennedy
On 12/07/2012 06:17 PM, Alexey Pechnikov wrote: "insert or replace" doesn't trigger updating of the FTS index but only 'rebuild' do it: sqlite> .s address_fts0 CREATE VIRTUAL TABLE "address_fts0" USING fts4(content="view_address_exists", "sys_title:hash"); sqlite> select

Re: [sqlite] Custom collation method works for comparison, not for ORDER BY

2012-12-05 Thread Dan Kennedy
On 12/06/2012 06:11 AM, Niall O'Reilly wrote: On 05/12/12 21:12, Clemens Ladisch wrote: Do these queries give the correct result? select '100A' collate ipaddress< '127.0.0.1'; select '100A' collate ipaddress< ' ABCD'; I.e., does the collation function actually work?

Re: [sqlite] Tracing latencies

2012-12-05 Thread Dan Kennedy
ced GEOINT Solutions Operating Unit Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Dan Kennedy [danielk1...@gmail.com] Sent: Wednesday, December 05, 2012 10:27 AM To: sqlite-users@

Re: [sqlite] Tracing latencies

2012-12-05 Thread Dan Kennedy
Discussion of SQLite Database Subject: EXT :Re: [sqlite] Tracing latencies Hi Dan On Wed, Dec 5, 2012 at 6:38 PM, Dan Kennedy<danielk1...@gmail.com> wrote: If it's not fsync() then IO delays are normally caused by read(). You could try [strace -T -eread ...] to check. Are SELECT statement

Re: [sqlite] Tracing latencies

2012-12-05 Thread Dan Kennedy
On 12/05/2012 03:11 PM, Keith Chew wrote: Hi Dan On Wed, Dec 5, 2012 at 6:38 PM, Dan Kennedy<danielk1...@gmail.com> wrote: If it's not fsync() then IO delays are normally caused by read(). You could try [strace -T -eread ...] to check. Are SELECT statements fast on the same databas

Re: [sqlite] Tracing latencies

2012-12-04 Thread Dan Kennedy
On 12/05/2012 09:22 AM, Keith Chew wrote: On Wed, Dec 5, 2012 at 1:14 PM, Keith Chew wrote: Since there is no fsync (I know this using grep on the strace ouput), it is hard to tell what to look for in the strace. The output is very noisy, so it makes it hard to go through

Re: [sqlite] Persistence of -wal and -shm

2012-11-29 Thread Dan Kennedy
On 11/30/2012 12:04 AM, Simon Slavin wrote: I have a folder with 17 independent databases in, each of them opened for reading an writing occasionally. Two of them have both -wal and -shm files, even though they shouldn't have been opened for read or write for days, and the last opening of each

Re: [sqlite] Replace on fts4 table results in unexpected matchinfo result

2012-11-27 Thread Dan Kennedy
On 11/27/2012 11:42 AM, Eric wrote: The following SQL results in X'01000600'. For reference, "na" option should generate total number of documents and the average number of tokens per document. CREATE VIRTUAL TABLE IF NOT EXISTS fts USING fts4(body); REPLACE INTO fts ( docid, body )

Re: [sqlite] FTS substring behavior

2012-11-08 Thread Dan Kennedy
On 11/09/2012 01:49 AM, Paul Vercellotti wrote: Hi there, I wanted to clarify if FTS could provide any optimization for substring matches like '*ion*' or similar? No. I think it will actually search for tokens that start with the 4 ASCII characters "*ion" if you try that. Dan.

Re: [sqlite] Calling "ROLLBACK" outside transaction

2012-10-28 Thread Dan Kennedy
On 10/29/2012 07:35 AM, Igor Korot wrote: Hi, ALL, Will I be punished if I call ROLLBACK outside transaction? No. You will be rewarded with an error code though. To check if an SQLite connection has an open write-transaction: http://www.sqlite.org/c3ref/get_autocommit.html Dan.

Re: [sqlite] statement prepares OK but step returns SQLITE_NOTADB

2012-10-26 Thread Dan Kennedy
On 10/27/2012 07:06 AM, Simon Slavin wrote: On 26 Oct 2012, at 11:05pm, Clemens Ladisch wrote: Yes; sqlite3_finalize _always_ frees the statement. And if the statement is already finalized (due to an earlier error, perhaps) then it is a harmless noop. So you can do it

Re: [sqlite] I/O error on creating index with 3.7.14

2012-10-26 Thread Dan Kennedy
On 10/26/2012 12:14 PM, Jamie Norrish wrote: Using 3.7.14, when creating an index on a 27G database (on the table that contains almost all of the data), I consistently (on Windows XP and Debian GNU/Linux, on three different machines) get a disk I/O error. This does not happen using 3.7.13 (only

Re: [sqlite] FTS returns out of memory when use NEAR and OR

2012-10-24 Thread Dan Kennedy
On 10/24/2012 11:07 PM, Vlad Seryakov wrote: Hello For some time already i noticed that when i use NEAR/1 and OR in one query like SELECT * FROM search WHERE search MATCH 'tom NEAR/1 hanks or tom hanks' Are you able to share the database file that you use to reproduce this? Thanks. Dan.

Re: [sqlite] Transaction inside transaction

2012-10-21 Thread Dan Kennedy
On 10/22/2012 11:34 AM, Igor Korot wrote: Hi, ALL, Is it possible to have transaction inside transaction? Will it be handled correctly? What I mean is: crate transaction 1 by issuing "BEGIN", create transaction 2 by issuing "BEGIN". Close transaction 2 by issuing either "COMMIT" or "ROLLBACK".

Re: [sqlite] CREATE INDEX is 13 times slower with 3.7.14.1 than with 3.6.22

2012-10-21 Thread Dan Kennedy
Am 18.10.2012 16:49, schrieb Dan Kennedy: On 10/18/2012 03:32 PM, Imanuel wrote: Ok, here it is (45mb): http://www.file-upload.net/download-6707980/CREATE_INDEX_test.7z.html On Linux here 3.6.22 takes around 61 seconds. Against 23 for a new version. Are you able to reproduce the performance

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-20 Thread Dan Kennedy
On 10/20/2012 09:14 PM, Simon Slavin wrote: On 19 Oct 2012, at 9:40pm, Efim Dyadkin wrote: You are right about the purpose of unlink but it is out of context. There are a transaction in progress and hot journal on disk. If journal can't be deleted by the end of

Re: [sqlite] Begin immediate transaction -> SQLITE_BUSY (database is locked)

2012-10-19 Thread Dan Kennedy
On 10/18/2012 09:05 PM, Pavel Ivanov wrote: On Thu, Oct 18, 2012 at 6:32 AM, Daniel Polski wrote: The SELECT statement, including the _prepare() stage and all the _step()s until you've reached the last row, and then the _finalize(), is all one process. They're all part

Re: [sqlite] CREATE INDEX is 13 times slower with 3.7.14.1 than with 3.6.22

2012-10-18 Thread Dan Kennedy
On 10/18/2012 09:49 PM, Dan Kennedy wrote: On 10/18/2012 03:32 PM, Imanuel wrote: Ok, here it is (45mb): http://www.file-upload.net/download-6707980/CREATE_INDEX_test.7z.html On Linux here 3.6.22 takes around 61 seconds. Against 23 for a new version. Are you able to reproduce the performance

Re: [sqlite] CREATE INDEX is 13 times slower with 3.7.14.1 than with 3.6.22

2012-10-18 Thread Dan Kennedy
the database - it is currently uploading, I will mail the link tomorrow. Imanuel Am 17.10.2012 22:08, schrieb Dan Kennedy: On 10/18/2012 01:32 AM, Imanuel wrote: Hello I tested this on an SSD with a database with one single table with 5,553,534 entries: CREATE TABLE Namen(id INTEGER PRIMARY

Re: [sqlite] CREATE INDEX is 13 times slower with 3.7.14.1 than with 3.6.22

2012-10-17 Thread Dan Kennedy
On 10/18/2012 01:32 AM, Imanuel wrote: Hello I tested this on an SSD with a database with one single table with 5,553,534 entries: CREATE TABLE Namen(id INTEGER PRIMARY KEY, geonameid INTEGER, lang TEXT, name TEXT, pref INTEGER DEFAULT 0, short INTEGER DEFAULT 0, coll INTEGER DEFAULT 0,

Re: [sqlite] light weight write barriers

2012-10-12 Thread Dan Kennedy
On 10/11/2012 11:38 PM, Nico Williams wrote: On Wed, Oct 10, 2012 at 12:48 PM, Richard Hipp wrote: Could you list the requirements of such a light weight barrier? i.e. what would it need to do minimally, what's different from fsync/fdatasync ? For SQLite, the write barrier

Re: [sqlite] Combining user-defined functions with aggregate functions

2012-10-10 Thread Dan Kennedy
On 10/10/2012 10:09 PM, Hamish Allan wrote: On 10 October 2012 16:07, Dan Kennedy<danielk1...@gmail.com> wrote: On 10/10/2012 10:01 PM, Ryan Johnson wrote: On 10/10/2012 10:49 AM, Dan Kennedy wrote: The easiest workaround is probably to use a temp table to store the unaggregated r

Re: [sqlite] Combining user-defined functions with aggregate functions

2012-10-10 Thread Dan Kennedy
On 10/10/2012 10:01 PM, Ryan Johnson wrote: On 10/10/2012 10:49 AM, Dan Kennedy wrote: On 10/10/2012 08:14 PM, Hamish Allan wrote: Short form question: Working: SELECT a, userfunc(systemfunc) FROM t; Working: SELECT a, sum(systemfunc) FROM t GROUP BY a; Not working: SELECT a, sum(userfunc

Re: [sqlite] Combining user-defined functions with aggregate functions

2012-10-10 Thread Dan Kennedy
On 10/10/2012 08:14 PM, Hamish Allan wrote: Short form question: Working: SELECT a, userfunc(systemfunc) FROM t; Working: SELECT a, sum(systemfunc) FROM t GROUP BY a; Not working: SELECT a, sum(userfunc(systemfunc)) FROM t GROUP BY a; Long form question: I have a user-defined C function

Re: [sqlite] CREATE INDEX on huge DB fails with SQLITE_NOMEM

2012-10-09 Thread Dan Kennedy
On 10/09/2012 03:30 PM, Marcus Grimm wrote: Hello, I'm currently investigating how far I can go with my favorite DB engine. For that purpose I'm testing my application with an artificial database that is appx. 50 times bigger that the maximum I have seen in the field so far. The test creates a

Re: [sqlite] interesting deadlock.

2012-10-05 Thread Dan Kennedy
(using your example below)? That sounds like it will work around the problem. If db1 is using a private cache the problem cannot occur. Fix is here: http://www.sqlite.org/src/info/89b8c377a6 Should appear in 3.7.15. On Sep 28, 2012, at 1:49 AM, Dan Kennedy wrote: On 09/28/2012 03:32

Re: [sqlite] interesting deadlock.

2012-09-28 Thread Dan Kennedy
On 09/28/2012 03:32 AM, Jonathan Engle wrote: I've been picking away at this for the last few days and have it narrowed down fairly well. It looks like if I turn off shared cache, it works fine (same application code). If I run with SQL_DEBUG enabled, the first issue I run into in an assertion

Re: [sqlite] How much disk space is required to checkpoint?

2012-09-25 Thread Dan Kennedy
On 09/26/2012 05:48 AM, Simon Slavin wrote: On 25 Sep 2012, at 10:54pm, David Barrett wrote: If my database is X GB, and the WAL file is Y GB, how much total disk space is required to: 1) Checkpoint the database I think it's a maximum of X+Y+Y (including the

Re: [sqlite] Index not used in query

2012-09-20 Thread Dan Kennedy
On 09/20/2012 04:51 PM, Scholz Maik (CM-AI/PJ-CF42) wrote: Hi, I have a problem with a missing use of an index. My Example: sqlite> create table tab1 (o INT, a INT, b INT,UNIQUE(o,b)); sqlite> select * from sqlite_master; table|tab1|tab1|2|CREATE TABLE tab1 (o INT, a INT, b INT,UNIQUE(o,b))

Re: [sqlite] WAL, synchronous=1 and durability

2012-09-11 Thread Dan Kennedy
On 09/11/2012 11:03 PM, Daniel Frimerman wrote: In FULL mode, the above is sync'ed, although I don't know whether individual writes to the WAL file are sync'ed, or when all the data belonging to the commit is written the WAL is sync'ed. In NORMAL mode this is not done and that is why it is much

Re: [sqlite] [Question] Does it necessary to sync directory on persist journal mode?

2012-09-11 Thread Dan Kennedy
On 09/11/2012 02:22 PM, Yongil Jang wrote: Please, don't forget my questions. 2012/9/10 Yongil Jang Dear sqlite-users, I have a question about directory sync. Question: In case of journal file already exists on disk with persist journal mode, does it

Re: [sqlite] WAL, synchronous=1 and durability

2012-09-11 Thread Dan Kennedy
On 09/11/2012 01:21 PM, Keith Chew wrote: Hi Dan In both NORMAL mode, we do the following: 1. Write a bunch of transactions into the WAL file. 2. fsync() the WAL file. 3. Copy the data from the WAL file into the database file. 4. fsync() the database file. If a power failure

Re: [sqlite] WAL, synchronous=1 and durability

2012-09-10 Thread Dan Kennedy
On 09/11/2012 11:12 AM, Keith Chew wrote: Hi Jay In WAL mode that's only half incorrect. Your description of NORMAL seems correct, but FULL should be fully durable. The WAL file may need to be checkpointed on startup, but the if the commit happens in WAL/FULL, you should have

Re: [sqlite] Possible bug - journal_mode DELETE/TRUNCATE

2012-09-09 Thread Dan Kennedy
On 09/10/2012 03:15 AM, Daniel Frimerman wrote: My apologies about the attachment; should have known better. This should be better: https://dl.dropbox.com/u/50838941/SQLite3_Test.zip I only get the problem with DELETE and TRUNCATE journal_mode (synchronous set to NORMAL or FULL), but not with

Re: [sqlite] FTS4 - reversing the index to plain text

2012-09-04 Thread Dan Kennedy
On 09/04/2012 07:51 PM, Pavel Hlavnicka wrote: Dear all, we are using sqlite FTS4 to build a fulltext index on data which should not be available to the user without a decryption inside the application. FTS4 matches perfectly - we can use either contentless database or compress/uncompress

Re: [sqlite] SQLITE_MISUE returned from sqlite3_step with inconsistent errMsg

2012-08-31 Thread Dan Kennedy
On 08/31/2012 12:42 PM, Daniel Dawson wrote: Hey Guys, I am calling sqlite3_step and checking the return value, Usually I get an SQLITE_DONE, or an SQLITE_BUSY which I handle. However, sometimes I get an SQLITE_MISUSE return code. If I call sqlite3_errmsg straight after receiving the code

Re: [sqlite] foreign keys across database boundaries

2012-08-27 Thread Dan Kennedy
On 08/27/2012 03:44 PM, Baruch Burstein wrote: Can foreign keys or triggers be set between ATTACHed database tables? No. They can not. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Any plans to provide the sqlite3RunParser in the API

2012-08-14 Thread Dan Kennedy
On 08/14/2012 04:05 PM, Bishwa Shrestha wrote: On 08/13/2012 05:51 PM, Jay A. Kreibich wrote: On Mon, Aug 13, 2012 at 03:43:46PM +0200, Bishwa Shrestha scratched on the wall: Hi, I've recently started using sqlite3 c-library. I'm using the in-memory databases which are pretty fast since I'm

Re: [sqlite] Why "TRUNCATE TABLE" can't empty a table?

2012-08-14 Thread Dan Kennedy
On 08/14/2012 02:04 PM, daedae11 wrote: Following is my program: rc = sqlite3_exec(db, "TRUNCATE TABLE students;", NULL, NULL, ); DELETE FROM students; ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] MATCH multiple

2012-08-10 Thread Dan Kennedy
On 08/10/2012 12:48 PM, E. Timothy Uy wrote: I recently switched a table to FTS4. Usually I query this table using the IN operator, e.g., SELECT * FROM Table WHERE term IN (a,b,c) If I want to use MATCH, is my only option SELECT * FROM Table WHERE term MATCH 'a or b or c' I think

Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Dan Kennedy
On 08/03/2012 11:33 PM, Tobias Giesen wrote: Hello, thanks for the replies! A sample Mountain-unreadable file is here: http://www.superflexible.com/broken.sql Works fine under Snow Leopard. I get the same results when using my own application as when using /usr/bin/sqlite3. So, we can

Re: [sqlite] sqlite3 database unreadable on Mountain Lion

2012-08-03 Thread Dan Kennedy
On 08/03/2012 09:33 PM, Tobias Giesen wrote: Hello, here's a problem that's puzzling me. I have one particular type of database that has become unreadable on the new Mac OS 10.8. It must be related to the SQL structure. The error I get is "database disk image is malformed". But the same file,

Re: [sqlite] File is encrypted or not a database - checked header which is OK

2012-08-02 Thread Dan Kennedy
On 08/02/2012 02:43 PM, Wim Paulussen wrote: I have a database giving me the dreaded 'File is encryptes or not a database' command. I checked for the 'SQlite format 3' part, which is present. All other databases in the same directory work as expected, there are no journal files present, so I

Re: [sqlite] error in example rank function

2012-07-21 Thread Dan Kennedy
On 07/22/2012 05:39 AM, AJ ONeal wrote: Back to looking at http://www.sqlite.org/fts3.html#appendix_a Notice the line: if( nVal!=(1+nCol) ) goto wrong_number_args; nVal will always be 2 with the given use case: rank(matchinfo(documents), documents_data.weight) or in the previous

Re: [sqlite] unrecognized parameter: content=""

2012-07-21 Thread Dan Kennedy
On 07/21/2012 02:03 PM, AJ ONeal wrote: Weird: now that I've reproduced the error (using the script), I can no longer reproduce the successful execution: sqlite3 ':memory:' 'CREATE VIRTUAL TABLE t1 USING fts4(content="", a, b, c);' Hmm... yet when I open another terminal window it begins to

Re: [sqlite] Using the SQLite Online Backup AP

2012-07-09 Thread Dan Kennedy
On 07/10/2012 11:42 AM, Sreekumar TP wrote: In the description of the backup API, (http://www.sqlite.org/backup.html) , it is said "It cannot be used to copy data to or from in-memory databases." This statement identifies a shortcoming of the "old" method of creating backups (taking an

Re: [sqlite] Strange issue with sqlite 3.7.9

2012-07-04 Thread Dan Kennedy
On 07/04/2012 08:26 PM, Alan Chandler wrote: Due to hardware problems with my Debian Stable server, I have just upgraded to Ubuntu-Server 12.04. I have installed sqlite3 and when I ask it the version (with .version) it replies SQLite 3.7.9 2011-11-01 00:52:41

Re: [sqlite] Bug in sqlite3_step

2012-07-03 Thread Dan Kennedy
On 07/04/2012 03:30 AM, Jay A. Kreibich wrote: On Tue, Jul 03, 2012 at 04:26:42PM -0400, Richard Hipp scratched on the wall: Actually, you can bind on a DDL statement, but bindings are only valid for the lifetime of the statement itself, not for the whole lifetime of the object created by the

Re: [sqlite] Consequences of lexicographic sorting of keys in SQLite4?

2012-07-02 Thread Dan Kennedy
On 07/02/2012 04:29 PM, Niall O'Reilly wrote: On 29 Jun 2012, at 23:58, Richard Hipp wrote: But you know: How often do people use BLOBs as keys? What other SQL engines other than SQLite even allow BLOBs as keys? Are we trying to optimize something that is never actually used? For

Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-07-01 Thread Dan Kennedy
On 06/30/2012 04:27 AM, Jeff Archer wrote: Simon Slavin slavins at bigfraud.org Fri Jun 29 17:16:36 EDT 2012 Do you do the _prepare() first, then make a change to the database schema ? For instance Start of app Prepare the INSERT statement CREATE TABLE Bind the INSERT statement Step the

Re: [sqlite] How to avoid duplicate entries in FTS table?

2012-07-01 Thread Dan Kennedy
On 07/01/2012 05:17 PM, Navaneeth.K.N wrote: Hello, On Sun, Jul 1, 2012 at 2:27 PM, Petite Abeillewrote: On Jul 1, 2012, at 9:11 AM, Navaneeth.K.N wrote: Now, repeating a "pattern" and "id" combination is an error to me. There should be always one "pattern" to

Re: [sqlite] Odd insertion error FTS4 + ICU

2012-06-19 Thread Dan Kennedy
On 06/19/2012 04:28 AM, E. Timothy Uy wrote: > Dear Dan, > > With the change from U8_NEXT to U16_NEXT, I am able to insert 一日耶羅波安出. I > was also able to insert the rest of the data set (about 31000 more rows > containing both traditional and simplified Chinese). Is this an ICU error? > Seems like

Re: [sqlite] Odd insertion error FTS4 + ICU

2012-06-18 Thread Dan Kennedy
On 06/19/2012 03:39 AM, E. Timothy Uy wrote: > If anyone can unravel this mystery, it would be much appreciated. For now, > I inserted a comma - 一日、耶羅波安出 and it works. I suspect it must be somehow > that the sequence of bytes encodes another character, which throws the > tokenizer out of whack or

Re: [sqlite] Odd insertion error FTS4 + ICU

2012-06-18 Thread Dan Kennedy
On 06/19/2012 02:11 AM, E. Timothy Uy wrote: > I recompiled ICU using U_CHARSET_IS_UTF8 and the error persists. > > On Mon, Jun 18, 2012 at 11:45 AM, E. Timothy Uy wrote: > >> Hopefully someone has some insight on this. I am using FTS4 with >> tokenize=icu (and PRAGMA

Re: [sqlite] FTS Example Fails (matchinfo arguments)

2012-06-14 Thread Dan Kennedy
On 06/14/2012 01:27 PM, Sergei G wrote: I am running sqlite3 version 3.7.3 on debian. I run the following commands from fts3.html documentation page: CREATE VIRTUAL TABLE t1 USING fts4(a, b); INSERT INTO t1 VALUES('transaction default models default', 'Non transaction reads'); INSERT INTO t1

Re: [sqlite] (no subject)

2012-06-12 Thread Dan Kennedy
On 06/12/2012 05:41 PM, Nicholas Thompson wrote: Hi, I am new to SQLITE Would be using Microsoft VS 2008& 2010 Is it possible to safely use multiple threads in a process with each thread making its own connection to the same database rc = sqlite3_open("file::memory:?cache=shared",); Should

Re: [sqlite] Segmentation Fault when calling sqlite3_finalize

2012-05-31 Thread Dan Kennedy
On 05/31/2012 10:46 PM, Stephen Wood wrote: Hello all, I'm having some memory allocation difficulties while using the SQLite C API. The goal of the function that is currently giving me issues is just trying to read the column names from a table. Tip: Column names are available after

Re: [sqlite] What does "The use of the amalgamation is recommended for all applications." mean, precisely?

2012-05-24 Thread Dan Kennedy
On 05/24/2012 10:53 PM, Larry Brasfield wrote: On the support page http://www.sqlite.org/howtocompile.html, it says: "The use of the amalgamation is recommended for all applications." Is this a general recommendation, to use the amalgamated source file as the preferred way of including SQLite

Re: [sqlite] sqlite3_analyzer failing for large files

2012-05-23 Thread Dan Kennedy
On 05/23/2012 05:06 PM, Demper Delic wrote: When trying to analyze a 3.5 GB database file (which passes PRAGMA integrity_check) using the Windows analyzer provided in the download page, it fails immediately with an "Empty or malformed database: db.sqlite" error message. It works on some

Re: [sqlite] sqlite3_column_count vs. sqlite3_data_count

2012-05-16 Thread Dan Kennedy
On 05/16/2012 06:04 PM, Stephan Beal wrote: On Wed, May 16, 2012 at 1:02 PM, Dan Kennedy<danielk1...@gmail.com> wrote: Not so. It's the number of columns of data currently available. Which is sometimes the same as sqlite3_column_count() and sometimes zero. Can sqlite3_data_count() b

Re: [sqlite] sqlite3_column_count vs. sqlite3_data_count

2012-05-16 Thread Dan Kennedy
On 05/16/2012 05:57 PM, Petite Abeille wrote: On May 16, 2012, at 12:49 PM, Baruch Burstein wrote: sqlite3_column_count Number of columns. http://www.sqlite.org/c3ref/column_count.html sqlite3_data_count Number of rows. http://www.sqlite.org/c3ref/data_count.html Not so. It's the

Re: [sqlite] sqlite3_column_count vs. sqlite3_data_count

2012-05-16 Thread Dan Kennedy
On 05/16/2012 05:49 PM, Baruch Burstein wrote: sqlite3_column_count sqlite3_data_count What is the difference between the two? sqlite3_data_count() will return zero if the statement handle does not currently point to a row of data. For example if it has just been prepared or reset, or if the

Re: [sqlite] [sqlite-dev] Bad performance with foreign key contraint

2012-05-14 Thread Dan Kennedy
On 05/14/2012 10:39 AM, Jonas Malaco Filho wrote: I found this on the docs : If this SELECT returns any rows at all, then SQLite concludes that deleting the row from the parent table would violate the foreign key constraint and returns an error. Similar

Re: [sqlite] Two-line patch to fix memory leak

2012-05-11 Thread Dan Kennedy
On 05/11/2012 11:28 PM, Eric Sink wrote: In sqlite3Fts3Matchinfo(): Near the end of the function, I added two lines: if( rc!=SQLITE_OK ){ sqlite3_result_error_code(pContext, rc); }else{ int n = pCsr->nMatchinfo * sizeof(u32); sqlite3_result_blob(pContext, pCsr->aMatchinfo, n,

Re: [sqlite] Data race (file race) in pager

2012-05-04 Thread Dan Kennedy
On 05/04/2012 11:21 PM, Paul Thomson wrote: I am working on a tool that (among other things) can detect data races, including file access races. I have detected a file race in SQLite on the database file that appears to be real, although I am not certain - I have no experience with SQLite. I

Re: [sqlite] SQLITE Header access

2012-05-03 Thread Dan Kennedy
On 05/04/2012 12:52 AM, Igor Tandetnik wrote: On 5/3/2012 1:42 PM, msantha wrote: I am using sqlite in my application only for read access. But someone else might open and modify the same database. You may know this doesn't happen, but SQLite doesn't. The DB gets hit often by my application

Re: [sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Dan Kennedy
On 04/14/2012 03:14 AM, Steinar Midtskogen wrote: Puneet Kishor writes: If you want the results in separate columns, you can do something like SELECT Min(a) minimum, 'none' maximum FROM t UNION ALL SELECT 'none' minimum, Max(a) minimum FROM t; Then it does a full scan

Re: [sqlite] Unicode problem when setting PRAGMA journal_mode

2012-04-11 Thread Dan Kennedy
On 04/11/2012 09:50 PM, Nick Shaw wrote: -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: 10 April 2012 19:04 To: General Discussion of SQLite Database Subject: Re: [sqlite] Unicode problem when setting

Re: [sqlite] Foreign Key Problems

2012-04-03 Thread Dan Kennedy
On 04/03/2012 11:18 PM, Pete wrote: Thanks you SImon. I see this is because the version of sqlite3 I have does not support foreign keys. I am running OS X 10.6.8 and sqlite3 comes with the OS. Does anyone know where I can get a version of sqlite3 for OS X that does support foreign keys? It

Re: [sqlite] Simultaneous opening of database sometimes fails even with 1 second timeout and only 2 processes

2012-04-03 Thread Dan Kennedy
On 04/03/2012 04:20 PM, Gregory Petrosyan wrote: On Tue, Apr 3, 2012 at 12:53 PM, Dan Kennedy<danielk1...@gmail.com> wrote: As a side note: why does not SQLite automatically retry implicit transactions after invoking busy handler? It's a race. That's what SQLITE_BUSY means. As Ja

Re: [sqlite] Simultaneous opening of database sometimes fails even with 1 second timeout and only 2 processes

2012-04-03 Thread Dan Kennedy
On 04/03/2012 12:48 PM, Gregory Petrosyan wrote: On Mon, Apr 2, 2012 at 7:51 PM, Jay A. Kreibich wrote: On Mon, Apr 02, 2012 at 07:40:58PM +0400, Gregory Petrosyan scratched on the wall: Hello, I am experiancing a weird problem: sometimes (1 time in a 10-100) when 2

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Dan Kennedy
On 04/02/2012 07:22 AM, Pete wrote: I'm running into an issue with foreign keys where no matter what value I supply for a child key, I get a foreign key mismatch error. Here are my test tables. "foreign key mismatch" indicates a schema problem. Usually a missing index. See here:

Re: [sqlite] [patch] sqlite-3.7.11: valgrind errors in testsuite

2012-03-31 Thread Dan Kennedy
On 03/31/2012 04:04 PM, Yuriy Kaminskiy wrote: valgrind ./testfixture test/trigger7.test Note: line numbers below are off-by-2. trigger7-2.1... Ok trigger7-2.2...==11533== Invalid read of size 1 Seems always reproducible. Thanks for reporting this. These tests are run with valgrind as part

Re: [sqlite] xBestIndex/xFilter Bug(?) when using LIKE "F%"

2012-03-29 Thread Dan Kennedy
On 03/23/2012 03:59 PM, Kurt Keller wrote: I have a virtual table implementation, that implements the xBestIndex/xFilter funktions and I found the following problem: This query SELECT * FROM vf WHERE field LIKE "F%"; will result in a call to xBestIndex with the following constraint

Re: [sqlite] Possible bug? Primary key not created for CREATE TABLE(id INTEGER primary key);

2012-03-25 Thread Dan Kennedy
On 03/25/2012 02:07 PM, Neo Anderson wrote: See the following result: sqlite> select * from sqlite_master order by type; type|name|tbl_name|rootpage|sql index|sqlite_autoindex_t_1|t|4| index|sqlite_autoindex_t3_1|t3|7| table|t|t|2|CREATE TABLE t(id int primary key, key, value)

Re: [sqlite] slightly confusing documentation on limits.html page

2012-03-24 Thread Dan Kennedy
On 03/23/2012 01:19 AM, Jeff Robbins wrote: Item 12 on the limits page (http://www.sqlite.org/limits.html) states that a maximum SQLite database size is about 140 terabytes. But item 13 on the same page refers to 14 terabytes as the maximum. The calculation given in item 12 yields this value:

Re: [sqlite] Do we need locking with multithread off ?

2012-03-18 Thread Dan Kennedy
On 03/18/2012 01:12 PM, Arnav Aggarwal wrote: On Sun, Mar 18, 2012 at 11:19 AM, Dan Kennedy<danielk1...@gmail.com> wrote: On 03/18/2012 11:26 AM, Arnav Aggarwal wrote: On Sat, Mar 17, 2012 at 12:07 PM, Arnav Aggarwal< arnav.aggarwal.2...@gmail.com> wrote: On Sat,

Re: [sqlite] Do we need locking with multithread off ?

2012-03-17 Thread Dan Kennedy
On 03/18/2012 11:26 AM, Arnav Aggarwal wrote: On Sat, Mar 17, 2012 at 12:07 PM, Arnav Aggarwal< arnav.aggarwal.2...@gmail.com> wrote: On Sat, Mar 17, 2012 at 11:51 AM, Roger Binnswrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 16/03/12 22:50, Arnav

Re: [sqlite] Sqlite compile options for multithreaded application

2012-03-14 Thread Dan Kennedy
On 03/14/2012 06:09 PM, rahul dev wrote: Guys, I am using sqlite version 3.7.10. My application is multi-threaded and each thread opens a separate connection to the the same database file. I want my database operations to be thread-safe and as concurrent as possible. Can you please tell

Re: [sqlite] Backup API handling of corrupt source DB

2012-03-07 Thread Dan Kennedy
On 03/07/2012 06:22 PM, Marcus Grimm wrote: Dear list, I'm using the backup api to frequently backup a running sqlite database. I'm wondering if the backup API is able to detect a corrupt database or will it simply also backup a corrupt DB ? Backup just copies pages. It will not detect

Re: [sqlite] Once again about file change counter

2012-03-06 Thread Dan Kennedy
On 03/06/2012 06:45 PM, Max Vlasov wrote: On Tue, Mar 6, 2012 at 2:37 PM, Dan Kennedy<danielk1...@gmail.com> wrote: On 03/06/2012 02:41 PM, Max Vlasov wrote: But for correct work this vfs should rely on the fact that file change counter will stay the same until the final

Re: [sqlite] Once again about file change counter

2012-03-06 Thread Dan Kennedy
On 03/06/2012 02:41 PM, Max Vlasov wrote: Hi, there are some ideas for vfs implementation that would require tracking file change counter. As I recall, I asked about specific api for working with file change counter, and seems like there was no such. On the other side it looks like it's not a

Re: [sqlite] SELECT COUNT (DISTINCT column_name FROM table)

2012-03-02 Thread Dan Kennedy
sqlite3_prepare (db=, zSql=, nBytes=-1, ppStmt=, pzTail=0x0) at sqlite3.c:24831 rc = 21104640 #5 0x00466730 in sql_stmt (db=9, stmt=0xffc0) at /localhome/user/a/b/c/d/e/f/g/h/k.c:496 errmsg = 0x0 retval = __PRETTY_FUNCTION__ = "\000\000\000\000\000\000\0

Re: [sqlite] SELECT COUNT (DISTINCT column_name FROM table)

2012-03-01 Thread Dan Kennedy
On 03/01/2012 10:54 PM, Sreekumar TP wrote: version 3.7.7.1 The query works on x86, but fails on MIPS processor! Are you able to post a stack trace? Ideally generated by the gdb "where full" command. Thanks. Dan. Sreekumar On Thu, Mar 1, 2012 at 7:00 PM, Dan Kenned

Re: [sqlite] SELECT COUNT (DISTINCT column_name FROM table)

2012-03-01 Thread Dan Kennedy
On 03/01/2012 05:48 PM, Sreekumar TP wrote: In my system, the statement causes sqlite3parser function to crash. My compiler is mips , little endian, gcc version is 4.5.2 SQLite version? 3.7.10 seems Ok here. Dan. ___ sqlite-users mailing list

Re: [sqlite] Is it possible to reduce the number of times sqlite3BTreeMoveToUnpacked is called with an SQLITE C++ application?

2012-02-28 Thread Dan Kennedy
On 02/28/2012 04:29 PM, Frank Chang wrote: Good morning, We have a SQLITE C++ application which tries to find the intersection between the blobs in separate sqlite database tables(which we call subgraphs) ,containing record numbers. When we profile the code below we find that the top

Re: [sqlite] FTS simple tokenizer

2012-02-28 Thread Dan Kennedy
On 02/28/2012 12:09 AM, Jos Groot Lipman wrote: It was reported before (and not solved) http://www.mail-archive.com/sqlite-users@sqlite.org/msg55959.html The document sources are updated now. So the fix will appear on the website next time it is regenerated.

Re: [sqlite] FTS simple tokenizer

2012-02-26 Thread Dan Kennedy
On 02/27/2012 05:59 AM, Hamish Allan wrote: The docs for the simple tokenizer (http://www.sqlite.org/fts3.html#tokenizer) say: "A term is a contiguous sequence of eligible characters, where eligible characters are all alphanumeric characters, the "_" character, and all characters with UTF

Re: [sqlite] SQLite3 FTS4 matchinfo() problem

2012-02-24 Thread Dan Kennedy
On 02/23/2012 10:22 PM, Felix Timm wrote: Dear Sir or Madam, I am using the FTS4 module of SQLite3 and have a problem with the Example of the matchinfo() auxiliary function. At the moment I am just trying to run the matchinfo() example from http://www.sqlite.org/fts3.html#matchinfo and it

Re: [sqlite] xFilter or xBestIndex needs to know which columns were selected

2012-02-24 Thread Dan Kennedy
On 02/24/2012 02:02 PM, Steinar Midtskogen wrote: Hello Is it possible to find out in xFilter or xBestIndex which columns were selected? That is, if I do "SELECT a, b, c FROM t" where t is a virtual table, I would like to know in xFilter or xBestIndex that the result will only consist of the

Re: [sqlite] synchronization issue: no directory sync after unlink

2012-02-23 Thread Dan Kennedy
On 02/23/2012 06:02 PM, Florent Bayendrian wrote: Hi, I have a synchronization issue on an embedded device running Linux : if a power shutdown is done just after a commit, sqlite will restore the database to the previous state using the journal file. At the end of a transaction the unlink of

Re: [sqlite] Problem with LIKE and greek characters

2012-02-22 Thread Dan Kennedy
On 02/22/2012 03:53 PM, Robert Gdula wrote: Hi, I've problem with greek characters when I'm using SQLite, it's no working, but for English charaters is ok, problem it is only for LIKE, when I use WHERE for greek characters it's working ok, how to resolve this problem ? SQLite's built-in LIKE

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