Re: [sqlite] C code spanish character insert problem

2009-09-29 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bible Trivia Extreme wrote:
> (loop over spanish .txt file here while inserting)
> sprintf(query, "INSERT INTO questions VALUES('%s', '%s')", question,
> answer);

That is a *really* bad way of doing things, both from a performance point of
view and security/integrity.  (Lookup SQL injection to see why.)  If you
must use a printf style interface then at least use sqlite3_mprintf with %Q
format.  But you'll be far better off using a prepared statement and binding
strings to it in your loop.

You also don't show using a transation (BEGIN/COMMIT).  Without it each
insert will be a transaction and run at the speed of your disk.

> sqlite3_exec(db, "PRAGMA encoding = UTF8-8", 0, 0, 0);

That is a syntax error (should be UTF8).  In any event it certainly doesn't
do what you think it does.  From your code using SQLite you can't even tell
what encoding the database is in.  The SQLite API always gives you UTF8 when
using regular APIs and UTF16 when using the -16 suffix APIs.

The database encoding only affects how many bytes are used in the file for
unicode strings.  Unless you are storing a *lot* of text you generally will
not care. (And by lot I mean hundreds of megabytes and possibly gigabytes.)
 The defaults it picks are very sensible (ie match the api family you use.)

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

iEYEARECAAYFAkrC6uUACgkQmOOfHg372QT9agCePAO+bc2hLFN2Oc4C0nENyxfZ
6HIAn2tyguLzHPtQ/N8oc1ro1htF5l7/
=XTkd
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] C code spanish character insert problem

2009-09-29 Thread Dan Bishop
Bible Trivia Extreme wrote:
>> Open your spanish.txt file in a hex editor.  The letter 'ñ' should be
>> encoded as C3 B1.  If you see F1 instead, it means your file is in
>>
>> 
> ISO-8859-1 or something similar.Thanks Dan, it seems to be F1.  So what do I 
> do exactly?
>
> Im assuming I need to fix the .txt file somehow, but how?
>
> Thanks for your help
Use the "iconv" command-line program, or any programming language 
containing the equivalent functionality.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Inconsistency in mutex.h and mutex.c

2009-09-29 Thread Dan Kennedy

On Sep 30, 2009, at 5:29 AM, Schrum, Allan wrote:

> At the bottom of mutex.h there is an:
>
> #ifdef SQLITE_MUTEX_OMIT
> ...
> #endif /* defined(SQLITE_OMIT_MUTEX)
>
> Either the comments or the define should be changed. This occurs in  
> mutex.c as well.
>
> The pattern for all other "OMIT" definitions is SQLITE_OMIT_% so it  
> would be nice if this one could be changed to stay consistent with  
> the rest.

This one is supposed to be consistent with SQLITE_MUTEX_NOOP,
SQLITE_MUTEX_PTHREADS and so on. Can fix the comments though.

Dan.


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


Re: [sqlite] C code spanish character insert problem

2009-09-29 Thread Bible Trivia Extreme
Open your spanish.txt file in a hex editor.  The letter 'ñ' should be

> encoded as C3 B1.  If you see F1 instead, it means your file is in
> ISO-8859-1 or something similar.
> ___
>
> Thanks Dan, it seems to be F1.  So what do I do exactly?
Im assuming I need to fix the .txt file somehow, but how?

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


Re: [sqlite] C code spanish character insert problem

2009-09-29 Thread Dan Bishop
Bible Trivia Extreme wrote:
> On Tue, Sep 29, 2009 at 9:48 PM, Simon Slavin
> wrote:
>
>   
>> On 30 Sep 2009, at 2:25am, Bible Trivia Extreme wrote:
>>
>> 
>>> Is there something special I need to do in the C/Sqlite
>>> code to make this work properly?
>>>   
>> Which SQLite function calls are you using to run your INSERT commands ?
>>
>> Simon.
>>
>> 
>
> My psuedo code is as follows:
>
> sqlite3_open(...);
> sqlite3_exec(db, "PRAGMA encoding = UTF8-8", 0, 0, 0);
>
> char *query = "create table questions(q text, ans text)";
> sqlite3_exec(db, query, NULL, NULL, );
>
> (loop over spanish .txt file here while inserting)
> sprintf(query, "INSERT INTO questions VALUES('%s', '%s')", question,
> answer);
>
> end of loop
> sqlite3_close(db);
Open your spanish.txt file in a hex editor.  The letter 'ñ' should be 
encoded as C3 B1.  If you see F1 instead, it means your file is in 
ISO-8859-1 or something similar.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] C code spanish character insert problem

2009-09-29 Thread Bible Trivia Extreme
On Tue, Sep 29, 2009 at 9:48 PM, Simon Slavin
wrote:

>
> On 30 Sep 2009, at 2:25am, Bible Trivia Extreme wrote:
>
> > Is there something special I need to do in the C/Sqlite
> > code to make this work properly?
>
> Which SQLite function calls are you using to run your INSERT commands ?
>
> Simon.
>

My psuedo code is as follows:

sqlite3_open(...);
sqlite3_exec(db, "PRAGMA encoding = UTF8-8", 0, 0, 0);

char *query = "create table questions(q text, ans text)";
sqlite3_exec(db, query, NULL, NULL, );

(loop over spanish .txt file here while inserting)
sprintf(query, "INSERT INTO questions VALUES('%s', '%s')", question,
answer);

end of loop
sqlite3_close(db);
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] C code spanish character insert problem

2009-09-29 Thread Igor Tandetnik
Bible Trivia Extreme wrote:
> Im trying to figure out why I cannot get spanish characters
> into my sqlite DB properly.

Start here:
http://www.joelonsoftware.com/articles/Unicode.html

Igor Tandetnik



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


Re: [sqlite] multiple prepare statements

2009-09-29 Thread Igor Tandetnik
Sam Carleton wrote:
> Is it possible to have two different prepare statements at one time

Yes. As many as you need.

Igor Tandetnik



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


[sqlite] Phoronix SQLite benchmark Improvements - [was Re: SQLite behaviour on FreeBSD and KVM]

2009-09-29 Thread Matthew Tippett
Relabling to provide focus on this thread the KVM/FreeBSD specific 
issues - I'll deal with that the main thread.

So, if I could put forward to you a few suggestions.

   1) Review the existing tests (which you have done somewhat already)
   2) Define a clear and relevant intent for benchmarking SQLite
   3) Work with Michael (from Phoronix) and myself to codify this intent 
  into a set of test cases and test suites

I'll let this fork of the thread settle for a bit before taking it off list.

Regards,

Matthew


 Original Message  
Subject: Re: [sqlite] SQLite behaviour on FreeBSD and KVM
From: Simon Slavin 
To: General Discussion of SQLite Database 
Date: 09/29/2009 08:40 PM

> On 29 Sep 2009, at 10:29pm, Matthew Tippett wrote:
> 
>> If there is anyone who is interested in assisting in improving the
>> quality/value/functional interest of the benchmarks, then please
>> advise.
> 
> In SQLite, when you know you are making many changes and don't need to  
> consult the data until you're finished, you surround the changes with  
> BEGIN TRANSACTION and END TRANSACTION.  This makes them into one big  
> update rather than lots of little ones, and it means that disk gets  
> updated just once (handwave here) rather than after each command.   
> Naturally, this is hugely faster.  No way should 2500 inserts in  
> SQLite take 14 minutes.
> 
> So much faster that, as Pavel noted upthread, it's suspiciously like  
> what you're seeing in the result for KVM.  This suggests that KVM is  
> not really writing results to disk immediately.  Putting those INSERTs  
> into one transaction could make Ubuntu 9.10 (not KVM) as fast or  
> faster than the result you're getting for KVM.  Sorry, I have no Linux  
> to test it on.
> 
> You could modify the sqlite test to reflect this.  You could perhaps  
> turn sqlite-2500-insertions.txt into 50 transactions, with BEGIN  
> TRANSACTION and END TRANSACTION around each 50 INSERT commands.  Or  
> you could have two tests: make two copies of sqlite-2500- 
> insertions.txt, leave one as it is and put BEGIN TRANSACTION and END  
> TRANSACTION at the beginning and end of the other.  This would test  
> both 2500 individual INSERT commands and one transaction of 2500  
> INSERTs, testing SQLite as both kinds of application would need to use  
> it.
> 
> I know nothing about KVM but I assume that it's operating correctly  
> here: since the entire machine is virtualised it doesn't matter that  
> it's not really writing to real disk.
> 
> 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] SQLite behaviour on FreeBSD and KVM

2009-09-29 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthew Tippett wrote:
> I would like to highlight the following SQLite benchmark results posted
> by Phoronix via Phoronix Test Suite (http://www.phoronix-test-suite.com/)

An earlier test showed massive differences for Linux filesystems but those
results also didn't hold up.  Someone entered a ticket about it (which is
not the right place to discuss these things!) and the last comment shows
actual reproducible numbers:

  http://sqlite.org/cvstrac/tktview?tn=3934

My general advice is to produce a text file of queries and run those using
the SQLite shell.  That kind of test is easy for anyone else to download and
reproduce.  You then need to ensure the test suite itself gets the same
numbers as the shell.

Transactions and disk syncing have been covered by other comments.

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

iEYEARECAAYFAkrCuCUACgkQmOOfHg372QRNBQCdEBh/jT0Np4d9z1/UNhHSD0k3
rGcAoJsvP8jHS7E46YVoqwkcqjiy/PmA
=IOFK
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] C code spanish character insert problem

2009-09-29 Thread Bible Trivia Extreme
Hello-

Im trying to figure out why I cannot get spanish characters
into my sqlite DB properly.  Im using a C program to read
a text file that is already translated into spanish.  When I
look at this file the spanish characters (tilde n, acentos etc)
are correct.  When I run the C program and open the resulting
DB, the places those characters are supposed to be are
question marks, ie ma?ana for manana (with tilde n).

Is there something special I need to do in the C/Sqlite
code to make this work properly?

Im running it on a Mini Mac, but have also tried a
Fedora Core 11 linux box as well.

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


Re: [sqlite] SQLite behaviour on FreeBSD and KVM

2009-09-29 Thread Simon Slavin

On 29 Sep 2009, at 10:29pm, Matthew Tippett wrote:

> If there is anyone who is interested in assisting in improving the
> quality/value/functional interest of the benchmarks, then please
> advise.

In SQLite, when you know you are making many changes and don't need to  
consult the data until you're finished, you surround the changes with  
BEGIN TRANSACTION and END TRANSACTION.  This makes them into one big  
update rather than lots of little ones, and it means that disk gets  
updated just once (handwave here) rather than after each command.   
Naturally, this is hugely faster.  No way should 2500 inserts in  
SQLite take 14 minutes.

So much faster that, as Pavel noted upthread, it's suspiciously like  
what you're seeing in the result for KVM.  This suggests that KVM is  
not really writing results to disk immediately.  Putting those INSERTs  
into one transaction could make Ubuntu 9.10 (not KVM) as fast or  
faster than the result you're getting for KVM.  Sorry, I have no Linux  
to test it on.

You could modify the sqlite test to reflect this.  You could perhaps  
turn sqlite-2500-insertions.txt into 50 transactions, with BEGIN  
TRANSACTION and END TRANSACTION around each 50 INSERT commands.  Or  
you could have two tests: make two copies of sqlite-2500- 
insertions.txt, leave one as it is and put BEGIN TRANSACTION and END  
TRANSACTION at the beginning and end of the other.  This would test  
both 2500 individual INSERT commands and one transaction of 2500  
INSERTs, testing SQLite as both kinds of application would need to use  
it.

I know nothing about KVM but I assume that it's operating correctly  
here: since the entire machine is virtualised it doesn't matter that  
it's not really writing to real disk.

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


Re: [sqlite] Compiler warnings with Sun Studio 12.1 on Solaris 10

2009-09-29 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Nicolas Williams wrote:
> On Tue, Sep 29, 2009 at 11:21:30AM -0700, Roger Binns wrote:
>> Nicolas Williams wrote:
>>> If you move the cast to the left the warning should go away: 
>>> ((sqlite3_int64)(1L<<63))
>> And this is why making warnings go away leads to bugs.  The replacement
>> above will only work if sizeof(long)==sizeof(long long) which is not the
>> case on Windows in 64 bit mode or in 32 bit mode in general on any platform.
> 
> Where is long long entering the picture here? 

Really? The cast is to a 64 bit quantity.  Pretty much every compiler uses
'long long' to represent a 64 bit quantity (even in 32 bit mode), although
some also have __int64 and others int64_t depending on age and standards
compliance.

Another example of compilers whining is gcc saying that in one part of the
code, a parameter to memset could be zero (which usually indicates a
programming error).  Except the compiler is wrong as human inspection
proves.  Just because a warning is present does not mean it is right or that
the compiler is perfect.  Hiding these warnings is even more dangerous
because it obfuscates the original intention of the code.  (This is why a
universal no warnings policy can hurt.)

Demonstrate the code is wrong functionality (ie tests are broken) or that it
isn't written in a standards compliant way :-)  The compiler warnings could
help point to those locations.

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

iEYEARECAAYFAkrCpjYACgkQmOOfHg372QScTgCeNILUcfFPq45ehdgfPQb+HdoI
D0kAn1AhMylW5G7+rm73rCbWWknAA+Bl
=FmBf
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Inconsistency in mutex.h and mutex.c

2009-09-29 Thread Schrum, Allan
At the bottom of mutex.h there is an:

#ifdef SQLITE_MUTEX_OMIT
...
#endif /* defined(SQLITE_OMIT_MUTEX)

Either the comments or the define should be changed. This occurs in mutex.c as 
well.

The pattern for all other "OMIT" definitions is SQLITE_OMIT_% so it would be 
nice if this one could be changed to stay consistent with the rest.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite behaviour on FreeBSD and KVM

2009-09-29 Thread Matthew Tippett
If there is anyone who is interested in assisting in improving the
quality/value/functional interest of the benchmarks, then please
advise.

PTS can handle direct numerical, average or gemetric means at
individual test case or aggregate test suites.

Regards... Matthew


On 9/29/09, Simon Slavin  wrote:
>
> On 29 Sep 2009, at 8:57pm, Matthew Tippett wrote:
>
>> In particular
>>
>> http://www.phoronix.com/scan.php?page=article=linux_2631_kvm=3
>> http://www.phoronix.com/scan.php?page=article=freebsd8_ubuntu910=7
>>
>> In both of these cases, there are configurations where there is an
>> order
>> of magnitude difference between the performance of the systems.
>>
>> I would like to confirm my expectation that SQLite will by default
>> always do synchronous file operations.  It seems that in the Ubuntu
>> guest on KVM Ubuntu host and the FreeBSD-8.0-RC1 benchmarks, it would
>> appears that the kernel and filesystem are not honoring the request
>> for
>> synchronous fileIO.
>>
>> Is my assertion sane? If some SQLite domain experts could look at the
>> results and temper to what performance numbers "sound right" for
>> SQLite
>> it would be appreciated.
>
> To save everyone else tracking it down, the SQL test in this case
> consists of
>
> CREATE TABLE pts1 ('I' SMALLINT NOT NULL, 'DT' TIMESTAMP NOT NULL
> DEFAULT CURRENT_TIMESTAMP, 'F1' VARCHAR(4) NOT NULL, 'F2' VARCHAR(16)
> NOT NULL);\
>
> and then running 2500 lines like these:
>
> INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('1',
> CURRENT_TIMESTAMP, '6758', '9844343722998287');
> INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('2',
> CURRENT_TIMESTAMP, '3733', '8925952369645997');
> INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('3',
> CURRENT_TIMESTAMP, '5636', '8366445547934654');
> INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('4',
> CURRENT_TIMESTAMP, '5626', '1439954363252147');
>
> I cannot find any sign of BEGIN;COMMIT; .
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>

