Re: [sqlite] write internal blob vs external file

2014-09-15 Thread Dominique Devienne
On Fri, Sep 12, 2014 at 11:48 PM, Eric Rubin-Smith eas@gmail.com wrote: Looking at the sqlite web site and mailing lists shows that the SQLite team has taken a stab at answering the question, is it faster to read a blob out of sqlite or out of a file?. See the links below. Does the team

[sqlite] SET (x,y) = (x1,y1)?

2014-09-15 Thread Mark Lawrence
I occasionally have the need to update two columns based on complex sub queries, which are often very similar UPDATE t SET x = ( SELECT 1...), y = ( SELECT 2...)-- nearly the same as SELECT 1 ; Normally one could use a CTE to do the work once: WITH

Re: [sqlite] SET (x,y) = (x1,y1)?

2014-09-15 Thread Mark Lawrence
On Mon Sep 15, 2014 at 10:51:04AM +0200, Mark Lawrence wrote: Normally one could use a CTE to do the work once: WITH cte AS ( SELECT 1 AS x, 2 AS y ) UPDATE t SET x = cte.x, y = cte.y ; Actually this doesn't

Re: [sqlite] write internal blob vs external file

2014-09-15 Thread Dan Kennedy
On 09/15/2014 03:18 PM, Dominique Devienne wrote: On Fri, Sep 12, 2014 at 11:48 PM, Eric Rubin-Smith eas@gmail.com wrote: Looking at the sqlite web site and mailing lists shows that the SQLite team has taken a stab at answering the question, is it faster to read a blob out of sqlite or out

Re: [sqlite] write internal blob vs external file

2014-09-15 Thread Dominique Devienne
On Mon, Sep 15, 2014 at 12:29 PM, Dan Kennedy danielk1...@gmail.com wrote: On 09/15/2014 03:18 PM, Dominique Devienne wrote: On Fri, Sep 12, 2014 at 11:48 PM, Eric Rubin-Smith eas@gmail.com wrote: Looking at the sqlite web site and mailing lists shows that the SQLite team has taken a

[sqlite] Set compile time option

2014-09-15 Thread Prakash Premkumar
Hi, How do I set the sqlite compile time option SQLITE_DEBUG ? Can you please specify how I should set it in the command line ? Thanks Prakash ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] write internal blob vs external file

2014-09-15 Thread Simon Slavin
On 15 Sep 2014, at 12:19pm, Dominique Devienne ddevie...@gmail.com wrote: On Mon, Sep 15, 2014 at 12:29 PM, Dan Kennedy danielk1...@gmail.com wrote: On 09/15/2014 03:18 PM, Dominique Devienne wrote: whenever you want to update a single byte of a blob, you must rewrite the whole row,

Re: [sqlite] Set compile time option

2014-09-15 Thread Simon Slavin
On 15 Sep 2014, at 12:46pm, Prakash Premkumar prakash.p...@gmail.com wrote: How do I set the sqlite compile time option SQLITE_DEBUG ? Include the following line in your C source code: #define SQLITE_DEBUG 1 near the top, along with any other lines you have starting with '#'. The line

Re: [sqlite] write internal blob vs external file

2014-09-15 Thread Dominique Devienne
On Mon, Sep 15, 2014 at 1:59 PM, Simon Slavin slav...@bigfraud.org wrote: On 15 Sep 2014, at 12:19pm, Dominique Devienne ddevie...@gmail.com wrote: On Mon, Sep 15, 2014 at 12:29 PM, Dan Kennedy danielk1...@gmail.com wrote: On 09/15/2014 03:18 PM, Dominique Devienne wrote: want to update

Re: [sqlite] write internal blob vs external file

2014-09-15 Thread Simon Slavin
On 15 Sep 2014, at 1:23pm, Dominique Devienne ddevie...@gmail.com wrote: On Mon, Sep 15, 2014 at 1:59 PM, Simon Slavin slav...@bigfraud.org wrote: It just rewrites bytes wherever the existing row is on disk, Then how is this transaction safe? I might not be reading the doc right, but I

Re: [sqlite] Set compile time option

2014-09-15 Thread Richard Hipp
On Mon, Sep 15, 2014 at 8:08 AM, Simon Slavin slav...@bigfraud.org wrote: On 15 Sep 2014, at 12:46pm, Prakash Premkumar prakash.p...@gmail.com wrote: How do I set the sqlite compile time option SQLITE_DEBUG ? Include the following line in your C source code: #define SQLITE_DEBUG 1

Re: [sqlite] write internal blob vs external file

2014-09-15 Thread Eric Rubin-Smith
Dominique Devienne wrote: Looking at the sqlite web site and mailing lists shows that the SQLite team has taken a stab at answering the question, is it faster to read a blob out of sqlite or out of a file?. See the links below. Does the team have analogous guidance regarding

