[sqlite] WAL mode and backup API

2010-11-30 Thread Marco Bambini
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?

Thanks a lot for your answer.
--
Marco Bambini
http://www.sqlabs.com






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


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?


Yes. The connection to the backup source acts like any other reader.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WAL mode and backup API

2010-11-30 Thread Marcus Grimm
On 30.11.2010 11:32, Dan Kennedy wrote:
 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?


 Yes. The connection to the backup source acts like any other reader.

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.

Marcus

 ___
 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] Question

2010-11-30 Thread Paul Sanderson
As said off topic - but I have never heard of a cell ID being recorded
with an SMS message. You can find more info on the SMS message format
by search for sms pdu (protocol description unit) you can see from
this somewhat complex structure that the cell ID is not part of the
transmitted message format. This information is available at the
handset though and it is *possible* that it is recorded on specific
handsets although I have never seen it.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


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 on the source database
before starting the backup? i.e.

   sqlite3_exec(pSource, BEGIN; SELECT * FROM sqlite_master, 0, 0, 0);

   ... do backup ...

   sqlite3_exec(pSource, COMMIT, 0, 0, 0);

Does that help things any?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] WAL mode and backup API

2010-11-30 Thread Marcus Grimm

On 30.11.2010 11:50, Dan Kennedy wrote:

 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 on the source database
 before starting the backup? i.e.

 sqlite3_exec(pSource, BEGIN; SELECT * FROM sqlite_master, 0, 0, 0);

 ... do backup ...

 sqlite3_exec(pSource, COMMIT, 0, 0, 0);

 Does that help things any?

wow... what a trick!
Using your hint I'm not able to reproduce any restarts!
I can imagine what your hint does in wal mode, but without your input
I would never came to that idea... :-)

Thanks Dan! This makes the wal mode and backup API even more sexy.

Marcus


 ___
 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] searching with like on FTS3

2010-11-30 Thread Pascal Schnurr
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 sentences
and there is no perfekt tokenizer atm i tried mecab but it makes
misstakes).

Is there no other way than to hold the same data in an virtual FTS3 and
a normal table to do both search types? because i don't want to bloat
the download and in memory caching.

the normal table is 29MB
indexed is 59MB (and loaded completely in memory ~80MB)

both together would be over 100MB when loading completely into memory
and with basically the same data twice.

regards
boscowitch

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


[sqlite] cost of sqlite3_open

2010-11-30 Thread Christoph Schreiber
Hi, I'm working on a multi-threaded image server and I have 2 questions:

1) How expensive is a call to sqlite3_open. Does a call to 
sqlite3_enable_shared_cache make it cheaper?

2) If sqlite3_open is an expensive operation then I would like to keep a list 
(cache) of open database connections (sqlite*'s). Here's how it *should* work: 
The main thread calls sqlite3_open a couple of times and pushes the resulting 
sqlite-handles into a concurrent queue. The worker thread then pops the handle 
from the queue, does what needs to be done and pushes the handle back. No 
sqlite-handle is used by more than one thread at the same time. Is that safe?

Cheers, Christoph


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


Re: [sqlite] cost of sqlite3_open

2010-11-30 Thread Pavel Ivanov
 1) How expensive is a call to sqlite3_open. Does a call to 
 sqlite3_enable_shared_cache make it cheaper?