-- 
Sent from my mobile device
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite behaviour on FreeBSD and KVM

2009-09-29 Thread Pavel Ivanov
> I cannot find any sign of BEGIN;COMMIT; .

And as a result of that, Matthew, you're right, on OS (or OS + file
system) where fsync() doesn't do physical write test getting huge
boost in performance.
Just take the second test: 12,500 transactions in 771.13 seconds
giving about 16 transactions per second which is reasonable and
explainable. Any faster performance is questionable, especially the
order of magnitude faster...

Pavel

On Tue, Sep 29, 2009 at 5:17 PM, Simon Slavin
 wrote:
>
> On 29 Sep 2009, at 8:57pm, Matthew Tippett wrote:
>
>> In particular
>>     http://www.phoronix.com/scan.php?page=article=linux_2631_kvm=3
>> http://www.phoronix.com/scan.php?page=article=freebsd8_ubuntu910=7
>>
>> In both of these cases, there are configurations where there is an
>> order
>> of magnitude difference between the performance of the systems.
>>
>> I would like to confirm my expectation that SQLite will by default
>> always do synchronous file operations.  It seems that in the Ubuntu
>> guest on KVM Ubuntu host and the FreeBSD-8.0-RC1 benchmarks, it would
>> appears that the kernel and filesystem are not honoring the request
>> for
>> synchronous fileIO.
>>
>> Is my assertion sane? If some SQLite domain experts could look at the
>> results and temper to what performance numbers "sound right" for
>> SQLite
>> it would be appreciated.
>
> To save everyone else tracking it down, the SQL test in this case
> consists of
>
> CREATE TABLE pts1 ('I' SMALLINT NOT NULL, 'DT' TIMESTAMP NOT NULL
> DEFAULT CURRENT_TIMESTAMP, 'F1' VARCHAR(4) NOT NULL, 'F2' VARCHAR(16)
> NOT NULL);\
>
> and then running 2500 lines like these:
>
> INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('1',
> CURRENT_TIMESTAMP, '6758', '9844343722998287');
> INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('2',
> CURRENT_TIMESTAMP, '3733', '8925952369645997');
> INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('3',
> CURRENT_TIMESTAMP, '5636', '8366445547934654');
> INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('4',
> CURRENT_TIMESTAMP, '5626', '1439954363252147');
>
> I cannot find any sign of BEGIN;COMMIT; .
>
> 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] SQLite behaviour on FreeBSD and KVM

2009-09-29 Thread Simon Slavin

On 29 Sep 2009, at 8:57pm, Matthew Tippett wrote:

> In particular
> http://www.phoronix.com/scan.php?page=article=linux_2631_kvm=3
> http://www.phoronix.com/scan.php?page=article=freebsd8_ubuntu910=7
>
> In both of these cases, there are configurations where there is an  
> order
> of magnitude difference between the performance of the systems.
>
> I would like to confirm my expectation that SQLite will by default
> always do synchronous file operations.  It seems that in the Ubuntu
> guest on KVM Ubuntu host and the FreeBSD-8.0-RC1 benchmarks, it would
> appears that the kernel and filesystem are not honoring the request  
> for
> synchronous fileIO.
>
> Is my assertion sane? If some SQLite domain experts could look at the
> results and temper to what performance numbers "sound right" for  
> SQLite
> it would be appreciated.

To save everyone else tracking it down, the SQL test in this case  
consists of

CREATE TABLE pts1 ('I' SMALLINT NOT NULL, 'DT' TIMESTAMP NOT NULL  
DEFAULT CURRENT_TIMESTAMP, 'F1' VARCHAR(4) NOT NULL, 'F2' VARCHAR(16)  
NOT NULL);\

and then running 2500 lines like these:

INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('1',  
CURRENT_TIMESTAMP, '6758', '9844343722998287');
INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('2',  
CURRENT_TIMESTAMP, '3733', '8925952369645997');
INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('3',  
CURRENT_TIMESTAMP, '5636', '8366445547934654');
INSERT INTO 'pts1' ('I', 'DT', 'F1', 'F2') VALUES ('4',  
CURRENT_TIMESTAMP, '5626', '1439954363252147');

I cannot find any sign of BEGIN;COMMIT; .

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


Re: [sqlite] Use of .TIMER within sqlite3 commandline utility: wasRE: sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Simon Slavin

On 29 Sep 2009, at 8:22pm, Wilson, Ronald wrote:

>> The .timer command is only available on unix and unix-like platforms
>> at present. Not on win32.
>
> D'Oh!

Ah.  Okay, I have it because I'm using a Mac.  The OP must be running  
Windows.

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


[sqlite] SQLite behaviour on FreeBSD and KVM

2009-09-29 Thread Matthew Tippett
Hi,