Re: [sqlite] BUG: Aggregate functions in subqueries

2014-09-15 Thread Richard Hipp
On Sun, Sep 14, 2014 at 12:18 AM, Lea Verou l...@verou.me wrote: Per the 3.7.11 changelog [1], queries of the form SELECT max(x), y FROM table return the value of y from the same row that contains the maximum x value. However, this: select y from (SELECT max(x), y FROM table); would not

Re: [sqlite] write internal blob vs external file

2014-09-15 Thread Dan Kennedy
On 09/15/2014 06:19 PM, Dominique Devienne wrote: On Mon, Sep 15, 2014 at 12:29 PM, Dan Kennedy danielk1...@gmail.com wrote: On 09/15/2014 03:18 PM, Dominique Devienne wrote: On Fri, Sep 12, 2014 at 11:48 PM, Eric Rubin-Smith eas@gmail.com wrote: Looking at the sqlite web site and

Re: [sqlite] SET (x,y) = (x1,y1)?

2014-09-15 Thread Dennis Jenkins
This construct does not work in postgresql 9.3.5 (unless I have a typo). However, I would love for it to work in both Postgresql and Sqlite. djenkins@ostara ~ $ psql -Upostgres -dcapybara_regtest psql (9.3.5) Type help for help. capybara_regtest=# create table test1 (col1 integer, col2

Re: [sqlite] SET (x,y) = (x1,y1)?

2014-09-15 Thread John McKown
On Mon, Sep 15, 2014 at 10:21 AM, Dennis Jenkins dennis.jenkins...@gmail.com wrote: This construct does not work in postgresql 9.3.5 (unless I have a typo). However, I would love for it to work in both Postgresql and Sqlite. djenkins@ostara ~ $ psql -Upostgres -dcapybara_regtest psql

Re: [sqlite] SET (x,y) = (x1,y1)?

2014-09-15 Thread Hick Gunter
Maybe you can reformulate the query to fit INSERT OR UPDATE INTO t SELECT t.a,t.b,...,s.x,s.y FROM t, s ... -Ursprüngliche Nachricht- Von: Mark Lawrence [mailto:no...@null.net] Gesendet: Montag, 15. September 2014 10:51 An: sqlite-users@sqlite.org Betreff: [sqlite] SET (x,y) = (x1,y1)?

Re: [sqlite] SET (x,y) = (x1,y1)?

2014-09-15 Thread Petite Abeille
On Sep 15, 2014, at 7:08 PM, Hick Gunter h...@scigames.at wrote: Maybe you can reformulate the query to fit INSERT OR UPDATE INTO t SELECT t.a,t.b,...,s.x,s.y FROM t, s … There is no such a thing as 'INSERT OR UPDATE’ in SQLite. There is a ‘REPLACE’, but it’s definitively not the same as

Re: [sqlite] BUG: Aggregate functions in subqueries

2014-09-15 Thread Petite Abeille
On Sep 15, 2014, at 4:48 PM, Richard Hipp d...@sqlite.org wrote: On Sun, Sep 14, 2014 at 12:18 AM, Lea Verou l...@verou.me wrote: Per the 3.7.11 changelog [1], queries of the form SELECT max(x), y FROM table return the value of y from the same row that contains the maximum x value.

[sqlite] Divide by 0 not giving error

2014-09-15 Thread Dave Wellman
Hi all, I've found that an sql request that I expected to fail, but it didn't. On the face of it that is good news but there is a potential downside. I wonder if my expectation is wrong or if this is a bug which so far hasn't been caught. The problem deals with dividing by 0. As far as I

Re: [sqlite] Divide by 0 not giving error

2014-09-15 Thread Richard Hipp
On Mon, Sep 15, 2014 at 2:50 PM, Dave Wellman dwell...@ward-analytics.com wrote: The problem deals with dividing by 0. As far as I can remember, in every programming language that I have ever used and in all databases that I've used, if you try and divide by 0 the process will fail with a

Re: [sqlite] Divide by 0 not giving error

2014-09-15 Thread Simon Slavin
On 15 Sep 2014, at 7:50pm, Dave Wellman dwell...@ward-analytics.com wrote: Should trying to divide by 0 result in an error? No. There's no mechanism for reporting a mathematical error in SQL. You can report malformed commands, references to entities (tables, columns, etc.) which don't

[sqlite] System.Data.SQLite version 1.0.94.0 released

2014-09-15 Thread Joe Mistachkin
System.Data.SQLite version 1.0.94.0 (with SQLite 3.8.6) is now available on the System.Data.SQLite website: https://system.data.sqlite.org/ Further information about this release can be seen at https://system.data.sqlite.org/index.html/doc/trunk/www/news.wiki Please post on the

[sqlite] query REAL without trailing decimal and zero?

