Re: [sqlite] Error whilst trying to compile csv.c

2017-08-08 Thread Richard Hipp
On 8/8/17, Gavin Rayner wrote: > Hi, > > I’m new to sqlite and C. I get this error whilst trying to compile csv.c on > macOS 10.12.6. See http://sqlite.org/csv.html It appears that recent versions of XCode have created a macro "vsnprintf" in

Re: [sqlite] Error whilst trying to compile csv.c

2017-08-08 Thread Richard Hipp
A fix is now on trunk. https://www.sqlite.org/src/info/795eede331b832a5 On 8/8/17, Richard Hipp wrote: > On 8/8/17, Gavin Rayner wrote: >> Hi, >> >> I’m new to sqlite and C. I get this error whilst trying to compile csv.c >> on >> macOS 10.12.6. See

Re: [sqlite] hex and char functions

2017-08-08 Thread x
I accidentally deleted the latest 3 replies to this thread in my mail so apologies for not including any content from those mails. Ryan, the error happens immediately in c++ builder. E.g. UnicodeString S=”\u0085”; Int Code=S[1]; Code returns 63 (x3F) which is code for ‘?’ and the question mark

[sqlite] Error Message "database table is locked"

2017-08-08 Thread Manoj Sengottuvel
Hi Richard, In our IOS app - we are getting the error "*database table is locked*" while executing the table drop script (e.g. drop table tbl1;). The same error we are getting for index drop also. Pl let me know how to fix this issue. Regards, Manoj

[sqlite] Amalgamation compilation with SQLITE_THREADSAFE=0

2017-08-08 Thread Jacky Lam
Hi All, I am currently doing amalgamation compilation of SQLite and target for low computational power, portable, single thread devices. The OS version used in these devices are the very simplified version of Linux OS. More specifically, it does not have pthread, mutex and mutli-threading related

Re: [sqlite] Error Message "database table is locked"

2017-08-08 Thread Jens Alfke
> On Aug 8, 2017, at 9:38 PM, Manoj Sengottuvel wrote: > > In our IOS app - we are getting the error "*database table is locked*" > while executing the table drop script (e.g. drop table tbl1;). You may still have a compiled statement (sqlite3_stmt*) for a query that

Re: [sqlite] Amalgamation compilation with SQLITE_THREADSAFE=0

2017-08-08 Thread Simon Slavin
On 9 Aug 2017, at 3:31am, Jacky Lam wrote: > 1. Can I call sqlite3_open more than one times before calling sqlite3_close > and sqlite3_free? Call sqlite3_open() for each database you want to open. You can have any number of databases open at the same time. Call

Re: [sqlite] hex and char functions

2017-08-08 Thread Rowan Worth
On 8 August 2017 at 18:32, x wrote: > Why does it always turn out to be my own fault ☹ > Welcome to programming ;) It's very rare in practice to find an actual bug in a library or language, especially one as widely deployed and tested as sqlite. Glad you're sorted, I

Re: [sqlite] SQLITE PHP syntax issues - INSERT INTO db

2017-08-08 Thread Jens Alfke
> On Aug 5, 2017, at 6:48 AM, Edmondo Borasio wrote: > > *$query1="INSERT INTO Table"."(ID,name,surname)"."VALUES(\' ' . $NewID . > '\','newName','newSurname');"; * It’s a very, very bad idea to insert variable strings directly into a SQL query like this. If the

Re: [sqlite] SQLITE PHP syntax issues - INSERT INTO db