I would like to highlight the following SQLite benchmark results posted
by Phoronix via Phoronix Test Suite (http://www.phoronix-test-suite.com/)

In particular
 http://www.phoronix.com/scan.php?page=article=linux_2631_kvm=3
http://www.phoronix.com/scan.php?page=article=freebsd8_ubuntu910=7

In both of these cases, there are configurations where there is an order
of magnitude difference between the performance of the systems.

I would like to confirm my expectation that SQLite will by default
always do synchronous file operations.  It seems that in the Ubuntu
guest on KVM Ubuntu host and the FreeBSD-8.0-RC1 benchmarks, it would
appears that the kernel and filesystem are not honoring the request for
synchronous fileIO.

Is my assertion sane? If some SQLite domain experts could look at the 
results and temper to what performance numbers "sound right" for SQLite 
it would be appreciated.

Regards,

Matthew

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


Re: [sqlite] Compiler warnings with Sun Studio 12.1 on Solaris 10

2009-09-29 Thread Nicolas Williams
On Tue, Sep 29, 2009 at 12:05:21PM -0700, Jim Showalter wrote:
> Warnings are never harmless--they clutter the build output and 
> introduce cognitive dissonance when trying to see if a build is clean 
> or not.
> 
> I worked on a project where they hadn't enabled warnings during 
> development because it was "too much trouble". When I enabled 
> warnings, there were more than 14,000 of them, and of course then the 
> warnings couldn't be addressed because "there were too many of them".
> 
> Zero tolerance for warnings!

I mostly agree.  There are warnings that one can safely choose to
ignore.  For example, the Sun Studio lint has a very large number of
static analysis options, a few of which I think should be removed (e.g.,
complaints about constant while loop conditions -- while (1) ... is just
too common and useful to complain about, nor is it clear why constant
while loop conditions are a bad thing given that for (;;) elicits no
complaints).  Others you might quibble about in specific projects (e.g.,
lint complaining about ignored function return values when you don't
cast the function return to void).  But ignoring all warnings?  That's
just asking for trouble.  That doesn't appear to be what the SQLite3
community is doing though, so I've no real complaint here.

In this case I agree that the warnings are harmless.  You do have do
wonder: why use constant expressions that result in overflow warnings
(0x1f<<28) when there are equivalent constant expressions that don't
(0xf<<28)?  Compiler variations might be a good reason for not using
certain constant expressions (e.g., D. R.  Hipp's point about the L
suffix).  I don't really know about compilers other than GCC and Sun
Studio, so I'll shut up now :)

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


Re: [sqlite] Use of .TIMER within sqlite3 commandline utility: wasRE: sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Wilson, Ronald
> The .timer command is only available on unix and unix-like platforms
> at present. Not on win32.

D'Oh!

Ron Wilson, Engineering Project Lead
(o) 434.455.6453, (m) 434.851.1612, www.harris.com

HARRIS CORPORATION   |   RF Communications Division
assuredcommunications(tm)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Compiler warnings with Sun Studio 12.1 on Solaris 10

2009-09-29 Thread Nicolas Williams
On Tue, Sep 29, 2009 at 11:21:30AM -0700, Roger Binns wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Nicolas Williams wrote:
> > If you move the cast to the left the warning should go away: 
> > ((sqlite3_int64)(1L<<63))
> 
> And this is why making warnings go away leads to bugs.  The replacement
> above will only work if sizeof(long)==sizeof(long long) which is not the
> case on Windows in 64 bit mode or in 32 bit mode in general on any platform.

Where is long long entering the picture here?  And what of the
alternative I gave where the actual most negative value of sqlite3_int64
is used?  In any case, you clearly know how to fix the warning safely.

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


Re: [sqlite] sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Wilson, Ronald
> sqlite> .timer on
> sqlite> select 1;
> 1
> CPU Time: user 0.000295 sys 0.000269
> sqlite>

What version are you using?

RW

Ron Wilson, Engineering Project Lead
(o) 434.455.6453, (m) 434.851.1612, www.harris.com

HARRIS CORPORATION   |   RF Communications Division
assuredcommunications(tm)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Use of .TIMER within sqlite3 commandline utility: was RE: sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Dan Kennedy

On Sep 30, 2009, at 1:41 AM, Griggs, Donald wrote:

>
>
> I believe one must enable the .TIMER option when compiling  
> sqlite3.   I
> think the pre-compiled versions have this disabled by default (at  
> least
> for the Windows binaries).

The .timer command is only available on unix and unix-like platforms
at present. Not on win32.




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


Re: [sqlite] Compiler warnings with Sun Studio 12.1 on Solaris 10

2009-09-29 Thread D. Richard Hipp

On Sep 29, 2009, at 2:21 PM, Roger Binns wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Nicolas Williams wrote:
>> If you move the cast to the left the warning should go away:  
>> ((sqlite3_int64)(1L<<63))
>
> And this is why making warnings go away leads to bugs.  The  
> replacement
> above will only work if sizeof(long)==sizeof(long long) which is not  
> the
> case on Windows in 64 bit mode or in 32 bit mode in general on any  
> platform.

Further:  We have had problems with the L suffix in some compilers.   
We haven't found a portable way to express a 64-bit integer literal.

>
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkrCUCYACgkQmOOfHg372QTvAQCfQaHiApWb0UNFAgleFUnFQfAu
> nXkAnRqqCi4MNIllFSuoW0F9FwIz/8Hi
> =gmns
> -END PGP SIGNATURE-
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

D. Richard Hipp
d...@hwaci.com



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


[sqlite] Use of .TIMER within sqlite3 commandline utility: was RE: sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Griggs, Donald
 

I believe one must enable the .TIMER option when compiling sqlite3.   I
think the pre-compiled versions have this disabled by default (at least
for the Windows binaries).



Donald


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


Re: [sqlite] sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Petite Abeille

On Sep 29, 2009, at 7:19 PM, Wilson, Ronald wrote:

> I can't find the .timer feature in the SQLite command line utility.

sqlite> .timer on
sqlite> select 1;
1
CPU Time: user 0.000295 sys 0.000269
sqlite>


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


Re: [sqlite] Comparing two tables?

2009-09-29 Thread Petite Abeille

On Sep 29, 2009, at 6:50 PM, Cory Nelson wrote:

> i believe he means except, not minus.

Correct. Got my SQL dialects intermingled :)

> If all you need is differing
> rows, this will work like a charm.  Otherwise if you need a more
> fine-grained delta like only returning columns that changed, you will
> need a more complex (but still pretty simple) join.
>
> SELECT * FROM t_foo EXCEPT SELECT * FROM t_bar;

And for the "fancy" join, something like:

select *
from   bar
left join  foo
on foo.id = bar.id
where  foo.id is null
or foo.baz != bar.baz

etc...

As always, details might vary.


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


Re: [sqlite] Bug report: Memory reused after freed

2009-09-29 Thread Dan Kennedy

On Sep 30, 2009, at 1:09 AM, Ralf Junker wrote:

> At 14:04 29.09.2009, Dan Kennedy wrote:
>
>> On Sep 29, 2009, at 4:30 PM, Ralf Junker wrote:
>>
>>> My memory manager reports that the SQL below results in memory being
>>> reused after it has already been freed when it is RUN FOR A SECOND
>>> TIME on the same database connection.
>>
>> Hi Ralf,
>>
>> Thanks for this report. I'm unable to reproduce the problem so far
>> though.
>
> No longer needed. The problem no longer shows with check-in  
> [582bd76828] applied. In fact I believed that it was initiated by my  
> report on this list.

It was. valgrind reported that the code was using an uninitialized
variable when running your SQL sample. Now that I look at it a second
time I can see how that led to writing to freed memory, as the bounds
checker reported.

Thanks for following up.

Dan.

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


Re: [sqlite] Compiler warnings with Sun Studio 12.1 on Solaris 10

2009-09-29 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Nicolas Williams wrote:
> If you move the cast to the left the warning should go away: 
> ((sqlite3_int64)(1L<<63))

And this is why making warnings go away leads to bugs.  The replacement
above will only work if sizeof(long)==sizeof(long long) which is not the
case on Windows in 64 bit mode or in 32 bit mode in general on any platform.

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

iEYEARECAAYFAkrCUCYACgkQmOOfHg372QTvAQCfQaHiApWb0UNFAgleFUnFQfAu
nXkAnRqqCi4MNIllFSuoW0F9FwIz/8Hi
=gmns
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug report: Memory reused after freed

2009-09-29 Thread Ralf Junker
At 14:04 29.09.2009, Dan Kennedy wrote:

>On Sep 29, 2009, at 4:30 PM, Ralf Junker wrote:
>
>> My memory manager reports that the SQL below results in memory being  
>> reused after it has already been freed when it is RUN FOR A SECOND  
>> TIME on the same database connection.
>
>Hi Ralf,
>
>Thanks for this report. I'm unable to reproduce the problem so far
>though.

No longer needed. The problem no longer shows with check-in [582bd76828] 
applied. In fact I believed that it was initiated by my report on this list.

Information below is just FYI.

>Are you compiling SQLite with any special symbols or anything
>like that?

Not that I am aware of. Certainly nothing except the usual which I did before 
the problem surfaced.

>Are you able to build other programs using this memory manager? If so,
>does the bug show up when you pass the problematic SQL to the command
>line tool twice? Or if I send you a C program are you able to build and
>test it?

I am not able to use the exact same memory manager when I run C code directly.

Alternatively, I did just now run SQLite on Embarcadero's C++ Builder with 
CodeGuard enabled. This results in a magnitude of error reports while the 
SQLite code still produces correct results AFAIKS. It is impossible for me to 
tell if these reports also contain the one I reported earlier. Knowing little 
about how well CodeGuard does its job, I am not sure how seriously I shall take 
its warnings as long as all works well.

Ralf 

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


Re: [sqlite] Bug report: Memory reused after freed

2009-09-29 Thread Ralf Junker
At 14:04 29.09.2009, Dan Kennedy wrote:

>On Sep 29, 2009, at 4:30 PM, Ralf Junker wrote:
>
>> My memory manager reports that the SQL below results in memory being  
>> reused after it has already been freed when it is RUN FOR A SECOND  
>> TIME on the same database connection.
>
>Hi Ralf,
>
>Thanks for this report. I'm unable to reproduce the problem so far
>though.

No longer needed. The problem no longer shows with check-in [582bd76828] 
applied. In fact I believed that it was initiated by my report on this list.

Information below is just FYI.

>Are you compiling SQLite with any special symbols or anything
>like that?

Not that I am aware of. Certainly nothing except the usual which I did before 
the problem surfaced.

>Are you able to build other programs using this memory manager? If so,
>does the bug show up when you pass the problematic SQL to the command
>line tool twice? Or if I send you a C program are you able to build and
>test it?

I am not able to use the exact same memory manager when I run C code directly.

Alternatively, I did just now run SQLite on Embarcadero's C++ Builder with 
CodeGuard enabled. This results in a magnitude of error reports while the 
SQLite code still produces correct results AFAIKS. It is impossible for me to 
tell if these reports also contain the one I reported earlier. Knowing little 
about how well CodeGuard does its job, I am not sure how seriously I shall take 
its warnings as long as all works well.

Ralf 

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


Re: [sqlite] sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Wilson, Ronald
> Huh.  Do a .help in that version.  Should be there.  See
> 
> 
> 
> Simon.

I tried it in 3.6.10 and went, "huh" as well.  So I upgraded to the
latest (3.6.18) and still no .timer command.

RW

Ron Wilson, Engineering Project Lead
(o) 434.455.6453, (m) 434.851.1612, www.harris.com

HARRIS CORPORATION   |   RF Communications Division
assuredcommunications(tm)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Wilson, Ronald
> That's a good start. Don't forget iostat. On top of that,
> Simon Slavin already told you how to measure time taken in
> SQLite with the .timer ON command.

I can't find the .timer feature in the SQLite command line utility.

SQLite version 3.6.18
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .timer ON
unknown command or invalid arguments:  "timer". Enter ".help" for help
sqlite> .quit

RW

Ron Wilson, Engineering Project Lead
(o) 434.455.6453, (m) 434.851.1612, www.harris.com

HARRIS CORPORATION   |   RF Communications Division
assuredcommunications(tm)

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


[sqlite] Feature Request Discussion: Virtual Table Column Use identification

2009-09-29 Thread Schrum, Allan
Hi Folks,

I need to know what columns of my virtual table implementation are used for a 
particular query or not. The computation of the columns is expensive and cannot 
be deferred until the call to xColumn(). Thus I need to know before the first 
row is fetched so that I can be efficient in my operation of the virtual table.

I have found a solution that works for me, but it is a minor breaking change 
for some of the existing virtual table implementations. I have modified the 
vdbe.c engine so that after opening the virtual table (OP_VOpen) that it scan 
the current microcode for columns (OP_VColumn) used by that cursor. I then call 
xColumn() with the pContext set to NULL (that's the breaking change). The 
"NULL" indicates to my implementation that the column will be used in the query 
that is about to happen. In my xOpen() routine I initialize things to keep 
track of what is used and then identify which columns are used through the call 
to xColumn().

For existing implementations the required change would be to test pContext and 
return immediately.

My questions for the group are:

Is this a reasonable extension / feature to add to virtual table 
implementations? I need it, but would this help others as well?

Would surrounding this new code with a PRAGMA option help with respect to the 
"breaking change". These interfaces are experimental, but are being used by 
many. The amount of time used to find these opcodes is small, so I do not think 
this is an efficiency issue. Rather it is a way to gently introduce this 
concept.

Is there another way to do this that is not a breaking change?

Comments? Questions?

Thanks,

-Allan

The patch for the modification against 3.6.18 release vdbe.c that implements 
the above feature is below. This code is added *after* all the work for 
OP_VOpen has been completed. I place this code in the public domain under the 
same license as SQLITE3.

diff -r -u sqlite3/src/vdbe.c roqlite3/src/vdbe.c
--- sqlite3/src/vdbe.c  2009-09-28 13:34:11.0 -0600
+++ new/src/vdbe.c 2009-09-28 13:34:13.0 -0600
@@ -5173,6 +5173,18 @@
   pModule->xClose(pVtabCursor);
 }
   }
+  if( SQLITE_OK==rc ){
+// Help virtual table module with knowledge of which columns are used
+int i ;
+
+// Scan all opcodes for references to virtual columns associated with this 
cursor
+for(i=0; inOp; i++){
+  Op *anOp = >aOp[i];
+  if ( anOp->opcode == OP_VColumn && pOp->p1 == anOp->p1 ) {
+rc = pModule->xColumn(pVtabCursor, NULL, anOp->p2);
+  }
+}
+  }
   break;
 }
 #endif /* SQLITE_OMIT_VIRTUALTABLE */
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Comparing two tables?

2009-09-29 Thread Cory Nelson
On Tue, Sep 29, 2009 at 9:38 AM, Petite Abeille
 wrote:
