[sqlite] Primary key values can be NULL

2016-04-18 Thread Keith Medcalf
"INTEGER PRIMARY KEY" declares an alias for the rowid. It is always NOT NULL (it is the record number) and it is always and integer (it is not ducky-typed). Specifying NULL for the rowid causes the generation of the "next" rowid/record number. AUTOINCREMENT modifies "next" to mean "one

[sqlite] UPDATE/open/close blocked while executing SELECT

2016-04-18 Thread Keith Medcalf
On Monday, 18 April, 2016 08:47 Olivier Mascia wrote: > Just to clarify: you mean compiled using SQLITE_CONFIG_MULTITHREAD (and > not SQLITE_CONFIG_SERIALIZED), is that it? > Then, if using threads in the application, each thread has its own > connection (or multiple connections) but no thread

[sqlite] SQLite 3.12.1 reports "database corruption" with existing databases created with SQLite 3.9.2

2016-04-18 Thread Clemens Ladisch
t18970237136 at web.de wrote: >>> after updating to 1.0.100.0 which uses SQLite 3.12.1, we are getting the >>> following error >>> >>> SQLite error (1): AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY > > The problem is ... the "[" and "]" in this syntax: > CREATE TABLE Customer ( >

[sqlite] Is it possible that dropping a big table takes very long

2016-04-18 Thread Dan Kennedy
On 04/16/2016 04:59 PM, Cecil Westerhof wrote: > I am playing a bit with SQLite. I first had a table with 1E8 elements. When > trying to drop this it looked like SQLite got hung. I tried it from DB > Browser and a Java program. > I just tried it with a table of 1E7 elements. That was dropped in

[sqlite] SQLite 3.12.1 reports "database corruption" with existing databases created with SQLite 3.9.2

2016-04-18 Thread t18970237...@web.de
Hi Clemens,? > Gesendet:?Montag, 18. April 2016 um 16:07 Uhr > Von:?"Clemens Ladisch" > t18970237136 at web.de wrote: > > after updating to 1.0.100.0 which uses SQLite 3.12.1, we are getting the > > following error > > > > SQLite error (1): AUTOINCREMENT is only allowed on an INTEGER PRIMARY

[sqlite] SQLite 3.12.1 reports "database corruption" with existing databases created with SQLite 3.9.2

2016-04-18 Thread Clemens Ladisch
t18970237136 at web.de wrote: > after updating to 1.0.100.0 which uses SQLite 3.12.1, we are getting the > following error > > SQLite error (1): AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY > > The problem seems to be that the tables have been created using the following > SQL: >

[sqlite] SQLite 3.12.1 reports "database corruption" with existing databases created with SQLite 3.9.2

2016-04-18 Thread t18970237...@web.de
[Sorry, I sent an HTML email which doesn't seem do be allowed by the mailing list. I'm sending the message again as plain text] Hi, we are using SQLite in a C# (.Net 4.6, x86 and x64) Application on Windows 10/7 using the System.Data.Sqlite wrapper from https://system.data.sqlite.org. We use

[sqlite] UPDATE/open/close blocked while executing SELECT

2016-04-18 Thread Olivier Mascia
> Le 18 avr. 2016 ? 15:10, Detlef Golze a ?crit : > > thank you for the hints. I think I do it correctly, I compiled with > SQLITE_CONFIG_MULTITHREAD and attach the database with the URI option > cache=shared. Do you really *need* to use shared cache in favor of private cache? There are more

[sqlite] UPDATE/open/close blocked while executing SELECT

2016-04-18 Thread Clemens Ladisch
Detlef Golze wrote: > I attach the database with the URI option cache=shared. This makes all threads share a single connection. Don't do it. Regards, Clemens

[sqlite] UPDATE/open/close blocked while executing SELECT

2016-04-18 Thread Simon Slavin
On 18 Apr 2016, at 2:10pm, Detlef Golze wrote: > I compiled with SQLITE_CONFIG_MULTITHREAD That bit's okay. > and attach the database with the URI option cache=shared Try turning that bit off and see if it results in an overall speed-up. Simon.

[sqlite] UPDATE/open/close blocked while executing SELECT

2016-04-18 Thread Olivier Mascia
> Le 18 avr. 2016 ? 14:17, Detlef Golze a ?crit : > > Hi, > > I am using SQLite C amalgamation version 3.08.11.01 compiled for Multi > Threading Mode and using WAL Journal Mode. > > Sometimes I need to execute a SELECT statement which takes a very long time > to complete. I realized that

[sqlite] Primary key values can be NULL

2016-04-18 Thread David Raymond
I don't mean to poke a busy thread with a possibly stupid newbie question, but here goes. How is this that much different than say, the SQLITE_DEFAULT_FILE_FORMAT compile option? (Pasting it here then continuing comment below) Text pasted here SQLITE_DEFAULT_FILE_FORMAT=<1 or 4>

[sqlite] sqlite3 update hook data

2016-04-18 Thread Martin Trnovec
Hi, Do you know if there is a way how to get n-th column of row during sqlite3_update_hook callback ? I saw there are (in experimental version) some functions like sqlite3_preupdate_new that are able to get this information during sqlite3_preupdate_hook but this is not in stable version. A by

[sqlite] UPDATE/open/close blocked while executing SELECT

2016-04-18 Thread Detlef Golze
> Detlef Golze wrote: > > I attach the database with the URI option cache=shared. > > This makes all threads share a single connection. Don't do it. > > > Regards, > Clemens That was indeed the problem. During my initial tests this option provided the best performance. I probably need to

[sqlite] Primary key values can be NULL

2016-04-18 Thread Adam Devita
I had a similar thought, until I imagined Program uses sqlite DLL The program creates dbs, and sometimes does inserts with null primary keys. (Why is beyond the scope, it just does sometimes.) Upgrading the DLL would start making files in the new format, but the program using the dll doesn't

[sqlite] SQLite 3.12.1 reports "database corruption" with existing databases created with SQLite 3.9.2

2016-04-18 Thread Richard Hipp
On 4/18/16, Clemens Ladisch wrote: > t18970237136 at web.de wrote: after updating to 1.0.100.0 which uses SQLite 3.12.1, we are getting the following error SQLite error (1): AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY >> >> The problem is ... the "[" and "]"

[sqlite] UPDATE/open/close blocked while executing SELECT

2016-04-18 Thread Detlef Golze
Hello Olivier, thank you for the hints. I think I do it correctly, I compiled with SQLITE_CONFIG_MULTITHREAD and attach the database with the URI option cache=shared. Also, each connection is used by one thread at a time. But another thread may reuse a connection - I hope that is allowed. Are

[sqlite] Is it possible that dropping a big table takes very long

2016-04-18 Thread Olivier Mascia
> Le 18 avr. 2016 ? 12:30, Dan Kennedy a ?crit : > >> I am playing a bit with SQLite. I first had a table with 1E8 elements. When >> trying to drop this it looked like SQLite got hung. I tried it from DB >> Browser and a Java program. >> I just tried it with a table of 1E7 elements. That was

[sqlite] Crash in shell on Windows with redirected stdout

2016-04-18 Thread David Welch
Hi, I'm getting a crash in the sqlite shell on Windows 7 in sqlite3 version 3.12.1. I can reprduce it with the console commands echo "SELECT 1;" > tmp.sql sqlite3 :memory: -init tmp.sql >log What seems to happen is that sqlite3_initialise is never called and consequently the

[sqlite] UPDATE/open/close blocked while executing SELECT

2016-04-18 Thread Detlef Golze
Hi, I am using SQLite C amalgamation version 3.08.11.01 compiled for Multi Threading Mode and using WAL Journal Mode. Sometimes I need to execute a SELECT statement which takes a very long time to complete. I realized that during that time other functions are blocked for a significant amount

[sqlite] Pascal (almost) style BLOBs

2016-04-18 Thread Paul Sanderson
You could use a binary PList or some other form of structured data - the BPList blob could then contain, ints, floats, strings byte arrays or even embedded binary plists. As it is a structured format then to an extent it is self documenting (in terms of the stored data types) Paul

[sqlite] Is it possible that dropping a big table takes very long

2016-04-18 Thread Rowan Worth
On 18 April 2016 at 06:55, Cecil Westerhof wrote: > ?I put a strace on it. This was what I got: > Process 26455 attached with 20 threads > % time seconds usecs/call callserrors syscall > -- --- --- - - > 99.80 11245.498406

[sqlite] sqlite3 update hook data

2016-04-18 Thread Richard Hipp
On 4/18/16, Martin Trnovec wrote: > > Do you know if there is a way how to get n-th column of row during > sqlite3_update_hook callback ? I saw there are (in experimental version) > some functions like sqlite3_preupdate_new that are able to get this > information during sqlite3_preupdate_hook but

[sqlite] Is it possible that dropping a big table takes very long

2016-04-18 Thread Cecil Westerhof
2016-04-17 18:23 GMT+02:00 Simon Slavin : > > On 17 Apr 2016, at 5:13pm, Cecil Westerhof wrote: > > > Or is this normal > > in Java programs? > > Yes. You're discovering that Java is rubbish. 'futex' for Java is what > most environments call 'mutex' and Java doesn't do locking well. It's this

[sqlite] Is it possible that dropping a big table takes very long

2016-04-18 Thread Cecil Westerhof
2016-04-17 21:59 GMT+02:00 Scott Robison : > On Sun, Apr 17, 2016 at 1:44 PM, Cecil Westerhof > wrote: > > > 2016-04-17 18:13 GMT+02:00 Cecil Westerhof : > > > > > 2016-04-17 17:13 GMT+02:00 Keith Medcalf : > > > The strange thing is that the blob variant takes a lot of time now > also. > > >