Re: [sqlite] Simultaneous opening of database sometimes fails even with 1 second timeout and only 2 processes

2012-04-02 Thread Gregory Petrosyan
On Mon, Apr 2, 2012 at 7:51 PM, Jay A. Kreibich wrote: > On Mon, Apr 02, 2012 at 07:40:58PM +0400, Gregory Petrosyan scratched on the > wall: >> Hello, >> >> I am experiancing a weird problem: sometimes (1 time in a 10-100) when >> 2 processes try to open the same database file

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 11:39 PM, Webdude wrote: > I'm sure everyone thinks I'm mad, but I still haven't seen proof of "Can't > be done". The question is not "can this be done" but "should it be done this way". Relying on a sequence of SQL statements yielding exactly the

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Webdude
/ Inserting the same data in the same order on the same platform />>>/ with the same (PRAGMA) settings would result in the files />>>/ matching identically. // />>/ Do you feel that the platform - Hardware / OS / some other factor could influence the way SQLite performed its sequence? /

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Simon Slavin
On 3 Apr 2012, at 2:42am, Webdude wrote: > Hi Simon, > > thanks for helping me with this. > >> Inserting the same data in the same order on the same platform >> with the same (PRAGMA) settings would result in the files >> matching identically. > > Do you feel that

Re: [sqlite] System.Data.SQLite DLL pre-load bug

2012-04-02 Thread Joe Mistachkin
Cheetah wrote: > > I went to try and file this as a ticket, but it appears that > feature has been disabled for the "anonymous" login method. > Reporting issues on this mailing list is fine. > > Anyways, the new release's processor detection and native > library pre-loading has a nearly

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Jean-Christophe Deschamps
Do you feel that the platform - Hardware / OS / some other factor could influence the way SQLite performed its sequence? Instead of trying to compare the hashes of DB files themselves, you appear to want a strict comparison of sets in the contents of the DBs. For instance, changing the

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Webdude
/ It's not important that the 2 db files are exactly the same all the time />/ that people are editing them, but only when they 'finalise' a 'package'. />/ So what if some code in the 'packaging' process performed a sequence of />/ queries that read all the data from the db, table by table,

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 8:37 PM, Webdude wrote: > It's not important that the 2 db files are exactly the same all the time > that people are editing them, but only when they 'finalise' a 'package'. > So what if some code in the 'packaging' process performed a sequence of >

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Igor Tandetnik
On 4/2/2012 9:37 PM, Webdude wrote: It's not important that the 2 db files are exactly the same all the time that people are editing them, but only when they 'finalise' a 'package'. So what if some code in the 'packaging' process performed a sequence of queries that read all the data from the

Re: [sqlite] Concurrency violation

