Re: [sqlite] How to check foreign keys

2011-06-26 Thread Cecil Westerhof
2011/6/27 Simon Slavin > > I think Cecil was referring to the fact that some program can > > forget to switch foreign_keys to on, and delete rows that are > > referenced, or change primary keys. > > Ah. Okay. Yes, that can present a problem. There's an argument that >

Re: [sqlite] How to check foreign keys

2011-06-26 Thread Cecil Westerhof
2011/6/26 Kees Nuyt > I think Cecil was referring to the fact that some program can > forget to switch foreign_keys to on, and delete rows that are > referenced, or change primary keys. > Yes, that is what I mend. So, his question is not about locking, but about verifying

Re: [sqlite] PRAGMA bug in 3.7.7 (but fine in 3.7.6.3)

2011-06-26 Thread Richard Hipp
On Sun, Jun 26, 2011 at 7:28 PM, Richard Hipp wrote: > On Sun, Jun 26, 2011 at 6:52 PM, Richard Hipp wrote: > >> The big mystery is why this problem is not showing up in our rather >> extensive test suite. I'm still investigating that aspect of the issue. >>

Re: [sqlite] PRAGMA bug in 3.7.7 (but fine in 3.7.6.3)

2011-06-26 Thread Richard Hipp
On Sun, Jun 26, 2011 at 6:52 PM, Richard Hipp wrote: > The big mystery is why this problem is not showing up in our rather > extensive test suite. I'm still investigating that aspect of the issue. > > The reason our tests didn't pick up on this is that the error only occurs if

Re: [sqlite] PRAGMA bug in 3.7.7 (but fine in 3.7.6.3)

2011-06-26 Thread Greg Stein
On Sun, Jun 26, 2011 at 18:52, Richard Hipp wrote: > On Sun, Jun 26, 2011 at 3:59 PM, Greg Stein wrote: > >> Hey all, >> >> There is a bug in 3.7.7 that affects Apache Subversion. We've verified >> that it is this latest release, as prior releases have worked

Re: [sqlite] PRAGMA bug in 3.7.7 (but fine in 3.7.6.3)

2011-06-26 Thread Richard Hipp
On Sun, Jun 26, 2011 at 3:59 PM, Greg Stein wrote: > Hey all, > > There is a bug in 3.7.7 that affects Apache Subversion. We've verified > that it is this latest release, as prior releases have worked just > fine for us. > > Below is the reproduction script, thanks to Daniel

Re: [sqlite] How to check foreign keys

2011-06-26 Thread Simon Slavin
On 26 Jun 2011, at 10:41pm, Kees Nuyt wrote: > I think Cecil was referring to the fact that some program can > forget to switch foreign_keys to on, and delete rows that are > referenced, or change primary keys. Ah. Okay. Yes, that can present a problem. There's an argument that switching

Re: [sqlite] How to check foreign keys

2011-06-26 Thread Kees Nuyt
On Sun, 26 Jun 2011 18:37:46 +0100, Simon Slavin wrote: > >On 26 Jun 2011, at 12:03pm, Cecil Westerhof wrote: > >> Because SQLite is not a server, it is possible that someone removes a record >> that should not be removed because of a foreign key constraint. How to check >>

Re: [sqlite] PRAGMA bug in 3.7.7 (but fine in 3.7.6.3)

2011-06-26 Thread Teg
I had to back away from 3.7.7 too because my program hung during startup. Wonder if it's related to this? I haven't looked any deeper at it. It hung, I switched back to my older library and it worked. C Sunday, June 26, 2011, 3:59:33 PM, you wrote: GS> Hey all, GS> There is a bug in 3.7.7

[sqlite] PRAGMA bug in 3.7.7 (but fine in 3.7.6.3)

2011-06-26 Thread Greg Stein
Hey all, There is a bug in 3.7.7 that affects Apache Subversion. We've verified that it is this latest release, as prior releases have worked just fine for us. Below is the reproduction script, thanks to Daniel Shahaf. With this pragma not working, we cannot even start up :-( Please help!

