Re: [sqlite] heap corruption?

2009-04-06 Thread Dan
On Apr 7, 2009, at 10:45 AM, Tom Broadbent wrote: > hello - > > i'm using SQLite in an embedded application (WinCE) and i'm running > into what appears to a heap corruption issue. the access violation > happens at the following line (in pcache1Fetch): > > for(pPage=pCache->apHash[h];

[sqlite] heap corruption?

2009-04-06 Thread Tom Broadbent
hello - i'm using SQLite in an embedded application (WinCE) and i'm running into what appears to a heap corruption issue. the access violation happens at the following line (in pcache1Fetch): for(pPage=pCache->apHash[h]; pPage&>iKey!=iKey; pPage=pPage->pNext); mostly i'm curious what others

Re: [sqlite] Database handle(sqlite3_stmt)

2009-04-06 Thread Igor Tandetnik
"Joanne Pham" wrote in message news:677762.12434...@web90302.mail.mud.yahoo.com > Can we use one statement handle for both insert and select? Of course not. When you call sqlite3_prepare, you pass the query text and get back the statement handle. The query can't begin

Re: [sqlite] Select statements in the context of transactions.

2009-04-06 Thread Igor Tandetnik
"Rosemary Alles" wrote in message news:20a6b796-613b-4f5d-bfca-359d6b9fa...@ipac.caltech.edu > I want to speed up my app. Can I run SELECT statements within the > context of a transaction. Yes, but it's unlikely to make it run any faster. > If so, how does one handle the

[sqlite] Select statements in the context of transactions.

2009-04-06 Thread Rosemary Alles
I want to speed up my app. Can I run SELECT statements within the context of a transaction. If so, how does one handle the query results? I would assume this cannot be done with sql_prepare, sql_bind, sql_step? Would I *have* to use sql_exec - such that a callback can be specified to

Re: [sqlite] Database handle(sqlite3_stmt)

2009-04-06 Thread Joanne Pham
Sorry for not make it clear! I am talking about statement handle not the database handle. Can we use one statement handle for both insert and select? Thanks, JP From: Igor Tandetnik To: sqlite-users@sqlite.org Sent: Monday, April 6, 2009

Re: [sqlite] Database handle(sqlite3_stmt)

2009-04-06 Thread Igor Tandetnik
Joanne Pham wrote: > Is sqlite allowing to use the same datbase handle(sqlite3_stmt) for > both read and insert operation. Are you talking about database handle (sqlite3*) or statement handle (sqlite3_stmt*)? Your question is confusing. Yes, you can issue both SELECT and

[sqlite] Database handle(sqlite3_stmt)

2009-04-06 Thread Joanne Pham
Hi All, Is sqlite allowing to use the same datbase handle(sqlite3_stmt) for both read and insert operation. Basislly onehandle(sqlite3_stmt) is inside the transaction which hasn't commited yet and the same handle is used for the read of the same database. Is this ok to use one handle for both

[sqlite] Datatypes on the command line: can you simply rely on quote()?

2009-04-06 Thread Florian v. Savigny
I have been tinkering with writing an Elisp interface to SQLite via the command line tool (since I'm not smart enough to interfere with the guts of Emacs). As to data types, I had taken to bloating all queries by duplicating all columns with a "typeof(column)" statement. Having gotten this to

[sqlite] sqlite3 query optimization question

2009-04-06 Thread Rosemary Alles
Hullo everyone, I'm relatively new to sqlite. I have an optimization problem regarding an sql query. Background: I have a database with two tables one with -say- 12k rows of data, and the other with more. The first table (lets calls it A) has the following columns: source_id, x_pos, y_pos,

Re: [sqlite] Is it using an index?

2009-04-06 Thread Scott Baker
Gerry Snyder wrote: > Scott Baker wrote: >> I didn't realize "INTEGER PRIMARY KEY" was case sensitive. Thanks > > Are you sure what you used before did not have a typo, or the words in a > different order? Good question... must have been. Testing it: sqlite> CREATE TABLE foo (bar integer

Re: [sqlite] Is it using an index?

2009-04-06 Thread P Kishor
On Mon, Apr 6, 2009 at 3:11 PM, Scott Baker wrote: > Eric Minbiole wrote: >>> If I have a query: >>> >>> SELECT foo FROM bar WHERE id = 14; >>> >>> How can I see if that query is optimized to use an index, and which index >>> it's using. I thought if you did an EXPLAIN it

Re: [sqlite] Is it using an index?

2009-04-06 Thread Gerry Snyder
Scott Baker wrote: > I didn't realize "INTEGER PRIMARY KEY" was case sensitive. Thanks Are you sure what you used before did not have a typo, or the words in a different order? Gerry ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Is it using an index?

2009-04-06 Thread Scott Baker
Eric Minbiole wrote: >> If I have a query: >> >> SELECT foo FROM bar WHERE id = 14; >> >> How can I see if that query is optimized to use an index, and which index >> it's using. I thought if you did an EXPLAIN it would show that, but I'm not >> seeing it? Maybe it's not really using an index? >

Re: [sqlite] crash on sqlite3 mutex

2009-04-06 Thread Dan
On Apr 7, 2009, at 1:11 AM, Joanne Pham wrote: > Hi all, > I have the application is used sqlite 3.5.9 and the program is > crashed with the following strack trace: > #0 0x46b35300 in pthread_mutex_lock () from /lib/libpthread.so.0 > #1 0xb6def162 in sqlite3_mutex_enter (p=0x9aca00b6) at

Re: [sqlite] Is it using an index?

2009-04-06 Thread Eric Minbiole
> If I have a query: > > SELECT foo FROM bar WHERE id = 14; > > How can I see if that query is optimized to use an index, and which index > it's using. I thought if you did an EXPLAIN it would show that, but I'm not > seeing it? Maybe it's not really using an index? Use the command "EXPLAIN

[sqlite] Is it using an index?

2009-04-06 Thread Scott Baker
If I have a query: SELECT foo FROM bar WHERE id = 14; How can I see if that query is optimized to use an index, and which index it's using. I thought if you did an EXPLAIN it would show that, but I'm not seeing it? Maybe it's not really using an index? - Scott

[sqlite] crash on sqlite3 mutex

2009-04-06 Thread Joanne Pham
Hi all, I have the application is used sqlite 3.5.9 and the program is crashed with the following strack trace: #0  0x46b35300 in pthread_mutex_lock () from /lib/libpthread.so.0 #1  0xb6def162 in sqlite3_mutex_enter (p=0x9aca00b6) at ../src/mutex_unix.c:192 #2  0xb6e1ab96 in sqlite3_exec

Re: [sqlite] Simple Tokenizer in FTS3

2009-04-06 Thread Scott Hess
My suggestion would be to spin up a debugger and set a breakpoint on that loop and check to see if it's really doing what you think it is. If it is, break in the code doing the actual tokenization and see if it's being called as expected. Or scatter some printf() calls in there. It's

[sqlite] Simple Tokenizer in FTS3

2009-04-06 Thread Andy Roberts
Hi, I downloaded the amalgamation sources in order to create a build of sqlite with FTS3 enabled. The problem for me is that the default "simple" tokenizer is not behaving precisely how I want. In fact, I'd prefer if it wouldn't count punctuation as a delimeter, and stuck purely to whitespace.

Re: [sqlite] multiple row insert

2009-04-06 Thread MikeW
Igor Tandetnik writes: > > "Justin Lolofie" wrote > in message ... > > Is there syntax to do multiple row insert? Something like: > > > > insert into my_table (a,b,c) values ((1,2,3),(4,5,6)); > > > > The documentation for INSERT seems to imply this is not possible.

Re: [sqlite] busy_timeout() doesn't work

2009-04-06 Thread Dan
On Apr 6, 2009, at 5:02 AM, Alexander Batyrshin wrote: > Hello all, > I have found that busy_timeout doesn work in this case: > > --- > %< > > #include > #include > > > int check_error (int rc, char

Re: [sqlite] sqlite3_step() returning SQLITE_OK

2009-04-06 Thread Dan
On Apr 3, 2009, at 8:03 PM, Radcon Entec wrote: > According to the documentation, assuming I'm reading it correctly, > and assuming there are no locks on the database, and assuming the > query sent to sqlite3_prepare_v2() was valid, sqlite3_step() should > return either SQLITE_ROW or