[sqlite] Get rid of old-style function declarations/definitions in lemon.c

2017-04-12 Thread Guy Harris
Here's a patch, against the current Fossil repository, including some changes we've made to lemon.c in Wireshark, that gets rid of old-style K function definitions/declarations, and also removes trailing white space from some lines (the Wireshark pre-commit hook complains about them):

Re: [sqlite] Issue with LoadExtension with Spatialite

2017-04-12 Thread Green Fields
I have had this problem. Essentially, precompiled binaries (SQLite3.dll, and System.Data.Sqlite) for Windows do not appear to allow extension loading using the SQL function. I have raised this before, http://sqlite.1065341.n5.nabble.com/Extension-Loading-td93885.html but it may need custom

Re: [sqlite] Ambiguity in 'pragma page_size' docs

2017-04-12 Thread Richard Hipp
On 4/12/17, David Raymond wrote: > > When I open a connection, what's > the best way to ensure I've connected to an existing file, and am not about > to create a brand new one by trying to find out? Use sqlite3_open_v2() to create the database connection and make sure

Re: [sqlite] Ambiguity in 'pragma page_size' docs

2017-04-12 Thread David Raymond
I think there're two questions going on here. (Though I'm probably adding on to the original question) First is similar to a recent thread and is: When I open a connection, what's the best way to ensure I've connected to an existing file, and am not about to create a brand new one by trying to

Re: [sqlite] Ambiguity in 'pragma page_size' docs

2017-04-12 Thread Jens Alfke
> On Apr 12, 2017, at 12:53 PM, Richard Hipp wrote: > > The implication *should* be that you *never* change the page size. > SQLite will pick a good page size for you automatically, which works > in 99.99% of all cases. … provided you're running 3.12 or later. Prior to that it

Re: [sqlite] Which pragmas are persistent?

2017-04-12 Thread Jens Alfke
> On Apr 12, 2017, at 1:01 PM, Simon Slavin wrote: > >> which I only need to issue when initializing a new database. > > 'need' is a bit strong. I have never worried about pagesize in a database. > I’ve always just left it at the default for whatever platform I’m using

Re: [sqlite] Which pragmas are persistent?

2017-04-12 Thread David Raymond
I recommend taking a look at http://www.sqlite.org/fileformat2.html and look at 1.2 The Database Header. Since everything's stored in the file, the permanent pragmas are going to be ones which change one of the values in there. Permanent: page_size (change requires vacuum) auto_vacuum (change

Re: [sqlite] Which pragmas are persistent?

2017-04-12 Thread Simon Slavin
On 12 Apr 2017, at 8:29pm, Jens Alfke wrote: > which I only need to issue when initializing a new database. 'need' is a bit strong. I have never worried about pagesize in a database. I’ve always just left it at the default for whatever platform I’m using when I create

Re: [sqlite] Ambiguity in 'pragma page_size' docs

2017-04-12 Thread Richard Hipp
On 4/12/17, Jens Alfke wrote: > The docs[1] say that: > >> The page_size pragma will only set in the page size if it is issued before >> any other SQL statements that cause I/O against the database file. > > It's not stated explicitly, but I believe the pragma has to be issued

[sqlite] Regression in json()

2017-04-12 Thread Rolf Ade
The fix http://www.sqlite.org/cgi/src/info/4f1b5229a3bbc9d4 (Escape control characters in JSON) introduced a regression. > ./sqlite3 SQLite version 3.19.0 2017-04-12 17:50:12 [...] sqlite> select json('"ä"'); Error: malformed JSON I'd expect: "ä" The reason is

[sqlite] Ambiguity in 'pragma page_size' docs

2017-04-12 Thread Jens Alfke
The docs[1] say that: > The page_size pragma will only set in the page size if it is issued before > any other SQL statements that cause I/O against the database file. It's not stated explicitly, but I believe the pragma has to be issued before any other statement _ever_ causes I/O, i.e. it

Re: [sqlite] Which pragmas are persistent?

2017-04-12 Thread Richard Hipp
On 4/12/17, Jens Alfke wrote: > Many of SQLite's pragma commands change database settings. It would be > helpful if their documentation[1] stated which of these persist across > closing/reopening the database, and which are scoped only to the open > connection. For example,

