[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-29 Thread Etienne Charland
I think I found where the problem is coming from. I did an automated database conversion from SQL Server. Most primary keys are GUIDs. In SQLite, these columns are still defined as 'uniqueidentifier' which is not a valid data type. If I try updating a table that has INT primary key, then it work

[sqlite] Query returns "stack overflow error"

2015-05-29 Thread Etienne Charland
It gets generated across various classes and functions, but this code generates the columns and subqueries. public static IQueryable QueryVideoListItem(IQueryable query, SearchSettings settings) { if (settings == null) settings = new SearchSettings();

[sqlite] String.Substring Generates Error

2015-05-29 Thread Etienne Charland
How about this line of code var Obj = context.MediaCategories.Select(c => "ABC".Substring(1) != null).ToList(); It produces SELECT CASE WHEN (Substring('ABC', 1 + 1, (LENGTH('ABC')) - 1) IS NOT NULL) THEN 1 WHEN (Substring('ABC', 1 + 1, (LENGTH('ABC')) - 1) IS NULL) THEN 0 END AS [C1] FROM [M

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-29 Thread Etienne Charland
I tried this very basic code on a very basic table that contains no DATETIME field. var Obj = context.MediaCategories.FirstOrDefault(); Obj.Folder = "test"; context.SaveChanges(); The table has this format - MediaCategoryId GUID Primary Key - MediaTypeId INT - Name NVARCHAR - Folder NVARCHAR I

[sqlite] Query returns "stack overflow error"

2015-05-29 Thread Etienne Charland
I can get the query to run if I remove enough columns. This query fails with 1 column (subquery) beyond what is allowed to run. https://www.spiritualselftransformation.com/misc/LinqSQLiteError.txt Etienne

[sqlite] Query returns "stack overflow error"

2015-05-29 Thread Joe Mistachkin
Etienne Charland wrote: > > https://www.spiritualselftransformation.com/misc/LinqSQLiteError.txt > What LINQ query is responsible for generating this SQL? -- Joe Mistachkin

[sqlite] String.Substring Generates Error

2015-05-29 Thread Joe Mistachkin
Etienne Charland wrote: > > There is a bug with String.Substring generating SUBSTRING instead of > SUBSTR, which results in the SQL query failing. > Is there some C# example code (and an associated database schema) which demonstrates this issue? -- Joe Mistachkin

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-29 Thread Joe Mistachkin
Your issue might be related to this: https://system.data.sqlite.org/index.html/tktview/4bbf851fa5b26c1ca74a However, it's difficult to determine without seeing the database and the SQL generated from the LINQ code. -- Joe Mistachkin

[sqlite] Query returns "stack overflow error"

2015-05-29 Thread Etienne Charland
I'm using SQLiteStudio. It's not easy to run it manually because of how the parameters must be passed, and the function that doesn't exist within the database. I tried replacing all parameters by their value, and replacing the function with a simple multiplication. It throws an error, but doesn

[sqlite] String.Substring Generates Error

2015-05-29 Thread Etienne Charland
There is a bug with String.Substring generating SUBSTRING instead of SUBSTR, which results in the SQL query failing. Here's a way to fix this bug. In your database model, add this code right before EntityContainer In your context class (create a partial class next to it

[sqlite] Query returns "stack overflow error"

2015-05-29 Thread Etienne Charland
I finally managed to get my C# application running with the SQLite database and LINQ. However, there are requests that are very long because they return a grid where each column must be calculated individually, and this crashes with "stack overflow error". These queries run fast on a SQL Server

[sqlite] LINQ to SQLite Cannot Update: "Store update, insert, or delete statement affected an unexpected number of rows"

2015-05-29 Thread Etienne Charland
With System.Data.SQLite and LINQ to Entities, I'm unable to do a simple update. This code using (Entities context = new Entities()) { var Obj = context.MyTable.Where(m => m.Title.StartsWith("Alaska")).FirstOrDefault(); Obj.Artist = "A"; context.SaveChanges(); } T

[sqlite] Replace an open database

2015-05-29 Thread Dan Kennedy
On 05/29/2015 03:27 PM, Zaumseil Ren? wrote: >> On Fri, May 29, 2015 at 8:48 AM, Dan Kennedy <[hidden >> email]> >> wrote: >> >>> On 05/29/2015 12:59 PM, Zaumseil Ren? wrote: >>> On 05/27/2015 11:59 PM, Wade, Wi

[sqlite] Replace an open database

2015-05-29 Thread Dan Kennedy
On 05/29/2015 02:35 PM, Dominique Devienne wrote: > On Fri, May 29, 2015 at 8:48 AM, Dan Kennedy wrote: > >> On 05/29/2015 12:59 PM, Zaumseil Ren? wrote: >> >>> On 05/27/2015 11:59 PM, Wade, William wrote: >>> But instead of using a regular SQL transaction to drop all the old tables, use

[sqlite] Unit test failure on Linux arm / Mer

2015-05-29 Thread Jussi Pakkanen
On 29.05.2015 13:43, Richard Hipp wrote: >>>testfixture test/func4.test >>>testfixture test/nan.test >>> > Please just post the relevant lines of the output in the body of your > email. You should easily be able to see which lines are important. > Thanks. Here's the first test:

[sqlite] Replace an open database

2015-05-29 Thread Dan Kennedy
On 05/29/2015 12:59 PM, Zaumseil Ren? wrote: > On 05/27/2015 11:59 PM, Wade, William wrote: > >>> 3) The writing thread prefers to delete any existing file. If it can't do >>> that (some readers currently have the file open) it gains an exclusive >>> read/write lock (consistent with no reader has

[sqlite] Error while copying the contents of VdbeOp object

2015-05-29 Thread Sairam Gaddam
How to correctly copy the contents of original VdbeOp aOp which is created by SQlite for some query into another custom VdbeOp object. I tried by normally copying the contents one by one but it resulted in errors. And how to correctly allocate memory to the custom VdbeOp object and how to free th

[sqlite] Crippling query plan change between 3.7.13 and 3.8.10.2

2015-05-29 Thread Richard Hipp
On 5/28/15, Florian Weimer wrote: > The Debian security tracker > uses an SQLite database to keep track of vulnerabilites and > generate reports. > > We recently upgraded SQLite from 3.7.13 to 3.8.7.1 as part of an > operating system upgrade and experienced a

[sqlite] Unit test failure on Linux arm / Mer

2015-05-29 Thread Jussi Pakkanen
On 28.05.2015 22:41, Richard Hipp wrote: > These are floating-point number tests. I suspect that your machine is > giving a different result in the 14-th significant digit, or something > like that. > > Run these: > > testfixture test/func4.test > testfixture test/nan.test > > And pos

[sqlite] Replace an open database

2015-05-29 Thread Dominique Devienne
On Fri, May 29, 2015 at 8:48 AM, Dan Kennedy wrote: > On 05/29/2015 12:59 PM, Zaumseil Ren? wrote: > >> On 05/27/2015 11:59 PM, Wade, William wrote: >> >>> But instead of using a regular SQL transaction to drop all the old >>> tables, use the backup API to clobber the existing database with the n

[sqlite] Replace an open database

2015-05-29 Thread Zaumseil René
>On Fri, May 29, 2015 at 8:48 AM, Dan Kennedy <[hidden >email]> > wrote: > >> On 05/29/2015 12:59 PM, Zaumseil Ren? wrote: >> >>> On 05/27/2015 11:59 PM, Wade, William wrote: >>> But instead of using a regular SQ

[sqlite] Unit test failure on Linux arm / Mer

2015-05-29 Thread Richard Hipp
On 5/29/15, Jussi Pakkanen wrote: > On 29.05.2015 13:43, Richard Hipp wrote: > testfixture test/func4.test testfixture test/nan.test >> Please just post the relevant lines of the output in the body of your >> email. You should easily be able to see which lines are imp

[sqlite] Request additional test data. Was: Crippling query plan change between 3.7.13 and 3.8.10.2

2015-05-29 Thread Richard Hipp
Would it be possible for you to send in other complex queries used by your application? I'd like to add these queries to the testing process used by SQLite, if you don't mind. Such queries also provide us with good examples in which to look for new query optimization opportunities. You can send

[sqlite] Unit test failure on Linux arm / Mer

2015-05-29 Thread Richard Hipp
On 5/29/15, Jussi Pakkanen wrote: > On 28.05.2015 22:41, Richard Hipp wrote: > >> These are floating-point number tests. I suspect that your machine is >> giving a different result in the 14-th significant digit, or something >> like that. >> >> Run these: >> >> testfixture test/func4.test

[sqlite] Error while copying the contents of VdbeOp object

2015-05-29 Thread Richard Hipp
On 5/29/15, Sairam Gaddam wrote: > How to correctly copy the contents of original VdbeOp aOp which is created > by SQlite for some query into another custom VdbeOp object. You cannot, in general, do that. The P4 operand often contains information that must be freed when no longer needed, meaning

[sqlite] Replace an open database

2015-05-29 Thread Zaumseil René
On 05/27/2015 11:59 PM, Wade, William wrote: >> 3) The writing thread prefers to delete any existing file. If it can't do >> that (some readers currently have the file open) it gains an exclusive >> read/write lock (consistent with no reader has a transaction in progress) >> and truncates the f