Its cost depends on the size of your schema as it gets parsed during
open. Shared cache doesn't make it cheaper. It can make somewhat
cheaper (in some cases) to use several connections to the same
database with the cost of mutual exclusion of sqlite3_step calls
working with any handle to the same database. But that's it.

 2) If sqlite3_open is an expensive operation then I would like to keep a list 
 (cache) of open database connections (sqlite*'s). Here's how it *should* 
 work: The main thread calls sqlite3_open a couple of times and pushes the 
 resulting sqlite-handles into a concurrent queue. The worker thread then pops 
 the handle from the queue, does what needs to be done and pushes the handle 
 back. No sqlite-handle is used by more than one thread at the same time. Is 
 that safe?

Yes, that's perfectly safe.


Pavel

On Tue, Nov 30, 2010 at 9:37 AM, Christoph Schreiber luky0...@yahoo.de wrote:
 Hi, I'm working on a multi-threaded image server and I have 2 questions:

 1) How expensive is a call to sqlite3_open. Does a call to 
 sqlite3_enable_shared_cache make it cheaper?

 2) If sqlite3_open is an expensive operation then I would like to keep a list 
 (cache) of open database connections (sqlite*'s). Here's how it *should* 
 work: The main thread calls sqlite3_open a couple of times and pushes the 
 resulting sqlite-handles into a concurrent queue. The worker thread then pops 
 the handle from the queue, does what needs to be done and pushes the handle 
 back. No sqlite-handle is used by more than one thread at the same time. Is 
 that safe?

 Cheers, Christoph


 ___
 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] SQLITE transactions failing with multiple threads

2010-11-30 Thread cricketfan

Hello,
I have 2 threads in my program, 1st thread is doing inserts into a 
table and 2nd thread is trying to update the already inserted columns.
1. I have bundled the 1000 inserts per transaction in 1st thread.
2. When I try to start a transaction in the 2nd thread for my updates (when
the 1st thread is running simultaneously) I am getting an error(error code 1
- SQL error or missing database).
If I start the begin transaction in 2nd thread after the 1st thread finishes
it works normally. Is this normal behavior? Also not that both threads are
using the same handle passed by main.
-- 
View this message in context: 
http://old.nabble.com/SQLITE-transactions-failing-with-multiple-threads-tp30340806p30340806.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


Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Drake Wilson
Quoth cricketfan srtedul...@yahoo.co.in, on 2010-11-30 07:49:36 -0800:
 Also not that both threads are
 using the same handle passed by main.

No, don't do that.  Using the same handle in two threads concurrently
can break depending on the SQLite threading mode, and will gain you no
parallelism in the modes where it works.  Aside from that, transaction
state is bound to a handle; you're starting a transaction and then
trying to start another one inside it.

Open two handles instead.

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


Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Simon Slavin

On 30 Nov 2010, at 3:49pm, cricketfan wrote:

I have 2 threads in my program, 1st thread is doing inserts into a 
 table and 2nd thread is trying to update the already inserted columns.
 1. I have bundled the 1000 inserts per transaction in 1st thread.
 2. When I try to start a transaction in the 2nd thread for my updates (when
 the 1st thread is running simultaneously) I am getting an error(error code 1
 - SQL error or missing database).
 If I start the begin transaction in 2nd thread after the 1st thread finishes
 it works normally. Is this normal behavior? Also not that both threads are
 using the same handle passed by main.

I think you identified the problem.  Try having separate handles for each 
thread.  Either have each thread open its own connection or have your main 
thread open two connections, one for the INSERTs, one for the UPDATEs.

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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread john darnell
Thanks Igor.

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Igor Tandetnik
Sent: Monday, November 29, 2010 7:11 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Just compiled SQLite in Visual Studio

john darnell john.darn...@walsworth.com wrote:
 I just added it to a Visual Studio 8 project, turned off the use of 
 precompiled headers (the project is a C++ project) and
 compiled the SQLite.c file without any errors.

There is no such thing as a C++ project. A project in Visual Studio can happily 
contain both C and C++ files. By default, file extension determines whether the 
file is compiled with C or C++ compiler (.c would indicate C), and this could 
also be overridden in project settings on a per-file basis.
-- 
Igor Tandetnik

___
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] EXPLAIN QUERY PLAN

2010-11-30 Thread Duquette, William H (316H)
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 applied; the detail explains 
which table and index is involved.  But what does the from column mean?

Thanks!

Will

--
Will Duquette -- william.h.duque...@jpl.nasa.gov
Athena Development Lead -- Jet Propulsion Laboratory
It's amazing what you can do with the right tools.

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


[sqlite] Creating a database.

2010-11-30 Thread john darnell
I know this is a fundamental question, but in the book I'm using to learn 
SQLite, there is no reference that I can find for what one needs to do to 
create a database.  I thought that simply using a CREATE statement with a 
database name included might do the trick, but alas it does not.