>
> On Sep 29, 2009, at 6:32 PM, Joe Bennett wrote:
>
>> Have two tables structured exactly the same. Want to compare both of
>> them and get the delta. Been Googling for about an hour now and I see
>> tools that do this (maybe a freeware one I haven't found?) and was
>> looking for a solution that more meets the budget I was given for this
>> project, zero... Any words of wisdom from the group at large on where
>> to find how to do what I'm looking for or any examples?
>
> Have you consider union/minus/intersect? Very handy. And free.

i believe he means except, not minus.  If all you need is differing
rows, this will work like a charm.  Otherwise if you need a more
fine-grained delta like only returning columns that changed, you will
need a more complex (but still pretty simple) join.

SELECT * FROM t_foo EXCEPT SELECT * FROM t_bar;

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


Re: [sqlite] sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Simon Slavin

On 29 Sep 2009, at 5:11pm, oryann9 wrote:

> I did do this, set-up a cron job using vmstat, free and top.

Great tools.  Don't forget that 'top' is a way into the information  
'ps' shows.  You might find that 'ps' shows you more useful  
information.  Or you might not.

> I do not know how to set-up a 'suite of benchmark queries'.  Will  
> you provide me with yours or help me with the queries?

I think he just means you should make up a set of statements that  
resemble the statements you intend to use SQLite for.  SQLite includes  
a large test suite which might make an interesting benchmark, but it  
won't resemble /your/ use of it.  For example, some users do a small  
number of SELECT commands with complicated 'WHERE' clauses on  
extremely large databases, whereas other users do a huge number of  
SELECT commands with no 'WHERE' clauses on smaller databases.   
Improved performance on one test does not mean improved performance on  
the other.

So if you're testing SQLite for your purposes, you might want to make  
up data and usage patterns that resemble what you're going to want it  
for yourself.  That will give you a better idea how it will perform  
for you than some standardised test suite.

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


Re: [sqlite] Comparing two tables?

2009-09-29 Thread Adam DeVita
Good day,


Are you looking to simply identify records that are different (not missing
from the tables) or identify records with ANY field different and get the
result?

Is there a primary key? Posting the structure would be helpful.  This should
not be hard.

C:\Documents and Settings\HP_Administrator>sqlite3 adam.db
SQLite version 3.6.10
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
sqlite> create table one (a int, b text);
sqlite> create table two (a int, b text);
sqlite> insert into one (a,b) values (1,'23);
   ...> ');
sqlite> insert into one (a,b) values (2,'23');
sqlite> insert into one (a,b) values (3,'423');
sqlite> insert into one (a,b) values (5,'4423');
sqlite> insert into one (a,b) values (6,'4423');
sqlite> insert into two select * from one;
sqlite> insert into one (a,b) values (4,'3423');
sqlite> insert into one (a,b) values (123,'3423');
sqlite> insert into two (a,b) values (123,'3423');
sqlite> insert into two (a,b) values (1233,'3423');
sqlite> select a,b from one where a not in(select a from two)
   ...> union all
   ...> select a,b from two where a not in(select a from one) ;
4|3423
1233|3423
sqlite>



On Tue, Sep 29, 2009 at 12:38 PM, Petite Abeille
wrote:

>
> On Sep 29, 2009, at 6:32 PM, Joe Bennett wrote:
>
> > Have two tables structured exactly the same. Want to compare both of
> > them and get the delta. Been Googling for about an hour now and I see
> > tools that do this (maybe a freeware one I haven't found?) and was
> > looking for a solution that more meets the budget I was given for this
> > project, zero... Any words of wisdom from the group at large on where
> > to find how to do what I'm looking for or any examples?
>
> Have you consider union/minus/intersect? Very handy. And free.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
VerifEye Technologies Inc.
905-948-0015x245
7100 Warden Ave, Unit 3
Markham ON, L3R 8B5
Canada
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Comparing two tables?

2009-09-29 Thread Joe Bennett
Figuratively I'm looking to take a row in table A, find it in table B
and compare the values in each column... If there is a delta, let me
know What I am trying to do is take an old table and compare it to
the new one and show the changes...



-Joe

On Tue, Sep 29, 2009 at 12:37 PM,   wrote:
> What is the delta?
>
> RBS
>
>
>> Hi,
>>
>>
>> Have two tables structured exactly the same. Want to compare both of
>> them and get the delta. Been Googling for about an hour now and I see
>> tools that do this (maybe a freeware one I haven't found?) and was
>> looking for a solution that more meets the budget I was given for this
>> project, zero... Any words of wisdom from the group at large on where
>> to find how to do what I'm looking for or any examples?
>>
>>
>>
>> -Joe
>> ___
>> 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-users Digest, Vol 21, Issue 122

2009-09-29 Thread Kees Nuyt
[quoting fixed]

On Tue, 29 Sep 2009 09:11:52 -0700 (PDT), oryann9
 wrote:


> Kees Nuyt wrote:
>>
>> oryann9  wrote:
>>>Is there a method, set of tools to gather and show
>>>either graphically or non-graphically the performance
>>>of SQLite3 databases?
>>>I am trying to determine the current memory, disk IO
>>>and cpu load all DB transactions place on our server.

>>Set up a suite of benchmark queries and use the performance
>>tools of your operating system, vmstat, iostat, etc..
>>You can also try sar, or if you are rich, TeamQuest.

>I did do this, set-up a cron job using vmstat, free and top.

That's a good start. Don't forget iostat. On top of that,
Simon Slavin already told you how to measure time taken in
SQLite with the .timer ON command.

>I do not know how to set-up a 'suite of benchmark queries'.

It's simply a set of typical database actions that are
important for your application. Concentrate on
performance-critical queries.
A one-time import of initial data may be less important than
a end-user query that has to be performed every ten seconds.

>Will you provide me with yours 

I don't have one, and I did have one, it wouldn't be
representative for your use case.

>or help me with the queries?

You will have to build your own, specific for your use case.
If you get stuck with a specific query, you can of course
ask for help here.
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Comparing two tables?

2009-09-29 Thread bartsmissaert
What is the delta?

RBS


> Hi,
>
>
> Have two tables structured exactly the same. Want to compare both of
> them and get the delta. Been Googling for about an hour now and I see
> tools that do this (maybe a freeware one I haven't found?) and was
> looking for a solution that more meets the budget I was given for this
> project, zero... Any words of wisdom from the group at large on where
> to find how to do what I'm looking for or any examples?
>
>
>
> -Joe
> ___
> 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] Comparing two tables?

2009-09-29 Thread Joe Bennett
Hi,


Have two tables structured exactly the same. Want to compare both of
them and get the delta. Been Googling for about an hour now and I see
tools that do this (maybe a freeware one I haven't found?) and was
looking for a solution that more meets the budget I was given for this
project, zero... Any words of wisdom from the group at large on where
to find how to do what I'm looking for or any examples?



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


Re: [sqlite] Comparing two tables?

2009-09-29 Thread Petite Abeille

On Sep 29, 2009, at 6:32 PM, Joe Bennett wrote:

> Have two tables structured exactly the same. Want to compare both of
> them and get the delta. Been Googling for about an hour now and I see
> tools that do this (maybe a freeware one I haven't found?) and was
> looking for a solution that more meets the budget I was given for this
> project, zero... Any words of wisdom from the group at large on where
> to find how to do what I'm looking for or any examples?

Have you consider union/minus/intersect? Very handy. And free.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread oryann9





>Is there a method, set of tools to gather and show
>either graphically or non-graphically the performance
>of SQLite3 databases?
>I am trying to determine the current memory, disk IO
>and cpu load all DB transactions place on our server.

Set up a suite of benchmark queries and use the performance
tools of your operating system, vmstat, iostat, etc..
You can also try sar, or if you are rich, TeamQuest.
-- 
  (  Kees Nuyt
  )

I did do this, set-up a cron job using vmstat, free and top.  I do not know how 
to set-up a 'suite of benchmark queries'.  Will you provide me with yours or 
help me with the queries?

thank you!



  

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


Re: [sqlite] How to use sqlite3_exec() to execute SQL command with Unicode text?

2009-09-29 Thread Kees Nuyt
On Tue, 29 Sep 2009 07:07:54 -0700 (PDT), bigboss97
 wrote:

>
>My program is using sqlite3_exec() to run SQL command which has the type of
>char*. Now I want to allow unicode in my DB. What do I have to change?
>Obviously, sqlite3_exec() won't work any more.
>
>Phuoc

This page tells it all in a nutshell:
http://www.sqlite.org/c3ref/stmt.html
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] How to use sqlite3_exec() to execute SQL command with Unicode text?

2009-09-29 Thread bigboss97

My program is using sqlite3_exec() to run SQL command which has the type of
char*. Now I want to allow unicode in my DB. What do I have to change?
Obviously, sqlite3_exec() won't work any more.

Phuoc

-

www.folksfun.com

-- 
View this message in context: 
http://www.nabble.com/How-to-use-sqlite3_exec%28%29-to-execute-SQL-command-with-Unicode-text--tp25663732p25663732.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] Data storage : Boolean and Date

2009-09-29 Thread Romain Perney
Thanks a lot Igor, that's just what I wanted to know.

Igor Tandetnik wrote:
>/ - what is the best way to store date-time values with sqlite3?
/
This depends on what you plan to do with them. If you need to manipulate 
the dates in your SQL queries (as opposed to just shuffling them in and 
out), then you want one of the formats understood by SQLite's built-in 
date/time functions:

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

Here you have a choice of a string like '2009-09-29 07:44:00', a Julian 
day (a double with whole part representing date and fracional part 
representing time) or a traditional Unix time (the number of seconds 
since midnight 1/1/1970).

If you don't need to manipulate these fields in your SQL, then you can 
choose any format you want. E.g. in my application I find it convenient 
to store dates as integers like 20090929 (I don't need times).

>/ - to store boolean values?
/
As integer 0 or 1.

Igor Tandetnik 

-- 
Romain PERNEY 



Tel : 01.53.21.99.20
CARDIWEB - Business & Technology
29 Cité d'Antin - 75009 PARIS
 

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


Re: [sqlite] Faster inserts in SQlite ...

2009-09-29 Thread Atul_Vaidya

Hi Nicolas,
  My application is windows based. I did set the pragma Page
Size  = 4096 as suggested by Alexey. but, it hardy made any difference to
the speed. I am abandoning the multi-threading idea, as the other components
used in my application aren't thread safe.
Also, i was wondering, if apart from Begin Transaction/End Transaction, is
there any other method for batched inserts in SQlite ?
Can i use triggers for this ?
If one has to use ZFS in tandem with Windows OS,(mine is Vista/Xp),how is
this achieved ?
Thanks for awesome support,
Regards,
Atul.


Nicolas Williams wrote:
> 
> On Mon, Sep 21, 2009 at 03:37:02PM -0400, Pavel Ivanov wrote:
>> > Have you any IO operations? As result you have dependence of page
>> > size.
>> 
>> Though your performance most probably will not depend on these
>> operations because they will be executed at some random times by OS.
>> And they will be collected to have multiple blocks in one operation
>> anyway...
>> I don't have good knowledge of how disk cache works in kernel to say
>> if it will be beneficiary to send data there in chunks equal to blocks
>> on disk as opposed to chunks of any arbitrary size...
> 
> It is well-known that matching DB page size and filesystem record size
> is important for improving performance.
> 
> SQLite3 supports power-of-2 page sizes from 512 to 32KB.
> 
> Most filesystems use 512, 4096 or 8192 byte blocks.  SQLite3's default
> pagesize is 1024 bytes.
> 
> In the case of ZFS the fs recordsize is variable up to 128KB, and can be
> tuned per-dataset.  You should set the recordsize to 32KB for ZFS
> datasets containing SQLite3 DBs, and you should set the SQLite3 pagesize
> to 32KB.
> 
> Nico
> -- 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Faster-inserts-in-SQlite-...-tp25530282p25661817.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] Bug report: Memory reused after freed

2009-09-29 Thread Dan Kennedy

On Sep 29, 2009, at 4:30 PM, Ralf Junker wrote:

> My memory manager reports that the SQL below results in memory being  
> reused after it has already been freed when it is RUN FOR A SECOND  
> TIME on the same database connection.

Hi Ralf,

Thanks for this report. I'm unable to reproduce the problem so far
though. Are you compiling SQLite with any special symbols or anything
like that?

Are you able to build other programs using this memory manager? If so,
does the bug show up when you pass the problematic SQL to the command
line tool twice? Or if I send you a C program are you able to build and
test it?

Thanks,
Dan.


> Psydocode (I do not run C):
>
>  sqlite3_initialize;
>  sqlite3_open(DB_FILE_NAME, );
>  sqlite3_exec(DB, SQL, NULL, NULL, NULL);
>  sqlite3_exec(DB, SQL, NULL, NULL, NULL);
>  sqlite3_close(DB);
>  sqlite3_shutdown;
>
> The database file does not exist before running sqlite3_open().
>
> I can reproduce the problem reliably with [e4eb227b14]. There were  
> simmilar memory reports during the development of fkeys.c. They have  
> been fixed by [5b4d46374a] except for the one mentioned here.
>
> Finally, here is the SQL:
>
>  PRAGMA foreign_keys = 0;
>  DROP TABLE IF EXISTS t1;
>  DROP TABLE IF EXISTS t2;
>
>  PRAGMA foreign_keys = 1;
>  CREATE TABLE t1(a PRIMARY KEY, b UNIQUE);
>  CREATE TABLE t2(x REFERENCES t1 ON UPDATE CASCADE ON DELETE CASCADE);
>  INSERT INTO t1 VALUES('aaa', 1);
>  INSERT INTO t2 VALUES('aaa');
>  UPDATE t1 SET a = 'bbb';
>  DELETE FROM t1;
>
>  PRAGMA foreign_keys = 0;
>  DROP TABLE t1;
>  DROP TABLE t2;
>
>  PRAGMA foreign_keys = 1;
>  CREATE TABLE t1(x, y, PRIMARY KEY(x, y));
>  CREATE TABLE t2(a, b, FOREIGN KEY(a, b) REFERENCES t1 ON UPDATE  
> CASCADE);
>  INSERT INTO t1 VALUES(1, 2);
>  INSERT INTO t2 VALUES(1, 2);
>  UPDATE t1 SET x = 5;
>
> Ralf
>
> 
>
> Call stack leading to the problem:
>
> Modified byte offsets (and lengths): 512(6)
>
> The previous block size was: 2048
>
> This block was previously allocated by thread 0x8BC, and the stack  
> trace (return addresses) at the time was:
> 4088CE [DebugReallocMem]
> 413A48 [realloc][4198]
> 453A7E [...@sqlite3realloc]
> 453AF9 [sqlite3_realloc]
> 453C22 [...@sqlite3dbrealloc]
> 440AE6 [...@sqlite3vdbeswap]
> 440B37 [...@sqlite3vdbeaddop3]
> 440B8F [...@sqlite3vdbeaddop0]
> 4256CE [...@sqlite3triggersexist]
> 4539A3 [...@sqlite3dbfree]
> 425894 [...@sqlite3triggersexist]
>
> The allocation number was: 632
>
> The block was previously freed by thread 0x8BC, and the stack trace  
> (return addresses) at the time was:
> 413781 [Free][3285]
> 45397C [sqlite3_free]
> 4539C7 [...@sqlite3dbfree]
> 440FA2 [...@sqlite3vdbejumphere]
> 440FD2 [...@sqlite3vdbeprogramdelete]
> 440F5F [...@sqlite3vdbejumphere]
> 440F88 [...@sqlite3vdbejumphere]
> 44265B [...@sqlite3vdbedelete]
> 4425A5 [...@sqlite3vdbefinalize]
> 42DA71 [sqlite3_exec]
> 45B9F7 [D:\DI_Stable\Lib\SQLite3\Test\Test.dpr][Test][initialization] 
> [45]
>
> The current thread ID is 0x8BC, and the stack trace (return  
> addresses) leading to this error is:
> 408698 [DebugGetMem]
> 4088CE [DebugReallocMem]
> 413A48 [realloc][4198]
> 453A7E [...@sqlite3realloc]
> 453AF9 [sqlite3_realloc]
> 453C22 [...@sqlite3dbrealloc]
> 440AE6 [...@sqlite3vdbeswap]
> 440B37 [...@sqlite3vdbeaddop3]
> 440B8F [...@sqlite3vdbeaddop0]
> 4256CE [...@sqlite3triggersexist]
> 4539A3 [...@sqlite3dbfree]
>
> Current memory dump of 256 bytes starting at pointer address 7FEE3CD0:
> A0 DC 46 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80  
> 80 80 80 80 80 80 80 80 80
> 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80  
> 80 80 80 80 80 80 80 80 80
> 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80  
> 80 80 80 80 80 80 80 80 80
> 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80  
> 80 80 80 80 80 80 80 80 80
> 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80  
> 80 80 80 80 80 80 80 80 80
> 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80  
> 80 80 80 80 80 80 80 80 80
> 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80  
> 80 80 80 80 80 80 80 80 80
> 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80  
> 80 80 80 80 80 80 80 80 80
>   Ü  F  .  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €   
> €  €  €  €  €  €  €  €  €
> €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €   
> €  €  €  €  €  €  €  €  €
> €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €   
> €  €  €  €  €  €  €  €  €
> €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €   
> €  €  €  €  €  €  €  €  €
> €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €   
> €  €  €  €  €  €  €  €  €
> €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €   
> €  €  €  €  €  €  €  €  €
> €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €   
> €  €  €  €  €  €  €  €  €
> €  

Re: [sqlite] Data storage : Boolean and Date

2009-09-29 Thread Igor Tandetnik
Romain Perney wrote:
> - what is the best way to store date-time values with sqlite3?

This depends on what you plan to do with them. If you need to manipulate 
the dates in your SQL queries (as opposed to just shuffling them in and 
out), then you want one of the formats understood by SQLite's built-in 
date/time functions:

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

Here you have a choice of a string like '2009-09-29 07:44:00', a Julian 
day (a double with whole part representing date and fracional part 
representing time) or a traditional Unix time (the number of seconds 
since midnight 1/1/1970).

If you don't need to manipulate these fields in your SQL, then you can 
choose any format you want. E.g. in my application I find it convenient 
to store dates as integers like 20090929 (I don't need times).

> - to store boolean values?

As integer 0 or 1.

Igor Tandetnik 



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


Re: [sqlite] Compiler warnings with Sun Studio 12.1 on Solaris 10

2009-09-29 Thread D. Richard Hipp

On Sep 27, 2009, at 5:28 PM, Dr. David Kirkby wrote:

> "sqlite3.c", line 18731: warning: integer overflow detected: op "<<"
> "sqlite3.c", line 18748: warning: integer overflow detected: op "<<"

Both cases are complaining about a constant:  (0x1f<<28)Both are  
harmless.

> "sqlite3.c", line 32546: warning: statement not reached

Complains about this code:

 /*NOTREACHED*/
 assert( 0 );

Harmless.

> "sqlite3.c", line 69160: warning: integer overflow detected: op "<<"

Complains about this constant:   (((sqlite3_int64)1)<<63)   Harmless

All warnings are harmless and will remain unaddressed for now.  Thanks  
for the reports, though!

D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] performance trending

2009-09-29 Thread Kees Nuyt
On Mon, 28 Sep 2009 19:07:05 -0700 (PDT), oryann9
 wrote:

>Is there a method, set of tools to gather and show
>either graphically or non-graphically the performance
>of SQLite3 databases?
>I am trying to determine the current memory, disk IO
>and cpu load all DB transactions place on our server.

Set up a suite of benchmark queries and use the performance
tools of your operating system, vmstat, iostat, etc..
You can also try sar, or if you are rich, TeamQuest.
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Bug report: Memory reused after freed

2009-09-29 Thread Ralf Junker
My memory manager reports that the SQL below results in memory being reused 
after it has already been freed when it is RUN FOR A SECOND TIME on the same 
database connection.

Psydocode (I do not run C):

  sqlite3_initialize;
  sqlite3_open(DB_FILE_NAME, );
  sqlite3_exec(DB, SQL, NULL, NULL, NULL);
  sqlite3_exec(DB, SQL, NULL, NULL, NULL);
  sqlite3_close(DB);
  sqlite3_shutdown;

The database file does not exist before running sqlite3_open().

I can reproduce the problem reliably with [e4eb227b14]. There were simmilar 
memory reports during the development of fkeys.c. They have been fixed by 
[5b4d46374a] except for the one mentioned here.

Finally, here is the SQL:

  PRAGMA foreign_keys = 0;
  DROP TABLE IF EXISTS t1;
  DROP TABLE IF EXISTS t2;
  
  PRAGMA foreign_keys = 1;
  CREATE TABLE t1(a PRIMARY KEY, b UNIQUE);
  CREATE TABLE t2(x REFERENCES t1 ON UPDATE CASCADE ON DELETE CASCADE);
  INSERT INTO t1 VALUES('aaa', 1);
  INSERT INTO t2 VALUES('aaa');
  UPDATE t1 SET a = 'bbb';
  DELETE FROM t1;
  
  PRAGMA foreign_keys = 0;
  DROP TABLE t1;
  DROP TABLE t2;
  
  PRAGMA foreign_keys = 1;
  CREATE TABLE t1(x, y, PRIMARY KEY(x, y));
  CREATE TABLE t2(a, b, FOREIGN KEY(a, b) REFERENCES t1 ON UPDATE CASCADE);
  INSERT INTO t1 VALUES(1, 2);
  INSERT INTO t2 VALUES(1, 2);
  UPDATE t1 SET x = 5;

Ralf



Call stack leading to the problem:

Modified byte offsets (and lengths): 512(6)

The previous block size was: 2048

This block was previously allocated by thread 0x8BC, and the stack trace 
(return addresses) at the time was:
4088CE [DebugReallocMem]
413A48 [realloc][4198]
453A7E [...@sqlite3realloc]
453AF9 [sqlite3_realloc]
453C22 [...@sqlite3dbrealloc]
440AE6 [...@sqlite3vdbeswap]
440B37 [...@sqlite3vdbeaddop3]
440B8F [...@sqlite3vdbeaddop0]
4256CE [...@sqlite3triggersexist]
4539A3 [...@sqlite3dbfree]
425894 [...@sqlite3triggersexist]

The allocation number was: 632

The block was previously freed by thread 0x8BC, and the stack trace (return 
addresses) at the time was:
413781 [Free][3285]
45397C [sqlite3_free]
4539C7 [...@sqlite3dbfree]
440FA2 [...@sqlite3vdbejumphere]
440FD2 [...@sqlite3vdbeprogramdelete]
440F5F [...@sqlite3vdbejumphere]
440F88 [...@sqlite3vdbejumphere]
44265B [...@sqlite3vdbedelete]
4425A5 [...@sqlite3vdbefinalize]
42DA71 [sqlite3_exec]
45B9F7 [D:\DI_Stable\Lib\SQLite3\Test\Test.dpr][Test][initialization][45]

The current thread ID is 0x8BC, and the stack trace (return addresses) leading 
to this error is:
408698 [DebugGetMem]
4088CE [DebugReallocMem]
413A48 [realloc][4198]
453A7E [...@sqlite3realloc]
453AF9 [sqlite3_realloc]
453C22 [...@sqlite3dbrealloc]
440AE6 [...@sqlite3vdbeswap]
440B37 [...@sqlite3vdbeaddop3]
440B8F [...@sqlite3vdbeaddop0]
4256CE [...@sqlite3triggersexist]
4539A3 [...@sqlite3dbfree]

Current memory dump of 256 bytes starting at pointer address 7FEE3CD0:
A0 DC 46 00 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 
80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 
80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 
80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 
80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 
80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 
80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 
80 80 80 80 80 80
80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 
80 80 80 80 80 80
   Ü  F  .  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  € 
 €  €  €  €  €
€  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  € 
 €  €  €  €  €
€  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  € 
 €  €  €  €  €
€  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  € 
 €  €  €  €  €
€  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  € 
 €  €  €  €  €
€  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  € 
 €  €  €  €  €
€  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  € 
 €  €  €  €  €
€  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  €  € 
 €  €  €  €  €

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


[sqlite] Data storage : Boolean and Date

2009-09-29 Thread Romain Perney
Hi all,

I'm new to the list, and I can't find any archive to look trough...
My questions was :
- what is the best way to store date-time values with sqlite3?
- to store boolean values?

I assume INTEGER is the solution, but I wanted to know if there was some 
convention about that...
Thanks for your help,

-- 
Romain PERNEY 



Tel : 01.53.21.99.20
CARDIWEB - Business & Technology
29 Cité d'Antin - 75009 PARIS
 

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