[sqlite] Issues with

2010-09-14 Thread Nimish Nayak
I was trying to figure out how to export the Database as an SQL File.

I came across sqlite3_backup but it copies Db to Db. But i failed to get the
Db to sql file as dont by SqliteBrowser

I can achieve this using .dump or .bachup in sqlite cli but how should i do
it using the C API's ?

-- 
Mr. Nimish Nayak
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Issues with

2010-09-14 Thread Simon Slavin

On 14 Sep 2010, at 9:55am, Nimish Nayak wrote:

> I was trying to figure out how to export the Database as an SQL File.
> 
> I came across sqlite3_backup but it copies Db to Db. But i failed to get the
> Db to sql file as dont by SqliteBrowser
> 
> I can achieve this using .dump or .bachup in sqlite cli but how should i do
> it using the C API's ?

Write your own code to create a text file.  Or script the command-line tool to 
do it for you by issuing the '.dump' command on the command-line.

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


[sqlite] documentation errors

2010-09-14 Thread Oliver Peters
doubled words
-

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

"occurs on on one or more specified columns of a table."


needless round bracket
--

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

"
(
IGNORE
"


Oliver

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


Re: [sqlite] Importing csv to SQLite

2010-09-14 Thread Konrad J Hambrick


Roger Binns wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On 09/13/2010 04:06 PM, BareFeetWare wrote:
>> All this talk of replacing multiple commas with pipes, then replacing pipes 
>> and so on, though clever and helpful is problematic, cumbersome and even 
>> comical for a mature product like SQLite.
> 
> SQLite is a SQL library and does an excellent job of that.
> 
> Numerous tools are built on top of that library.  One example is a shell
> which can be used for interaction with a SQLite database, but is not
> formally specified, supported nor developed to the same degree as the
> library.  You are not required to use the shell, and there are numerous
> alternatives.
> 
> See also:
> 
>   http://www.sqlite.org/src/rptview?rn=5
> 
> It is fairly easy to write your own as appropriate.  Some self horn tooting:
> 
>   http://apidoc.apsw.googlecode.com/hg/shell.html
> 
> Roger

Roger --

I Agree -- sqlite3 is NOT the sqlite DB engine.

Thanks for the links.  I will try out your sqlite shell.

As to Code_Defect# c25aab7e7e ...

I have never had any problems importing simple pipe-delimited .txt
files into sqlite DBs via the sqlite3 shell.

Maybe instead of 'fixing' sqlite3 .CSV imports, you could simply
change the description of the .import command to

.import - import simple delimited text files.

CSV IO is a monster.  Even MS Excel doesn't export proper CSVs
and it sure as hell can't import them( quoted strings that look
like numbers ALWAYS become numbers in Excel).

Besides, pre-filtering raw text files before finally executing
`sqlite3 ... ".import ..."` is the 'UNIX way' !

My $0.02 ...

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


[sqlite] WHERE Clause Not Working On Database

2010-09-14 Thread Rich Shepard
   I cannot select rows from a table using the WHERE clause and cannot find
my error. Perhaps others will see what I miss.

   The table, Companies, has 1500+ rows. One column is defined as
   state CHAR(2),

but the select statement seeking all rows where state = 'OR' for example
returns nothing:

sqlite> select * from Companies where state = 'OR';
sqlite>

   If I specify a single column in the above the same lack of returned rows
is seen.

   A select * from Companies statement returns all rows with no error
messages; so does a count statement:

sqlite> select count(distinct state) from Companies;
5

   Also, it does not matter which column I specify in the WHERE clause, no
rows are returned.

   What simple, embarrassing error have I made in the syntax of the SELECT
statement when I add the WHERE clause?

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


[sqlite] DB file locked when no other process using it

2010-09-14 Thread Andrew Wood
Im getting an error saying the database is locked even though no other 
process is accessing the file. I think it was probably caused by a 
process crashing part way through. Is there a way to force release the lock?

Andrew

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


Re: [sqlite] WHERE Clause Not Working On Database

2010-09-14 Thread Paul Corke
On 14 September 2010 14:45, Rich Shepard wrote:

> sqlite> select * from Companies where state = 'OR';

What do you get from:

select distinct state from companies;

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


Re: [sqlite] WHERE Clause Not Working On Database

2010-09-14 Thread Rich Shepard
On Tue, 14 Sep 2010, Paul Corke wrote:

> What do you get from:
>
> select distinct state from companies;

Paul,

sqlite> select distinct state from Companies;
'ID'
'NV'
'OR'
'UT'
'WA'

   That's why this inability to use the WHERE clause completely escapes my
