System.Data.SQLite
Check-in [749d5af8d3]
Not logged in

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

Overview
Comment:Make sure enabling UseUTF16Encoding sets the schema encoding to UTF-16. Fix for [7c151a2f0e].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 749d5af8d3197c944346c685009588044dfca1e0
User & Date: mistachkin 2015-05-19 18:24:27
References
2015-05-19
18:25 Closed ticket [7c151a2f0e]: UseUTF16Encoding=True creates a db with UTF-8 encoding plus 5 other changes artifact: 6b1e04c3b6 user: mistachkin
Context
2015-05-19
21:30
Add the NuGet XDT transform file to the solution files. check-in: 9c07ab2010 user: mistachkin tags: trunk
18:24
Make sure enabling UseUTF16Encoding sets the schema encoding to UTF-16. Fix for [7c151a2f0e]. check-in: 749d5af8d3 user: mistachkin tags: trunk
2015-05-16
03:33
Improve documentation for the 'restrictionValues' parameter to SQLiteConnetion.GetSchema. check-in: 4be7ad3120 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

    49     49         <li>Updated to <a href="https://www.nuget.org/packages/EntityFramework/6.1.3">Entity Framework 6.1.3</a>.</li>
    50     50         <li>Improve ADO.NET conformance of the SQLiteDataReader.RecordsAffected property. Fix for <a href="https://system.data.sqlite.org/index.html/info/74542e702e">[74542e702e]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    51     51         <li>Prevent the IDataReader.GetDataTypeName method from throwing &quot;No current row&quot; exceptions. Fix for <a href="https://system.data.sqlite.org/index.html/info/94252b9059">[94252b9059]</a>.</li>
    52     52         <li>When BinaryGUID handling is off, transform the LINQ parameter types as well. Fix for <a href="https://system.data.sqlite.org/index.html/info/a4d9c7ee94">[a4d9c7ee94]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    53     53         <li>The IDataReader.GetDataTypeName method should always return the declared type name.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    54     54         <li>Add DefaultFlags_SQLiteConnection environment variable to enable customization of the default connection flags.</li>
    55     55         <li>Prevent calls to sqlite3_step() and sqlite3_interrupt() from being interrupted via ThreadAbortException.</li>
           56  +      <li>Make sure enabling UseUTF16Encoding sets the schema encoding to UTF-16. Fix for <a href="https://system.data.sqlite.org/index.html/info/7c151a2f0e">[7c151a2f0e]</a>.</li>
    56     57       </ul>
    57     58       <p><b>1.0.96.0 - March 5, 2015</b></p>
    58     59       <ul>
    59     60         <li>Prevent the IDataReader.GetOrdinal method from throwing &quot;No current row&quot; exceptions. Fix for <a href="https://system.data.sqlite.org/index.html/info/2be4298631">[2be4298631]</a>, <a href="https://system.data.sqlite.org/index.html/info/abad7c577d">[abad7c577d]</a>, and <a href="https://system.data.sqlite.org/index.html/info/c28d7fe915">[c28d7fe915]</a>.</li>
    60     61         <li>When counting the number of tables in the GetSchemaTable method, do not include those that have a null or empty name. Fix for <a href="https://system.data.sqlite.org/index.html/info/92dbf1229a">[92dbf1229a]</a>.</li>
    61     62       </ul>
    62     63       <p><b>1.0.95.0 - March 2, 2015</b></p>