I went to the SQLite website and under the SQLite in 5 minutes page it says 
to simply do this (after downloading the appropriate files, which I did) at the 
dos prompt:

SQLite3 test.db

When I tried it, I received this back:

SQLite version 3.7.3
Enter .help for instructions
Enter SQL statements terminated with a ;
sqlite

I quit out of the SQLite shell and looked for test.db and did not find it.

So my question remains. How do I create a database?
R,
John A.M. Darnell
Senior Programmer
Walsworth Publishing Company
Brookfield, MO
John may also be reached at 
johnamdarn...@gmail.commailto:johnamdarn...@gmail.com

Trivia SF question:  In the movie, THE MATRIX, just before Neo and Trinity take 
a harrowing ride up an elevator shaft holding on to an elevator cable, Neo 
mutters a single phrase. What is that phrase?

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


Re: [sqlite] Creating a database.

2010-11-30 Thread Jay A. Kreibich
On Tue, Nov 30, 2010 at 10:40:52AM -0600, john darnell scratched on the wall:
 I know this is a fundamental question, but in the book I'm using to
 learn SQLite, there is no reference that I can find for what one needs
 to do to create a database.  I thought that simply using a CREATE
 statement with a database name included might do the trick, but alas
 it does not.

  From code, you use sqlite3_open_v2( ).  See the docs for specifics:

http://sqlite.org/c3ref/open.html


  From the shell, you just access a non-existent file.

 I went to the SQLite website and under the SQLite in 5 minutes page it says 
 to simply do this (after downloading the appropriate files, which I did) at 
 the dos prompt:
 
 SQLite3 test.db
 
 When I tried it, I received this back:
 
 SQLite version 3.7.3
 Enter .help for instructions
 Enter SQL statements terminated with a ;
 sqlite
 
 I quit out of the SQLite shell and looked for test.db and did not find it.
 
 So my question remains. How do I create a database?

  The SQLite library uses lazy file creation.  There are a number of
  configuration parameters that become fixed once the database header is
  written to disk.  As such, the actual file creation is delayed until
  it *must* be written.  This gives you a chance to issue PRAGMA commands
  and setup the proper configuration after the database is open, but 
  before the header is written.
  
  To force SQLite to actually write the database file to disk just
  issue a CREATE TABLE statement:

CREATE TABLE t ( i );



-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


[sqlite] creating a database

2010-11-30 Thread john darnell
Okay, I seem to have figured it out.   One needs to create the database and 
then add a table before the database will be created.

Sorry for the baby steps.
R,
John A.M. Darnell
Senior Programmer
Walsworth Publishing Company
Brookfield, MO
John may also be reached at 
johnamdarn...@gmail.commailto:johnamdarn...@gmail.com

Trivia SF question:  In the movie, THE MATRIX, just before Neo and Trinity take 
a harrowing ride up an elevator shaft holding on to an elevator cable, Neo 
mutters a single phrase. What is that phrase?

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


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 applied; the detail explains 
 which table and index is involved.  But what does the from column mean?

 Thanks!

The output of EQP is changing for 3.7.4. But the interpretation
of the from column remains the same. See here:

   http://www.sqlite.org/draft/eqp.html

Buried about 2/3 of the way through section 1.1.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] EXPLAIN QUERY PLAN

2010-11-30 Thread Duquette, William H (316H)
Thanks, Dan!


On 11/30/10 9:05 AM, Dan Kennedy danielk1...@gmail.com wrote:

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 applied; the detail explains 
 which table and index is involved.  But what does the from column mean?

 Thanks!

The output of EQP is changing for 3.7.4. But the interpretation
of the from column remains the same. See here:

   http://www.sqlite.org/draft/eqp.html

Buried about 2/3 of the way through section 1.1.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

--
Will Duquette -- william.h.duque...@jpl.nasa.gov
Athena Development Lead -- Jet Propulsion Laboratory
It's amazing what you can do with the right tools.

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


Re: [sqlite] cost of sqlite3_open

2010-11-30 Thread Jean-Christophe Deschamps
Pavel,

  1) How expensive is a call to sqlite3_open. Does a call to 
 sqlite3_enable_shared_cache make it cheaper?

Its cost depends on the size of your schema as it gets parsed during
open.


Isn't this contradictory with an answer by Igor made in a recent thread?

Subject: Re: [sqlite] sqlite3_open on non-DB files / corrupt DBs


Nick Shaw nick.s...@citysync.co.uk wrote:
  Is there a reason that sqlite3_open() will happily open a non-sqlite
  file, returning SQLITE_OK, instead of returning SQLITE_NOTADB, which
  would seem a more obvious return value?

SQLite doesn't actually touch the file until the first substantive 
statement is executed on the connection. This allows one to set 
various PRAGMAs that can only be set before the database is created.




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


Re: [sqlite] cost of sqlite3_open

2010-11-30 Thread Pavel Ivanov
  1) How expensive is a call to sqlite3_open. Does a call to
 sqlite3_enable_shared_cache make it cheaper?

Its cost depends on the size of your schema as it gets parsed during
open.

 Isn't this contradictory with an answer by Igor made in a recent thread?

It's not contradictory. I say that real cost of sqlite3_open is
parsing the schema. Igor says that this cost is actually deferred from
inside sqlite3_open call to the first substantive sqlite3_step call.
So you will have to pay this price anyway, just profiler output would
be somewhat confusing.


Pavel

On Tue, Nov 30, 2010 at 1:50 PM, Jean-Christophe Deschamps
j...@q-e-d.org wrote:
 Pavel,

  1) How expensive is a call to sqlite3_open. Does a call to
 sqlite3_enable_shared_cache make it cheaper?

Its cost depends on the size of your schema as it gets parsed during
open.


 Isn't this contradictory with an answer by Igor made in a recent thread?

Subject: Re: [sqlite] sqlite3_open on non-DB files / corrupt DBs


Nick Shaw nick.s...@citysync.co.uk wrote:
  Is there a reason that sqlite3_open() will happily open a non-sqlite
  file, returning SQLITE_OK, instead of returning SQLITE_NOTADB, which
  would seem a more obvious return value?

SQLite doesn't actually touch the file until the first substantive
statement is executed on the connection. This allows one to set
various PRAGMAs that can only be set before the database is created.




 ___
 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] searching with like on FTS3

2010-11-30 Thread Sam Roberts
On Mon, Nov 29, 2010 at 9:08 AM, Pascal Schnurr pasc...@boscowitch.de wrote:
 Hi recently I noticed that i can't search with the like '%searchword%'
 syntax on an FTS3 virtual table.

I'm no expert, but are you sure? This exact example, using LIKE,
appears in the FTS3 docs:

http://www.sqlite.org/fts3.html#section_1
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] searching with like on FTS3

2010-11-30 Thread boscowitch
It does but as you can see the like is only performed on a normal table
and the match you find only entrys like  sql  or maby   selserver 
but not blablalbasqlstatic



Am Dienstag, den 30.11.2010, 11:50 -0800 schrieb Sam Roberts:
 On Mon, Nov 29, 2010 at 9:08 AM, Pascal Schnurr pasc...@boscowitch.de wrote:
  Hi recently I noticed that i can't search with the like '%searchword%'
  syntax on an FTS3 virtual table.
 
 I'm no expert, but are you sure? This exact example, using LIKE,
 appears in the FTS3 docs:
 
 http://www.sqlite.org/fts3.html#section_1
 ___
 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 transactions failing with multiple threads

2010-11-30 Thread cricketfan

Drake, I am using SQLITE in threadsafe mode. Transaction inside another
transaction isnt that equivalent of nested transactions? Should that be
allowed? I have no problem opening another handle but just trying to
understand the intricacies, thanks.


Drake Wilson-3 wrote:
 
 Quoth cricketfan srtedul...@yahoo.co.in, on 2010-11-30 07:49:36 -0800:
 Also not that both threads are
 using the same handle passed by main.
 
 No, don't do that.  Using the same handle in two threads concurrently
 can break depending on the SQLite threading mode, and will gain you no
 parallelism in the modes where it works.  Aside from that, transaction
 state is bound to a handle; you're starting a transaction and then
 trying to start another one inside it.
 
 Open two handles instead.
 

-- 
View this message in context: 
http://old.nabble.com/SQLITE-transactions-failing-with-multiple-threads-tp30340806p30343167.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


Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Drake Wilson
Quoth cricketfan srtedul...@yahoo.co.in, on 2010-11-30 12:11:52 -0800:
 Drake, I am using SQLITE in threadsafe mode. Transaction inside another
 transaction isnt that equivalent of nested transactions? Should that be
 allowed?

SQLite has named savepoints, but not nested BEGIN transactions.  It's
hard to tell what exactly you're doing from the description, such as
why you're doing these updates with two threads to start with, so it's
hard to give good advice.  Perhaps you could show some example code?

Which threading mode do you mean?  Serialized or multithreaded?

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


Re: [sqlite] Some floats of 15 digits or less do not round-trip

2010-11-30 Thread Rick Regan
On Tue, Nov 30, 2010 at 12:29 AM, Shane Harrelson sh...@sqlite.org wrote:





It turns out the same problem exists on Linux (I used sqlite3-3.7.3.bin);
for example:

sqlite create table t1(d float);
sqlite insert into t1 values(9.87e+31);
sqlite select * from t1;
9.870001e+31

So it seems that extended precision is not enough, and to fix the problem,
higher precision is needed.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] cost of sqlite3_open

2010-11-30 Thread Jean-Christophe Deschamps

It's not contradictory. I say that real cost of sqlite3_open is
parsing the schema. Igor says that this cost is actually deferred from
inside sqlite3_open call to the first substantive sqlite3_step call.
So you will have to pay this price anyway, just profiler output would
be somewhat confusing.

I agree that the price has to be paid somewhere in time.  The issue I 
raised was about the precise moment in was occuringin time, nothing 
else.  Nothing really important anyway.


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


Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread cricketfan

Drake,
 It is in serialized mode. Opening another handle did resolve the
issue. I am doing inserts in one thread and then if necessary update the
same using another thread. 


Drake Wilson-3 wrote:
 
 Quoth cricketfan srtedul...@yahoo.co.in, on 2010-11-30 12:11:52 -0800:
 Drake, I am using SQLITE in threadsafe mode. Transaction inside another
 transaction isnt that equivalent of nested transactions? Should that be
 allowed?
 
 SQLite has named savepoints, but not nested BEGIN transactions.  It's
 hard to tell what exactly you're doing from the description, such as
 why you're doing these updates with two threads to start with, so it's
 hard to give good advice.  Perhaps you could show some example code?
 
 Which threading mode do you mean?  Serialized or multithreaded?
 
--- Drake Wilson
 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 

-- 
View this message in context: 
http://old.nabble.com/SQLITE-transactions-failing-with-multiple-threads-tp30340806p30343885.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


Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Simon Slavin

On 30 Nov 2010, at 8:11pm, cricketfan wrote:

 Drake, I am using SQLITE in threadsafe mode. Transaction inside another
 transaction isnt that equivalent of nested transactions? Should that be
 allowed? I have no problem opening another handle but just trying to
 understand the intricacies, thanks.

The database handle is not just a pointer to the file on disk, it's used to 
store some details and state of the current operation.  The way you're using a 
single handle tries to cram the state of two different operations in it at 
once.  It's not going to work.  If you have two different threads that might 
access the database at the same time, you need two different handles.

You could get rid of the problem by implementing some sort of semaphore system 
between your threads to prevent them using the database at the same time.  But 
that would defeat the point of using two threads in the first place.  So it's 
probably best to let SQLite handle the semaphoring for you, by using two 
different handles.

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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Bob Keeland
OK then I have a newbee question that is actually out of the scope of SQLite. 
If the only difference between C and C++ is the file extension, then what is 
the difference between C and C++? I'm thinking of adding a language other than 
the Visual Basic that I kind of know and would like to know the difference. 
I've been thinking about Java, but am not sure yet.
Bob Keeland

