[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread Török Edwin
On 11/27/2015 08:30 PM, R Smith wrote: > > > On 2015/11/27 4:44 PM, Adam Devita wrote: >> I think the OP meant to write: >> "If the expression is an aggregate expression, it is evaluated across >> all rows in the group. Otherwise, it is evaluated against a single >> arbitrarily chosen row from

[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread Simon Slavin
On 27 Nov 2015, at 9:08pm, T?r?k Edwin wrote: > Thanks, non-deterministic was probably the wrong term to use. > I wanted to find situations where a query's result depends on an > implementation detail of SQLite, and the behaviour is not fully specified by > the

[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread Bernardo Sulzbach
On Fri, Nov 27, 2015 at 8:29 PM, Simon Slavin wrote: > > And just as you write, all the above behaviours can change in different > versions of SQLite so even if you do detailed detective work using the > current version it might all be obsolete next week. > > Simon. > Exactly. One of the

[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread R Smith
On 2015/11/27 4:44 PM, Adam Devita wrote: > I think the OP meant to write: > "If the expression is an aggregate expression, it is evaluated across > all rows in the group. Otherwise, it is evaluated against a single > arbitrarily chosen row from within the group. " > > Is there a way I could

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Dan Kennedy
On 11/27/2015 12:13 PM, Igor Korot wrote: > Hi, > Is there any way to have "sqlite3_errmsg" function return a wide char string? > Or do a conversion in a portable way? Will sqlite3_errmsg16() work for you? https://www.sqlite.org/c3ref/errcode.html Dan.

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Simon Slavin
On 27 Nov 2015, at 7:03pm, Igor Korot wrote: > But what about Linux/Mac? > Can I use that function there? Code pages are a Microsoft thing. Macs just have ASCII and Unicode, with easy-to-use system functions to convert between them. There's no need to worry about locales and code pages and

[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread Simon Slavin
On 27 Nov 2015, at 6:30pm, R Smith wrote: > Let me explain better, let's assume the query contains MAX(x)... The result > will be from whichever row contains the max, and if the x was not in the > aggregate function, it will be from some row (which may or may not be the one > with the max

[sqlite] optimization for outer join with most simple views

2015-11-27 Thread E.Pasma
Hello, I like to post this remark again as it seems closely related to "Query flattening for left joins involving subqueries on the right- hand side". I have a complete different reason though. For playing with sudoku solving, I have a table representing the digits 1..9: CREATE TABLE

[sqlite] SQLite crashes

2015-11-27 Thread Zsbán Ambrus
On the SQLITE_OMIT_LOOKASIDE macro. On Fri, Nov 27, 2015 at 2:45 PM, Richard Hipp wrote: > The lookaside memory allocator is a fast memory pool used by > individual database connections for short-lived memory allocations. > It makes SQLite run faster, but by bypassing the system >

[sqlite] Query flattening for left joins involving subqueries on the right-hand side

2015-11-27 Thread Kirill Müller
On 27.11.2015 10:38, Clemens Ladisch wrote: > Kirill M?ller wrote: >> I see no reason why the following two queries can't be executed with the >> same plans: >> >> ... t1 LEFT JOIN t2 ... >> ... t1 LEFT JOIN (SELECT * FROM t2) ... > In this case, the queries are identical. But SQLite's query

[sqlite] Query flattening for left joins involving subqueries on the right-hand side

2015-11-27 Thread Kirill Müller
Exactly. And I'd pretty much like SQLite to figure that out for me ;-) -Kirill On 27.11.2015 03:19, Keith Medcalf wrote: > Would it not be more efficient to say: > > select 1 from t1 limit 1; > > ? > >> -Original Message- >> From: sqlite-users-bounces at mailinglists.sqlite.org

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Dominique Devienne
On Fri, Nov 27, 2015 at 2:45 PM, OBones wrote: > Dominique Devienne wrote: > >> That's UTF-16, while a wstring is expected to be in the current locale >> (which won't be UTF-16 on Windows). >> > Excuse me, but the std::wstring type is based on wchar and has no codepage > assigned to it. > And

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread OBones
Dominique Devienne wrote: > On Fri, Nov 27, 2015 at 2:16 PM, Dan Kennedy wrote: > >> On 11/27/2015 12:13 PM, Igor Korot wrote: >> >>> Hi, >>> Is there any way to have "sqlite3_errmsg" function return a wide char >>> string? >>> Or do a conversion in a portable way? >>> >> Will sqlite3_errmsg16()

[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread Darren Duncan
On 2015-11-27 5:46 AM, Keith Medcalf wrote: >> Is there a way I could programatically determine that a query is non- >> deterministic at query prepare time? > > What do you mean, non-deterministic? The result is deterministic in all > cases. > > It may be complicated and/or difficult for you to

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Dominique Devienne
On Fri, Nov 27, 2015 at 2:16 PM, Dan Kennedy wrote: > On 11/27/2015 12:13 PM, Igor Korot wrote: > >> Hi, >> Is there any way to have "sqlite3_errmsg" function return a wide char >> string? >> Or do a conversion in a portable way? >> > > Will sqlite3_errmsg16() work for you? > >

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Igor Korot
Hi, guys. But what about Linux/Mac? Can I use that function there? Thank you. On Nov 27, 2015 9:54 AM, "Dominique Devienne" wrote: > On Fri, Nov 27, 2015 at 2:45 PM, OBones wrote: > > > Dominique Devienne wrote: > > > >> That's UTF-16, while a wstring is expected to be in the current locale >

[sqlite] SQLite crashes

2015-11-27 Thread Harmen de Jong - CoachR Group B.V.
> (1) Recompile with the following compile-time options: -DSQLITE_DEBUG > -DSQLITE_OMIT_LOOKASIDE > > (2) Enable whatever AddressSanitizer tools > (https://en.wikipedia.org/wiki/AddressSanitizer) you have available on your > platform, in addition to (1) above. > > (3) If you do not have an

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Scott Robison
On Fri, Nov 27, 2015 at 12:03 PM, Igor Korot wrote: > Hi, guys. > But what about Linux/Mac? > Can I use that function there? > It will always give you a UTF-16 encoded string as a void*. To get it into a wstring would involve extracting the 16 bit code points and possibly converting them to 32

[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread Török Edwin
Hi, I mistakenly used the wrong side of the ON caluse in a group by clause for a query and I was wondering why SQLite didn't return the same results always: - SELECT SUM(x) FROM (SELECT files.size + LENGTH(CAST(files.name AS BLOB)) + SUM(COALESCE(LENGTH(CAST(fmeta.key AS BLOB)) +

[sqlite] method for thousands separator via sed post processing

2015-11-27 Thread Rowan Worth
Hi Bruce, On 27 November 2015 at 10:59, Bruce Hohl wrote: > Thanks to suggestions on this list I explored the sed post processing > avenue and found a solution. There are quite a few sed docs at > http://sed.sourceforge.net For my needs I adapted an example from >

[sqlite] Query flattening for left joins involving subqueries on the right-hand side

2015-11-27 Thread Clemens Ladisch
Kirill M?ller wrote: > I see no reason why the following two queries can't be executed with the same > plans: > > ... t1 LEFT JOIN t2 ... > ... t1 LEFT JOIN (SELECT * FROM t2) ... In this case, the queries are identical. But SQLite's query optimizer does not try to optimize this because such

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Dominique Devienne
On Fri, Nov 27, 2015 at 6:13 AM, Igor Korot wrote: > Is there any way to have "sqlite3_errmsg" function return a wide char > string? > Or do a conversion in a portable way? > Portably, not using standard C++ AFAIK. But there are several OSS frameworks that hide platform differences. Since

[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread Adam Devita
I think the OP meant to write: "If the expression is an aggregate expression, it is evaluated across all rows in the group. Otherwise, it is evaluated against a single arbitrarily chosen row from within the group. " Is there a way I could programmatically determine that a query is going to use an

[sqlite] SQLite crashes

2015-11-27 Thread Richard Hipp
On 11/27/15, Harmen de Jong - CoachR Group B.V. wrote: >> (1) Recompile with the following compile-time options: -DSQLITE_DEBUG >> -DSQLITE_OMIT_LOOKASIDE >> >> (2) Enable whatever AddressSanitizer tools >> (https://en.wikipedia.org/wiki/AddressSanitizer) you have available on >> your platform,

[sqlite] SQLite3 API

2015-11-27 Thread Cousin Stanley
> I have written (in COBOL) an SQLite3 interface for GnuCOBOL > Robert Any plans for distribution of your cobol/sqlite interface ? -- Stanley C. Kitching Human Being Phoenix, Arizona

[sqlite] SQLite3 API

2015-11-27 Thread Richard Hipp
On 11/26/15, Robert W.Mills (Phoenix) wrote: > > But how do I get the number of rows UPDATEd or DELETEd? > https://www.sqlite.org/c3ref/changes.html -- D. Richard Hipp drh at sqlite.org

[sqlite] drop, create and copy a table

2015-11-27 Thread Héctor Fiandor
Dear Mr. Smith and Dr. Hipp> Finally, I have an application that works, using your suggestions. Something is not working as I want, but finally, it works. Thanks very mucho for your help. Regards, Ing. H?ctor Fiandor hfiandor at ceniai.inf.cu -Mensaje original- De:

[sqlite] Warnings for non-deterministic queries?

2015-11-27 Thread Keith Medcalf
> Is there a way I could programatically determine that a query is non- > deterministic at query prepare time? What do you mean, non-deterministic? The result is deterministic in all cases. It may be complicated and/or difficult for you to compute, but it is always deterministic. The

[sqlite] .NET Linux problem with Microsoft.Data.Sqlite.dll and sqlite3_prepare_v2

2015-11-27 Thread Frank Chang
Richard Hipp or Igor Tadetnik, Here is the C# code for Microsoft.Data.Sqlite.dll, designed for .NET users on Ubuntu Linux and Windows, I am using the latest version of libsqlite3.so compiled as follows; gcc -shared -g -o libsqlite3.so -fPIC sqlite3.c I was able to get

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Igor Korot
Hi, Scott, On Fri, Nov 27, 2015 at 1:01 AM, Scott Robison wrote: > On Thu, Nov 26, 2015 at 10:13 PM, Igor Korot wrote: >> >> Hi, >> Is there any way to have "sqlite3_errmsg" function return a wide char > string? >> Or do a conversion in a portable way? >> >> Thank you. > > The portable way

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Scott Robison
On Fri, Nov 27, 2015 at 1:19 AM, J Decker wrote: > On Fri, Nov 27, 2015 at 12:17 AM, Scott Robison > wrote: > > On Thu, Nov 26, 2015 at 11:42 PM, Igor Korot wrote: > > > >> Hi, Scott, > >> > >> On Fri, Nov 27, 2015 at 1:01 AM, Scott Robison > > >> wrote: > >> > On Thu, Nov 26, 2015 at 10:13

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Scott Robison
On Thu, Nov 26, 2015 at 11:42 PM, Igor Korot wrote: > Hi, Scott, > > On Fri, Nov 27, 2015 at 1:01 AM, Scott Robison > wrote: > > On Thu, Nov 26, 2015 at 10:13 PM, Igor Korot wrote: > >> > >> Hi, > >> Is there any way to have "sqlite3_errmsg" function return a wide char > > string? > >> Or do a

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread J Decker
On Fri, Nov 27, 2015 at 12:17 AM, Scott Robison wrote: > On Thu, Nov 26, 2015 at 11:42 PM, Igor Korot wrote: > >> Hi, Scott, >> >> On Fri, Nov 27, 2015 at 1:01 AM, Scott Robison >> wrote: >> > On Thu, Nov 26, 2015 at 10:13 PM, Igor Korot wrote: >> >> >> >> Hi, >> >> Is there any way to have

[sqlite] sqlite3_errmsg and wide char

2015-11-27 Thread Igor Korot
Hi, Is there any way to have "sqlite3_errmsg" function return a wide char string? Or do a conversion in a portable way? Thank you.