Re: [sqlite] cannot set connection while a datareader is active

2014-04-13 Thread Joe Mistachkin

Stefano Ravagni wrote:
>
> Hello Joe, here my code for CloseDati to help you to reproduce the error 
> that i don't understand...
> 
> ++
> Public Sub CloseDati()
> 
>  'chiude i dati del datareader associati all'oggetto DATI cui
>  ' spesso sono attaccati anche altri oggetti come
>  ' l'oggetto ObjCmd
>  Try
>  If IsNothing(Dati) = False Then
>  If Dati.IsClosed = False Then Dati.Close()
>  End If
>  Catch ex As Exception
>  Call ScriviLog("ModConnessione.CloseDati", ex.Message)
>  MsgBox("ERRORE DURANTE LA CHIUSURA DEI DATI APERTI!" & vbCrLf
& vbCrLf & ex.Message)
>  End Try
>  End Sub
> 
> Just seen the image attachment i sent which demostrate i obtain the error
?
> 

I'm still unable to reproduce the issue.  Is an exception being caught by
this
method while trying to close the data reader?  Also, perhaps instead of
using
the IsNothing function, you might want to change the "If" expression to:

If Not Dati Is Nothing Then

In theory, changing the "If" expression should not make any difference;
however,
I seem to recall that the IsNothing function was typically used for checking
the
sub-type of a Variant (i.e. and not for checking for null references).  Of
course,
I have not used Visual Basic.NET for quite a long time and I may be wrong.

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Windows Phone 8.1

2014-04-13 Thread Lane Williams
I have used the SQLite on several Windows Store and Windows Phone projects
including the latest version 3.8.4.3 on a Windows Phone 8 project from VS
2013, they all work Great.

However the 3.8.4.3 version will not recognize in my latest Windows Phone
8.1 project.  I am trying to use the new "Universal Apps" method in VS
2013, the Windows 8.1 will load (3.8.4.3) but the Windows Phone 8.1 does
not show the SQLite as an option to load.

Is an update in the works to support the latest Windows Phone 8.1
platform.  Is there a suggested work around for using the current version
of SQLite with Windows Phone 8.1.

Thanks,
Lane
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug with FTS3 parenthesis and ICU (2)

2014-04-13 Thread David Hedley
This is definitely a bug in sqlite. I have experienced it too.

The problem stems from “getNextToken(…)” expecting to find the parentheses in 
the token delimiters (rather than the tokens themselves). The ICU tokenizer 
returns the parentheses as tokens, rather than ignoring them as delimiters as 
the simple tokenizer does.

Two possible fixes:
1. Fix getNextToken(...) to look in tokens as well as delimiters for parentheses
2. Fix icuNext to not return parentheses as tokens.

To me, option 1. seemed easier to do a quick hack to, until there is an 
official fix.

