System.Data.SQLite
Check-in [f154173793]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:When converting a Julian Day value to an integer, round to the nearest millisecond first. Pursuant to [69cf6e5dc8].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f154173793f81c6f7b706d88376d06d4f394a5b5
User & Date: mistachkin 2016-12-14 19:31:48
References
2016-12-14
19:35 Closed ticket [69cf6e5dc8]: Round trip of DateTime is sometimes 1 ms off with JulianDay Format plus 3 other changes artifact: 47bc940277 user: mistachkin
19:32 Closed ticket [295b53ca2c]: problem save datetime type. plus 4 other changes artifact: 559dfd1f99 user: mistachkin
Context
2016-12-16
21:44
Final updates for release 1.0.104.0. check-in: ba38a327be user: mistachkin tags: trunk, release, release-1.0.104.0
20:46
Update version history docs. check-in: 86029276db user: mistachkin tags: preRelease
2016-12-14
19:31
When converting a Julian Day value to an integer, round to the nearest millisecond first. Pursuant to [69cf6e5dc8]. check-in: f154173793 user: mistachkin tags: trunk
2016-12-06
01:49
Candidate fix for ticket [69cf6e5dc8]. Closed-Leaf check-in: 471c16c617 user: mistachkin tags: tkt-69cf6e5dc8
2016-11-28
23:05
Add SQLite core library docs for the 'column-name-list' syntax element. check-in: e6c1544623 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Doc/Extra/Provider/version.html.

    45     45       <h1 class="heading">Version History</h1>
    46     46       <p><b>1.0.104.0 - December XX, 2016</b></p>
    47     47       <ul>
    48     48         <li>Updated to <a href="https://www.sqlite.org/releaselog/3_15_2.html">SQLite 3.15.2</a>.</li>
    49     49         <li>Add the &quot;%PreLoadSQLite_AssemblyDirectory%&quot;, &quot;%PreLoadSQLite_TargetFramework%&quot;, and &quot;%PreLoadSQLite_XmlConfigDirectory%&quot; <a href="https://system.data.sqlite.org/index.html/artifact?ci=trunk&filename=Doc/Extra/Provider/environment.html">replacement tokens</a> for use in configuration setting values. Pursuant to <a href="https://system.data.sqlite.org/index.html/info/d4728aecb7">[d4728aecb7]</a>.</li>
    50     50         <li>Prevent the GetByte, GetChar, and GetInt16 methods of the SQLiteDataReader class from throwing exceptions for large integer values. Pursuant to <a href="https://system.data.sqlite.org/index.html/info/5535448538">[5535448538]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    51     51         <li>Use <a href="https://www.sqlite.org/lang_savepoint.html">SAVEPOINTs</a> to properly implement nested transactions when the new AllowNestedTransactions connection flag is used. Pursuant to <a href="https://system.data.sqlite.org/index.html/info/1f7bfff467">[1f7bfff467]</a>.</li>
           52  +      <li>When converting a Julian Day value to an integer, round to the nearest millisecond first. Pursuant to <a href="https://system.data.sqlite.org/index.html/info/69cf6e5dc8">[69cf6e5dc8]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    52     53       </ul>
    53     54       <p><b>1.0.103.0 - September 15, 2016</b></p>
    54     55       <ul>
    55     56         <li>Updated to <a href="https://www.sqlite.org/releaselog/3_14_2.html">SQLite 3.14.2</a>.</li>
    56     57         <li>Add preliminary support for the .NET Framework 4.6.2.</li>
    57     58         <li>Change the SQLiteReadValueCallback delegate &quot;eventArgs&quot; parameter to be of type SQLiteReadEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    58     59         <li>Make SQLiteReadValueEventArgs and SQLiteReadArrayEventArgs derive from SQLiteReadEventArgs.&nbsp;<b>** Potentially Incompatible Change **</b></li>

Changes to Setup/data/verify.lst.

   819    819     Tests/tkt-544dba0a2f.eagle
   820    820     Tests/tkt-5535448538.eagle
   821    821     Tests/tkt-56b42d99c1.eagle
   822    822     Tests/tkt-58ed318f2f.eagle
   823    823     Tests/tkt-59edc1018b.eagle
   824    824     Tests/tkt-6434e23a0f.eagle
   825    825     Tests/tkt-647d282d11.eagle
          826  +  Tests/tkt-69cf6e5dc8.eagle
   826    827     Tests/tkt-6c6ecccc5f.eagle
   827    828     Tests/tkt-71bedaca19.eagle
   828    829     Tests/tkt-72905c9a77.eagle
   829    830     Tests/tkt-74542e702e.eagle
   830    831     Tests/tkt-7714b60d61.eagle
   831    832     Tests/tkt-7c151a2f0e.eagle
   832    833     Tests/tkt-7e3fa93744.eagle

Changes to System.Data.SQLite/SQLiteConvert.cs.

   253    253       /// <returns>
   254    254       /// The resulting Julian Day <see cref="Int64" /> value.
   255    255       /// </returns>
   256    256       private static long DoubleToJd(
   257    257           double julianDay
   258    258           )
   259    259       {
   260         -        return (long)(julianDay * 86400000.0);
          260  +        return (long)Math.Round(julianDay * 86400000.0);
   261    261       }
   262    262   
   263    263       ///////////////////////////////////////////////////////////////////////////
   264    264   
   265    265       /// <summary>
   266    266       /// Converts a Julian Day value from an <see cref="Int64" /> to a
   267    267       /// <see cref="Double" />.