Re: [sqlite] 3.7.7, URI filenames, and UNC paths

2011-06-26 Thread Jan Hudec
On Fri, Jun 24, 2011 at 11:28:56 -0400, Cheetah wrote: > The documentation clearly states that using an authority other than > localhost is not permitted. However, AFAICT, the standard form of a file: > URI on windows for a UNC path uses exactly that. That's in accord with the URL specification.

Re: [sqlite] How to check foreign keys

2011-06-26 Thread Simon Slavin
On 26 Jun 2011, at 12:03pm, Cecil Westerhof wrote: > Because SQLite is not a server, it is possible that someone removes a record > that should not be removed because of a foreign key constraint. How to check > if a database is still correct? There is no check after: >PRAGMA FOREIGN_KEYS =

Re: [sqlite] 3.7.7, URI filenames, and UNC paths

2011-06-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/25/2011 01:22 PM, Cheetah wrote: > What I'm suggesting is that it should be possible to open any file via > a URI that can be opened using the non-URI open call. You can. Use this: file://localhost/\\darkstar\home\fred\data.db Roger

Re: [sqlite] Again bug in .indices

2011-06-26 Thread Cecil Westerhof
2011/6/26 Kees Nuyt > >When using > > .indices > >but when using: > >.indices weights > >I get: > >sqlite_autoindex_weights_1 > >Should it not be shown in the first instance also? > > It's a matter of taste if it should. > >.indices > will show indices which

Re: [sqlite] Substring question

2011-06-26 Thread Black, Michael (IS)
It's not obvious but this works CREATE TABLE x (s string); INSERT INTO "x" VALUES('ab:cdef'); INSERT INTO "x" VALUES('ghij:klmn'); sqlite> select ltrim(ltrim(s,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'),':') from x; ltri cdef klmn Just make sure your char set contains all

Re: [sqlite] Again bug in .indices

2011-06-26 Thread Kees Nuyt
On Sun, 26 Jun 2011 11:24:31 +0200, Cecil Westerhof wrote: >I have the following (beside some others) table defined: >CREATE TABLE IF NOT EXISTS weights ( > id INTEGERPRIMARY KEY, > categoryID INTEGERNOT NULL,

[sqlite] How to check foreign keys

2011-06-26 Thread Cecil Westerhof
Because SQLite is not a server, it is possible that someone removes a record that should not be removed because of a foreign key constraint. How to check if a database is still correct? There is no check after: PRAGMA FOREIGN_KEYS = ON; I checked. -- Cecil Westerhof

[sqlite] randomness issues on windows

2011-06-26 Thread bob
i'm getting an issue relating to the use of the random() function in a SQL query. i run 2 PHP scripts very quickly (less than 1 second apart). they use an SQL query likeSELECT * FROM table ORDER BY random() LIMIT 5; because the 2 scripts run so close together (in time) i get the same

[sqlite] Again bug in .indices

2011-06-26 Thread Cecil Westerhof
I have the following (beside some others) table defined: CREATE TABLE IF NOT EXISTS weights ( id INTEGERPRIMARY KEY, categoryID INTEGERNOT NULL, measureDateDATE DEFAULT (DATE('now')), weight

Re: [sqlite] The last records of a query

2011-06-26 Thread Cecil Westerhof
2011/6/25 Max Vlasov > Use ORDER BY ... DESC. Sure, if you have a large dataset, it'd better be > indexed. > At the moment it is not a large dataset, but it is better to be prepared. I have the following definition: CREATE TABLE IF NOT EXISTS weights ( id

Re: [sqlite] The last records of a query

2011-06-26 Thread Cecil Westerhof
2011/6/25 Kees Nuyt > >selectStr=" > >SELECT categories.desc > >,weights.measureDate > >,weights.weight > >,weights.fat > >,weights.water > >,weights.muscle > >FROM weights > >,categories