2012-04-02 Thread Agrawal, Manish
Thanks very much for your response. I tried a simple test based on this suggestion as follows: CREATE TABLE "table1" ("field1" INTEGER PRIMARY KEY NOT NULL UNIQUE, "field2" INTEGER NOT NULL ); INSERT INTO "table1" VALUES(1, 1); INSERT INTO "table1" VALUES(2, 2); INSERT INTO "table1" VALUES(3,

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Webdude
Hi Simon, thanks for helping me with this. Inserting the same data in the same order on the same platform with the same (PRAGMA) settings would result in the files matching identically. Do you feel that the platform - Hardware / OS / some other factor could influence the way SQLite

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Webdude
Hi Nico, thanks for the reply. You can't rely on two SQLite3 DBs with the same contents being equal files. The sequences of INSERT/UPDATE/DELETE statements that created the two files with the same contents can differ and thus result in different b-tree layouts. It's not important that

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Nico Williams
Also, if you were to use the running XOR of hashes method you'd also have to not make use of auto-allocated row IDs or any INTEGER PRIMARY KEYs, or AUTOINCREMENTed columns, or to not include any of those in the hashes, which probably also means not using any of those in FOREIGN KEYs. That's...

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Simon Slavin
On 3 Apr 2012, at 12:27am, Webdude wrote: > A key part of the design requires that if another user who is using the same > program, (and probably would have to be using the same version of the SQLite > engine I suspect), if they put exactly the same items into their

Re: [sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 6:27 PM, Webdude wrote: > I am building a file comparison tool that is free as in beer and speech. > The program allows people to put certain things in an SQLite database file, > then an MD5 or SHA hash is run on the resulting file for identity of

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/04/12 14:34, Simon Slavin wrote: > I wonder whether it respects languages. A German user living in France has some Swedish names in their list to be sorted. Do you use Swedish sort order, German sort order, German name order or French order?

[sqlite] Hashing 2 SQLite db files with the same data

2012-04-02 Thread Webdude
Hi, I am building a file comparison tool that is free as in beer and speech. The program allows people to put certain things in an SQLite database file, then an MD5 or SHA hash is run on the resulting file for identity of the total package contents. A key part of the design requires that if

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 5:46 PM, Simon Slavin wrote: > Replace part of that routine with something which specifies the locale rather > than fetching it from OS settings.  And store the locale used with the index, > as a COLLATE setting.  Thus leaving it up to whoever writes

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 10:44pm, Igor Tandetnik wrote: > On 4/2/2012 5:34 PM, Simon Slavin wrote: >> Hmm. It's there: >> >> >> >> "The following function compares two Unicode strings of possibly

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 1:25 PM, Richard Hipp wrote: > On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: >> I think ... a higher priority than that would be handling Unicode >> correctly.  And having Unicode support would be useful in writing the code >>

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 4:24 PM, Simon Slavin wrote: > On 2 Apr 2012, at 9:58pm, Alexey Pechnikov wrote: >> Description: Unicode string library for C >> The 'libunistring' library implements Unicode strings (in the UTF-8, >> UTF-16, and UTF-32

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Jean-Christophe Deschamps
At 23:44 02/04/2012, you wrote: I wonder whether it respects languages. These don't, but u8_strcoll et al supposedly do, based on LC_COLLATE locale category. Herein lies the problem: if you build an index using these functions while running under locale A, then try to run queries against

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Igor Tandetnik
On 4/2/2012 5:34 PM, Simon Slavin wrote: Hmm. It's there: "The following function compares two Unicode strings of possibly different lengths. — Function: int u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t

Re: [sqlite] SQLITE Binding Issue when using [] brackets

2012-04-02 Thread Igor Tandetnik
On 4/1/2012 4:23 PM, ap wrote: http://sqlite.org/c3ref/bind_blob.html Brackets are recommended for attribute names in some cases, it seems the binding for :VVV does not permit :[VVV]. Is this the case? This is the case. Parameter names must be proper identifiers. recdct {'[c1]': 1,

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 10:24pm, Simon Slavin wrote: > On 2 Apr 2012, at 9:58pm, Alexey Pechnikov wrote: > >> Description: Unicode string library for C >> The 'libunistring' library implements Unicode strings (in the UTF-8, >> UTF-16, and UTF-32

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 9:58pm, Alexey Pechnikov wrote: > Description: Unicode string library for C > The 'libunistring' library implements Unicode strings (in the UTF-8, > UTF-16, and UTF-32 encodings), together with functions for > Unicode characters (character names,

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 3:58 PM, Alexey Pechnikov wrote: > And see too: > > Homepage: http://www.gnu.org/software/libunistring/ Thanks! That looks like a dream come true (even if LGPL). It's much more complete than the OpenSolaris u8_textprep stuff, which would be

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
And see too: # LANG=C aptitude show libunistring0 Package: libunistring0 New: yes State: not installed Version: 0.9.3-3 Priority: optional Section: libs Maintainer: Andreas Rottmann Uncompressed Size: 1221 k Depends: libc6 (>= 2.3) Description: Unicode string library for C The

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 1:25 PM, Richard Hipp wrote: > On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: >> I think ... a higher priority than that would be handling Unicode >> correctly.  And having Unicode support would be useful in writing the code >>

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 7:25pm, Richard Hipp wrote: > On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: > >> I think ... a higher priority than that would be handling Unicode >> correctly. And having Unicode support would be useful in writing the code >>

[sqlite] 1st Call For Papers, 19th Annual Tcl/Tk Conference 2012

2012-04-02 Thread Andreas Kupries
19th Annual Tcl/Tk Conference (Tcl'2012) http://www.tcl.tk/community/tcl2012/ November 12 - 16, 2012 Holiday Inn Chicago Mart Plaza 350 West Mart Center Drive Chicago, Illinois, USA Important Dates: Abstracts and proposals due August27, 2012 Notification to authors September 10,

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
Why you need ICU library to parse datetime strings?!! The my previous patch to parse Russian dates has only single row without any external libs. 2012/4/2 Richard Hipp > On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: > > > > > I think ... a higher

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Richard Hipp
On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: > > I think ... a higher priority than that would be handling Unicode > correctly. And having Unicode support would be useful in writing the code > which handles dates. > > size of SQLite library: approx 500 KB size of

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 6:18pm, Alexey Pechnikov wrote: > Please see http://www.sqlite.org/lang_datefunc.html and you will be > frustrated because SQLite can format date/time to different string formats > but can't read the produced date/time strings. I am not frustrated.

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Pavel Ivanov
> Also, it appears that the foreign_keys setting only applies for the life of > a db connection and they have to be enabled every time a db is opened.  Is > that correct? Yes, that's correct. > Do all PRAGMA settings work like that? Almost. Some of exceptions are page_size, auto_vacuum,

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
> 2012/4/2 Simon Slavin Please see http://www.sqlite.org/lang_datefunc.html and you will be frustrated because SQLite can format date/time to different string formats but can't read the produced date/time strings. -- Best regards, Alexey Pechnikov. http://pechnikov.tel/

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Jay A. Kreibich
On Mon, Apr 02, 2012 at 08:38:37PM +0400, Alexey Pechnikov scratched on the wall: > Why we can't control this? As example, in Russia the date format is > DD.MM. and is needed the patch > http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565c=720cb1015e95af7a > > I think the new pragmas

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 5:56pm, Pete wrote: > Enabling foreign keys in my application works fine and INSERTs thast > violate a fkey constraint fail. Is this a know problem with sqlite3? I'm > using version 3.6.12 on a Mac. "This

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 5:38pm, Alexey Pechnikov wrote: > Why we can't control this? As example, in Russia the date format is > DD.MM. and is needed the patch > http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565c=720cb1015e95af7a > > I think the new pragmas DATEFORMAT

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Pete
I have a couple of follow up questions on this. sqlite3 doesn't seem to recognise the foreign_keys PRAGMA. If I execute "PRAGMA foreign_keys=1", I don't get an error. If I then execute "PRAGMA foreign_keys" to get the setting, nothing is returned. If I INSERT a record that violates the foreign

[sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
Why we can't control this? As example, in Russia the date format is DD.MM. and is needed the patch http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565c=720cb1015e95af7a I think the new pragmas DATEFORMAT and TIMEFORMAT will be helpful for internationalization. These may be used for parsing

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Pete
Thanks Pavel and Dan, that was the problem. In the past, I've always used a primary key as the parent of a foreign key link so hadn't run into this issue. Pete On Mon, Apr 2, 2012 at 9:00 AM, wrote: > Message: 12 > Date: Mon, 02 Apr 2012 15:33:20 +0700 > From:

Re: [sqlite] Simultaneous opening of database sometimes fails even with 1 second timeout and only 2 processes

2012-04-02 Thread Jay A. Kreibich
On Mon, Apr 02, 2012 at 07:40:58PM +0400, Gregory Petrosyan scratched on the wall: > Hello, > > I am experiancing a weird problem: sometimes (1 time in a 10-100) when > 2 processes try to open the same database file (and execute something > like 'create table foo if not exists'), one of them

[sqlite] Simultaneous opening of database sometimes fails even with 1 second timeout and only 2 processes

2012-04-02 Thread Gregory Petrosyan
Hello, I am experiancing a weird problem: sometimes (1 time in a 10-100) when 2 processes try to open the same database file (and execute something like 'create table foo if not exists'), one of them fails with SQLITE_BUSY — despite 1 second (or bigger) timeout. Processes themselves produce

Re: [sqlite] SQLITE Binding Issue when using [] brackets

2012-04-02 Thread Simon Davies
On 1 April 2012 21:23, ap wrote: > > http://sqlite.org/c3ref/bind_blob.html > > Brackets are recommended for attribute names in some cases, it seems the > binding for :VVV does not permit :[VVV]. Is this the case? Square brackets are a quoting mechanism for identifiers

Re: [sqlite] Adding R-Tree index module to existing project

2012-04-02 Thread Jay A. Kreibich
On Sun, Apr 01, 2012 at 08:41:02PM -0700, A Gilmore scratched on the wall: > I have a project that compiles SQLite with the following options: > > -DSQLITE_SECURE_DELETE=1 > -DSQLITE_THREADSAFE=1 > -DSQLITE_CORE=1 > -DSQLITE_ENABLE_FTS3=1 > -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 >

[sqlite] System.Data.SQLite DLL pre-load bug

2012-04-02 Thread Cheetah
I went to try and file this as a ticket, but it appears that feature has been disabled for the "anonymous" login method. Anyways, the new release's processor detection and native library pre-loading has a nearly show-stopper bug for me. The processor detection uses

[sqlite] (no subject)

2012-04-02 Thread Darko Filipovic
http://tourism.singapore18.com/wp-content/uploads/cache/02efpk.html;> http://tourism.singapore18.com/wp-content/uploads/cache/02efpk.html ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] SQLITE Binding Issue when using [] brackets

2012-04-02 Thread ap
http://sqlite.org/c3ref/bind_blob.html Brackets are recommended for attribute names in some cases, it seems the binding for :VVV does not permit :[VVV]. Is this the case? I prefer the dictionary binding if possible. Normally no issues, however when I introduce brackets there may be an issue.

[sqlite] (no subject)

2012-04-02 Thread Allen Fowler
http://avocat.prunelle.org/wp-content/plugins/extended-comment-options/02gfns.html;> http://avocat.prunelle.org/wp-content/plugins/extended-comment-options/02gfns.html ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Foreign Key Problems

2012-04-02 Thread Dan Kennedy
On 04/02/2012 07:22 AM, Pete wrote: I'm running into an issue with foreign keys where no matter what value I supply for a child key, I get a foreign key mismatch error. Here are my test tables. "foreign key mismatch" indicates a schema problem. Usually a missing index. See here: