[sqlite] FTS5 returns "corrupt" plus trailing zero

2015-09-29 Thread Dan Kennedy
On 09/21/2015 05:14 PM, Ralf Junker wrote: > My implementation of > > http://www.sqlite.org/src/artifact/400384798349d658?ln=94-96 > > returns "corrupt" plus a trailing zero, that is 8 characters in total. > > Maybe this line > > http://www.sqlite.org/src/artifact/4fdbc0a321e3a1d7?ln=5364 > >

[sqlite] Odd download file names

2015-09-29 Thread Stephen Chrzanowski
Yes, I did run [fossil ui], which launched a web browser to localhost/ 127.0.0.1. I didn't know about showsql. That'll absolutely help. On Tue, Sep 29, 2015 at 8:09 PM, Richard Hipp wrote: > On 9/29/15, Stephen Chrzanowski wrote: > > I did use the UI. It temporarily confused me with the

[sqlite] Odd download file names

2015-09-29 Thread Richard Hipp
On 9/29/15, Stephen Chrzanowski wrote: > I did use the UI. It temporarily confused me with the looks until I > realized I was looking at localhost, not the fossil repo. Did you try "fossil ui" on *your* repository? > > Yeah, I've already investigated the database, but have yet to dig into the

[sqlite] Odd download file names

2015-09-29 Thread Stephen Chrzanowski
I did use the UI. It temporarily confused me with the looks until I realized I was looking at localhost, not the fossil repo. Yeah, I've already investigated the database, but have yet to dig into the meat of it. On to hour 7 of experience gaining, unless work gets in the way. ;) There are a

[sqlite] Best Practices

2015-09-29 Thread Richard Hipp
On 9/29/15, eluken at pentarch.org wrote: > I am using SQLite as the backend for a table-top wargame aid. One of the > features I am including in the aid is allowing the user to change the name > of the database. What would be the best way to do so? Inside the filesystem? > Or some feature in

[sqlite] Is it legal SQL to select a specific row of a group via a HAVING clause?

2015-09-29 Thread James K. Lowden
On Tue, 29 Sep 2015 15:05:42 +0800 Rowan Worth wrote: > Imagine a DB storing a history of currency exchange rate info. > > CREATE TABLE Prices ( > id INTEGER PRIMARY KEY, > day INTEGER, > currency TEXT, > price FLOAT); Better for your purpose would be: CREATE TABLE Prices (

[sqlite] Best Practices

2015-09-29 Thread elu...@pentarch.org
I am using SQLite as the backend for a table-top wargame aid. One of the features I am including in the aid is allowing the user to change the name of the database. What would be the best way to do so? Inside the filesystem? Or some feature in SQLite to copy the database to a new name? Ideally,

[sqlite] Odd download file names

2015-09-29 Thread Keith Medcalf
did you try "fossil ui"? > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users- > bounces at mailinglists.sqlite.org] On Behalf Of Stephen Chrzanowski > Sent: Tuesday, 29 September, 2015 10:58 > To: General Discussion of SQLite Database >

[sqlite] Odd download file names

2015-09-29 Thread Kees Nuyt
On Tue, 29 Sep 2015 04:01:39 -0400, Stephen Chrzanowski wrote: > Thanks, it does. > > I'm working under the Win7/64 environment doing the builds using the C++ > Builder from Bloodshed, but I do speak Linux, so I can follow along with > what you're saying here. > > I've found "fuel" and playing

[sqlite] Is it legal SQL to select a specific row of a group via a HAVING clause?

2015-09-29 Thread Rowan Worth
Hi guys, Imagine a DB storing a history of currency exchange rate info. CREATE TABLE Prices ( id INTEGER PRIMARY KEY, day INTEGER, currency TEXT, price FLOAT); Assume 'day' increases monotonically and there is at most one price recorded per currency per day - if you want to know

[sqlite] Is it legal SQL to select a specific row of a group via a HAVING clause?

2015-09-29 Thread Gabor Grothendieck
On Tue, Sep 29, 2015 at 6:16 AM, Simon Slavin wrote: > I don't like using sub-SELECT and I would love to see another reader > rephrase this using 'WITH' or a VIEW. > with sub as (select currency, price, max(day) from prices group by currency) select currency, price from sub;

[sqlite] Odd download file names

2015-09-29 Thread Richard Hipp
On 9/29/15, Stephen Chrzanowski wrote: > Long story story short, "fuel" didn't do what I wanted, so it got > scrapped. It wouldn't show me a history of what happened to a file (Not > even a diff), and it wouldn't show me the contents of the desired file on > the fly. I went to the CLI for

[sqlite] Odd download file names

2015-09-29 Thread Stephen Chrzanowski
Long story story short, "fuel" didn't do what I wanted, so it got scrapped. It wouldn't show me a history of what happened to a file (Not even a diff), and it wouldn't show me the contents of the desired file on the fly. I went to the CLI for fossil, found the timeline functionality, and that

[sqlite] SQLITE_BUSY_SNAPSHOT from BEGIN IMMEDIATE