Added Tests/tkt-69cf6e5dc8.eagle.

            1  +###############################################################################
            2  +#
            3  +# tkt-69cf6e5dc8.eagle --
            4  +#
            5  +# Written by Joe Mistachkin.
            6  +# Released to the public domain, use at your own risk!
            7  +#
            8  +###############################################################################
            9  +
           10  +package require Eagle
           11  +package require Eagle.Library
           12  +package require Eagle.Test
           13  +
           14  +runTestPrologue
           15  +
           16  +###############################################################################
           17  +
           18  +package require System.Data.SQLite.Test
           19  +runSQLiteTestPrologue
           20  +
           21  +###############################################################################
           22  +
           23  +runTest {test tkt-69cf6e5dc8-1.1 {Julian DateTime precision} -setup {
           24  +  setupDb [set fileName tkt-69cf6e5dc8-1.1.db] "" JulianDay Utc \
           25  +      BindDateTimeWithKind [appendArgs DateTimeFormatString= \
           26  +      [getDateTimeFormat] \;]
           27  +} -body {
           28  +  sql execute $db {
           29  +    CREATE TABLE t1(x);
           30  +  }
           31  +
           32  +  set dateTime(0) [object create DateTime 2016 11 20 0 46 3 0 Utc]
           33  +
           34  +  sql execute -execute scalar $db \
           35  +      "INSERT INTO t1 (x) VALUES(?);" [list param1 DateTime $dateTime(0)]
           36  +
           37  +  set dataReader [sql execute -execute reader -format datareader -alias \
           38  +      $db "SELECT x FROM t1;"]
           39  +
           40  +  while {[$dataReader Read]} {
           41  +    lappend result [$dataReader GetValue 0]
           42  +    set dateTime(1) [$dataReader -create -alias GetDateTime 0]
           43  +    lappend result [$dateTime(1) ToString [getDateTimeFormat]]
           44  +  }
           45  +
           46  +  set result
           47  +} -cleanup {
           48  +  unset -nocomplain dataReader
           49  +
           50  +  cleanupDb $fileName
           51  +
           52  +  unset -nocomplain dateTime result db fileName
           53  +} -constraints {eagle command.object monoBug28 monoBug42 command.sql\
           54  +compile.DATA SQLite System.Data.SQLite} -result {2457712.53197917 {2016-11-20\
           55  +00:46:03Z}}}
           56  +
           57  +###############################################################################
           58  +
           59  +runSQLiteTestEpilogue
           60  +runTestEpilogue

Changes to readme.htm.

   212    212       <b>1.0.104.0 - December XX, 2016</b>
   213    213   </p>
   214    214   <ul>
   215    215       <li>Updated to <a href="https://www.sqlite.org/releaselog/3_15_2.html">SQLite 3.15.2</a>.</li>
   216    216       <li>Add the &quot;%PreLoadSQLite_AssemblyDirectory%&quot;, &quot;%PreLoadSQLite_TargetFramework%&quot;, and &quot;%PreLoadSQLite_XmlConfigDirectory%&quot; <a href="https://system.data.sqlite.org/index.html/artifact?ci=trunk&filename=Doc/Extra/Provider/environment.html">replacement tokens</a> for use in configuration setting values. Pursuant to [d4728aecb7].</li>
   217    217       <li>Prevent the GetByte, GetChar, and GetInt16 methods of the SQLiteDataReader class from throwing exceptions for large integer values. Pursuant to [5535448538].&nbsp;<b>** Potentially Incompatible Change **</b></li>
   218    218       <li>Use <a href="https://www.sqlite.org/lang_savepoint.html">SAVEPOINTs</a> to properly implement nested transactions when the new AllowNestedTransactions connection flag is used. Pursuant to [1f7bfff467].</li>
          219  +    <li>When converting a Julian Day value to an integer, round to the nearest millisecond first. Pursuant to [69cf6e5dc8].&nbsp;<b>** Potentially Incompatible Change **</b></li>
   219    220   </ul>
   220    221   <p>
   221    222       <b>1.0.103.0 - September 15, 2016</b>
   222    223   </p>
   223    224   <ul>
   224    225       <li>Updated to <a href="https://www.sqlite.org/releaselog/3_14_2.html">SQLite 3.14.2</a>.</li>
   225    226       <li>Add preliminary support for the .NET Framework 4.6.2.</li>

Changes to www/news.wiki.

     6      6       <b>1.0.104.0 - December XX, 2016</b>
     7      7   </p>
     8      8   <ul>
     9      9       <li>Updated to [https://www.sqlite.org/releaselog/3_15_2.html|SQLite 3.15.2].</li>
    10     10       <li>Add the &quot;%PreLoadSQLite_AssemblyDirectory%&quot;, &quot;%PreLoadSQLite_TargetFramework%&quot;, and &quot;%PreLoadSQLite_XmlConfigDirectory%&quot; [https://system.data.sqlite.org/index.html/artifact?ci=trunk&filename=Doc/Extra/Provider/environment.html|replacement tokens] for use in configuration setting values. Pursuant to [d4728aecb7].</li>
    11     11       <li>Prevent the GetByte, GetChar, and GetInt16 methods of the SQLiteDataReader class from throwing exceptions for large integer values. Pursuant to [5535448538].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    12     12       <li>Use [https://www.sqlite.org/lang_savepoint.html|SAVEPOINTs] to properly implement nested transactions when the new AllowNestedTransactions connection flag is used. Pursuant to [1f7bfff467].</li>
           13  +    <li>When converting a Julian Day value to an integer, round to the nearest millisecond first. Pursuant to [69cf6e5dc8].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    13     14   </ul>
    14     15   <p>
    15     16       <b>1.0.103.0 - September 15, 2016</b>
    16     17   </p>
    17     18   <ul>
    18     19       <li>Updated to [https://www.sqlite.org/releaselog/3_14_2.html|SQLite 3.14.2].</li>
    19     20       <li>Add preliminary support for the .NET Framework 4.6.2.</li>