2014-09-15 Thread Nelson, Erik - 2
When I query a field defined with type 'real', I get '.0' appended to the results for whole numbers. For example if the value in the field is 1, it appears as 1.0 in the query results. Is there some way for me to change this? I poked around in the code and it appeared that the format string

Re: [sqlite] query REAL without trailing decimal and zero?

2014-09-15 Thread Richard Hipp
On Mon, Sep 15, 2014 at 3:02 PM, Nelson, Erik - 2 erik.l.nel...@bankofamerica.com wrote: When I query a field defined with type 'real', I get '.0' appended to the results for whole numbers. For example if the value in the field is 1, it appears as 1.0 in the query results. Is there some

Re: [sqlite] query REAL without trailing decimal and zero?

2014-09-15 Thread Nelson, Erik - 2
Richard Hipp wrote on Monday, September 15, 2014 3:16 PM On Mon, Sep 15, 2014 at 3:02 PM, Nelson, Erik - 2 erik.l.nel...@bankofamerica.com wrote: When I query a field defined with type 'real', I get '.0' appended to the results for whole numbers. For example if the value in the field

Re: [sqlite] Divide by 0 not giving error

2014-09-15 Thread Dave Wellman
Richard, Thanks for that, at least I know that what I'm seeing is going to continue. Simon, I'm really surprised at that. Effectively what this means is that the answer that Sqlite returns may or may not be the correct result. I realise this may only be in a single circumstance but that is still

Re: [sqlite] Divide by 0 not giving error

2014-09-15 Thread Simon Slavin
On 15 Sep 2014, at 8:33pm, Dave Wellman dwell...@ward-analytics.com wrote: Simon, I'm really surprised at that. Effectively what this means is that the answer that Sqlite returns may or may not be the correct result. What ? No. It's correct. The answer is not known, and NULL means I don't

Re: [sqlite] Divide by 0 not giving error

2014-09-15 Thread RSmith
On 2014/09/15 20:50, Dave Wellman wrote: Hi all, I've found that an sql request that I expected to fail, but it didn't. On the face of it that is good news but there is a potential downside. I wonder if my expectation is wrong or if this is a bug which so far hasn't been caught. The

Re: [sqlite] Divide by 0 not giving error

2014-09-15 Thread RSmith
On 2014/09/15 22:13, Simon Slavin wrote: On 15 Sep 2014, at 8:33pm, Dave Wellman dwell...@ward-analytics.com wrote: Simon, I'm really surprised at that. Effectively what this means is that the answer that Sqlite returns may or may not be the correct result. What ? No. It's correct. The

Re: [sqlite] presentation about ordering and atomicity of filesystems

2014-09-15 Thread Nico Williams
On Fri, Sep 12, 2014 at 6:47 PM, James K. Lowden jklow...@schemamania.org wrote: On Fri, 12 Sep 2014 19:38:53 +0100 Simon Slavin slav...@bigfraud.org wrote: I don't think it can be done by trying to build it on top of an existing file system. I think we need a file system (volume format,

Re: [sqlite] presentation about ordering and atomicity of filesystems

2014-09-15 Thread Nico Williams
On Fri, Sep 12, 2014 at 7:21 PM, Richard Hipp d...@sqlite.org wrote: On Fri, Sep 12, 2014 at 8:07 PM, Simon Slavin slav...@bigfraud.org wrote: one thing that annoys me about SQLite is that it needs to make a journal file which isn't part of the database file. Why ? Why can't it just write

Re: [sqlite] presentation about ordering and atomicity of filesystems

2014-09-15 Thread Nico Williams
On Sat, Sep 13, 2014 at 10:39 AM, Richard Hipp d...@sqlite.org wrote: I say that a filesystem is an eventually-consistent key/value database. Yes! The keys are the filenames and the values are all big BLOBs, specifically the file content. Filesystems also have a hierarchical keyspace, which

Re: [sqlite] Divide by 0 not giving error

2014-09-15 Thread James K. Lowden
On Mon, 15 Sep 2014 21:13:01 +0100 Simon Slavin slav...@bigfraud.org wrote: I suppose we then get into a discussion of what is the 'correct result'. I completely understand that NULL is unknown, but I've always thought that there is a difference between unknown and 'error'. It is not

Re: [sqlite] Divide by 0 not giving error

2014-09-15 Thread Simon Slavin
On 16 Sep 2014, at 1:23am, James K. Lowden jklow...@schemamania.org wrote: Whether or not something is an error is a matter of definition. SQLite defines division by zero to be NULL. It's very unusual in that regard. MySQL does it too unless ERROR_FOR_DIVISION_BY_ZERO mode is enabled:

[sqlite] SQL Query to Vdbe Instructions

2014-09-15 Thread Prakash Premkumar
Hi, Can you please tell me which function/set of functions convert the SQL query to Vdbe program ? Thanks Prakash ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users