Dear SQLite developers,

I'm creating a plugin under Cordova framework targeting Win10 (UWP), so my project is in c# with WinRT. I'm using SQLite3 successfully. I have the reference for the SQLite.Net.Core-PCL and SQLite.Net-PCL (v3.1.1), and added the SQLite3 for my Win10 project, using the SQLite.UWP.2015 version 3.13.0. I have to do some work on a given database with virtual tables, but whenever I want to update some row from 2 virtual table in a single transaction, my application breaks with a message in the attachment:

Assertion failed!
Program: ..\sqlite3.dll
File: tsrc/fts3.c
Line: 3772
Expression: |((Fts3Table*)pVtab)->mxSavepoint <iSavepoint
|

I've tested when this can be throwed, I created a simple example, creating two virtual table, inserting some data, and in the next transaction, I'm updating the two data. The first update is ok, but the second one fails.

|varpath =Path.Combine(ApplicationData.Current.LocalFolder.Path,"test.db");using(SQLiteConnectionconn =newSQLiteConnection(newSQLite.Net.Platform.WinRT.SQLitePlatformWinRT(),path)){try{conn.BeginTransaction();conn.Execute("CREATE VIRTUAL TABLE T1 USING fts4(ID,VALUE)"); //Just creating a test databaseconn.Execute("CREATE VIRTUAL TABLE T2 USING fts4(ID,VALUE)");conn.Execute("INSERT INTO T1 VALUES ('1','VALUE')");conn.Execute("INSERT INTO T2 VALUES ('2','VALUE')");conn.Commit();conn.BeginTransaction();conn.Execute("UPDATE T1 SET VALUE = 'value2' WHERE ID = '1'"); //Executed wellconn.Execute("UPDATE T2 SET VALUE = 'value2' WHERE ID = '2'"); //Assertion Fail!conn.Commit();}catch(Exceptionex){Log.Error("Error occured "+ex.Message);}}|

I found the rows in the fts3: https://github.com/mackyle/sqlite/blob/master/ext/fts3/fts3.c

|/* ** The xSavepoint() method. ** ** Flush the contents of the pending-terms table to disk. */staticintfts3SavepointMethod(sqlite3_vtab *pVtab,intiSavepoint){intrc =SQLITE_OK;UNUSED_PARAMETER(iSavepoint);assert(((Fts3Table*)pVtab)->inTransaction );assert(((Fts3Table*)pVtab)->mxSavepoint <iSavepoint );TESTONLY(((Fts3Table*)pVtab)->mxSavepoint =iSavepoint );if(((Fts3Table*)pVtab)->bIgnoreSavepoint==0){rc =fts3SyncMethod(pVtab);}returnrc;}|

If I'm running it in release mode, i don't get this error, because the asserts are excluded, and as i see, the rows are modified successfully, but in debug mode, throws me out always.

I have to use all update in one transaction, because if some of them fail, I have to rollback everything. I tried with unique savepoint, but the same effect. I have the same problem if I target Win8.1 and WindowsPhone8.1 too with the corresponding sqlite binaries.

Do you have any idea, how to resolve this, or why is this happening? Or maybe this is a bug? If the assert fails, maybe it have some effect on release mode too, but can't see now?

Regards,
Bence

_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to