--- On Tue, 11/30/10, john darnell john.darn...@walsworth.com wrote:


From: john darnell john.darn...@walsworth.com
Subject: Re: [sqlite] Just compiled SQLite in Visual Studio
To: General Discussion of SQLite Database sqlite-users@sqlite.org
Date: Tuesday, November 30, 2010, 10:25 AM


Thanks Igor.

-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Igor Tandetnik
Sent: Monday, November 29, 2010 7:11 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Just compiled SQLite in Visual Studio

john darnell john.darn...@walsworth.com wrote:
 I just added it to a Visual Studio 8 project, turned off the use of 
 precompiled headers (the project is a C++ project) and
 compiled the SQLite.c file without any errors.

There is no such thing as a C++ project. A project in Visual Studio can happily 
contain both C and C++ files. By default, file extension determines whether the 
file is compiled with C or C++ compiler (.c would indicate C), and this could 
also be overridden in project settings on a per-file basis.
-- 
Igor Tandetnik

___
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] Just compiled SQLite in Visual Studio

2010-11-30 Thread Simon Slavin

On 1 Dec 2010, at 1:01am, Bob Keeland wrote:

 OK then I have a newbee question that is actually out of the scope of SQLite. 
 If the only difference between C and C++ is the file extension,

No.

 then what is the difference between C and C++? I'm thinking of adding a 
 language other than the Visual Basic that I kind of know and would like to 
 know the difference. I've been thinking about Java, but am not sure yet.

Argh.  C++ is C, with some additional features added to all object-oriented 
programming and some other stuff.  So every C program is a C++ program, with 
the programmer never having chosen to use those extra facilities.  And every 
C++ compiler can compile a C program.

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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Doug
Igore didn't mean there is no difference between C and C++.  He was just
saying a 'project' isn't C or C++.  In other words, C and C++ have different
(though similar) compiler rules, syntax, etc.  By default, the compiler will
compile a '.c' file using the C rules, and a '.cpp' file with the C++ rules.
And you can mix .c and .cpp files in the same project.

As for what the difference is?  That's a big question.  Objects exist in
C++, and they don't in C.  That's the tip of the iceberg.

Doug

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Bob Keeland
Sent: Tuesday, November 30, 2010 5:02 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Just compiled SQLite in Visual Studio

OK then I have a newbee question that is actually out of the scope of
SQLite. If the only difference between C and C++ is the file extension, then
what is the difference between C and C++? I'm thinking of adding a language
other than the Visual Basic that I kind of know and would like to know the
difference. I've been thinking about Java, but am not sure yet.
Bob Keeland

--- On Tue, 11/30/10, john darnell john.darn...@walsworth.com wrote:


From: john darnell john.darn...@walsworth.com
Subject: Re: [sqlite] Just compiled SQLite in Visual Studio
To: General Discussion of SQLite Database sqlite-users@sqlite.org
Date: Tuesday, November 30, 2010, 10:25 AM


Thanks Igor.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik
Sent: Monday, November 29, 2010 7:11 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Just compiled SQLite in Visual Studio

john darnell john.darn...@walsworth.com wrote:
 I just added it to a Visual Studio 8 project, turned off the use of 
 precompiled headers (the project is a C++ project) and compiled the
SQLite.c file without any errors.

There is no such thing as a C++ project. A project in Visual Studio can
happily contain both C and C++ files. By default, file extension determines
whether the file is compiled with C or C++ compiler (.c would indicate C),
and this could also be overridden in project settings on a per-file basis.
--
Igor Tandetnik

___
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

__ Information from ESET NOD32 Antivirus, version of virus signature
database 5662 (20101130) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com





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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Jay A. Kreibich
On Wed, Dec 01, 2010 at 01:10:51AM +, Simon Slavin scratched on the wall:

 So every C program is a C++ program,

  Not true.
  
  Try to compile sqlite3.c with a C++ compiler and see how far you get. 

   -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] Just compiled SQLite in Visual Studio