understanding.

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


Re: [sqlite] WHERE Clause Not Working On Database

2010-09-14 Thread Jay A. Kreibich
On Tue, Sep 14, 2010 at 06:45:24AM -0700, Rich Shepard scratched on the wall:
>I cannot select rows from a table using the WHERE clause and cannot find
> my error. Perhaps others will see what I miss.
> 
>The table, Companies, has 1500+ rows. One column is defined as
>state CHAR(2),
> 
> but the select statement seeking all rows where state = 'OR' for example
> returns nothing:
> 
> sqlite> select * from Companies where state = 'OR';
> sqlite>

  Try: "select quote( state ) from companies group by state;"

  That will put quotes around the values. 
  
  Look for leading/trailing spaces.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WHERE Clause Not Working On Database

2010-09-14 Thread Jay A. Kreibich
On Tue, Sep 14, 2010 at 06:52:02AM -0700, Rich Shepard scratched on the wall:
> On Tue, 14 Sep 2010, Paul Corke wrote:
> 
> > What do you get from:
> >
> > select distinct state from companies;
> 
> Paul,
> 
> sqlite> select distinct state from Companies;
> 'ID'
> 'NV'
> 'OR'
> 'UT'
> 'WA'

  If that's a copy-paste from  a default sqlite3 session, the single
  quotes are part of the value.   i.e. you have four-character values,
  such as "'ID'".

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WHERE Clause Not Working On Database

2010-09-14 Thread Paul Corke
On 14 September 2010 14:52, Rich Shepard wrote:

> sqlite> select distinct state from Companies;
> 'ID'
> 'NV'
> 'OR'
> 'UT'
> 'WA'

It looks like the values in your db have quotes in them.

sqlite> create table companies(state char(2), name char(10));
sqlite> insert into companies values('OR','one');
sqlite> insert into companies values('OR','two');
sqlite> insert into companies values('ID','three');
sqlite> select * from companies where state='OR';
OR|one
OR|two
sqlite> select distinct state from companies;
ID
OR

Note the difference between OR and 'OR' in the two responses.

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


Re: [sqlite] WHERE Clause Not Working On Database

2010-09-14 Thread Simon Slavin

On 14 Sep 2010, at 2:57pm, Jay A. Kreibich wrote:

> On Tue, Sep 14, 2010 at 06:52:02AM -0700, Rich Shepard scratched on the wall:
>> sqlite> select distinct state from Companies;
>> 'ID'
>> 'NV'
>> 'OR'
>> 'UT'
>> 'WA'
> 
>  If that's a copy-paste from  a default sqlite3 session, the single
>  quotes are part of the value.   i.e. you have four-character values,
>  such as "'ID'".

In the year 2060, when computers are unbelievably clever and we're all 
programming by mental control, we will still have the problem of identifying 
which meta-level quote marks are in.

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


Re: [sqlite] WHERE Clause Not Working On Database

2010-09-14 Thread Rich Shepard
On Tue, 14 Sep 2010, Jay A. Kreibich wrote:

>  If that's a copy-paste from  a default sqlite3 session, the single quotes
>  are part of the value.  i.e. you have four-character values, such as
>  "'ID'".

Jay,

   That's because I used single quotes to delimit strings in the original
.csv file. Removing them in the .csv and re-importing solves the problem.

   I must have not used any quotation marks on text strings in prior data
imports for other databases after changing the ',' separator to '|' and not
remembered that's what I had done before.

Thanks,

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


[sqlite] pragma foreign_keys not persistent?

2010-09-14 Thread BareFeetWare
Hi all,

I've been playing around with:

pragma foreign_keys;

pragma foreign_keys = 1;

As far as I can tell, turning on foreign_keys for a database is not persistent. 
It only seems to be valid for that connection/session. So this means I have to 
prefix every command that I send to the database with a command to turn on 
foreign_keys and I therefore can't issue one-off commands, but they must be 
part of a session. Is this correct?

This worries me since any ad-hoc use of the database that does not implicitly 
turn on foreign keys is likely to mess up the data integrity.

Wouldn't it be better to have the foreign_keys setting persistent between 
sessions, so that once it's turned on, it stays turned on for all future 
sessions (unless explicitly turned off)?

Thanks,
Tom
BareFeetWare

 --
Comparison of SQLite GUI tools:
http://www.barefeetware.com/sqlite/compare/?ml

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


Re: [sqlite] pragma foreign_keys not persistent?

