Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Gwendal Roué
> Le 15 août 2017 à 08:44, Clemens Ladisch a écrit : > > sanhua.zh wrote: >> All 1. 2. 3. steps are run sequentially, which means that the step 2 >> runs after step 1 finished and step 3 runs after step 2 finished >> theoretically . >> Also, I can make sure the memory order

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Clemens Ladisch
Gwendal Roué wrote: > Serialized accesses from multiple threads is OK when the connection is > in the "Multi-thread" or "Serialized" threading modes, but not in the > "Single-thread" threading mode. says: | 1. *Single-thread*. In this mode, all mutexes are

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Gwendal Roué
> Le 16 août 2017 à 08:38, Clemens Ladisch a écrit : > > Gwendal Roué wrote: >> Serialized accesses from multiple threads is OK when the connection is >> in the "Multi-thread" or "Serialized" threading modes, but not in the >> "Single-thread" threading mode. > >

Re: [sqlite] group_concat() reverses order given where clause?

2017-08-16 Thread Jean-Luc Hainaut
On 15/08/2017 17:12, Bob Friesenhahn wrote: I am surprised by this behavior of group_concat(): The implementation of SQLite "group_concat" (a very powerful but often overlooked function) provides some but not all the features found in other DBMS (MySQL "group_concat" and PostgreSQL

Re: [sqlite] group_concat() reverses order given where clause?

2017-08-16 Thread Petite Abeille
> On Aug 16, 2017, at 11:11 AM, Jean-Luc Hainaut > wrote: > > The implementation of SQLite "group_concat" (a very powerful but often > overlooked function) provides some but not all the features found in other > DBMS (MySQL "group_concat" and PostgreSQL

[sqlite] WinForms | WPF: Using SQLite DataBase

2017-08-16 Thread ajm
Perhaps maybe of interest to those beginners using SQLite in Windows. WPF: Using SQLite DataBase https://www.codeproject.com/Tips/988690/WinForms-WPF-Using-SQLite-DataBase-For-User-For-Ap HTH -- Adolfo J. Millán. ___ sqlite-users mailing list

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Clemens Ladisch
Gwendal Roué wrote: >> Le 16 août 2017 à 08:38, Clemens Ladisch a écrit : >> Gwendal Roué wrote: >>> Serialized accesses from multiple threads is OK when the connection is >>> in the "Multi-thread" or "Serialized" threading modes, but not in the >>> "Single-thread" threading

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Keith Medcalf
On Wednesday, 16 August, 2017 00:11, Gwendal Roué wrote: >> Le 15 août 2017 à 08:44, Clemens Ladisch a écrit : >> sanhua.zh wrote: >>> All 1. 2. 3. steps are run sequentially, which means that the step 2 >>> runs after step 1 finished and step 3

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Keith Medcalf
>According to your interpretation, "Single-thread" and "Multi-thread" >modes are equivalent: >> Multi-thread. In this mode, SQLite can be safely used by multiple >threads provided that no single database connection is used >simultaneously in two or more threads. >Assuming there *is* a

Re: [sqlite] Is it safe to use same sqlite connection sequentially between threads ?

2017-08-16 Thread Dominique Devienne
On Wed, Aug 16, 2017 at 4:15 PM, Keith Medcalf wrote: > Setting "multithreaded" mode disables these checks in the SQLite3 library > and it is up to the application level code to ensure the single-entrance > per connection is enforced at the application level. If the

Re: [sqlite] Explain results help...

2017-08-16 Thread Simon Slavin
On 17 Aug 2017, at 4:36am, jose isaias cabrera wrote: > The following query is taking a bit too long for my taste. I did a quick > query with explain and I got this... Anything I can do to make it faster? > Yes, I know I need to do some major work on rearranging,

Re: [sqlite] Explain results help...

2017-08-16 Thread Jens Alfke
> On Aug 16, 2017, at 8:36 PM, jose isaias cabrera > wrote: > > The following query is taking a bit too long for my taste. I did a quick > query with explain and I got this… The output of EXPLAIN QUERY PLAN is a lot easier to understand; have you tried that? Most

Re: [sqlite] Compiler warning "gethostuuid() is disabled" building SQLite for iOS

2017-08-16 Thread jose isaias cabrera
Simon Slavin wrote... to cater for the lowest level of geekery. I think that is the first time I have seen this statement... :-) I know a few folks with that description. josé ___ sqlite-users mailing list

[sqlite] Explain results help...

2017-08-16 Thread jose isaias cabrera
Greetings! The following query is taking a bit too long for my taste. I did a quick query with explain and I got this... Anything I can do to make it faster? Yes, I know I need to do some major work on rearranging, but anything else? sqlite> ATTACH

[sqlite] Compiler warning "gethostuuid() is disabled" building SQLite for iOS

2017-08-16 Thread Jens Alfke
When compiling sqlite3.c for the iOS platform, the compiler emits a custom warning "gethostuuid() is disabled”, triggered by a #warn directive (see code below.) I understand why gethostuuid() isn’t available: the iOS platform intentionally blocks 3rd party apps from accessing device-specific

Re: [sqlite] COLLATE doesn't work with parenthesized expressions (doc issue)

2017-08-16 Thread Simon Slavin
On 17 Aug 2017, at 12:46am, Jens Alfke wrote: > sqlite> SELECT 1 WHERE 'foo' = 'FOO' COLLATE nocase; > 1 = 1 > sqlite> SELECT 1 WHERE ('foo' = 'FOO') COLLATE nocase; > sqlite> > > So it appears the COLLATE operator is ignored if the expression it

Re: [sqlite] Compiler warning "gethostuuid() is disabled" building SQLite for iOS

2017-08-16 Thread Jens Alfke
> On Aug 16, 2017, at 5:04 PM, Richard Hipp wrote: > > > Why use the local disk when you can instead use a network filesystem > that is less reliable and about 100x slower? > That was pretty much my conclusion! After I realized that most of the OS's sluggishness was

Re: [sqlite] Syntax Restrictions On UPDATE, DELETE, and INSERT Statements Within Triggers

2017-08-16 Thread David Raymond
The way I read the responses is that you can't specify this. You might be able to fudge things using the naming conventions where an unqualified name resolves in attached database order. But that only works if there's no table of that name in the main database as well. And wouldn't work if you

Re: [sqlite] Compiler warning "gethostuuid() is disabled" building SQLite for iOS

2017-08-16 Thread Jens Alfke
> On Aug 16, 2017, at 1:42 PM, Richard Hipp wrote: > > The proxy-locking VFS is important for OS-X, we are > told, because many applications store SQLite databases in the user's > home directory, and many OS-X users like to have their home > directories NSF-mounted. It was

Re: [sqlite] Compiler warning "gethostuuid() is disabled" building SQLite for iOS

2017-08-16 Thread Richard Hipp
On 8/16/17, Jens Alfke wrote: > > What I don’t understand is why SQLite would want to call gethostuuid(), The gethostuuid() system call is used only by the OS-X "proxy locking" VFS, which provides better performance across network filesystems. This VFS that was written at

Re: [sqlite] COLLATE doesn't work with parenthesized expressions (doc issue)

2017-08-16 Thread Richard Hipp
On 8/16/17, Jens Alfke wrote: > I have code that generates SQL queries that sometimes use collation, via the > COLLATE expression. In some cases the collation doesn’t take effect; after > some debugging I’ve narrowed the problem down to this simple test case in > the SQLite

Re: [sqlite] Compiler warning "gethostuuid() is disabled" building SQLite for iOS

2017-08-16 Thread Richard Hipp
On 8/16/17, Simon Slavin wrote: > > I worked at a university and we used network home directories. Why use the local disk when you can instead use a network filesystem that is less reliable and about 100x slower? -- D. Richard Hipp d...@sqlite.org

[sqlite] COLLATE doesn't work with parenthesized expressions (doc issue)

2017-08-16 Thread Jens Alfke
I have code that generates SQL queries that sometimes use collation, via the COLLATE expression. In some cases the collation doesn’t take effect; after some debugging I’ve narrowed the problem down to this simple test case in the SQLite 3.16 shell: sqlite> SELECT 1 WHERE 'foo' = 'FOO'

Re: [sqlite] COLLATE doesn't work with parenthesized expressions (doc issue)

2017-08-16 Thread Jens Alfke
> On Aug 16, 2017, at 4:55 PM, Richard Hipp wrote: > > Remember: COLLATE binds more tightly than ==. So > > 'xyz' = 'XYZ' COLLATE nocase > > gets parsed out as > >'xyz' = ('XYZ' COLLATE nocase) > > And that expression has a different meaning from your > >

Re: [sqlite] Compiler warning "gethostuuid() is disabled" building SQLite for iOS

2017-08-16 Thread Simon Slavin
On 17 Aug 2017, at 12:55am, Jens Alfke wrote: > I’ve never seen network home directories in the wild, but I believe it may be > used in educational settings for centralized administration. I worked at a university and we used network home directories. But they weren’t

Re: [sqlite] Compiler warning "gethostuuid() is disabled" building SQLite for iOS

2017-08-16 Thread Richard Hipp
On 8/16/17, Jens Alfke wrote: > So may I request taking out this #warn directive? > You can probably make the warning go away if you compile with -DSQLITE_ENABLE_LOCKING_STYLE=0 -- D. Richard Hipp d...@sqlite.org ___ sqlite-users

Re: [sqlite] COLLATE doesn't work with parenthesized expressions (doc issue)

2017-08-16 Thread Jens Alfke
> On Aug 16, 2017, at 4:52 PM, Simon Slavin wrote: > > Is there a chance this isn’t doing what you think it’s doing ? Perhaps it is > evaluating the contents of the brackets first, then getting a true/false > value, and applying the COLLATE to that value. That would

Re: [sqlite] Compiler warning "gethostuuid() is disabled" building SQLite for iOS

2017-08-16 Thread Simon Slavin
On 17 Aug 2017, at 1:04am, Richard Hipp wrote: > On 8/16/17, Simon Slavin wrote: > >> I worked at a university and we used network home directories. > > > Why use the local disk when you can instead use a network filesystem > that is less reliable and