2017-08-08 Thread Jens Alfke
> On Aug 8, 2017, at 10:03 AM, Igor Korot wrote: > > Just google "Jonny Drop All Tables". ;-) “Little Bobby Tables” to be precise; here’s a direct link: https://xkcd.com/327/ —Jens ___ sqlite-users

Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-08 Thread petern
Hey Brian. I had some time this morning to look at it. Try whacking this new concat_replace into your SQLite build in either func.c or sqlite3.c amalgam. Also remember to hook it up with a new entry after say, group_concat, as follows. AGGREGATE(group_replace, 3, 0, 0,

Re: [sqlite] LSM1 extension

2017-08-08 Thread x
I keep reading about this LSM1 but can’t find anything about it beyond tickets. Any links? From: Jens Alfke Sent: 08 August 2017 18:04 To: SQLite mailing list Subject: Re: [sqlite] LSM1 extension > On Aug 4, 2017, at 9:12

Re: [sqlite] hex and char functions

2017-08-08 Thread x
Just received this on Embarcadero forum. You are assigning an Ansi literal string to a Unicode string so a conversion from the current Ansi locale is occurring. Try assigning a unicode literal: UnicodeString S= L"\u0085"; That L in front of the string makes Code==133 and it’s also 133 inside

Re: [sqlite] Thinking about a way to extend the number of writers in WAL mode

2017-08-08 Thread Jens Alfke
> On Aug 4, 2017, at 11:28 AM, Nico Williams wrote: > > Imagine a mode where there is only a WAL, and to checkpoint is to write > a new WAL with only live contents and... rename(2) into place. What you’re describing is exactly how CouchDB’s storage engine works, as well

Re: [sqlite] Thinking about a way to extend the number of writers in WAL mode

2017-08-08 Thread Simon Slavin
On 8 Aug 2017, at 6:30pm, Jens Alfke wrote: > We’ve also seen that, on low-end hardware like mobile devices, I/O bandwidth > is limited enough that a running compaction can really harm the > responsiveness of the _entire OS_, as well as cause significant battery drain.

Re: [sqlite] LSM1 extension

2017-08-08 Thread Richard Hipp
On 8/8/17, x wrote: > I keep reading about this LSM1 but can’t find anything about it beyond > tickets. Any links? Baseline technology: https://en.wikipedia.org/wiki/Log-structured_merge-tree No documentation yet on the LSM1 implementation in SQLite. -- D. Richard Hipp

Re: [sqlite] LSM1 extension

2017-08-08 Thread x
Thanks Richard. From: Richard Hipp Sent: 08 August 2017 18:47 To: SQLite mailing list Subject: Re: [sqlite] LSM1 extension On 8/8/17, x wrote: > I keep reading about this LSM1 but can’t find anything

Re: [sqlite] SQLITE PHP syntax issues - INSERT INTO db

2017-08-08 Thread Igor Korot
Hi, On Tue, Aug 8, 2017 at 12:58 PM, Jens Alfke wrote: > >> On Aug 5, 2017, at 6:48 AM, Edmondo Borasio wrote: >> >> *$query1="INSERT INTO Table"."(ID,name,surname)"."VALUES(\' ' . $NewID . >> '\','newName','newSurname');"; * > > It’s a very, very

Re: [sqlite] LSM1 extension

2017-08-08 Thread Jens Alfke
> On Aug 4, 2017, at 9:12 PM, Charles Leifer wrote: > > Right -- my question is still unanswered as to why the code was merged in. It’s not uncommon in software engineering to put unfinished long-running feature work on the main development branch but disable it with a

Re: [sqlite] Thinking about a way to extend the number of writers in WAL mode

2017-08-08 Thread Nico Williams
On Tue, Aug 08, 2017 at 10:30:33AM -0700, Jens Alfke wrote: > > On Aug 4, 2017, at 11:28 AM, Nico Williams wrote: > > Imagine a mode where there is only a WAL, and to checkpoint is to write > > a new WAL with only live contents and... rename(2) into place. > > What you’re

Re: [sqlite] SQLITE PHP syntax issues - INSERT INTO db

2017-08-08 Thread Warren Young
On Aug 8, 2017, at 11:06 AM, Jens Alfke wrote: > > On Aug 8, 2017, at 10:03 AM, Igor Korot wrote: >> >> Just google "Jonny Drop All Tables". ;-) > > “Little Bobby Tables” to be precise; here’s a direct link: Little Bobby has a web site now:

Re: [sqlite] SQLITE PHP syntax issues - INSERT INTO db

2017-08-08 Thread Stephen Chrzanowski
To add on to what Jens mentions, with PHP, you can at least sanitize the $NewID by using (integer)$NewID. Any string or non integer that is assigned to $NewID will get converted to the integer value zero. From my experience, typically IDs aren't stored as zero, but I've not looked at EVERY

Re: [sqlite] SQLITE PHP syntax issues - INSERT INTO db

2017-08-08 Thread Stephen Chrzanowski
Awesome find Warren. Thanks. On Tue, Aug 8, 2017 at 4:08 PM, Warren Young wrote: > On Aug 8, 2017, at 11:06 AM, Jens Alfke wrote: > > > > On Aug 8, 2017, at 10:03 AM, Igor Korot wrote: > >> > >> Just google "Jonny Drop All Tables".

Re: [sqlite] LSM1 extension

2017-08-08 Thread Charles Leifer
There's some information that may be of interest on the sqlite4 wiki: * Design overview: https://sqlite.org/src4/doc/trunk/www/lsm.wiki * User guide: https://sqlite.org/src4/doc/trunk/www/lsmusr.wiki * API: https://sqlite.org/src4/doc/trunk/www/lsmapi.wiki My interest in this particular feature

[sqlite] Error whilst trying to compile csv.c

2017-08-08 Thread Gavin Rayner
Hi, I’m new to sqlite and C. I get this error whilst trying to compile csv.c on macOS 10.12.6. See http://sqlite.org/csv.html gavmacbook:code Gavin$ gcc -g -fPIC -dynamiclib csv.c -o csv.dylib csv.c:115:3: error: no member named '__builtin___vsnprintf_chk' in