[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Rowan Worth
On 6 September 2015 at 18:26, Luuk wrote: > > Suppose i have 'test.sql': > .echo on > DELETE FROM test; > BEGIN; > INSERT INTO test VALUES(1,'test1'); > INSERT INTO test VALUES(3,'test3',3); > INSERT INTO test VALUES(2,'test2'); > COMMIT; > SELECT * FROM test; > > And a database 'test.sqlite'

[sqlite] Potential bug: Database on gvfs mount cannot be committed to

2015-09-06 Thread Dan Kennedy
On 09/06/2015 09:23 PM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 09/06/2015 06:16 AM, Markus Weiland wrote: >> I've discovered a potential bug in handling of SQLite database >> files on gvfs mounted network shares. > SQLite doesn't support being stored on the

[sqlite] Potential bug: Database on gvfs mount cannot be committed to

2015-09-06 Thread Simon Slavin
On 6 Sep 2015, at 9:16pm, Roger Binns wrote: > no programs futzing with them (backup agents, virus scanners etc) Reminds me of my most annoying SQLite problem. They were running a virus scanner which delayed temp file deletion and SQLite could not manage its journal files properly. Took me

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Luuk
On 06-09-15 20:46, Petr L?z?ovsk? wrote: > Thanks to all answers. Are principles of such script OK, or I miss something? > > > set "_error=" > sqlite3.exe %db% BEGIN; > for /f "tokens=2,3 delims=," %%a in (data.csv) do ( > sqlite3 %db% "INSERT INTO payments(id,amount) VALUES

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Petr Lázňovský
Thanks to all answers. Are principles of such script OK, or I miss something? set "_error=" sqlite3.exe %db% BEGIN; for /f "tokens=2,3 delims=," %%a in (data.csv) do ( sqlite3 %db% "INSERT INTO payments(id,amount) VALUES ('%%a','%%b')"; if

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Simon Slavin
On 6 Sep 2015, at 7:46pm, Petr L?z?ovsk? wrote: > Thanks to all answers. Are principles of such script OK, or I miss something? Sorry you cannot script sqlite.exe like that. Each time you run it is a separate session. your BEGIN has no useful effect. Simon.

[sqlite] Potential bug: Database on gvfs mount cannot be committed to

2015-09-06 Thread Florian Weimer
* Roger Binns: > On 09/06/2015 06:16 AM, Markus Weiland wrote: >> I've discovered a potential bug in handling of SQLite database >> files on gvfs mounted network shares. > > SQLite doesn't support being stored on the network for several > reasons, including that network file protocols don't

[sqlite] Potential bug: Database on gvfs mount cannot be committed to

2015-09-06 Thread Markus Weiland
I see. Since this was working under Ubuntu 14.04, I assume this is a regression with gvfs. I'll check over there. On 2015-09-06 06:00 PM, sqlite-users-request at mailinglists.sqlite.org wrote: > On 09/06/2015 06:16 AM, Markus Weiland wrote: >> >I've discovered a potential bug in handling of

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Simon Slavin
On 6 Sep 2015, at 2:26pm, Yuriy M. Kaminskiy wrote: > Not quite. Even if some statement failed, if you COMMIT in the end, it > will succeed and database will be (partially) modified. > > It's application developer responsibility to check for errors and issue > ROLLBACK instead of COMMIT, if

[sqlite] sqlite-users Digest, Vol 93, Issue 5

2015-09-06 Thread Simon Slavin
On 6 Sep 2015, at 9:30am, sherry.ummen at gmail.com wrote: > Description(1..n) > Name > Desc > Records (0..n) >Number >Type >Values(1..n) > > Now its higly imposible to change this format because of legacy reason and > we use some proprietary single file database. > > Now we

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Luuk
On 06-09-15 15:26, Yuriy M. Kaminskiy wrote: > Luuk writes: > >> DELETE FROM test; >> BEGIN; >> INSERT INTO test VALUES(1,'test1'); >> INSERT INTO test VALUES(3,'test3',3); >> INSERT INTO test VALUES(2,'test2'); >> COMMIT; >> SELECT * FROM test; > (and normally I'd expect to see DELETE *inside*

[sqlite] Third test of json and index expressions, now it works

2015-09-06 Thread Scott Robison
On Sun, Sep 6, 2015 at 3:47 PM, pasma10 wrote: > op 06-09-2015 22:42 schreef Scott Robison op scott at casaderobison.com: > > > On Sun, Sep 6, 2015 at 10:54 AM, E.Pasma wrote: > > > >> > >> Op 6 sep 2015, om 16:44 heeft Scott Robison het volgende geschreven: > >> > >>> > >>> One, the argument

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Yuriy M. Kaminskiy
Luuk writes: > On 05-09-15 22:27, Simon Slavin wrote: >> On 5 Sep 2015, at 9:18pm, Petr L?z?ovsk? wrote: >> >>> Have some shell scripts working with sqlite. Receiving incoming >>> payments from bank via HTTP API and pushing it into database. This >>> script will start periodically, every single

[sqlite] Potential bug: Database on gvfs mount cannot be committed to

2015-09-06 Thread Markus Weiland
Hi, I've discovered a potential bug in handling of SQLite database files on gvfs mounted network shares. Steps to reproduce: 1. Under vanilla Ubuntu 15.04 with latest official patches and SQLite version 2.8.17, mount a Windows / SMB network share via Nautilus file manager. The share can be

[sqlite] Third test of json and index expressions, now it works

2015-09-06 Thread Scott Robison
On Sun, Sep 6, 2015 at 10:54 AM, E.Pasma wrote: > > Op 6 sep 2015, om 16:44 heeft Scott Robison het volgende geschreven: > >> >> One, the argument wasn't whether or not column expressions were called >> multiple times. My understanding of the debate was that using aliases in >> place of their

[sqlite] Potential bug: Database on gvfs mount cannot be committed to

2015-09-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/06/2015 11:13 AM, Florian Weimer wrote: > Surely that's not true, and NFS and SMB are fine as long as there > is no concurrent access? And no program crashes, no network glitches, no optimisation in the protocols to deal with latency, nothing

[sqlite] Potential bug: Database on gvfs mount cannot be committed to

2015-09-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/06/2015 10:20 AM, Markus Weiland wrote: > I see. Since this was working under Ubuntu 14.04, I assume this is > a regression with gvfs. I'll check over there. Nope. SQLite can not maintain data integrity when used with *any* network filesystem.

[sqlite] Third test of json and index expressions, now it works

2015-09-06 Thread E.Pasma
Op 6 sep 2015, om 03:17 heeft Scott Robison het volgende geschreven: > > select * from (select a as b from c) where b is something > Still column expressions are called mutiple times. SQLite 3.8.11 2015-07-27 13:49:41 b8e92227a469de677a66da62e4361f099c0b79d0 create table c(a) ; explain query

[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-06 Thread Luuk
On 06-09-15 07:47, Scott Robison wrote: > On Sat, Sep 5, 2015 at 9:58 PM, Keith Medcalf wrote: > >> Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows. >> >> sqlite3x.c: In function 'sqlite3MemoryBarrier': >> sqlite3x.c:20410:17: error: expected expression before ')' token

[sqlite] BEGINNER - Transactions in shell script

2015-09-06 Thread Luuk
On 05-09-15 22:27, Simon Slavin wrote: > On 5 Sep 2015, at 9:18pm, Petr L?z?ovsk? wrote: > >> Have some shell scripts working with sqlite. Receiving incoming payments >> from bank via HTTP API and pushing it into database. This script will start >> periodically, every single hour. >> >> Want

[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-06 Thread Keith Medcalf
On Sunday, 6 September, 2015 04:32, Richard Hipp said: > On 9/5/15, Keith Medcalf wrote: > > Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows. > Please retry after the latest check-in and let us know whether or not > the problem has been resolved. Confirmed that the

[sqlite] sqlite-users Digest, Vol 93, Issue 5

2015-09-06 Thread sherry.um...@gmail.com
Hi, I have a general data modeling question: I have the data in this format Description(1..n) Name Desc Records (0..n) Number Type Values(1..n) Now its higly imposible to change this format because of legacy reason and we use some proprietary single file database. Now we

[sqlite] Third test of json and index expressions, now it works

2015-09-06 Thread Scott Robison
On Sun, Sep 6, 2015 at 4:36 AM, E.Pasma wrote: > > Op 6 sep 2015, om 03:17 heeft Scott Robison het volgende geschreven: > >> >> select * from (select a as b from c) where b is something >> >> Still column expressions are called mutiple times. > > SQLite 3.8.11 2015-07-27 13:49:41

[sqlite] Potential bug: Database on gvfs mount cannot be committed to

2015-09-06 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 09/06/2015 06:16 AM, Markus Weiland wrote: > I've discovered a potential bug in handling of SQLite database > files on gvfs mounted network shares. SQLite doesn't support being stored on the network for several reasons, including that network file

[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-06 Thread Richard Hipp
On 9/5/15, Keith Medcalf wrote: > > Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows. > Please retry after the latest check-in and let us know whether or not the problem has been resolved. -- D. Richard Hipp drh at sqlite.org

[sqlite] Second test of json and index expressions, not so good

2015-09-06 Thread Domingo Alvarez Duarte
Hello ! That's awesome ! We can write cleaner queries with this. Thank you so much ! Cheers ! > Sun Sep 06 2015 12:39:03 am CEST CEST from "Richard Hipp" > Subject: Re: [sqlite] Second test of json and index >expressions, not so good > > On 9/4/15, Domingo Alvarez Duarte wrote: >

[sqlite] MemoryBarrier compile error on WIndows MinGW gcc 4.8.1

2015-09-06 Thread Scott Robison
On Sat, Sep 5, 2015 at 9:58 PM, Keith Medcalf wrote: > > Trunk does not compile with MinGW [gcc version 4.8.1 (GCC)] on Windows. > > sqlite3x.c: In function 'sqlite3MemoryBarrier': > sqlite3x.c:20410:17: error: expected expression before ')' token >MemoryBarrier(); > > /* > ** Try to provide

[sqlite] Third test of json and index expressions, now it works

2015-09-06 Thread Domingo Alvarez Duarte
Hello ! Sorry about that ! I confused your email with other person that was so negative and defensive about any critic to sqlite even constructive ones. I apologize again ! Cheers ! > Sat Sep 05 2015 10:19:55 pm CEST CEST from "R.Smith" >Subject: Re: [sqlite] Third test of json

[sqlite] Thread safety problem encountered by people working on WebKit

2015-09-06 Thread Richard Hipp
On 9/5/15, Darin Adler wrote: > Hi folks. > > I?m sending this on behalf of Michael Catanzaro, a contributor to the WebKit > open source project, who is working on a WebKit bug report, "Crash when > WebCore::SQLiteFileSystem::openDatabase is called from multiple threads" >