2010-09-14 Thread Jean-Christophe Deschamps

>As far as I can tell, turning on foreign_keys for a database is not 
>persistent. It only seems to be valid for that connection/session. So 
>this means I have to prefix every command that I send to the database 
>with a command to turn on foreign_keys and I therefore can't issue 
>one-off commands, but they must be part of a session. Is this correct?
>
>This worries me since any ad-hoc use of the database that does not 
>implicitly turn on foreign keys is likely to mess up the data integrity.
>
>Wouldn't it be better to have the foreign_keys setting persistent 
>between sessions, so that once it's turned on, it stays turned on for 
>all future sessions (unless explicitly turned off)?
>
>Thanks,
>Tom
>BareFeetWare
>
>  --
>Comparison of SQLite GUI tools:
>http://www.barefeetware.com/sqlite/compare/?ml

Very true, and the danger is even bigger when using SQLite third-party 
managers as not all of them make that pragma a persistent setting 
accross runs.

This setting is a meta-data of the database and really should go along 
with it for _any_ use.  The same applies to recursive_triggers pragma, 
albeit possibly of less common use in the wild.

If preserving backwards compatibility is seen as an absolute 
requirement, it would be easy to introduce a couple of new and simple 
"persistent_foreign_keys" and "persistent_recursive_triggers" pragmas.


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


[sqlite] dbstatus test needs ifcapable !lookaside logic

2010-09-14 Thread Noah Hart

if SQLITE is compiled with SQLITE_OMIT_LOOKASIDE then the dbstatus test 2 and
3 series will fail.

recommend adding the lines
ifcapable !lookaside { 
finish_test
return
 }

right before the lines


