[sqlite] sqlite native NuGet package maintainers?

2016-02-24 Thread da...@andl.org
I have raised an issue for cannot install Nuget native DLL into .NET 4.5 project. I requested information about where this project is maintained and by whom. Any response appreciated. Regards David M Bennett FACS Andl - A New Database Language - andl.org -Original Message- From:

[sqlite] Order by multiple columns

2016-02-24 Thread ad...@shuling.net
Hi, I am using SQLite 3.11. I create a table as follows: CREATE TABLE MyTable (F1 INTEGER, F2 INTEGER, F3 INTEGER); Then add the following records: INSERT INTO MyTable (F1, F2, F3) Values (1, 2, 8);

[sqlite] Order by multiple columns

2016-02-24 Thread Simon Slavin
On 24 Feb 2016, at 3:15am, admin at shuling.net wrote: > CREATE TABLE MyTable (F1 INTEGER, F2 INTEGER, F3 INTEGER); > > Now if I want to select from MyTable, and sort the result based on F1 > (ascendant), and for two records with same F1, then sort based on > F2(ascendant), then sort based on

[sqlite] Late calculation of a field

2016-02-24 Thread ad...@shuling.net
Hi, I am using SQLite 3.11. I create a table as follows: CREATE TABLE MyTable (F1 INTEGER, F2 INTEGER, F3 INTEGER, F4 INTEGER); Then add the following records: INSERT INTO MyTable (F1, F2) Values (1, 1);

[sqlite] Late calculation of a field

2016-02-24 Thread Simon Slavin
On 24 Feb 2016, at 3:28am, admin at shuling.net wrote: > Is that possible? No. If you are going to make lots of changes to the table and rarely use SELECT, do the calculation in the SELECT command. If you are going to make few changes to the table but do lots of searching and sorting,

[sqlite] WAL checkpoint

2016-02-24 Thread Sairam Gaddam
Before checkpointing the data from WAL, if the DB is queried, will the result include updated data from WAL or not? Will this situation arise? because writing to WAL and checkpoint occur very fast but if a query comes in between, will the result be updated or not before checkpoint.

[sqlite] WAL checkpoint

2016-02-24 Thread Igor Tandetnik
On 2/24/2016 12:56 AM, Sairam Gaddam wrote: > Before checkpointing the data from WAL, if the DB is queried, will the > result include updated data from WAL or not? It will. A transaction reads both from WAL and the original database file - whichever contains the fresher data. -- Igor Tandetnik

[sqlite] How to remove duplicate records

2016-02-24 Thread ad...@shuling.net
Hi, I am using SQLite 3.11. I create a table as follows: CREATE TABLE MyTable (F1 INTEGER, F2 INTEGER, F3 INTEGER); Then add the following records: INSERT INTO MyTable (F1, F2, F3) Values (1, 2, 8);

[sqlite] How to remove duplicate records

2016-02-24 Thread Dominique Devienne
On Wed, Feb 24, 2016 at 8:17 AM, wrote: > Now I want to eliminate duplicate record so for two records whose F1 and F2 > values are identical, even if their F3 values are different, then one > record > with the largest value of F3 will be kept and the other one will be > removed. > > Is that

[sqlite] Why is a separate journal file needed ?

2016-02-24 Thread Simon Slavin
In case you're new to this group, please understand that I'm experienced with SQLite and I understand how it works and how it uses journal files. Can someone explain to me -- or point at a web page which does -- why a separate journal file is needed. Why can't the information which SQLite

[sqlite] How to remove duplicate records

2016-02-24 Thread Clemens Ladisch
Dominique Devienne wrote: >Always ran into Error: only a single result allowed for a SELECT that >is part of an expression. --DD In a join, you can directly use a subquery with multiple columns: ... JOIN (SELECT ...) ... Regards, Clemens

[sqlite] How to remove duplicate records

2016-02-24 Thread Dominique Devienne
On Wed, Feb 24, 2016 at 1:58 PM, Clemens Ladisch wrote: > Dominique Devienne wrote: > >Always ran into Error: only a single result allowed for a SELECT that > >is part of an expression. --DD > > In a join, you can directly use a subquery with multiple columns: > ... JOIN (SELECT ...) ... >

[sqlite] SQLite-jdbc Bug - database table is locked