2010-11-30 Thread Bob Keeland
Oh, from the various replies I see that C++ is a more capable extension of C. 
Igor was only using a figure of speech, kind of. Sorry about the newbee 
question, but thanks for the replies.
 
Bob Keeland

--- On Tue, 11/30/10, Simon Slavin slav...@bigfraud.org wrote:


From: Simon Slavin slav...@bigfraud.org
Subject: Re: [sqlite] Just compiled SQLite in Visual Studio
To: General Discussion of SQLite Database sqlite-users@sqlite.org
Date: Tuesday, November 30, 2010, 7:10 PM



On 1 Dec 2010, at 1:01am, Bob Keeland wrote:

 OK then I have a newbee question that is actually out of the scope of SQLite. 
 If the only difference between C and C++ is the file extension,

No.

 then what is the difference between C and C++? I'm thinking of adding a 
 language other than the Visual Basic that I kind of know and would like to 
 know the difference. I've been thinking about Java, but am not sure yet.

Argh.  C++ is C, with some additional features added to all object-oriented 
programming and some other stuff.  So every C program is a C++ program, with 
the programmer never having chosen to use those extra facilities.  And every 
C++ compiler can compile a C program.

Simon.
___
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] Just compiled SQLite in Visual Studio

2010-11-30 Thread Reid Thompson
On 11/30/2010 10:18 PM, Doug wrote:
   Objects exist in
 C++, and they don't in C
actually  objects can and do exist in C, it's just a matter of writing 
them.  C++ added the extensions to make writing/managing them easier.

  
http://www.google.com/search?q=object+oriented+programming+in+Cie=utf-8oe=utf-8aq=trls=org.mozilla:en-US:officialclient=firefox-a
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Simon Slavin

On 1 Dec 2010, at 1:33am, Jay A. Kreibich wrote:

 On Wed, Dec 01, 2010 at 01:10:51AM +, Simon Slavin scratched on the wall:
 
 So every C program is a C++ program,
 
  Not true.
 
  Try to compile sqlite3.c with a C++ compiler and see how far you get. 

Can you explain the problem to me ?  The only C++ compiler I have here handles 
Obj-C as well and has no problem with it.

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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Reid Thompson
On 11/30/2010 8:42 PM, Simon Slavin wrote:
 On 1 Dec 2010, at 1:33am, Jay A. Kreibich wrote:

 On Wed, Dec 01, 2010 at 01:10:51AM +, Simon Slavin scratched on the wall:

 So every C program is a C++ program,
   Not true.

   Try to compile sqlite3.c with a C++ compiler and see how far you get.
 Can you explain the problem to me ?  The only C++ compiler I have here 
 handles Obj-C as well and has no problem with it.

which compiler are you using?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Igor Tandetnik
Bob Keeland keela...@yahoo.com wrote:
 OK then I have a newbee question that is actually out of the scope of SQLite. 
 If the only difference between C and C++ is the
 file extension, then what is the difference between C and C++?

Since the premise of the question is false, any conclusion whatsoever may 
logically follow.

C and C++ are two separate languages, somewhat related but nevertheless 
distinct. Just as it is customary to give Java sources a .java extension, it is 
customary to give C sources a .c extension and C++ sources a .cpp or .cc or 
sometimes .c++ extension. Just as the choice of file extension is not the only 
difference between Java and C++ (or Python, or Perl, or whatever), it's not the 
only difference between C and C++.

Igor Tandetnik

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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Igor Tandetnik
Simon Slavin slav...@bigfraud.org wrote:
 So every C program is a C++ program

Not quite true. Here are a few examples that are valid C but invalid C++:

/* implicit 'int' return type */
f();  

/* implicit conversion from void* to any pointer type */
char* p = malloc(100);

// calling a function without first declaring it.
undeclared(42);

// KR style function definitions.
void f(x)
int x;
{
}

It is true, however, that it's fairly easy to transform any C program into a 
program that's both valid C and C++, by applying straightforward modifications 
- tightening type safety and such.
-- 
Igor Tandetnik


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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Simon Slavin

