Index: Doc/Extra/Provider/version.html
==================================================================
--- Doc/Extra/Provider/version.html
+++ Doc/Extra/Provider/version.html
@@ -45,10 +45,11 @@
/// Lightweight expression translator for DML expression trees, which have constrained
/// scope and support.
ADDED Tests/tkt-9d353b0bd8.eagle
Index: Tests/tkt-9d353b0bd8.eagle
==================================================================
--- /dev/null
+++ Tests/tkt-9d353b0bd8.eagle
@@ -0,0 +1,64 @@
+###############################################################################
+#
+# tkt-9d353b0bd8.eagle --
+#
+# Written by Joe Mistachkin.
+# Released to the public domain, use at your own risk!
+#
+###############################################################################
+
+package require Eagle
+package require Eagle.Library
+package require Eagle.Test
+
+runTestPrologue
+
+###############################################################################
+
+package require System.Data.SQLite.Test
+runSQLiteTestPrologue
+runSQLiteTestFilesPrologue
+
+###############################################################################
+
+runTest {test tkt-9d353b0bd8-1.1 {DbModificationCommandTree w/INSERT} -body {
+ #
+ # NOTE: Re-copy the reference database file used for this unit test to the
+ # build directory in case it has been changed by a previous test run.
+ #
+ file copy -force $northwindEfDbFile \
+ [file join [getBuildDirectory] [file tail $northwindEfDbFile]]
+
+ set result [list]
+ set output ""
+
+ set code [catch {
+ testClrExec $testLinqExeFile [list -eventflags Wait -directory \
+ [file dirname $testLinqExeFile] -nocarriagereturns -stdout output \
+ -success 0] -insert
+ } error]
+
+ tlog "---- BEGIN STDOUT OUTPUT\n"
+ tlog $output
+ tlog "\n---- END STDOUT OUTPUT\n"
+
+ lappend result $code
+
+ if {$code == 0} then {
+ lappend result [string trim $output]
+ } else {
+ lappend result [string trim $error]
+ }
+
+ set result
+} -cleanup {
+ unset -nocomplain code output error result
+} -constraints {eagle monoToDo SQLite file_System.Data.SQLite.dll testExec\
+file_System.Data.SQLite.Linq.dll file_testlinq.exe file_northwindEF.db} \
+-result {0 {inserted 1}}}
+
+###############################################################################
+
+runSQLiteTestFilesEpilogue
+runSQLiteTestEpilogue
+runTestEpilogue
Index: readme.htm
==================================================================
--- readme.htm
+++ readme.htm
@@ -212,10 +212,11 @@
1.0.98.0 - August XX, 2015 (release scheduled)
- Updated to SQLite 3.8.11.
- Implement the Substring method for LINQ using the "substr" core SQL function. ** Potentially Incompatible Change **
+ - Remove errant semi-colons from the SQL used by LINQ to INSERT and then SELECT rows with composite primary keys. Fix for [9d353b0bd8].
- Add VfsName connection string property to allow a non-default VFS to be used by the SQLite core library.
- Add BusyTimeout connection string property to set the busy timeout to be used by the SQLite core library.
- Enable integration with the ZipVFS extension.
Index: testlinq/NorthwindModel.EF6.2010.edmx
==================================================================
--- testlinq/NorthwindModel.EF6.2010.edmx
+++ testlinq/NorthwindModel.EF6.2010.edmx
@@ -135,11 +135,17 @@
-
+
+
Index: testlinq/NorthwindModel.EF6.2012.edmx
==================================================================
--- testlinq/NorthwindModel.EF6.2012.edmx
+++ testlinq/NorthwindModel.EF6.2012.edmx
@@ -135,11 +135,17 @@
-
+
+
Index: testlinq/NorthwindModel.EF6.2013.edmx
==================================================================
--- testlinq/NorthwindModel.EF6.2013.edmx
+++ testlinq/NorthwindModel.EF6.2013.edmx
@@ -135,11 +135,17 @@
-
+
+
Index: testlinq/NorthwindModel.Linq.2008.edmx
==================================================================
--- testlinq/NorthwindModel.Linq.2008.edmx
+++ testlinq/NorthwindModel.Linq.2008.edmx
@@ -135,11 +135,17 @@
-
+
+
Index: testlinq/NorthwindModel.Linq.2010.edmx
==================================================================
--- testlinq/NorthwindModel.Linq.2010.edmx
+++ testlinq/NorthwindModel.Linq.2010.edmx
@@ -135,11 +135,17 @@
-
+
+
Index: testlinq/NorthwindModel.Linq.2012.edmx
==================================================================
--- testlinq/NorthwindModel.Linq.2012.edmx
+++ testlinq/NorthwindModel.Linq.2012.edmx
@@ -135,11 +135,17 @@
-
+
+
Index: testlinq/NorthwindModel.Linq.2013.edmx
==================================================================
--- testlinq/NorthwindModel.Linq.2013.edmx
+++ testlinq/NorthwindModel.Linq.2013.edmx
@@ -135,11 +135,17 @@
-
+
+
Index: testlinq/Program.cs
==================================================================
--- testlinq/Program.cs
+++ testlinq/Program.cs
@@ -142,10 +142,14 @@
}
}
return EFTransactionTest(value);
}
+ case "insert":
+ {
+ return InsertTest();
+ }
case "update":
{
return UpdateTest();
}
case "binaryguid":
@@ -536,10 +540,65 @@
once = true;
}
#endif
}
}
+
+ return 0;
+ }
+
+ //
+ // NOTE: Used to test the INSERT fix (i.e. an extra semi-colon in
+ // the SQL statement after the actual INSERT statement in
+ // the follow-up SELECT statement).
+ //
+ private static int InsertTest()
+ {
+ long[] orderIds = new long[] {
+ 0
+ };
+
+ using (northwindEFEntities db = new northwindEFEntities())
+ {
+ int[] counts = { 0 };
+
+ //
+ // NOTE: *REQUIRED* This is required so that the
+ // Entity Framework is prevented from opening
+ // multiple connections to the underlying SQLite
+ // database (i.e. which would result in multiple
+ // IMMEDIATE transactions, thereby failing [later
+ // on] with locking errors).
+ //
+ db.Connection.Open();
+
+ OrderDetails newOrderDetails = new OrderDetails();
+
+ newOrderDetails.OrderID = 10248;
+ newOrderDetails.ProductID = 1;
+ newOrderDetails.UnitPrice = (decimal)1.23;
+ newOrderDetails.Quantity = 1;
+ newOrderDetails.Discount = 0.0f;
+
+ db.AddObject("OrderDetails", newOrderDetails);
+
+ try
+ {
+ db.SaveChanges();
+ counts[0]++;
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine(e);
+ }
+ finally
+ {
+ db.AcceptAllChanges();
+ }
+
+ Console.WriteLine("inserted {0}", counts[0]);
+ }
return 0;
}
//
Index: www/news.wiki
==================================================================
--- www/news.wiki
+++ www/news.wiki
@@ -6,10 +6,11 @@
1.0.98.0 - August XX, 2015 (release scheduled)
- Updated to [https://www.sqlite.org/draft/releaselog/3_8_11.html|SQLite 3.8.11].
- Implement the Substring method for LINQ using the "substr" core SQL function. ** Potentially Incompatible Change **
+ - Remove errant semi-colons from the SQL used by LINQ to INSERT and then SELECT rows with composite primary keys. Fix for [9d353b0bd8].
- Add VfsName connection string property to allow a non-default VFS to be used by the SQLite core library.
- Add BusyTimeout connection string property to set the busy timeout to be used by the SQLite core library.
- Enable integration with the [http://www.hwaci.com/sw/sqlite/zipvfs.html|ZipVFS] extension.