System.Data.SQLite
Check-in [40def75096]
Not logged in

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

Overview
Comment:Prevent the IDataReader.GetDataTypeName method from throwing 'No current row' exceptions. Fix for [94252b9059]. Also, the IDataReader.GetDataTypeName method should always return the declared type name.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 40def75096dcb5aa0dee8e0adb395b4f535e7d6c
User & Date: mistachkin 2015-03-30 19:31:31
References
2015-03-30
19:32 Closed ticket [94252b9059]: IDataReader.GetDataTypeName() throw "No current row" plus 4 other changes artifact: b5923509ad user: mistachkin
Context
2015-03-30
20:34
Add more tests for ticket [94252b9059]. check-in: 9a50efa0ae user: mistachkin tags: trunk
19:31
Prevent the IDataReader.GetDataTypeName method from throwing 'No current row' exceptions. Fix for [94252b9059]. Also, the IDataReader.GetDataTypeName method should always return the declared type name. check-in: 40def75096 user: mistachkin tags: trunk
2015-03-26
22:16
Fix compilation error for the 'testlinq' program with the .NET Framework 3.5. check-in: 3cd750e5f4 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

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

    42     42       </div>
    43     43       <div id="mainSection">
    44     44       <div id="mainBody">
    45     45       <h1 class="heading">Version History</h1>
    46     46       <p><b>1.0.97.0 - May XX, 2015 <font color="red">(release scheduled)</font></b></p>
    47     47       <ul>
    48     48         <li>Updated to <a href="https://www.nuget.org/packages/EntityFramework/6.1.3">Entity Framework 6.1.3</a>.</li>
           49  +      <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>
    49     50         <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>
           51  +      <li>The IDataReader.GetDataTypeName method should always return the declared type name.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    50     52       </ul>
    51     53       <p><b>1.0.96.0 - March 5, 2015</b></p>
    52     54       <ul>
    53     55         <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>
    54     56         <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>
    55     57       </ul>
    56     58       <p><b>1.0.95.0 - March 2, 2015</b></p>

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

   532    532       /// Retrieves the name of the back-end datatype of the column
   533    533       /// </summary>
   534    534       /// <param name="i">The index of the column to retrieve</param>
   535    535       /// <returns>string</returns>
   536    536       public override string GetDataTypeName(int i)
   537    537       {
   538    538           CheckDisposed();
   539         -        VerifyForGet();
   540    539   
   541    540           if (i >= PrivateVisibleFieldCount && _keyInfo != null)
   542    541               return _keyInfo.GetDataTypeName(i - PrivateVisibleFieldCount);
   543    542   
   544         -        SQLiteType typ = GetSQLiteType(_flags, i);
   545         -        if (typ.Type == DbType.Object) return SQLiteConvert.SQLiteTypeToType(typ).Name;
   546         -        return _activeStatement._sql.ColumnType(_activeStatement, i, ref typ.Affinity);
          543  +        TypeAffinity affin = TypeAffinity.Uninitialized;
          544  +        return _activeStatement._sql.ColumnType(_activeStatement, i, ref affin);
   547    545       }
   548    546   
   549    547       /// <summary>
   550    548       /// Retrieve the column as a date/time value
   551    549       /// </summary>
   552    550       /// <param name="i">The index of the column to retrieve</param>
   553    551       /// <returns>DateTime</returns>

Added Tests/tkt-94252b9059.eagle.

            1  +###############################################################################
            2  +#
            3  +# tkt-94252b9059.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-94252b9059-1.1 {GetDataTypeName with no current row} -setup {
           24  +  setupDb [set fileName tkt-94252b9059-1.1.db]
           25  +} -body {
           26  +  sql execute $db {
           27  +    CREATE TABLE t1(x SOMETYPE, y INTEGER, z);
           28  +  }
           29  +
           30  +  set dataReader [sql execute -execute reader -format datareader \
           31  +      -alias $db "SELECT x, y, z FROM t1;"]
           32  +
           33  +  list [$dataReader GetDataTypeName 0] [$dataReader GetDataTypeName 1] \
           34  +      [$dataReader GetDataTypeName 2] [$dataReader GetFieldType 0] \
           35  +      [$dataReader GetFieldType 1] [$dataReader GetFieldType 2]
           36  +} -cleanup {
           37  +  unset -nocomplain dataReader
           38  +
           39  +  cleanupDb $fileName
           40  +
           41  +  unset -nocomplain db fileName
           42  +} -constraints \
           43  +{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
           44  +{SOMETYPE INTEGER {} System.Object System.Int64 System.Object}}
           45  +
           46  +###############################################################################
           47  +
           48  +runSQLiteTestEpilogue
           49  +runTestEpilogue

Changes to readme.htm.

   209    209   <h2><b>Version History</b></h2>
   210    210   
   211    211   <p>
   212    212       <b>1.0.97.0 - May XX, 2015 <font color="red">(release scheduled)</font></b>
   213    213   </p>
   214    214   <ul>
   215    215       <li>Updated to <a href="https://www.nuget.org/packages/EntityFramework/6.1.3">Entity Framework 6.1.3</a>.</li>
          216  +    <li>Prevent the IDataReader.GetDataTypeName method from throwing &quot;No current row&quot; exceptions. Fix for [94252b9059].</li>
   216    217       <li>When BinaryGUID handling is off, transform the LINQ parameter types as well. Fix for [a4d9c7ee94].&nbsp;<b>** Potentially Incompatible Change **</b></li>
          218  +    <li>The IDataReader.GetDataTypeName method should always return the declared type name.&nbsp;<b>** Potentially Incompatible Change **</b></li>
   217    219   </ul>
   218    220   <p>
   219    221       <b>1.0.96.0 - March 5, 2015</b>
   220    222   </p>
   221    223   <ul>
   222    224       <li>Prevent the IDataReader.GetOrdinal method from throwing &quot;No current row&quot; exceptions. Fix for [c28d7fe915].</li>
   223    225       <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.

     3      3   <b>Version History</b>
     4      4   
     5      5   <p>
     6      6       <b>1.0.97.0 - May XX, 2015 <font color="red">(release scheduled)</font></b>
     7      7   </p>
     8      8   <ul>
     9      9       <li>Updated to [https://www.nuget.org/packages/EntityFramework/6.1.3|Entity Framework 6.1.3].</li>
           10  +    <li>Prevent the IDataReader.GetDataTypeName method from throwing &quot;No current row&quot; exceptions. Fix for [94252b9059].</li>
    10     11       <li>When BinaryGUID handling is off, transform the LINQ parameter types as well. Fix for [a4d9c7ee94].&nbsp;<b>** Potentially Incompatible Change **</b></li>
           12  +    <li>The IDataReader.GetDataTypeName method should always return the declared type name.&nbsp;<b>** Potentially Incompatible Change **</b></li>
    11     13   </ul>
    12     14   <p>
    13     15       <b>1.0.96.0 - March 5, 2015</b>
    14     16   </p>
    15     17   <ul>
    16     18       <li>Prevent the IDataReader.GetOrdinal method from throwing &quot;No current row&quot; exceptions. Fix for [c28d7fe915].</li>
    17     19       <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>