On 21 Nov 2009, at 12:57am, Phil Longstaff wrote:

> I have an sqlite3 database where a SELECT hangs.  The statement is:
> 
> SELECT DISTINCT t.* FROM transactions AS t, splits AS s WHERE 
> s.tx_guid=t.guid 
> AND ((s.account_guid IN ('d076626fc5be59df7e592f8f0d66c7cd')))
> 
> Are there any tools to help me diagnose the problem?  I could download the 
> source and build with debug and try to trace my way through, but would prefer 
> some pre-built diagnostic/debug tools if possible.

I've no idea what's causing your problem so I'm asking questions at random.  
What's the deal with the double bracketing ?  I'm not insulting you, I'm 
curious and don't know if it's useful for something.  Try removing layers of 
the brackets in case it makes something work.

Are you executing this in your code, or in the sqlite3 command-line tool ?  If 
the former, please try the latter and see if you get the same result.

I would try using EXPLAIN on that command: just put 'EXPLAIN ' before the 
SELECT command and see what you get out.  It's possible that the EXPLAIN 
command will hang too.  Also there's EXPLAIN QUERY PLAN.

http://www.sqlite.org/lang_explain.html

If those hang you've almost certainly found a bug.  If they don't, it might 
still be a bug but it also might be corruption in your database.  Oh, by the 
way, use

PRAGMA integrity_check

on the database just in case it's corrupt in some weird way.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to