2015-09-29 Thread Rowan Worth
On 29 September 2015 at 03:47, Florian Weimer wrote: > Relatively rarely, while starting a transaction on a concurrently > modified SQLite database in WAL mode, I get a SQLITE_BUSY_SNAPSHOT > error for just-prepared "BEGIN IMMEDIATE" statement. > BEGIN IMMEDIATE takes a RESERVED lock straight

[sqlite] Is it legal SQL to select a specific row of a group via a HAVING clause?

2015-09-29 Thread Simon Slavin
On 29 Sep 2015, at 8:05am, Rowan Worth wrote: > CREATE TABLE Prices ( >id INTEGER PRIMARY KEY, >day INTEGER, >currency TEXT, >price FLOAT); > > Assume 'day' increases monotonically and there is at most one price > recorded per currency per day - if you want to know the latest

[sqlite] Query containing correlated subquery gets "stuck"

2015-09-29 Thread gunnar
Hi Clemens, It works perfect and fast with a covering index!! (I didn't know this concept but after you mentioned it, read about it here: http://www.sqlite.org/queryplanner.html#covidx Perhaps also interesting for others to read about) Thank you very much! Gunnar On 09/29/2015 09:33 AM,

[sqlite] Query containing correlated subquery gets "stuck"

2015-09-29 Thread gunnar
No I didn't. I will try it. And thank you very much for your help!! Gunnar Harms T +31 (0)20 53 53 487 F +31 (0)20 42 08 852 I www.hiqinvest.nl HiQ Invest Rembrandt Tower ? 9th floor Amstelplein 1 1096 HA Amsterdam On 09/29/2015 09:33 AM, Clemens Ladisch wrote: > gunnar wrote: >> Perhaps

[sqlite] Query containing correlated subquery gets "stuck"

2015-09-29 Thread gunnar
Hi, I thought "distinct(column)" is somewhat same as "group by column". I devised the query in steps and forgot to take away the distinct part. thanks, Gunnar On 09/29/2015 09:37 AM, Clemens Ladisch wrote: > gunnar wrote: >> select distinct(server_order_id), count(*) from ... group by

[sqlite] Odd download file names

2015-09-29 Thread Kees Nuyt
On Tue, 29 Sep 2015 02:01:03 -0400, Stephen Chrzanowski wrote: > For the past year, I've had a script that runs daily that reads all the > links off of http://sqlite.org/download.html and downloads anything that is > missing. It has been a long while since I've looked at this particular >

[sqlite] Query containing correlated subquery gets "stuck"

2015-09-29 Thread Clemens Ladisch
gunnar wrote: > select distinct(server_order_id), count(*) from ... group by server_order_id > ... Please note that DISTINCT does not work this way; it always applies to all expressions in the SELECT clause, and "(server_order_id)" is just the same as "server_order_id". The query actually works

[sqlite] Query containing correlated subquery gets "stuck"

2015-09-29 Thread Clemens Ladisch
gunnar wrote: > Perhaps someone knows a way how I can speed up the original query. Did you try a covering index (add cb_seq_num to ordercallback_index3)? Regards, Clemens

[sqlite] Is it legal SQL to select a specific row of a group via a HAVING clause?

2015-09-29 Thread Clemens Ladisch
Rowan Worth wrote: > if you want to know the latest prices, is this legal? > > SELECT currency, price FROM Prices GROUP BY currency HAVING time = MAX(time); It is not legal ANSI SQL, and most other databases will complain. While the WHERE clause allows to filter out rows from the table, the

[sqlite] Odd download file names

2015-09-29 Thread Richard Hipp
On 9/29/15, Stephen Chrzanowski wrote: > Thanks, it does. > > I'm working under the Win7/64 environment doing the builds using the C++ > Builder from Bloodshed, but I do speak Linux, so I can follow along with > what you're saying here. Plain old Fossil is cross-platform. You can download

[sqlite] Is it legal SQL to select a specific row of a group via a HAVING clause?

2015-09-29 Thread Hick Gunter
The main difference between HAVING and WHERE ist that WHERE operates on the input set and HAVING operates on the output set. If your condition requires computing an aggregate, then HAVING is a viable method of avoiding a subquery that needs to repeatedly scan the input table: SELECT

[sqlite] Odd download file names

2015-09-29 Thread Stephen Chrzanowski
Thanks, it does. I'm working under the Win7/64 environment doing the builds using the C++ Builder from Bloodshed, but I do speak Linux, so I can follow along with what you're saying here. I've found "fuel" and playing around with that to see if I can go back into history instead of downloading

[sqlite] Odd download file names

2015-09-29 Thread Stephen Chrzanowski
Fourth question has been answered, but I was looking at the source code to find my answer. Now, to go step back in time :] On Tue, Sep 29, 2015 at 2:01 AM, Stephen Chrzanowski wrote: > For the past year, I've had a script that runs daily that reads all the > links off of

[sqlite] Odd download file names

2015-09-29 Thread Stephen Chrzanowski
For the past year, I've had a script that runs daily that reads all the links off of http://sqlite.org/download.html and downloads anything that is missing. It has been a long while since I've looked at this particular section of my NAS, but thought I'd bring my repositories up to snuff, and