2016-02-24 Thread Pankaj Bisen
Hello Everyone, I have two unrelated tables table_A and table_B in my SQLite DB. Trying to drop table_B while a resultset is open on table_A throws "java.sql.SQLException: database table is locked". Following simple code will illustrate the Bug clearly. public class Class1 { public static

[sqlite] SQLite-jdbc Bug - database table is locked

2016-02-24 Thread Simon Slavin
On 24 Feb 2016, at 2:49am, Pankaj Bisen wrote: > I have two unrelated tables table_A and table_B in my SQLite DB. Trying to > drop table_B while a resultset is open on table_A throws SQLite does not have table-level locking. If anything in the database file needs to be locked then the whole

[sqlite] Why skip invoking busy handler while pBt->inTransaction!=TRANS_NONE

2016-02-24 Thread sanhua.zh
In the source code of SQLite, btree.c, sqlite3BtreeBeginTrans function, The code do { /* Call lockBtree() until either pBt-pPage1 is populated or ** lockBtree() returns something other than SQLITE_OK. lockBtree() ** may return SQLITE_OK but leave pBt-pPage1 set to 0 if after ** reading

[sqlite] Why is a separate journal file needed ?

2016-02-24 Thread Richard Hipp
On 2/24/16, Simon Slavin wrote: > Why can't the information which SQLite > stores in a journal file be put in the database file ? Doing so would double the size of the database file. Every database file would contain extra space (normally unused) set aside for the journal. -- D. Richard Hipp

[sqlite] Why is a separate journal file needed ?

2016-02-24 Thread Paul
Good point! I can assume that the problem would be a sparsity of database file. If you mix normal pages and journal then database will be fragmented. You can't avoid it. Even if you start writing journal at the end of file, hoping that you can later truncate it at commit, there is no way to

[sqlite] Multicolumn unique (resending)

2016-02-24 Thread Klaus Jantzen
Hello, after reading the SQLite documentation I decided to change some of my database applications to use SQLite. Following the syntax descriptions and after some experiments I found out that one cannot define a multicolumn constraint ... UNIQUE(col_a, col_b, col_c). How would you do that in

[sqlite] Multicolumn unique (resending)

2016-02-24 Thread Richard Hipp
On 2/24/16, Klaus Jantzen wrote: > Hello, > > after reading the SQLite documentation I decided to change some of my > database > applications to use SQLite. > > Following the syntax descriptions and after some experiments I found out > that one cannot > define a multicolumn constraint ...

[sqlite] Why is a separate journal file needed ?

2016-02-24 Thread Stephen Chrzanowski
IMO, all that, plus the fact that you have an easy roll back mechanism. Anything that needs to be put in the database is external to the pristine database. Lock the database with a transaction, fill up the journal, the power goes out, your pristine database isn't touched. Just whatever happens

[sqlite] Issue with v3.11

2016-02-24 Thread Miroslav Rajcic
Hello, I have a program using sqlite for document storage. Sqlite layer has been quite stable until I replaced v3.10.2 with 3.11. Relevant parts of the program are: //at app startup static void SqliteErrorLogCallback(void *pArg, int iErrCode, const char *zMsg) { printf("Sqlite error (code:

[sqlite] Why is a separate journal file needed ?

2016-02-24 Thread R Smith
On 2016/02/24 3:49 PM, Richard Hipp wrote: > On 2/24/16, Simon Slavin wrote: >> Why can't the information which SQLite >> stores in a journal file be put in the database file ? > Doing so would double the size of the database file. Every database > file would contain extra space (normally

[sqlite] Why is a separate journal file needed ?

2016-02-24 Thread Igor Tandetnik
On 2/24/2016 10:08 AM, Stephen Chrzanowski wrote: > IMO, all that, plus the fact that you have an easy roll back mechanism. > Anything that needs to be put in the database is external to the pristine > database. Lock the database with a transaction, fill up the journal, the > power goes out, your

[sqlite] Issue with v3.11

2016-02-24 Thread Richard Hipp
On 2/24/16, Miroslav Rajcic wrote: > Hello, > I have a program using sqlite for document storage. Sqlite layer has > been quite stable until I replaced v3.10.2 with 3.11. > > Error: > Sqlite error (code: 1, txt: SQL logic error or missing database): > unrecognized token: "x" > > > Breaking with

[sqlite] SQLite-jdbc Bug - database table is locked

2016-02-24 Thread Dan Kennedy
On 02/24/2016 09:49 AM, Pankaj Bisen wrote: > Hello Everyone, > > I have two unrelated tables table_A and table_B in my SQLite DB. Trying to > drop table_B while a resultset is open on table_A throws > "java.sql.SQLException: database table is locked". That's an SQLITE_LOCKED error. Here:

[sqlite] Why skip invoking busy handler while pBt->inTransaction!=TRANS_NONE

2016-02-24 Thread Dan Kennedy
On 02/24/2016 08:32 PM, sanhua.zh wrote: > In the source code of SQLite, btree.c, sqlite3BtreeBeginTrans function, > The code > > > do { >/* Call lockBtree() until either pBt-pPage1 is populated or >** lockBtree() returns something other than SQLITE_OK. lockBtree() >** may return

[sqlite] Why skip invoking busy handler while pBt->inTransaction!=TRANS_NONE

2016-02-24 Thread Igor Tandetnik
On 2/24/2016 8:32 AM, sanhua.zh wrote: > So it?s the question I confused. Why SQLite skip invoking busy handler while > it's in TRANS (either read or write) ? Deadlock detection, I would guess. See https://www.sqlite.org/c3ref/busy_handler.html , look for the paragraph that mentions

[sqlite] Issue with v3.11

2016-02-24 Thread Richard Hipp
On 2/24/16, Richard Hipp wrote: > > What compile-time options are you using? > Dan deduced that you must be using -DSQLITE_OMIT_BLOB_LITERAL. That (unsupported) compile-time option does indeed induce the error you are seeing. A fix has been checked in

[sqlite] Issue with v3.11

2016-02-24 Thread Miroslav Rajcic
Hi Richard, that was really fast! Indeed, I was using the SQLITE_OMIT_BLOB_LITERAL flag. Removing the flag solved the issue. Thank you guys for a quick solution. Regards, Miroslav On 24.2.2016. 17:20, Richard Hipp wrote: > On 2/24/16, Richard Hipp wrote: >> What compile-time options are

[sqlite] How this /*A-overwrites-S*/ should work ?

2016-02-24 Thread Domingo Alvarez Duarte
Hello ! I have a modification on the parser.y for my own purposes and it was been parsed till the introduction of " /*A-overwrites-S*/" and it seems that something is wrong on parser.y see bellow, after the SELECT specification the " /*A-overwrites-S*/" is wrapped by "#if SELECTTRACE_ENABLED"

[sqlite] How this /*A-overwrites-S*/ should work ?

2016-02-24 Thread Domingo Alvarez Duarte
Here is the full changes I did in parser.y: ? %endif SQLITE_OMIT_COMPOUND_SELECT oneselect(A) ::= SELECT|XSELECT(S) distinct(D) selcollist(W) from(X) where_opt(Y) groupby_opt(P) having_opt(Q) orderby_opt(Z) limit_opt(L). { #if SELECTTRACE_ENABLED ? Token s = S;

[sqlite] How this /*A-overwrites-S*/ should work ?

2016-02-24 Thread Domingo Alvarez Duarte
I solved it setting a variable before " /*A-overwrites-S*/", but I's still confusing it's usage inside a wrapped "#ifdef" that supposed only will be executed conditionally. Cheers ! oneselect(A) ::= SELECT|XSELECT(S) distinct(D) selcollist(W) from(X) where_opt(Y)

[sqlite] How this /*A-overwrites-S*/ should work ?

2016-02-24 Thread Richard Hipp
On 2/24/16, Domingo Alvarez Duarte wrote: > Hello ! > > I have a modification on the parser.y for my own purposes and it was been > parsed till the introduction of " /*A-overwrites-S*/" and it seems that > something is wrong on parser.y see bellow,\ The /*A-overwrites-S*/ comment is a hint to

[sqlite] How this /*A-overwrites-S*/ should work ?

2016-02-24 Thread Richard Hipp
On 2/24/16, Domingo Alvarez Duarte wrote: > I solved it setting a variable before " /*A-overwrites-S*/", but I's still > confusing it's usage inside a wrapped "#ifdef" that supposed only will be > executed conditionally. The /*A-overwrites-S*/ comment is processed by Lemon, and Lemon has no

[sqlite] How this /*A-overwrites-S*/ should work ?

2016-02-24 Thread Domingo Alvarez Duarte
Thanks for the answer ! > Wed Feb 24 2016 6:38:46 pm CET CET from "Richard Hipp" > > > The /*A-overwrites-S*/ comment is processed by Lemon, and Lemon has no > knowledge of #ifdefs. > > > I can understand that but it will confuse other people like it did to me ! Cheers !

[sqlite] Crash when running complex FT5 queries

2016-02-24 Thread Gergely Lukacsy (glukacsy)
Hi, We run into a reproducible crash on FTS5 search when searching something complex such as: "(word1* word2* word3*) OR word1* OR word2* OR word3*" It might be that we are doing something wrong, but any insight is appreciated. The actual crashing call is a sqlite3_step/1 call: while

[sqlite] Why is a separate journal file needed ?

2016-02-24 Thread Paul Sanderson
You would need some sort of allocation table for the journal (wal or rollback) and on a rollback commit or a wal checkpoint the allocation would need to be cleared (or maybe some "in use" bit cleared) to show that the pages were now free to be re-used. The additional data stored with rollback