Re: [sqlite] FTS4 code from the website

2011-06-29 Thread Dan Kennedy
On 06/30/2011 10:31 AM, Ryan Henrie wrote: > Reference Page: http://www.sqlite.org/fts3.html#appendix_a > > At the bottom of the page, there is a sample c file to calculate the > rank, and a FTS query to use it. I can't get it to work. > > You can see my files here: > >

Re: [sqlite] Indexes on columns

2011-06-24 Thread Dan Kennedy
On 06/24/2011 12:26 PM, logan...@gmail.com wrote: > Hello, > > My understanding is that an index is automatically created on any column > that is used in the primary key (or a composite index is created if the key > is composed of different columns). If this is correct then why don't I see >

Re: [sqlite] Sqlite3 WAL (file is encrypted or is not a database, database table is locked, database disk image is malformed') at high load

2011-06-23 Thread Dan Kennedy
On 06/23/2011 12:11 PM, Anoop K wrote: > I am using sqlite3(sqlite-3.7.0.1) with WAL enabled as storage for a > multiprocessing daemon(python). On doing a BULK insert of .5 million rows > each of size 230 bytes in batches of 500 where each batch is a transaction, > following errors happen in other

Re: [sqlite] Bug in composite foreign key constraints.

2011-06-10 Thread Dan Kennedy
On 06/11/2011 12:08 AM, Max wrote: > CREATE TABLE TestTable ( > id integer primary key, > name varchar, > source_id integer not null, > parent_id integer, > foreign key(source_id, parent_id) references TestTable(source_id, id) > ); > > CREATE UNIQUE INDEX testindex on

Re: [sqlite] Bug in composite foreign key constraints.

2011-06-10 Thread Dan Kennedy
On 06/10/2011 10:33 PM, Max wrote: > I just grabbed a 3.7.6.3 binary from the sqlite page. The second schema > still fails to throw a constraint error. Hopefully fixed here: http://www.sqlite.org/src/info/442d8d8bfe Grab the zip file from the "Zip Archive" link on the above page. Dan.

Re: [sqlite] What is so slow on dropping tables?

2011-06-01 Thread Dan Kennedy
On 06/01/2011 02:18 AM, Jan Hudec wrote: > Hellow folks, > > At $work we have an application that processes *huge* (tens of millions of > rows in some of the larger tables, sometimes over 30GiB file size). This > application changes and when it does, it drops some tables and calculates > them

Re: [sqlite] FTS4 reserved characters

2011-06-01 Thread Dan Kennedy
On 06/01/2011 06:30 AM, Mohd Radzi Ibrahim wrote: > Hi, > I was searching for any reference to reserved characters used in FTS4, but > failed to find any. > > I have problem with query with - ftstable match 'width 5" ' > > But it's ok with - ftstable match 'width 5' > > to fix this, I replaces

Re: [sqlite] Addition: Re: SQLite locking question

2011-05-06 Thread Dan Kennedy
On 05/06/2011 05:53 PM, Ole Reinhardt wrote: > Hi Dan, > >>> I have to correct myself a little... the hanging sqlite3_open_v2() does >>> not happe while the prepare of the first query but during the first >>> sqlite3_step() of the first query... >> >> Each shared-cache has a mutex associated with

Re: [sqlite] Addition: Re: SQLite locking question

2011-05-06 Thread Dan Kennedy
On 05/06/2011 05:17 PM, Ole Reinhardt wrote: > Hi all, > > I have to correct myself a little... the hanging sqlite3_open_v2() does > not happe while the prepare of the first query but during the first > sqlite3_step() of the first query... Each shared-cache has a mutex associated with it. When

Re: [sqlite] Virtual tables and OR clause

2011-05-04 Thread Dan Kennedy
On 05/04/2011 08:58 PM, Schrum, Allan wrote: > Hi Folks, > > Using virtual tables the WHERE clause is broken up and sent to the "best > index" function to determine the best index. Then the "filter" function is > called to perform the actual work. I've noticed that the SQLITE engine seems > to

Re: [sqlite] select * on empty virtual table

2011-04-29 Thread Dan Kennedy
On 04/29/2011 11:15 PM, Joseph Stockman wrote: > > We have tried a null pointer, a zero-length static, a dummy static and > strings created on the heap via sqlite3_mprintf. > All cause the same segmentation fault. Run your app under valgrind. Post the errors it finds if they don't make the

Re: [sqlite] No journal vs WAL journal

2011-04-26 Thread Dan Kennedy
On 04/26/2011 08:13 AM, Nikolaus Rath wrote: > Nikolaus Rath writes: > [ WAL Performance ] >> Really no one an idea of why this is happening? > > I tried to investigate this further myself and created a small example > program (attached). It fills a table with 500,000 entries

Re: [sqlite] Problems while upgrading to 3.7.3

2011-04-21 Thread Dan Kennedy
On 04/21/2011 05:42 PM, Gaurav Srivastava wrote: > Hi > > I have recently upgraded my sqlite version from 3.5.1 to 3.7.3. With the > update I have been seeing some issues with sqlite3_prepare_v2() API. > The workflow here is: > sqlite3VdbeSetSql(pVDbe, zSql, saveSqlflag) > ^ > | >

Re: [sqlite] sqlite-3.7.6.1 coredump/hang

2011-04-16 Thread Dan Kennedy
On 04/15/2011 05:35 PM, Thomas Klausner wrote: > On Fri, Apr 15, 2011 at 04:32:08PM +0700, Dan Kennedy wrote: >> How are you building sqlite3? Using configure/make from the >> sqlite-autoconf-3070601.tar.gz package on the website? > > Yes, using pkgsrc. What happens if

Re: [sqlite] sqlite-3.7.6.1 coredump/hang

2011-04-15 Thread Dan Kennedy
On 04/15/2011 04:08 PM, Thomas Klausner wrote: > On Fri, Apr 15, 2011 at 01:42:00PM +0700, Dan Kennedy wrote: >> Are there any other threads in the process? > > My program is not using threads. > sqlite3 is linked against libpthread. I don't think it's using threads &g

Re: [sqlite] sqlite-3.7.6.1 coredump/hang

2011-04-15 Thread Dan Kennedy
On 04/15/2011 01:32 PM, Thomas Klausner wrote: > On Fri, Apr 15, 2011 at 01:20:11PM +0700, Dan Kennedy wrote: >> Can you post the stack-trace from the core file? With debugging >> symbols if possible. > > Sorry, the backtrace is unusable: > (gdb) bt > #0 __nanosleep50

Re: [sqlite] sqlite-3.7.6.1 coredump/hang

2011-04-15 Thread Dan Kennedy
On 04/15/2011 12:27 PM, Thomas Klausner wrote: > Hi! > > With 3.7.6 and 3.7.6.1 on NetBSD-5.99.49/amd64, a program I'm using > started dumping core. Can you post the stack-trace from the core file? With debugging symbols if possible. > Perhaps non-standard options used during compilation are >

Re: [sqlite] FTS4 compress/uncompress functions

2011-04-13 Thread Dan Kennedy
On 04/13/2011 02:49 PM, Alexey Pechnikov wrote: > What type of value return _uncompress_? The original content may be > blob or text, so uncompress may return blob I think... Or we need to > store in compressed field the type of this. I guess that is correct. uncompress() should return the same

Re: [sqlite] FTS4 compress/uncompress functions

2011-04-12 Thread Dan Kennedy
On 04/13/2011 06:22 AM, Alexey Pechnikov wrote: > Which functions will be correct? As example, affinity for uncompress > functions can be as "blob" as "text". Now this is not important but > some tests will be nice for future compability. You mean what type of value should compress() return? Any

Re: [sqlite] User function calculates for every row before applying any where condition

2011-04-11 Thread Dan Kennedy
On 04/11/2011 05:32 PM, Enrico Thierbach wrote: > > On 11.04.2011, at 10:18, Maxim V. Shiyanovsky wrote: > >> Does SQlite (3.6.23.1 to be precise) perform any optimization when user >> function appears in the statement? >> >> I defined custom function MY_FUNC(a TEXT, b TEXT) and bound it with >>

Re: [sqlite] test/exists.test 2.$tn.1 fails if both DBs are in WAL mode

2011-04-10 Thread Dan Kennedy
>> For me, this test from test/exists.test fails if both database >> connections are opened in WAL mode, that is if "PRAGMA journal_mode=WAL" >> is issued right after each DB is opened. >> >># TABLE objects. >># >>do_test { >> sql1 { DROP TABLE IF EXISTS t1 } >>

Re: [sqlite] Can't load sqlite 3.75 under tcl 8.4.4.0

2011-04-10 Thread Dan Kennedy
On 04/10/2011 11:43 AM, thoselai...@shaw.ca wrote: > % package require sqlite > couldn't load library "C:/Tcl/lib/sqlite3/sqlite3/.dll": this library or a > dependent library could not be found in library path > > What is sqlite3/.dll ? > Where did that "/" come from? > > The pkgindex file

Re: [sqlite] Disabling a unique index

2011-04-08 Thread Dan Kennedy
On 04/08/2011 04:42 PM, Jaco Breitenbach wrote: > Dear experts, > > My application makes use of a SQLite table with a unique index. During > normal processing, the unique index is used to ensure no duplicate records > are entered into the table. However, at regular intervals large numbers of >

Re: [sqlite] Problem with incremental_vacuum and WAL

2011-04-05 Thread Dan Kennedy
On 04/05/2011 04:49 PM, Filip Navara wrote: > Hello, > > we are having problem with database that originated on computer of one > of our customers. > > The database is used in WAL mode with auto_vacuum=1 and page_size=1024. > > When running the "pragma incremental_vacuum(1);" command the WAL file

Re: [sqlite] BEGIN DEFERRED TRANSACTION causes core dump in a heavily periodic load with BEGIN EXCLUSIVE/IMMEDIATE TRANSACTION in version 3.7.5

2011-04-05 Thread Dan Kennedy
On 04/06/2011 01:39 AM, ChingChang Hsiao wrote: > I believe it is a bug in 3.7.5. It didn't happen in 3.6.22. It causes core > dump when using "BEGIN DEFERRED TRANSACTION" in one of our application to > access DB periodically(every 1 second) . There are other applications access > the same DB

Re: [sqlite] Full Text Search

2011-03-26 Thread Dan Kennedy
On 03/26/2011 02:18 PM, Sumesh KS wrote: > Hi, > > I am Sumesh, student from india. I currently doing a project using qt > and sqlite. I want to implement Full Text Search in that project. > Anyone please tell me, from where i start to learn FTS and it's > working and how it is implemented.

Re: [sqlite] "transaction" method of the Tcl bindings to SQLite

2011-03-24 Thread Dan Kennedy
On 03/24/2011 07:23 PM, Richard Hipp wrote: > On Wed, Mar 23, 2011 at 7:05 AM, Jean-Marie CUAZ wrote: > >> Hello, >> >> In a Tcl script, is it safe to call the Tcl "_return_" command inside >> and before the end of a multi-statement "_transaction_" method (for >> aborting the

Re: [sqlite] PRAGMA cache_size problem

2011-03-23 Thread Dan Kennedy
On 03/23/2011 03:26 PM, Jaco Breitenbach wrote: > Dear experts, > > I have compiled sqlite-autoconf-3070500 on a RedHat Linux machine. My > application is written in C, so uses the SQLite C interface. > > At startup I connect to an admin datafile, and then attach 20 more datafiles > to the

Re: [sqlite] Best approach for xBestIndex/xFilter effectiveness

2011-03-22 Thread Dan Kennedy
On 03/23/2011 01:07 AM, Jay A. Kreibich wrote: > On Tue, Mar 22, 2011 at 06:25:04PM +0700, Dan Kennedy scratched on the wall: > >> SQLite assumes that the result of each expression in the WHERE >> clause depends only on its inputs. If the input arguments are >> the same,

Re: [sqlite] Best approach for xBestIndex/xFilter effectiveness

2011-03-22 Thread Dan Kennedy
On 03/22/2011 04:26 PM, Max Vlasov wrote: > Hi, > > recently I finally started experimenting with virtual tables and there's at > least one thing I can not understand. > > As I see xBestIndex/xFilter were developed to allow fast searching if the > implementation is able to do this. But there's

Re: [sqlite] "Error: disk I/O error" on big databases vacuuming

2011-03-08 Thread Dan Kennedy
On 03/08/2011 11:51 PM, Alexey Pechnikov wrote: > I try to vacuum database about 11Gb size on debian squeeze host with 1,5 Gb > RAM: > > sqlite3 test.db 'vacuum;' > Error: disk I/O error > > Note: any new files does not created on vacuuming process (may be > created journal, does not it?). > >

Re: [sqlite] long insert statement failing on iPhone

2011-02-28 Thread Dan Kennedy
On 02/26/2011 09:37 AM, Mickey Mestel wrote: > hi all, > > new to the list. > > we are compiling the sqlite.c amalgamation file into our project, as we > want to encrypt the database, and the sqlite that comes with the iOS sdk does > not allow for that. > > we are developing on

Re: [sqlite] Reason for random names for the master journal?

2011-02-25 Thread Dan Kennedy
>> For example, say you have two databases in a transaction - mine.db >> and yours.db. A crash happens while committing the transaction >> and the file mine.db-mjMASTER is left in the file-system. >> >> Following recovery, if a process tries to read mine.db, the >> transaction on mine.db will be

Re: [sqlite] Reason for random names for the master journal?

2011-02-25 Thread Dan Kennedy
On 02/26/2011 12:30 AM, Johns Daniel wrote: > What is the reason was for having random filenames for the SQLite > master journal file (like mine.db-mj501CA440, mine.db-mj1C17, > mine.db-mj66677495, etc)? > > Here is the reason for this strange question. We have discovered that > the JFFS2

Re: [sqlite] Upgrade from 3.5.8 -> 3.7.5 - increase memory usage

2011-02-20 Thread Dan Kennedy
On 02/21/2011 09:38 AM, Simon Slavin wrote: > > On 21 Feb 2011, at 1:47am, Roger Binns wrote: > >> On 02/20/2011 02:48 PM, Todd Shutts wrote: >>> The application >>> never used more than 10MB and it is currently using 57+MB and continues >>> to climb. >> >> The single most likely explanation is

Re: [sqlite] FTS slowdown with matchinfo

2011-02-17 Thread Dan Kennedy
On 02/17/2011 05:41 AM, Iker Arizmendi wrote: > Dan Kennedy wrote: >> >> Can you make the database available for download? And >> supply the exact query you are using too? I'd like to >> know why this is. Thanks. >> >> Dan. >> > > You ca

Re: [sqlite] foreign key on delete no action

2011-02-16 Thread Dan Kennedy
> foreign key ChildTable (ChildColumn1, ChildColumn2) > references ParentTable (ParentColumn1, ParentColumn2) > on delete no action > > I have a few questions: > > 1. What does SQLite do if the action is just left blank? Does it have the > same affect as explicitly writing

Re: [sqlite] FTS slowdown with matchinfo

2011-02-15 Thread Dan Kennedy
On 02/16/2011 12:50 AM, Iker Arizmendi wrote: > Hello all, > > I'm running into what seems like an abnormally large > performance drop on on some FTS queries that use > matchinfo when compared to those that don't. > > I created an FTS table using the following: > > CREATE VIRTUAL TABLE test >

Re: [sqlite] UPDATE WITH ORDER BY LIMIT ERROR

2011-02-15 Thread Dan Kennedy
On 02/15/2011 06:04 PM, venkat easwar wrote: > Forgot to mention what error I am getting. > > near "order": syntax error > near "limit": syntax error - if i remove the order by clause See under the "Optional LIMIT and ORDER BY Clauses" heading on this page:

Re: [sqlite] upgrading DB from 3.6.23 to 3.7.5

2011-02-11 Thread Dan Kennedy
On 02/11/2011 08:08 PM, Sam Carleton wrote: > On Fri, Feb 11, 2011 at 6:54 AM, Philip Graham Willoughby< > phil.willoug...@strawberrycat.com> wrote: > >> Hi Sam, >> >> On 11 Feb 2011, at 05:29, Sam Carleton wrote: >>> I am sure it is bad form, but attached is one of the 3.6.23 DB, it is >> only

Re: [sqlite] determine SQLITE_MAX_LENGTH or sql_limit/sqlite3_limit

2011-02-09 Thread Dan Kennedy
On 02/10/2011 01:56 AM, Vannus wrote: > Zeoslib is reading sqlite field lengths incorrectly, as it checks for > brackets after the field typename ie. CHAR(123) > presumably this is only affecting me because I haven't defined field lengths > in my sqlite3 db. > > I don't want to hard-code

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-09 Thread Dan Kennedy
> I didn't find a way yet to reproduce the issue with a "clean" database. > Only way I can reproduce it is with some of the database, like the > test.db3. So I'm running out of ideas. This is the theory. test.db3 is an auto-vacuum database. http://www.sqlite.org/src/info/89b8c9ac54 Dan.

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-09 Thread Dan Kennedy
On 02/10/2011 12:10 AM, Dan Kennedy wrote: > On 02/09/2011 08:17 PM, Dennis Geldhof wrote: >> I checked some things for the attached database. It is created with >> sqlite version 3.6.3 or 3.6.23.1 with the help of the system.data.sqlite >> wrapper. The header displays (with

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-09 Thread Dan Kennedy
On 02/09/2011 08:17 PM, Dennis Geldhof wrote: > I checked some things for the attached database. It is created with > sqlite version 3.6.3 or 3.6.23.1 with the help of the system.data.sqlite > wrapper. The header displays (with the ./showdb) version 3.7.4, so it is > opened and changed with a

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-08 Thread Dan Kennedy
On 02/08/2011 10:24 PM, Dennis Geldhof wrote: >> -Original Message- >> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >> boun...@sqlite.org] On Behalf Of Dan Kennedy >> Sent: dinsdag 8 februari 2011 14:51 >> To: sqlite-users@sqlite.org >>

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-08 Thread Dan Kennedy
On 02/08/2011 08:26 PM, Dennis Geldhof wrote: >> -Original Message- >> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- >> boun...@sqlite.org] On Behalf Of Dan Kennedy >> Sent: dinsdag 8 februari 2011 12:33 >> To: sqlite-users@sqlite.org >>

Re: [sqlite] database disk image is malformed 3.7.x

2011-02-08 Thread Dan Kennedy
On 02/08/2011 06:00 PM, Dennis Geldhof wrote: > Hi all, > > > > I experienced some strange behavior between different versions of > sqlite. Our application uses the System.Data.Sqlite wrapper > (http://sqlite.phxsoftware.com/) which is on sqlite version 3.6.23.1, > but the tools we use to view the

Re: [sqlite] Multithreading problem

2011-02-04 Thread Dan Kennedy
On 02/04/2011 01:04 AM, Tiberio, Sylvain wrote: > You're right! > > I checked the Solaris documentation the correct flag to compile > multithread program is -D_REENTRANT. > > I have reconfigured and remade sqlite libs: >./configure --enable-threadsafe CFLAGS=-D_REENTRANT >make > > I have

Re: [sqlite] Trigger for incrementing a column is slow

2011-02-04 Thread Dan Kennedy
On 02/04/2011 03:24 PM, Kevin Wojniak wrote: > > On Feb 3, 2011, at 10:35 PM, Dan Kennedy wrote: > >> Do you have a test program that we can use to reproduce this phenomenon? >> >> Dan. > > Here is a complete program: > http://pastie.org/pastes/1527560 &g

Re: [sqlite] Trigger for incrementing a column is slow

2011-02-03 Thread Dan Kennedy
On 02/04/2011 06:01 AM, Kevin Wojniak wrote: > On Feb 3, 2011, at 2:27 PM, Jim Wilcoxson wrote: > >> On Thu, Feb 3, 2011 at 5:07 PM, Kevin Wojniak wrote: >> >>> >>> On Feb 3, 2011, at 11:41 AM, Petite Abeille wrote: >>> On Feb 3, 2011, at 6:53 PM, Kevin Wojniak wrote:

Re: [sqlite] Multithreading problem

2011-02-03 Thread Dan Kennedy
in multi-threaded apps? Something like -D_POSIX_C_SOURCE=199506L or -mt perhaps? Is SQLite being compiled with the same thread-related switches as the rest of the app? Dan. > > Sylvain > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun.

Re: [sqlite] Multithreading problem

2011-02-03 Thread Dan Kennedy
occurs in Sparc/Solaris 10 system. > - After my program error, the file try.db exists and has the correct > right -rw-r--r--, correct owner/group and a null size. > > Regards, > > Sylvain > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sq

Re: [sqlite] Multithreading problem

2011-02-03 Thread Dan Kennedy
On 02/02/2011 09:31 PM, Tiberio, Sylvain wrote: > Hi! > > > > I have a problem when I try to create a new database in a thread and try > to add a table on it. > > > > The following C code (see in the end of this e-mail) produces: The program is working Ok with 3.7.5 here. After the IO error in

Re: [sqlite] WAL for single user database on NFS and Solaris

2011-01-31 Thread Dan Kennedy
On 01/31/2011 11:53 AM, Shawn Wilsher wrote: > On Sun, Jan 30, 2011 at 8:26 PM, Dan Kennedy<danielk1...@gmail.com> wrote: >> If you set "PRAGMA locking_mode=EXCLUSIVE" before reading or >> writing the WAL-mode database it might work. > That would make u

Re: [sqlite] WAL for single user database on NFS and Solaris

2011-01-30 Thread Dan Kennedy
On 01/30/2011 10:06 AM, Ginn Chen wrote: > I think a single process accessing a single Sqlite database at a time over > NFS is supposed to be fine. > > But it is not working on Solaris. > On Solaris, man page of mmap() has > > EAGAINThe file to be mapped is already locked using >

Re: [sqlite] Query question

2011-01-25 Thread Dan Kennedy
On 01/25/2011 09:47 PM, Ian Hardingham wrote: > Hey guys. > > I have the following table: > > ratingsTable (id INTEGER PRIMARY KEY AUTOINCREMENT, mtId INTEGER, user > TEXT, rating INTEGER); > > mtId links to another table's primary key > > I wish to have a query which gives me the mtId which is

Re: [sqlite] EXTERNAL:Re: SQLite version 3.7.5 - code freeze

2011-01-25 Thread Dan Kennedy
On 01/25/2011 07:30 PM, Black, Michael (IS) wrote: > Yes -- MSVC spits out a bunch of constant expression warnings. Most are > bogus (e.g. while (1)). I looked at them all. > > In this case if it's a compile-time option (which it is) wouldn't you > normally put it in an #if block? Normally.

Re: [sqlite] SQLite version 3.7.5 - code freeze

2011-01-24 Thread Dan Kennedy
On 01/25/2011 12:20 PM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 01/24/2011 06:05 PM, Roger Binns wrote: >> I'm finding custom VFS code is no longer working at all. > > The cause is a new xFileControl operation SQLITE_FCNTL_SYNC which appears to > needlessly

Re: [sqlite] SQLite version 3.7.5 - code freeze

2011-01-24 Thread Dan Kennedy
On 01/25/2011 04:10 AM, Black, Michael (IS) wrote: > Is this if statement meant to be constant? Or should it be comparing the > requested encoding instead of SQLITE_UTF16NATIVE? > > SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){ >int c; >unsigned char const *z = zIn;

Re: [sqlite] JOIN bug in 3.7.2, not in 3.6.22

2011-01-17 Thread Dan Kennedy
> -- if endtime is in a different position in the table, the query works > CREATE TABLE interval (endtime INTEGER, entryid INTEGER, starttime INTEGER); > CREATE TABLE entry (id INTEGER PRIMARY KEY AUTOINCREMENT); > > INSERT INTO entry (id) VALUES ( 42); > > INSERT INTO interval (endtime,

Re: [sqlite] Understanding EXPLAIN QUERY

2011-01-16 Thread Dan Kennedy
On 01/17/2011 06:36 AM, Sam Carleton wrote: > I am trying to optimize a query by using the EXPLAIN QUERY, but the > documentation on the web (http://www.sqlite.org/eqp.html) does not match the > version of SQLite I am using (v3.6.23.1). The documentation says there are > three columns, but I am

Re: [sqlite] How to track a record if the aliased id is changed

2011-01-13 Thread Dan Kennedy
On 01/13/2011 02:31 AM, Max Vlasov wrote: > Hi, > for queries like UPDATE ... WHERE rowid=... one can in most cases reread the > record (based on the rowid) and keep for example the cursor in the grid at > the same record. But what if one of changed field is aliased to rowid, is > there a way to

Re: [sqlite] long running INSERT (up to now ~ 11 hours and still working)

2011-01-11 Thread Dan Kennedy
On 01/11/2011 03:00 PM, Oliver Peters wrote: > Hello, > > I'm on WinXP and using sqlite 3.7.4 with the CLI. I try to insert ~ 10,100,000 > records into a schema with different tables (http://pastebin.com/cbsPHNEj). > The > db file has already 1.9 GB when I start the INSERTs via > > sqlite3 -bail

Re: [sqlite] BUSY on COMMIT when EXCLUSIVE is held is an unexpected result

2010-12-17 Thread Dan Kennedy
On 12/17/2010 07:54 PM, Ben Harper wrote: > I have this case: > > Thread 1 Thread 2 > -- > BEGIN EXCLUSIVE > BEGIN EXCLUSIVE -> BUSY > ... etc ... > BEGIN EXCLUSIVE -> BUSY > COMMIT >

Re: [sqlite] WAL index in memory - multiple connections

2010-12-09 Thread Dan Kennedy
On 12/09/2010 04:08 PM, Yoni Londner wrote: > Hi, > > I want to use the feature that enable WAL to use heap memory instead of > shared memory for WAL index. > Using locking_mode=exclusive is not good enough option, since I want to > access the DB from two threads, and with locking_mode=exclusive I

Re: [sqlite] Problem with disableTerm() and virtual tables

2010-12-07 Thread Dan Kennedy
> > When I attempt to perform a certain join (shown below), the disableTerm > function fails in the ALWAYS assertion, because the wtFlags field already has > the TERM_CODED bit set. As far as I can tell, it is looking at the first > constraint in the ON clause of the LEFT JOIN, possibly for

Re: [sqlite] FTS3 bug?

2010-12-07 Thread Dan Kennedy
On 12/08/2010 04:18 AM, Iker Arizmendi wrote: > The function that opens a cursor for the simple tokenizer, > simpleOpen, does not set the "pTokenizer" member of the > returned cursor. Ie, it appears the following line is > missing: > > c->base.pTokenizer = pTokenizer; > > which causes

Re: [sqlite] WAL file size

2010-12-07 Thread Dan Kennedy
On 12/07/2010 09:49 PM, Yoni Londner wrote: > Hi, > > Yes, in this scheme the checksum is based on salt values and own frame > content.a > > Note that the current design solve a potential DB corruption bug in > sqlite. current WAL design is base on the fact that once sqlite writes > pages

Re: [sqlite] Assertion failure in SQLite 3.7.3 (new vs. 3.6.23.1)

2010-12-04 Thread Dan Kennedy
On 12/04/2010 12:54 AM, Philip Graham Willoughby wrote: > On 2 Dec 2010, at 20:43, Sylvain Pointeau wrote: > >> Hi, >> >> I am on macosx sqlite 3.7.3 >> >> $ /usr/local/bin/sqlite3 test.db3 >> SQLite version 3.7.3 >> Enter ".help" for instructions >> Enter SQL statements terminated with a ";" >>

Re: [sqlite] WAL file size

2010-12-02 Thread Dan Kennedy
In the current WAL format, the checksum for each frame is based on the contents of the frame, the salt-values in the wal header and the checksum of the previous frame. In this scheme is each frame checksum independent? i.e. each frame checksum is computed based only on the salt values in the WAL

Re: [sqlite] EXPLAIN QUERY PLAN

2010-11-30 Thread Dan Kennedy
On 11/30/2010 11:38 PM, Duquette, William H (316H) wrote: > I've just discovered EXPLAIN QUERY PLAN; it looks quite useful, but one part > of the output is somewhat opaque. > > The command returns three columns: order, from, and detail. "order" is > evidently the order in which the indices are

Re: [sqlite] WAL mode and backup API

2010-11-30 Thread Dan Kennedy
> BTW: > Is there any chance that in the future the wal mode > will avoid that the backup API will restart on DB > changes during the backup loop ? > Currently, even in wal mode, it does restart when changes > are detected while the backup is ongoing. What happens if you open a read transaction

Re: [sqlite] WAL mode and backup API

2010-11-30 Thread Dan Kennedy
On 11/30/2010 05:03 PM, Marco Bambini wrote: > Hello, > > if a running sqlite database is in WAL mode and a backup is performed on that > db using the sqlite3_backup API, does that process is considered like a > reader and can proceed concurrently with other readers and with the other > writer?

Re: [sqlite] searching with like on FTS3

2010-11-29 Thread Dan Kennedy
On 11/30/2010 12:09 AM, boscowitch wrote: > Hi recently I noticed that i can't search with the like '%searchword%' > syntax on an FTS3 virtual table. > > And with "match" i can't search on example sentences (the indexed data > is a japanese dictionary an therefore has no spaces in example

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

2010-11-26 Thread Dan Kennedy
On 11/25/2010 09:04 PM, Simon Slavin wrote: > > On 25 Nov 2010, at 2:00pm, Dan Kennedy wrote: > >> In WAL mode with synchronous=NORMAL, when the user commits >> a transaction, it is written into the WAL file. No sync >> until a checkpoint happens. So if the power f

Re: [sqlite] Assertion failure in SQLite 3.7.3 (new vs. 3.6.23.1)

2010-11-25 Thread Dan Kennedy
On 11/25/2010 03:45 PM, Philip Graham Willoughby wrote: > Hi all, > > I'm noticing a new failure with SQLite 3.7.3 as compared to the previous > version I was using, 3.6.23.1. Are you able to share the database and the query that causes the assert() to fail?

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

2010-11-25 Thread Dan Kennedy
On 11/25/2010 08:49 PM, Simon Slavin wrote: > > On 25 Nov 2010, at 8:36am, Dan Kennedy wrote: > >> On 11/25/2010 03:24 PM, Twylite wrote: >>> > > Argh. Trevor, I'm going to find Stephenie Meyer and do something she doesn't > like. > >>> I am se

Re: [sqlite] autoindex1 test fail on linux debian

2010-11-25 Thread Dan Kennedy
On 11/25/2010 02:43 PM, Yoni wrote: > Hi, > > I get the following fail when running sqlite3 tests, under linux debian, > with TCL 8.4. > Code is latest from fossil. > Any help appreciated. Try with 8.5 or newer. ___ sqlite-users mailing list

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

2010-11-25 Thread Dan Kennedy
On 11/25/2010 03:24 PM, Twylite wrote: > Hi, > > I am seeking technical information on the durability of transactions > with journal_mode=WAL and synchronous=NORMAL. > > Specifically, in the event of a power failure, can the following ever > happen: > (1) Loss of the last transaction completed. >

Re: [sqlite] NO_GETTOD

2010-11-22 Thread Dan Kennedy
On 11/22/2010 11:48 PM, Black, Michael (IS) wrote: > Bug in 3.7.3? > gcc -c -DNO_GETTOD sqlite3.c > sqlite3.c: In function âunixCurrentTimeInt64â: > sqlite3.c:27870: error: âiâ undeclared (first use in this function) > sqlite3.c:27870: error: (Each undeclared identifier is reported only once >

Re: [sqlite] Compile 64bit version of SQLIte on Solaris?

2010-11-22 Thread Dan Kennedy
On 11/22/2010 03:25 PM, Lynton Grice wrote: > Hi there, > > That does not work, I tried that already. > > # /usr/local/bin/gcc -m64 -D_FILE_OFFSET_BITS=64 -c -fPIC -DHAVE_USLEEP > sqlite3.c > sqlite3.c:1: sorry, unimplemented: 64-bit mode not compiled in > # > > And I am on a 64-bit Solaris box...

Re: [sqlite] Custom collating sequences and performance

2010-11-18 Thread Dan Kennedy
On 11/19/2010 05:22 AM, Duquette, William H (316H) wrote: > On 11/18/10 2:16 PM, "Drake Wilson" wrote: > > Quoth "Duquette, William H (316H)", on > 2010-11-18 14:08:10 -0800: >> It seems to me that it shouldn't be necessary for SQLite to

Re: [sqlite] Trouble with TRIGGERS

2010-11-16 Thread Dan Kennedy
On 11/16/2010 06:25 AM, Bernard Ertl wrote: > Hi, > > I'm experiencing some performance issues with triggers at the moment and > hoping someone can help shed some light on what is happening. > > I have a database with ~20 tables and>100 triggers. I noticed a severe > performance degradation

Re: [sqlite] Strange WAL mode on 5GB+ database

2010-11-11 Thread Dan Kennedy
On Nov 11, 2010, at 3:47 AM, Alexey Pechnikov wrote: > $ ls -lh merch.db* > -rw-r--r-- 1 - - 5,8G Ноя 10 23:01 merch.db > -rw-r--r-- 1 - - 32K Ноя 10 23:04 merch.db-shm > -rw-r--r-- 1 - - 449M Ноя 10 23:01 merch.db-wal > > sqlite> pragma journal_mode; > wal > sqlite> pragma

Re: [sqlite] INSERT OR IGNORE with rtree virtual tables

2010-11-08 Thread Dan Kennedy
>> In the shell: >> >> SQLite version 3.7.3 >> Enter ".help" for instructions >> Enter SQL statements terminated with a ";" >> sqlite> CREATE VIRTUAL TABLE a_rt USING rtree( _id, min_x, max_x, >> min_y, max_y ); >> sqlite> INSERT OR IGNORE INTO a_rt ( _id, min_x, max_x, min_y, >> max_y ) >>

Re: [sqlite] Query planner bug on "distinct" clause

2010-11-08 Thread Dan Kennedy
On Nov 8, 2010, at 5:12 AM, Alexey Pechnikov wrote: > sqlite> .s object_record > CREATE TABLE object_record > ( > record_id INTEGER PRIMARY KEY, > ts INTEGER NOT NULL DEFAULT (strftime('%s','now')), > object_id INTEGER NOT NULL > ); > CREATE INDEX object_id_ts_idx on

Re: [sqlite] A question about transactions

2010-11-04 Thread Dan Kennedy
On Nov 4, 2010, at 1:30 AM, Igor Tandetnik wrote: > Pavel Ivanov wrote: >>> Yes. That's precisely the intended use case. Remember though that >>> the transaction is not really committed until COMMIT statement >>> runs: if your application crashes or machine loses power,

Re: [sqlite] Mistake in threadtest3.c

2010-11-02 Thread Dan Kennedy
On Nov 2, 2010, at 5:12 PM, Andy Gibbs wrote: > Hi, > > I was looking at the diff to threadtest3.c in recent commit at > http://www.sqlite.org/src/fdiff?v1=58df1e3c060f534f=d6d209190c7110f9 > , and > I think I may have spotted an mistake in the code at the end of the > function > "static void

Re: [sqlite] BUG

2010-10-26 Thread Dan Kennedy
On Oct 26, 2010, at 2:22 PM, Alexey Pechnikov wrote: >> But view_user statement makes no attempt to select the last >> version. It > picks some arbitrary random version. You might want to consider > something > like this: > > Why you wrote about "some arbitrary random version" when we have

Re: [sqlite] Foreign key on different database - possible?

2010-10-20 Thread Dan Kennedy
On Oct 20, 2010, at 4:47 PM, Frank Millman wrote: > Dan Kennedy wrote: >> >> On Oct 20, 2010, at 3:59 PM, Frank Millman wrote: >> >>> Hi all >>> >>> I am using SQLite 3.7.2 on Fedora 10. >>> >>> I have multiple databases, which

Re: [sqlite] Foreign key on different database - possible?

2010-10-20 Thread Dan Kennedy
On Oct 20, 2010, at 3:59 PM, Frank Millman wrote: > Hi all > > I am using SQLite 3.7.2 on Fedora 10. > > I have multiple databases, which I can access concurrently by using > the > 'attach' command, and then referring to each table using > 'database.tablename'. It works well. > > Now I want to

Re: [sqlite] Scaling of Cache

2010-10-18 Thread Dan Kennedy
On Oct 19, 2010, at 9:01 AM, Doug wrote: > I'm not going to pretend to understand the SQLite source, but it seems > like having a mutex per PCache1 (ie the param passed in to > pcache1Fetch > and other cache functions) would be a good approach instead of the > global > mutex. But that

Re: [sqlite] Attach on disk database to memory database

2010-10-15 Thread Dan Kennedy
On Oct 15, 2010, at 11:40 PM, Schoinya wrote: > > Hello everybody > > I'm trying to attach on disk database to in memory database. > > But I get the strange error : SQLite error unrecognized token: ":" > > The following is the code: > >SQLiteConnection connInMemory = new >

Re: [sqlite] TestFixture 3.7.2 - Some WAL tests fail on QNX OS

2010-10-15 Thread Dan Kennedy
apNew[0], iRegion*szRegion, MS_SYNC); > void *pMem = mmap(0, szRegion, PROT_READ|PROT_WRITE, > MAP_SHARED, pShmNode->h, pShmNode->nRegion*szRegion > ); > > With the above msync() call all my failed test cases are passing. > > I don't see any msync()

Re: [sqlite] Just want to double check on index need

2010-10-14 Thread Dan Kennedy
On Oct 14, 2010, at 11:56 PM, Alan Chandler wrote: > On 14/10/10 17:28, Dan Kennedy wrote: >> >> On Oct 14, 2010, at 10:43 PM, Alan Chandler wrote: >>> CREATE TABLE div_winner_pick ( > ... >>> PRIMARY KEY (cid,confid,divid,uid) >>> ); > >

Re: [sqlite] Just want to double check on index need

2010-10-14 Thread Dan Kennedy
On Oct 14, 2010, at 10:43 PM, Alan Chandler wrote: > I am porting an application (American Football Results Picking > Competition) over from a Postgres databaseo to SQLite which involves > some fairly intense queries. I am doing this partially to do some > performance comparisons although I

Re: [sqlite] TestFixture 3.7.2 - Some WAL tests fail on QNX OS

2010-10-14 Thread Dan Kennedy
be really confident though - there may be race conditions lurking... Thanks for looking into this. Dan. > > This is all my understanding and not sure if this is causing the > actual issue. Please guide me if my approach/understanding is > incorrect. > > > Thanks, > P

Re: [sqlite] handling of BLOB bound parameters

2010-10-14 Thread Dan Kennedy
On Oct 14, 2010, at 5:43 PM, Jens Miltner wrote: > I just stumbled across a problem where sqlite would be stuck for > quite a long time inside sqlite3VdbeExpandSql when using bound BLOB > parameters, i.e. my query looks like > > INSERT INTO foo VALUES (?,?,?,?...) > > and one of the

Re: [sqlite] TestFixture 3.7.2 - Some WAL tests fail on QNX OS

2010-10-08 Thread Dan Kennedy
On Oct 8, 2010, at 9:44 PM, Raj, Praveen wrote: > Hello, > > I debugged the SQLite functions and here is my finding: > > The call to "mmap" in the function "unixShmMap" is causing the issue. > void *pMem = mmap(0, szRegion, PROT_READ|PROT_WRITE, > MAP_SHARED, pShmNode->h,

Re: [sqlite] [BUG] JOIN subquery in FROM with FTS3 table

2010-10-07 Thread Dan Kennedy
On Oct 7, 2010, at 5:50 PM, Shopsland gmail wrote: > Hi, > > Given this simple query with a subquery in FROM and a join with a > FTS3 table: > > SELECT news1.number, fts_news.title > FROM (SELECT number FROM news LIMIT 50) as news1, fts_news > WHERE news1.number=fts_news.docid > > The query

<    5   6   7   8   9   10   11   12   13   14   >