/// Write out a SQL select statement as a string.
ADDED Tests/tkt-0a32885109.eagle
Index: Tests/tkt-0a32885109.eagle
==================================================================
--- /dev/null
+++ Tests/tkt-0a32885109.eagle
@@ -0,0 +1,64 @@
+###############################################################################
+#
+# tkt-0a32885109.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-0a32885109-1.1 {LINQ compound-operator handling} -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] -unionall
+ } 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 {WHITC ANATR BERGS WHITC ANATR WHITC ANATR BERGS}}}
+
+###############################################################################
+
+runSQLiteTestFilesEpilogue
+runSQLiteTestEpilogue
+runTestEpilogue
Index: readme.htm
==================================================================
--- readme.htm
+++ readme.htm
@@ -214,10 +214,11 @@
- Updated to SQLite 3.8.7.
- Make sure SQL statements generated for DbUpdateCommandTree objects are properly delimited.
- Various minor performance enhancements to the SQLiteDataReader class. Pursuant to [e122d26e70].
- Defer disposing of connections created by the static SQLiteCommand.Execute method when a data reader is returned. Fix for [daeaf3150a].
+ - Wrap SELECT statements in parenthesis if they have an ORDER BY, LIMIT, or OFFSET clause and a compound operator is involved. Fix for [0a32885109].
- In the SQLiteDataReader.VerifyType method, remove duplicate "if" statement for the DbType.SByte value and move the remaining "if" to the Int64 affinity. Fix for [c5cc2fb334]. ** Potentially Incompatible Change **
- Handle Julian Day values that fall outside of the supported range for OLE Automation dates. Fix for [3e783eecbe]. ** Potentially Incompatible Change **
1.0.94.0 - September 9, 2014
Index: testlinq/Program.cs
==================================================================
--- testlinq/Program.cs
+++ testlinq/Program.cs
@@ -74,10 +74,14 @@
pageSize = int.Parse(arg.Trim());
}
return SkipTest(pageSize);
}
+ case "unionall":
+ {
+ return UnionAllTest();
+ }
case "endswith":
{
string value = null;
if (args.Length > 1)
@@ -215,10 +219,81 @@
Console.Write(customers.CustomerID);
once = true;
}
}
+
+ return 0;
+ }
+
+ //
+ // NOTE: Used to test the fix for ticket [0a32885109].
+ //
+ private static int UnionAllTest()
+ {
+ using (northwindEFEntities db = new northwindEFEntities())
+ {
+ bool once = false;
+
+ var customers1 = db.Customers.Where(
+ f => f.Orders.Any()).OrderByDescending(
+ f => f.CompanyName).Skip(1).Take(1);
+
+ var customers2 = db.Customers.Where(
+ f => f.Orders.Any()).OrderBy(
+ f => f.CompanyName).Skip(1).Take(1);
+
+ var customers3 = db.Customers.Where(
+ f => f.CustomerID.StartsWith("B")).OrderBy(
+ f => f.CompanyName).Skip(1).Take(1);
+
+ foreach (var customer in customers1)
+ {
+ if (once)
+ Console.Write(' ');
+
+ Console.Write(customer.CustomerID);
+ once = true;
+ }
+
+ foreach (var customer in customers2)
+ {
+ if (once)
+ Console.Write(' ');
+
+ Console.Write(customer.CustomerID);
+ once = true;
+ }
+
+ foreach (var customer in customers3)
+ {
+ if (once)
+ Console.Write(' ');
+
+ Console.Write(customer.CustomerID);
+ once = true;
+ }
+
+ foreach (var customer in customers1.Concat(customers2))
+ {
+ if (once)
+ Console.Write(' ');
+
+ Console.Write(customer.CustomerID);
+ once = true;
+ }
+
+ foreach (var customer in
+ customers1.Concat(customers2).Concat(customers3))
+ {
+ if (once)
+ Console.Write(' ');
+
+ Console.Write(customer.CustomerID);
+ once = true;
+ }
+ }
return 0;
}
//
Index: www/news.wiki
==================================================================
--- www/news.wiki
+++ www/news.wiki
@@ -8,10 +8,11 @@
- Updated to [http://www.sqlite.org/releaselog/3_8_7_1.html|SQLite 3.8.7.1].
- Make sure SQL statements generated for DbUpdateCommandTree objects are properly delimited.
- Various minor performance enhancements to the SQLiteDataReader class. Pursuant to [e122d26e70].
- Defer disposing of connections created by the static SQLiteCommand.Execute method when a data reader is returned. Fix for [daeaf3150a].
+ - Wrap SELECT statements in parenthesis if they have an ORDER BY, LIMIT, or OFFSET clause and a compound operator is involved. Fix for [0a32885109].
- In the SQLiteDataReader.VerifyType method, remove duplicate "if" statement for the DbType.SByte value and move the remaining "if" to the Int64 affinity. Fix for [c5cc2fb334]. ** Potentially Incompatible Change **
- Handle Julian Day values that fall outside of the supported range for OLE Automation dates. Fix for [3e783eecbe]. ** Potentially Incompatible Change **
1.0.94.0 - September 9, 2014