On 1 Dec 2010, at 1:46am, Reid Thompson wrote:

 On 11/30/2010 8:42 PM, Simon Slavin wrote:
 On 1 Dec 2010, at 1:33am, Jay A. Kreibich wrote:
 
 On Wed, Dec 01, 2010 at 01:10:51AM +, Simon Slavin scratched on the 
 wall:
 
 So every C program is a C++ program,
  Not true.
 
  Try to compile sqlite3.c with a C++ compiler and see how far you get.
 Can you explain the problem to me ?  The only C++ compiler I have here 
 handles Obj-C as well and has no problem with it.
 
 which compiler are you using?

Oh.  No matter.  It's the one Apple's Xcode calls and it's being very clever 
about what language it's compiling.  It defeated my test.

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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Igor Tandetnik
Bob Keeland keela...@yahoo.com wrote:
 Oh, from the various replies I see that C++ is a more capable extension of C. 
 Igor was only using a figure of speech, kind of.

Everything I said in this thread so far, I meant quite literally. Which 
expression of mine do you take as a figure of speech?
-- 
Igor Tandetnik


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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Reid Thompson
On 11/30/2010 9:04 PM, Simon Slavin wrote:
 Oh.  No matter.  It's the one Apple's Xcode calls and it's being very clever 
 about what language it's compiling.  It defeated my test.

 Simon.
a quick google query seems to imply that Xcode uses the Gnu Compiler 
Collection (gcc, g++,  gcj, gfortan, etc)   see 
http://en.wikipedia.org/wiki/GNU_Compiler_Collection the STRUCTURE 
section about midway down and http://gcc.gnu.org/ for the complete details
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Dustin Sallings

On Nov 30, 2010, at 18:04, Igor Tandetnik wrote:

 It is true, however, that it's fairly easy to transform any C program into a 
 program that's both valid C and C++, by applying straightforward 
 modifications - tightening type safety and such.

Except there are a lot of areas where C advanced in C99 that C++ can't 
deal with in current versions:

item_info info = { .nvalue = 1 };
 
struct {
char blah[];
}

char blah[somevariable];

The ability to sprintf a size_t or any general 64-bit number.

(and a few other things that are really convenient, but have got in my 
way in attempts to port c code to c++).

-- 
dustin sallings

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


Re: [sqlite] Just compiled SQLite in Visual Studio

2010-11-30 Thread Igor Tandetnik
Dustin Sallings dus...@spy.net wrote:
 On Nov 30, 2010, at 18:04, Igor Tandetnik wrote:
 
 It is true, however, that it's fairly easy to transform any C program into a 
 program that's both valid C and C++, by applying
 straightforward modifications - tightening type safety and such. 
 
 Except there are a lot of areas where C advanced in C99 that C++ can't deal 
 with in current versions

True. I should have clarified that I meant a C90 program. In my defense, I work 
primarily with Visual Studio compilers, which don't support C99 (except for the 
most trivial features, e.g. // comments).
-- 
Igor Tandetnik


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


[sqlite] Fwd: [sqlite-dev] SQLIte 64bit precompiled libraries for Windows

2010-11-30 Thread Saar Carmi
Is there anyone publishing stable version of precompiled binaries of sqlite
for Windows 64-bit ?
I understand from the below sqlite.org doesn't, but there maybe another
site?

Thanks

-- Forwarded message --
From: Dan Kennedy danielk1...@gmail.com
Date: Tue, Nov 30, 2010 at 6:58 PM
Subject: Re: [sqlite-dev] SQLIte 64bit precompiled libraries for Windows
To: sqlite-...@sqlite.org


On 11/30/2010 11:17 PM, Saar Carmi wrote:
 Hi
 Are there precompiled libraries for Windows 64bit available?

 Or should I compile it myself ?

Not available from sqlite.org.

For this kind of question, use the sqlite-users mailing list.
This mailing list is really for discussion of SQLite core
development and has only a small number of readers.
___
sqlite-dev mailing list
sqlite-...@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-dev
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users