Changes to SQLite.Interop/src/win/interop.c.

   390    390     ret = sqlite3_open_interop(filename, flags, ppdb);
   391    391   
   392    392   #if defined(INTEROP_DEBUG) && (INTEROP_DEBUG & INTEROP_DEBUG_OPEN16)
   393    393     sqlite3InteropDebug("sqlite3_open16_interop(): sqlite3_open_interop(\"%s\", %d, %p) returned %d.\n", filename, flags, ppdb, ret);
   394    394   #endif
   395    395   
   396    396     if ((ret == SQLITE_OK) && ppdb && !DbHasProperty(*ppdb, 0, DB_SchemaLoaded))
          397  +  {
   397    398       ENC(*ppdb) = SQLITE_UTF16NATIVE;
          399  +
          400  +#if SQLITE_VERSION_NUMBER >= 3008008
          401  +    //
          402  +    // BUGFIX: See ticket [7c151a2f0e22804c].
          403  +    //
          404  +    SCHEMA_ENC(*ppdb) = SQLITE_UTF16NATIVE;
          405  +#endif
          406  +  }
   398    407   
   399    408     return ret;
   400    409   }
   401    410   
   402    411   SQLITE_API const char *WINAPI sqlite3_errmsg_interop(sqlite3 *db, int *plen)
   403    412   {
   404    413     const char *pval = sqlite3_errmsg(db);

Added Tests/tkt-7c151a2f0e.eagle.

            1  +###############################################################################
            2  +#
            3  +# tkt-7c151a2f0e.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  +set character \UDDFDD83D; # NOTE: This is little-endian.
           24  +
           25  +###############################################################################
           26  +
           27  +runTest {test tkt-7c151a2f0e-1.1 {Open with UseUTF16Encoding=False} -setup {
           28  +  set fileName tkt-7c151a2f0e-1.1.db
           29  +  setupDb $fileName "" "" "" "" UseUTF16Encoding=False
           30  +} -body {
           31  +  sql execute $db "CREATE TABLE t1(x TEXT);"
           32  +
           33  +  sql execute $db [appendArgs "INSERT INTO t1 (x) VALUES(?);"] \
           34  +      [list param1 String $character]
           35  +
           36  +  list [sql execute -execute scalar $db "PRAGMA encoding;"] \
           37  +      [sql execute -execute scalar $db "SELECT x FROM t1;"]
           38  +} -cleanup {
           39  +  cleanupDb $fileName
           40  +
           41  +  unset -nocomplain db fileName
           42  +} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
           43  +System.Data.SQLite} -result [appendArgs "UTF-8 " $character]}
           44  +
           45  +###############################################################################
           46  +
           47  +runTest {test tkt-7c151a2f0e-1.2 {Open with UseUTF16Encoding=True} -setup {
           48  +  set fileName tkt-7c151a2f0e-1.2.db
           49  +  setupDb $fileName "" "" "" "" UseUTF16Encoding=True
           50  +} -body {
           51  +  sql execute $db "CREATE TABLE t1(x TEXT);"
           52  +
           53  +  sql execute $db [appendArgs "INSERT INTO t1 (x) VALUES(?);"] \
           54  +      [list param1 String $character]
           55  +
           56  +  list [sql execute -execute scalar $db "PRAGMA encoding;"] \
           57  +      [sql execute -execute scalar $db "SELECT x FROM t1;"]
           58  +} -cleanup {
           59  +  cleanupDb $fileName
           60  +
           61  +  unset -nocomplain db fileName
           62  +} -constraints {eagle command.object monoBug28 command.sql compile.DATA SQLite\
           63  +System.Data.SQLite} -result [appendArgs "UTF-16le " $character]}
           64  +
           65  +###############################################################################
           66  +
           67  +unset -nocomplain character
           68  +
           69  +###############################################################################
           70  +
           71  +runSQLiteTestEpilogue
           72  +runTestEpilogue

Changes to readme.htm.

   216    216       <li>Updated to <a href="https://www.nuget.org/packages/EntityFramework/6.1.3">Entity Framework 6.1.3</a>.</li>
   217    217       <li>Improve ADO.NET conformance of the SQLiteDataReader.RecordsAffected property. Fix for [74542e702e].&nbsp;<b>** Potentially Incompatible Change **</b></li>
   218    218       <li>Prevent the IDataReader.GetDataTypeName method from throwing &quot;No current row&quot; exceptions. Fix for [94252b9059].</li>
   219    219       <li>When BinaryGUID handling is off, transform the LINQ parameter types as well. Fix for [a4d9c7ee94].&nbsp;<b>** Potentially Incompatible Change **</b></li>
   220    220       <li>The IDataReader.GetDataTypeName method should always return the declared type name.&nbsp;<b>** Potentially Incompatible Change **</b></li>
   221    221       <li>Add DefaultFlags_SQLiteConnection environment variable to enable customization of the default connection flags.</li>
   222    222       <li>Prevent calls to sqlite3_step() and sqlite3_interrupt() from being interrupted via ThreadAbortException.</li>
          223  +    <li>Make sure enabling UseUTF16Encoding sets the schema encoding to UTF-16. Fix for [7c151a2f0e].</li>
   223    224   </ul>
   224    225   <p>
   225    226       <b>1.0.96.0 - March 5, 2015</b>
   226    227   </p>
   227    228   <ul>
   228    229       <li>Prevent the IDataReader.GetOrdinal method from throwing &quot;No current row&quot; exceptions. Fix for [c28d7fe915].</li>
   229    230       <li>When counting the number of tables in the GetSchemaTable method, do not include those that have a null or empty name. Fix for [92dbf1229a].</li>

Changes to www/news.wiki.

    10     10       <li>Updated to [https://www.nuget.org/packages/EntityFramework/6.1.3|Entity Framework 6.1.3].</li>
    11     11       <li>Improve ADO.NET conformance of the SQLiteDataReader.RecordsAffected property. Fix for [74542e702e].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    12     12       <li>Prevent the IDataReader.GetDataTypeName method from throwing &quot;No current row&quot; exceptions. Fix for [94252b9059].</li>
    13     13       <li>When BinaryGUID handling is off, transform the LINQ parameter types as well. Fix for [a4d9c7ee94].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    14     14       <li>The IDataReader.GetDataTypeName method should always return the declared type name.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    15     15       <li>Add DefaultFlags_SQLiteConnection environment variable to enable customization of the default connection flags.</li>
    16     16       <li>Prevent calls to sqlite3_step() and sqlite3_interrupt() from being interrupted via ThreadAbortException.</li>
           17  +    <li>Make sure enabling UseUTF16Encoding sets the schema encoding to UTF-16. Fix for [7c151a2f0e].</li>
    17     18   </ul>
    18     19   <p>
    19     20       <b>1.0.96.0 - March 5, 2015</b>
    20     21   </p>
    21     22   <ul>
    22     23       <li>Prevent the IDataReader.GetOrdinal method from throwing &quot;No current row&quot; exceptions. Fix for [c28d7fe915].</li>
    23     24       <li>When counting the number of tables in the GetSchemaTable method, do not include those that have a null or empty name. Fix for [92dbf1229a].</li>