#---
# Run the dbstatus-2 and dbstatus-3 tests with several of different
# lookaside buffer sizes.
#
foreach ::lookaside_buffer_size {0 64 120} {
-- 
View this message in context: 
http://old.nabble.com/dbstatus-test-needs-ifcapable-%21lookaside-logic-tp29711400p29711400.html
Sent from the SQLite mailing list archive at Nabble.com.

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


[sqlite] vacuum2 & 3 test does not work if compiled with codes

2010-09-14 Thread Noah Hart

if SQLITE is compiled with SQLITE_HAS_CODEC then the test 2.2 will fail, as
well as a number of the vacuum3 tests

recommend adding the follwing lines to the beginning of the file

# Do not use a codec for tests in this file, as the database file is
# manipulated directly using tcl scripts. See proc [set_file_format].
#
do_not_use_codec


Also the second test # vacuum2-2.1 should be vacuum2-2.2

Noah Hart
-- 
View this message in context: 
http://old.nabble.com/vacuum2---3-test-does-not-work-if-compiled-with-codes-tp29711540p29711540.html
Sent from the SQLite mailing list archive at Nabble.com.

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


[sqlite] what could be the reason that natural join stops working ?

2010-09-14 Thread Stef Mientki
 hello,

after modifying some tables, natural join stopped working  ???

I've 2 tables, each with a field named "vlid", which is the primary key in one 
of the tables

until a few moments ago, this worked perfectly

select Header from vraag
  natural join vraaglist
  where Nr = 0 and vraaglist.Name = 'eortc_br23'

but now it returns an empty string (while the string shouldn't be empty).

I test that by doing an explicit join

select Header from vraag
  join vraaglist on vraag.vlid = vraaglist.vlid
  where Nr = 0 and vraaglist.Name = 'eortc_br23'

which gives me the correct string of the field Header.

exchanging the 2 tables in the above statements, gives exactly the same results.

Is my database corrupt ?

thanks,
Stef Mientki
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] what could be the reason that natural join stops working ?

2010-09-14 Thread Oliver Peters

your version of sqlite?
your OS?
your backend?

What exactly have you done before the Natural Join stopped working?

Oliver


Am Dienstag, den 14.09.2010, 23:41 +0200 schrieb Stef Mientki:
> hello,
> 
> after modifying some tables, natural join stopped working  ???
> 
> I've 2 tables, each with a field named "vlid", which is the primary key in 
> one of the tables
> 
> until a few moments ago, this worked perfectly
> 
> select Header from vraag
>   natural join vraaglist
>   where Nr = 0 and vraaglist.Name = 'eortc_br23'
> 
> but now it returns an empty string (while the string shouldn't be empty).
> 
> I test that by doing an explicit join
> 
> select Header from vraag
>   join vraaglist on vraag.vlid = vraaglist.vlid
>   where Nr = 0 and vraaglist.Name = 'eortc_br23'
> 
> which gives me the correct string of the field Header.
> 
> exchanging the 2 tables in the above statements, gives exactly the same 
> results.
> 
> Is my database corrupt ?
> 
> thanks,
> Stef Mientki
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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


Re: [sqlite] what could be the reason that natural join stops working ?

2010-09-14 Thread Stef Mientki
 On 14-09-2010 23:50, Oliver Peters wrote:
> your version of sqlite?
I used several programs
SQLiteSpy,
SQLcc,
Python-programs,
so I don't know which versions of sqlite I used,
might that be the problem ?
> your OS?
windows XP
> your backend?
several, see above
> What exactly have you done before the Natural Join stopped working?
converted tables from string to unicode,
column rename + columns added + changed column constraints ( through copy table 
/ drop table /
rename table )

thanks,
Stef
> Oliver
>
>
> Am Dienstag, den 14.09.2010, 23:41 +0200 schrieb Stef Mientki:
>> hello,
>>
>> after modifying some tables, natural join stopped working  ???
>>
>> I've 2 tables, each with a field named "vlid", which is the primary key in 
>> one of the tables
>>
>> until a few moments ago, this worked perfectly
>>
>> select Header from vraag
>>   natural join vraaglist
>>   where Nr = 0 and vraaglist.Name = 'eortc_br23'
>>
>> but now it returns an empty string (while the string shouldn't be empty).
>>
>> I test that by doing an explicit join
>>
>> select Header from vraag
>>   join vraaglist on vraag.vlid = vraaglist.vlid
>>   where Nr = 0 and vraaglist.Name = 'eortc_br23'
>>
>> which gives me the correct string of the field Header.
>>
>> exchanging the 2 tables in the above statements, gives exactly the same 
>> results.
>>
>> Is my database corrupt ?
>>
>> thanks,
>> Stef Mientki
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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


Re: [sqlite] SQLITE_ENABLE_ATOMIC_WRITE on windows, good or bad?

2010-09-14 Thread JT Olds
On this note, how does one figure out if your system does support
atomic writes (or other FS things, like safe appends)?

Is there an easy way to have SQLite tell you what it finds out?

Alternatively (for my current use case), does Ext3 on 2.6 Linux
support atomic writes or safe appends?

On Mon, Sep 13, 2010 at 7:50 PM, Richard Hipp  wrote:
> On Mon, Sep 13, 2010 at 8:59 PM, Sam Carleton 
> wrote:
>
>> When compiling sqlite for Windows desktop OS's (XP, Vista, Win7), should
>> SQLITE_ENABLE_ATOMIC_WRITE be set or not?
>>
>
> Makes no difference really - windows does not support atomic writes.  So the
> atomic write feature will never be used. You might as well leave it turned
> off, to save code space, and a couple of branch instructions in the pager.
>
>
>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE_ENABLE_ATOMIC_WRITE on windows, good or bad?

2010-09-14 Thread Simon Slavin

On 15 Sep 2010, at 1:01am, JT Olds wrote:

> On this note, how does one figure out if your system does support
> atomic writes (or other FS things, like safe appends)?
> 
> Is there an easy way to have SQLite tell you what it finds out?

Unfortunately, SQLite cannot tell if its underlying operating system can do 
atomic writes: the operating system lies and the hard disk driver lies to the 
operating system.  You can check to see whether that version of SQLite was 
compiled with AR support in, but that doesn't tell you whether it has any 
effect or not.

Also it's difficult to test: even if there's no guarantee of atomic writes, 
writes are usually done in-order most of the time, so you can't test for it 
just by seeing if it fails a trial run.

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


Re: [sqlite] what could be the reason that natural join stops working ?

2010-09-14 Thread Pavel Ivanov
Did you by any chance introduced some unique constraint or unique
index on a set of columns one of which is primary key? AFAIK, there
was a problem in SQLite until some recent versions in processing of
redundant unique constraints in conjunction with natural joins.

But the best idea would be to post the full definition of those two
tables along with their indexes and constraints.

Pavel

On Tue, Sep 14, 2010 at 6:09 PM, Stef Mientki  wrote:
>  On 14-09-2010 23:50, Oliver Peters wrote:
>> your version of sqlite?
> I used several programs
> SQLiteSpy,
> SQLcc,
> Python-programs,
> so I don't know which versions of sqlite I used,
> might that be the problem ?
>> your OS?
> windows XP
>> your backend?
> several, see above
>> What exactly have you done before the Natural Join stopped working?
> converted tables from string to unicode,
> column rename + columns added + changed column constraints ( through copy 
> table / drop table /
> rename table )
>
> thanks,
> Stef
>> Oliver
>>
>>
>> Am Dienstag, den 14.09.2010, 23:41 +0200 schrieb Stef Mientki:
>>> hello,
>>>
>>> after modifying some tables, natural join stopped working  ???
>>>
>>> I've 2 tables, each with a field named "vlid", which is the primary key in 
>>> one of the tables
>>>
>>> until a few moments ago, this worked perfectly
>>>
>>> select Header from vraag
>>>   natural join vraaglist
>>>   where Nr = 0 and vraaglist.Name = 'eortc_br23'
>>>
>>> but now it returns an empty string (while the string shouldn't be empty).
>>>
>>> I test that by doing an explicit join
>>>
>>> select Header from vraag
>>>   join vraaglist on vraag.vlid = vraaglist.vlid
>>>   where Nr = 0 and vraaglist.Name = 'eortc_br23'
>>>
>>> which gives me the correct string of the field Header.
>>>
>>> exchanging the 2 tables in the above statements, gives exactly the same 
>>> results.
>>>
>>> Is my database corrupt ?
>>>
>>> thanks,
>>> Stef Mientki
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Query planner is broken in 3.7.2?

2010-09-14 Thread Peter.Hizalev
Hello,

Let say we create two tables:

create table a(num integer primary key);create unique index a_uq on a(num);
create table b(num integer primary key);create unique index b_uq on b(num);

Table a is populated with 1 million records and table b with 1000 records. We 
run analyze and look at sqlite_stat1 table:

d|d_uq|1000 1
a|a_uq|100 1

Now I run two selects with different orders of joins:

select * from a join b using(num);
select * from b join a using(num);

Corresponding timings are

CPU Time: user 0.00 sys 0.00
CPU Time: user 0.343750 sys 0.00

This shows that query analyzer is broken - it does not reorder simple inner 
join based on collected statistics. 

It worked OK in 3.6 and first release of 3.7 (although required _uq indexes in 
addition to primary key since no statistics on primaries were used).

Please advice.


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


[sqlite] SQL Logic error for in-memory database

2010-09-14 Thread Hemant Shah
Folks,

I have written a C program that creates in-memory database. It reads packets 
from the network and insert some info in the database. 

Sometimes I get following error:

SQL logic error or missing database.

I prepare statement, bind columns and run step.

After every insert I also delete rows more than one minute old.

The program may inserts between 10 to 100 rows a millisecond. There are no 
issues with memory or CPU. The system has two quad core CPUs and 24GB of 
memory. My program takes maximum of 200 MB of memory. Each row is about 250KB.

What could be the problem?

Thanks.

Hemant Shah
E-mail: hj...@yahoo.com


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


Re: [sqlite] SQL Logic error for in-memory database

2010-09-14 Thread Simon Slavin

On 15 Sep 2010, at 3:41am, Hemant Shah wrote:

> I have written a C program that creates in-memory database. It reads packets 
> from the network and insert some info in the database. 
> 
> Sometimes I get following error:
> 
> SQL logic error or missing database.

Does the error occur only when starting your program, or sometimes during a 
long run which had gone okay up to that point ?

Is the database accessed from more than one thread or process ?

Are you intentionally using NULL values anywhere ?

Simon.

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


Re: [sqlite] SQL Logic error for in-memory database

2010-09-14 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/14/2010 07:41 PM, Hemant Shah wrote:
> Sometimes I get following error:
> 
> SQL logic error or missing database.

That text corresponds to the error code SQLITE_ERROR which is the code used
for a wide variety of error conditions that don't have a more specific code.

In any event you haven't even told us which API is returning the code.

http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyQZ9EACgkQmOOfHg372QRwlQCg3abzvZCSB83x4gxJ9422oiiQ
BrwAn0g4/NSB3XqALkDYx641B7jTNfIn
=hMN8
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] DB file locked when no other process using it

2010-09-14 Thread Benoit Mortgat
Do you have SQLite Manager extension for Firefox installed? I had problems
with it having the database open until Firefox is restarted.

On Tue, Sep 14, 2010 at 15:45, Andrew Wood  wrote:

> Im getting an error saying the database is locked even though no other
> process is accessing the file. I think it was probably caused by a
> process crashing part way through. Is there a way to force release the
> lock?
>
> Andrew
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Benoit Mortgat
20, avenue Marcel Paul
69200 Vénissieux, France
+33 6 17 15 41 58
+33 4 27 11 61 23
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users