Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix DateTime constant handling in the LINQ assembly. Fix for [da9f18d039]. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
4dc462af32d02715f5611671326ecd11 |
User & Date: | mistachkin 2014-05-30 21:16:58.225 |
Context
2014-05-30
| ||
21:53 | Add SharedFlags static property to the SQLiteConnection class. Make the display names for connection string properties more consistent. check-in: e4b0d17481 user: mistachkin tags: trunk | |
21:16 | Fix DateTime constant handling in the LINQ assembly. Fix for [da9f18d039]. check-in: 4dc462af32 user: mistachkin tags: trunk | |
19:36 | Correct the SQLiteLog output formatting when the message originates from within the System.Data.SQLite library itself. check-in: 5ae87a8a66 user: mistachkin tags: trunk | |
Changes
Changes to Doc/Extra/Provider/version.html.
︙ | ︙ | |||
48 49 50 51 52 53 54 55 56 57 58 59 60 61 | <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_3.html">SQLite 3.8.4.3</a>.</li> <li>Add support for mapping transaction isolation levels to their legacy default values. Pursuant to <a href="http://system.data.sqlite.org/index.html/info/56b42d99c1">[56b42d99c1]</a>.</li> <li>Add support for setting the default DbType and type name used for mappings on a per-connection basis. Pursuant to <a href="http://system.data.sqlite.org/index.html/info/3c00ec5b52">[3c00ec5b52]</a>.</li> <li>Add SetChunkSize method to the SQLiteConnection class. Pursuant to [d1c008fa0a].</li> <li>Make the ISQLiteSchemaExtensions interface public. <b>** Potentially Incompatible Change **</b></li> <li>Have the SQLiteProviderFactory class (in the System.Data.SQLite.Linq assembly) implement the IServiceProvider interface.</li> <li>Fix bug in documentation generator automation that prevented some internal documentation links from working.</li> </ul> <p><b>1.0.92.0 - March 19, 2014</p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_1.html">SQLite 3.8.4.1</a>.</li> <li>Update the list of keywords returned by SQLiteConnection.GetSchema("ReservedWords"). <b>** Potentially Incompatible Change **</b></li> <li>Raise the static SQLiteConnection.Changed event when any SQLiteCommand or SQLiteDataReader object is closed or disposed.</li> <li>Add the SQLiteDataReader.StepCount property to return the number of rows seen so far.</li> | > | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_3.html">SQLite 3.8.4.3</a>.</li> <li>Add support for mapping transaction isolation levels to their legacy default values. Pursuant to <a href="http://system.data.sqlite.org/index.html/info/56b42d99c1">[56b42d99c1]</a>.</li> <li>Add support for setting the default DbType and type name used for mappings on a per-connection basis. Pursuant to <a href="http://system.data.sqlite.org/index.html/info/3c00ec5b52">[3c00ec5b52]</a>.</li> <li>Add SetChunkSize method to the SQLiteConnection class. Pursuant to [d1c008fa0a].</li> <li>Make the ISQLiteSchemaExtensions interface public. <b>** Potentially Incompatible Change **</b></li> <li>Have the SQLiteProviderFactory class (in the System.Data.SQLite.Linq assembly) implement the IServiceProvider interface.</li> <li>Fix bug in documentation generator automation that prevented some internal documentation links from working.</li> <li>Fix DateTime constant handling in the LINQ assembly. Fix for <a href="http://system.data.sqlite.org/index.html/info/da9f18d039">[da9f18d039]</a>. <b>** Potentially Incompatible Change **</b></li> </ul> <p><b>1.0.92.0 - March 19, 2014</p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_1.html">SQLite 3.8.4.1</a>.</li> <li>Update the list of keywords returned by SQLiteConnection.GetSchema("ReservedWords"). <b>** Potentially Incompatible Change **</b></li> <li>Raise the static SQLiteConnection.Changed event when any SQLiteCommand or SQLiteDataReader object is closed or disposed.</li> <li>Add the SQLiteDataReader.StepCount property to return the number of rows seen so far.</li> |
︙ | ︙ |
Changes to System.Data.SQLite.Linq/SQL Generation/SqlGenerator.cs.
︙ | ︙ | |||
885 886 887 888 889 890 891 | break; case PrimitiveTypeKind.Byte: result.Append(e.Value.ToString()); break; case PrimitiveTypeKind.DateTime: | | | 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 | break; case PrimitiveTypeKind.Byte: result.Append(e.Value.ToString()); break; case PrimitiveTypeKind.DateTime: result.Append(EscapeSingleQuote(SQLiteConvert.ToString((System.DateTime)e.Value, SQLiteDateFormats.ISO8601, DateTimeKind.Unspecified, null), false /* IsUnicode */)); break; case PrimitiveTypeKind.Decimal: string strDecimal = ((Decimal)e.Value).ToString(CultureInfo.InvariantCulture); // if the decimal value has no decimal part, cast as decimal to preserve type // if the number has precision > int64 max precision, it will be handled as decimal by sql server // and does not need cast. if precision is lest then 20, then cast using Max(literal precision, sql default precision) |
︙ | ︙ |
Changes to System.Data.SQLite/SQLiteConvert.cs.
︙ | ︙ | |||
495 496 497 498 499 500 501 | /// </summary> /// <param name="dateValue">The DateTime value to convert</param> /// <returns>Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a /// Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time /// string, a formatted date and time string in the current culture, or an ISO8601-format date/time string.</returns> public string ToString(DateTime dateValue) { | > > > > > > > > > > > > > > > > > > > > > | | | | | | | | | 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 | /// </summary> /// <param name="dateValue">The DateTime value to convert</param> /// <returns>Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a /// Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time /// string, a formatted date and time string in the current culture, or an ISO8601-format date/time string.</returns> public string ToString(DateTime dateValue) { return ToString(dateValue, _datetimeFormat, _datetimeKind, _datetimeFormatString); } /// <summary> /// Converts a string into a DateTime, using the DateTimeFormat, DateTimeKind, /// and DateTimeFormatString specified for the connection when it was opened. /// </summary> /// <param name="dateValue">The DateTime value to convert</param> /// <param name="format">The SQLiteDateFormats to use.</param> /// <param name="kind">The DateTimeKind to use.</param> /// <param name="formatString">The DateTime format string to use.</param> /// <returns>Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a /// Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time /// string, a formatted date and time string in the current culture, or an ISO8601-format date/time string.</returns> public static string ToString( DateTime dateValue, SQLiteDateFormats format, DateTimeKind kind, string formatString ) { switch (format) { case SQLiteDateFormats.Ticks: return dateValue.Ticks.ToString(CultureInfo.InvariantCulture); case SQLiteDateFormats.JulianDay: return ToJulianDay(dateValue).ToString(CultureInfo.InvariantCulture); case SQLiteDateFormats.UnixEpoch: return ((long)(dateValue.Subtract(UnixEpoch).Ticks / TimeSpan.TicksPerSecond)).ToString(); case SQLiteDateFormats.InvariantCulture: return dateValue.ToString((formatString != null) ? formatString : FullFormat, CultureInfo.InvariantCulture); case SQLiteDateFormats.CurrentCulture: return dateValue.ToString((formatString != null) ? formatString : FullFormat, CultureInfo.CurrentCulture); default: return (dateValue.Kind == DateTimeKind.Unspecified) ? DateTime.SpecifyKind(dateValue, kind).ToString( GetDateTimeKindFormat(kind, formatString), CultureInfo.InvariantCulture) : dateValue.ToString( GetDateTimeKindFormat(dateValue.Kind, formatString), CultureInfo.InvariantCulture); } } /// <summary> /// Internal function to convert a UTF-8 encoded IntPtr of the specified length to a DateTime. /// </summary> |
︙ | ︙ |
Added Tests/tkt-da9f18d039.eagle.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | ############################################################################### # # tkt-da9f18d039.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 ############################################################################### # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # set systemDataSQLiteDllFile [getBuildFileName System.Data.SQLite.dll] set systemDataSQLiteLinqDllFile [getBuildFileName System.Data.SQLite.Linq.dll] set systemDataSQLiteEf6DllFile [getBuildFileName System.Data.SQLite.EF6.dll] set testLinqExeFile [getBuildFileName testlinq.exe] set testEf6ExeFile [getBuildFileName testef6.exe] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # if {![haveConstraint [appendArgs file_ \ [file tail $systemDataSQLiteDllFile]]]} then { checkForFile $test_channel $systemDataSQLiteDllFile } if {![haveConstraint [appendArgs file_ \ [file tail $systemDataSQLiteLinqDllFile]]]} then { checkForFile $test_channel $systemDataSQLiteLinqDllFile } if {![haveConstraint [appendArgs file_ \ [file tail $systemDataSQLiteEf6DllFile]]]} then { checkForFile $test_channel $systemDataSQLiteEf6DllFile } if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile testlinq.exe } if {![haveConstraint [appendArgs file_ [file tail $testEf6ExeFile]]]} then { checkForFile $test_channel $testEf6ExeFile testef6.exe } if {![haveConstraint [appendArgs file_ [file tail $northwindEfDbFile]]]} then { checkForFile $test_channel $northwindEfDbFile } ############################################################################### runTest {test tkt-da9f18d039-1.1 {LINQ DateTime 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] -datetime } 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 {}}} ############################################################################### runTest {test tkt-da9f18d039-1.2 {EF6 DateTime 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 $testEf6ExeFile [list -eventflags Wait -directory \ [file dirname $testEf6ExeFile] -nocarriagereturns -stdout output \ -success 0] -datetime } 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.EF6.dll file_testef6.exe file_northwindEF.db} \ -result {0 {}}} ############################################################################### unset -nocomplain northwindEfDbFile testEf6ExeFile testLinqExeFile \ systemDataSQLiteEf6DllFile systemDataSQLiteLinqDllFile \ systemDataSQLiteDllFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue |
Changes to readme.htm.
︙ | ︙ | |||
215 216 217 218 219 220 221 222 223 224 225 226 227 228 | <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_3.html">SQLite 3.8.4.3</a>.</li> <li>Add support for mapping transaction isolation levels to their legacy default values. Pursuant to [56b42d99c1].</li> <li>Add support for setting the default DbType and type name used for mappings on a per-connection basis. Pursuant to [3c00ec5b52].</li> <li>Add SetChunkSize method to the SQLiteConnection class. Pursuant to [d1c008fa0a].</li> <li>Make the ISQLiteSchemaExtensions interface public. <b>** Potentially Incompatible Change **</b></li> <li>Have the SQLiteProviderFactory class (in the System.Data.SQLite.Linq assembly) implement the IServiceProvider interface.</li> <li>Fix bug in documentation generator automation that prevented some internal documentation links from working.</li> </ul> <p> <b>1.0.92.0 - March 19, 2014</b> </p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_1.html">SQLite 3.8.4.1</a>.</li> <li>Update the list of keywords returned by SQLiteConnection.GetSchema("ReservedWords"). <b>** Potentially Incompatible Change **</b></li> | > | 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 | <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_3.html">SQLite 3.8.4.3</a>.</li> <li>Add support for mapping transaction isolation levels to their legacy default values. Pursuant to [56b42d99c1].</li> <li>Add support for setting the default DbType and type name used for mappings on a per-connection basis. Pursuant to [3c00ec5b52].</li> <li>Add SetChunkSize method to the SQLiteConnection class. Pursuant to [d1c008fa0a].</li> <li>Make the ISQLiteSchemaExtensions interface public. <b>** Potentially Incompatible Change **</b></li> <li>Have the SQLiteProviderFactory class (in the System.Data.SQLite.Linq assembly) implement the IServiceProvider interface.</li> <li>Fix bug in documentation generator automation that prevented some internal documentation links from working.</li> <li>Fix DateTime constant handling in the LINQ assembly. Fix for [da9f18d039]. <b>** Potentially Incompatible Change **</b></li> </ul> <p> <b>1.0.92.0 - March 19, 2014</b> </p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_1.html">SQLite 3.8.4.1</a>.</li> <li>Update the list of keywords returned by SQLiteConnection.GetSchema("ReservedWords"). <b>** Potentially Incompatible Change **</b></li> |
︙ | ︙ |
Changes to testlinq/Program.cs.
1 2 3 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) | | | 1 2 3 4 5 6 7 8 9 10 11 | /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) * * Released to the public domain, use at your own risk! ********************************************************/ using System; using System.Diagnostics; using System.Linq; using System.Text; |
︙ | ︙ | |||
54 55 56 57 58 59 60 61 62 63 64 65 66 67 | switch (arg) { case "": // String.Empty case "old": { return OldTests(); } case "skip": { int pageSize = 0; if (args.Length > 1) { arg = args[1]; | > > > > | 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | switch (arg) { case "": // String.Empty case "old": { return OldTests(); } case "datetime": { return DateTimeTest(); } case "skip": { int pageSize = 0; if (args.Length > 1) { arg = args[1]; |
︙ | ︙ | |||
321 322 323 324 325 326 327 328 329 330 331 332 333 334 | } #endif } } return 0; } private static int OldTests() { using (northwindEFEntities db = new northwindEFEntities()) { { string entitySQL = "SELECT VALUE o FROM Orders AS o WHERE SQLite.DatePart('yyyy', o.OrderDate) = 1997 ORDER BY o.OrderID;"; | > > > > > > > > > > > | 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 | } #endif } } return 0; } private static int DateTimeTest() { using (northwindEFEntities db = new northwindEFEntities()) { DateTime dateTime = new DateTime(1997, 1, 1, 0, 0, 0, DateTimeKind.Local); int c1 = db.Orders.Where(i => i.OrderDate == new DateTime(1997, 1, 1, 0, 0, 0, DateTimeKind.Local)).Count(); int c2 = db.Orders.Where(i => i.OrderDate == dateTime).Count(); return c1 == c2 ? 0 : 1; } } private static int OldTests() { using (northwindEFEntities db = new northwindEFEntities()) { { string entitySQL = "SELECT VALUE o FROM Orders AS o WHERE SQLite.DatePart('yyyy', o.OrderDate) = 1997 ORDER BY o.OrderID;"; |
︙ | ︙ |
Changes to www/news.wiki.
︙ | ︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_3.html">SQLite 3.8.4.3</a>.</li> <li>Add support for mapping transaction isolation levels to their legacy default values. Pursuant to [56b42d99c1].</li> <li>Add support for setting the default DbType and type name used for mappings on a per-connection basis. Pursuant to [3c00ec5b52].</li> <li>Add SetChunkSize method to the SQLiteConnection class. Pursuant to [d1c008fa0a].</li> <li>Make the ISQLiteSchemaExtensions interface public. <b>** Potentially Incompatible Change **</b></li> <li>Have the SQLiteProviderFactory class (in the System.Data.SQLite.Linq assembly) implement the IServiceProvider interface.</li> <li>Fix bug in documentation generator automation that prevented some internal documentation links from working.</li> </ul> <p> <b>1.0.92.0 - March 19, 2014</b> </p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_1.html">SQLite 3.8.4.1</a>.</li> <li>Update the list of keywords returned by SQLiteConnection.GetSchema("ReservedWords"). <b>** Potentially Incompatible Change **</b></li> | > | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_3.html">SQLite 3.8.4.3</a>.</li> <li>Add support for mapping transaction isolation levels to their legacy default values. Pursuant to [56b42d99c1].</li> <li>Add support for setting the default DbType and type name used for mappings on a per-connection basis. Pursuant to [3c00ec5b52].</li> <li>Add SetChunkSize method to the SQLiteConnection class. Pursuant to [d1c008fa0a].</li> <li>Make the ISQLiteSchemaExtensions interface public. <b>** Potentially Incompatible Change **</b></li> <li>Have the SQLiteProviderFactory class (in the System.Data.SQLite.Linq assembly) implement the IServiceProvider interface.</li> <li>Fix bug in documentation generator automation that prevented some internal documentation links from working.</li> <li>Fix DateTime constant handling in the LINQ assembly. Fix for [da9f18d039]. <b>** Potentially Incompatible Change **</b></li> </ul> <p> <b>1.0.92.0 - March 19, 2014</b> </p> <ul> <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_4_1.html">SQLite 3.8.4.1</a>.</li> <li>Update the list of keywords returned by SQLiteConnection.GetSchema("ReservedWords"). <b>** Potentially Incompatible Change **</b></li> |
︙ | ︙ |