[sqlite] Which pragmas are persistent?

2017-04-12 Thread Jens Alfke
Many of SQLite's pragma commands change database settings. It would be helpful if their documentation[1] stated which of these persist across closing/reopening the database, and which are scoped only to the open connection. For example, the docs say that that 'pragma journal_mode=WAL' is

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread Ron Barnes
That worked Thank you very Much!! -Ron -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of R Smith Sent: Wednesday, April 12, 2017 10:12 AM To: sqlite-users@mailinglists.sqlite.org Subject: Re: [sqlite] SQLite - Interrogate

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread R Smith
On 2017/04/12 3:50 PM, Paul Sanderson wrote: another oops I see Ryan pretty much posted the same as me 5 minutes earlier - I'll go back to bed :) The more the merrier I say. There is no guarantee I am right, and seeing the problem solved in more than one way usually helps the poster - which

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread R Smith
On 2017/04/12 3:08 PM, Ron Barnes wrote: Hello Ryan, That Code below worked as you said it should. Awesome! And Thank you! I now have the days difference for each row. I have one other question if I may pose it to you, how do I count the number of rows, less than a day, or a week or a year

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread Paul Sanderson
another oops I see Ryan pretty much posted the same as me 5 minutes earlier - I'll go back to bed :) Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786 http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit -Forensic Toolkit for

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread Paul Sanderson
Try something like SELECT dateplay.vi, JulianDay('now') AS now, JulianDay(SubStr(Replace(dateplay.vi, '/', '-'), 1, 10)) AS jday, JulianDay('now') - JulianDay(SubStr(Replace(dateplay.vi, '/', '-'), 1, 10)) AS diff, CASE WHEN JulianDay('now') - JulianDay(SubStr(Replace(dateplay.vi,

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread Ron Barnes
Hello Ryan, That Code below worked as you said it should. Awesome! And Thank you! I now have the days difference for each row. I have one other question if I may pose it to you, how do I count the number of rows, less than a day, or a week or a year and so forth? I tried this code and a few

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread Paul Sanderson
Oops hit send too quickly the replace function replaces / with - in your date string to make the ISO 8601 and substr just makes sure we use the date portion only. Paul www.sandersonforensics.com skype: r3scue193 twitter: @sandersonforens Tel +44 (0)1326 572786

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread Paul Sanderson
Hi Ron Your dates are still not 8601 with your dates above in a table called dateplay and column named vi select vi, julianday('now') as now, julianday(substr(replace(vi, '/', '-'), 1, 10)) as jday, julianday('now') - julianday(substr(replace(vi, '/', '-'), 1, 10)) as diff from

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread R Smith
On 2017/04/12 2:13 PM, Ron Barnes wrote: Hi Jim, I ran an overnight job and converted 300+ million dates to the ISO 8601 format. Here are examples of the new dates. 2017/04/10 07:24:15 PM 2017/03/07 08:08:58 AM 2016/11/06 12:35:15 PM Since this should be easier how

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread Ron Barnes
R Smith WOW! Lol. I just ran an overnight job to convert the dates to a more machine friendly format. Looking at your code below, it is much more advanced than my skills can interpret. I will attempt to extract the code below (minus your conversion logic) to grab the days difference

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread Ron Barnes
Hi Jim, I ran an overnight job and converted 300+ million dates to the ISO 8601 format. Here are examples of the new dates. 2017/04/10 07:24:15 PM 2017/03/07 08:08:58 AM 2016/11/06 12:35:15 PM Since this should be easier how would you go about determining the Day(s)

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread R Smith
Mailer messed up the format on a very important space... retry: -- Script Items: 4 Parameter Count: 0 -- 2017-04-12 13:43:15.875 | [Info] Script Initialized, Started executing... --

Re: [sqlite] SQLite - Interrogate Date/Time field Statement question

2017-04-12 Thread R Smith
On 2017/04/12 1:24 AM, Ron Barnes wrote: Hello all, To everyone who helped me before - thank you very much! I'm coding in Visual Basic .NET (Visual Studio 2015) Community. I have to count a Date/Time field and the problem is, this field contains data in a format I'm not sure can be