In getNextToken, I changed: 
if (rc == SQLITE_DONE) iStart = n;
for (i = 0; i < iStart i++) { 
if (z[i] == '(') {

to:

if (rc == SQLITE_DONE) iStart = n;
for (i = 0; i < iEnd; i++) { // 2014-04-12 DCRH: Tweak 
to make parens work with ICU tokenizer
if (z[i] == '(') {

That way, it now searches the token text in addition to the preceding 
delimiters, and parentheses now work correctly with the ICU tokenizer.

Hope this helps,

David
-- 
David Hedley
CTO
Vistair Systems Ltd
Mobile: +44 (0)7971 681088
Tex: 0845 VISTAIR (8478247) / +44 1454 616531
Fax: 0870 1350992
-- 
Information in this electronic mail message is confidential and may be legally 
privileged. It is intended solely for the addressee. Access to this message by 
anyone else is unauthorised. If you are not the intended recipient any use, 
disclosure, copying or distribution of this message is prohibited and may be 
unlawful. When addressed to our customers, any information contained in this 
message is subject to Vistair Systems Ltd Terms and Conditions.

Vistair Systems Ltd is registered in England and Wales #5418081



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Richard Hipp
On Sat, Apr 12, 2014 at 5:04 PM, Alexander Bich  wrote:

> Hi there,
>
> I was trying to upgrade SQLite version in my C++ application from
> 3.8.0.2 to 3.8.4.3. Unfortunately after upgrade my application became
> experience major problems. I tracked down the bug and got an SQL
> script which gives different result on different versions of SQLite.
>

Thanks for the bug report and for the concise script for reproducing the
bug.

The problem is now fixed on trunk.  The problem has actually existed in all
prior versions of SQLite that supported partial indices.  That your script
happened to work in 3.8.0.2 was just a happy accident.  The problem has
been fixed by check-in http://www.sqlite.org/src/info/3122b836408 and the
ticket http://www.sqlite.org/src/info/2ea3e9fe6379fc3f6 has been closed.
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread James K. Lowden
On Sun, 13 Apr 2014 06:55:09 -0400
Richard Hipp  wrote:

> The following simplified test case causes an assertion fault:
> 
> CREATE TABLE t1(a,b);
> CREATE UNIQUE INDEX t1ab ON t1(a,b);
> CREATE INDEX t1b ON t1(b) WHERE b=1;
> INSERT INTO t1(a,b) VALUES(123,456);
> UPDATE OR REPLACE t1 SET b=789;

Not here, although I had to remove WHERE on t1b, 

SQLite version 3.7.13 2012-06-11 02:05:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE t1(a,b);
sqlite> CREATE UNIQUE INDEX t1ab ON t1(a,b);
sqlite> CREATE INDEX t1b ON t1(b) ;
sqlite> INSERT INTO t1(a,b) VALUES(123,456);
sqlite> UPDATE OR REPLACE t1 SET b=789;
sqlite> 

--jkl
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Simon Slavin

On 13 Apr 2014, at 12:32pm, Tim Streater  wrote:

>> CREATE INDEX t1b ON t1(b) WHERE b=1;
> 
> I get no assertion fault but rather a syntax error here on "where".

Partial indexes were introduced in 3.8.0.  See the last section of



Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database corruption issue

2014-04-13 Thread Florian Weimer
* Grzegorz Sikorski:

> We do fsck on the startup. Occasionally, there are some errors, so we
> decided to do 'fsck -p' to fix them before mounting the
> filesystem. Here is how we then mount the actual filesystem:
> /dev/mmcblk0p2 on /media/DATA type ext4
> (rw,relatime,barrier=1,journal_checksum,nodelalloc,data=journal,usrquota)
>
> I am not an expert in ext4, so I am not sure it is the best way to
> mount, but as far as I read on some forums, this is the safest (and
> slowest!) option.

It is, but it also less tested than data=writeback.  Have you
backported any ext4 fixes (such as commit 2d859db3e4) to your kernel?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Tim Streater
On 13 Apr 2014 at 11:55, Richard Hipp  wrote: 

> The UPDATE OR REPLACE also seems to be an essential component.  The
> following simplified test case causes an assertion fault:
>
> CREATE TABLE t1(a,b);
> CREATE UNIQUE INDEX t1ab ON t1(a,b);
> CREATE INDEX t1b ON t1(b) WHERE b=1;

I get no assertion fault but rather a syntax error here on "where".

> INSERT INTO t1(a,b) VALUES(123,456);
> UPDATE OR REPLACE t1 SET b=789;

Using SQLite version 3.7.13 2012-07-17 17:46:21 in the sqlite3 shell.



--
Cheers  --  Tim
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Richard Hipp
On Sat, Apr 12, 2014 at 5:04 PM, Alexander Bich  wrote:

> Hi there,
>
> I was trying to upgrade SQLite version in my C++ application from
> 3.8.0.2 to 3.8.4.3. Unfortunately after upgrade my application became
> experience major problems. I tracked down the bug and got an SQL
> script which gives different result on different versions of SQLite.
>
> Original script is rather big, so I tried to omit unessential things.
> That's the minimal script:
>
>
> CREATE TABLE items (id INTEGER PRIMARY KEY, key INTEGER NOT NULL,
> status INTEGER NOT NULL);
> CREATE UNIQUE INDEX items_key_status ON items (key, status);
> CREATE INDEX items_status_partial ON items (status) WHERE status = 1;
> INSERT INTO items (key, status) VALUES (123, 1);
> UPDATE OR REPLACE items SET status = 0 WHERE id = 1;
> SELECT COUNT(*) FROM items WHERE status = 1;
>

The UPDATE OR REPLACE also seems to be an essential component.  The
following simplified test case causes an assertion fault:

CREATE TABLE t1(a,b);
CREATE UNIQUE INDEX t1ab ON t1(a,b);
CREATE INDEX t1b ON t1(b) WHERE b=1;
INSERT INTO t1(a,b) VALUES(123,456);
UPDATE OR REPLACE t1 SET b=789;



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Bug with some combination of unique/partial indices

2014-04-13 Thread Alexander Bich
Hi there,

I was trying to upgrade SQLite version in my C++ application from
3.8.0.2 to 3.8.4.3. Unfortunately after upgrade my application became
experience major problems. I tracked down the bug and got an SQL
script which gives different result on different versions of SQLite.

Original script is rather big, so I tried to omit unessential things.
That's the minimal script:


CREATE TABLE items (id INTEGER PRIMARY KEY, key INTEGER NOT NULL,
status INTEGER NOT NULL);
CREATE UNIQUE INDEX items_key_status ON items (key, status);
CREATE INDEX items_status_partial ON items (status) WHERE status = 1;
INSERT INTO items (key, status) VALUES (123, 1);
UPDATE OR REPLACE items SET status = 0 WHERE id = 1;
SELECT COUNT(*) FROM items WHERE status = 1;


The last SELECT query should correctly return one number 0. Here the
results of different versions of official sqlite3.exe binaries from
sqlite.org:
sqlite_3.8.2.0.exe  http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users