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

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

Overview
Comment:Add StickyHasRows connection flag to cause the SQLiteDataReader.HasRows property to return non-zero if there were ever any rows in the associated result sets.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: baf17cba3cabc548e7ec9b779f35b8d2fa4545c2
User & Date: mistachkin 2014-03-18 23:12:30
Context
2014-03-20
04:34
Final updates for release 1.0.92.0. check-in: 6c365f48b9 user: mistachkin tags: trunk, release, release-1.0.92.0
02:36
Doc updates for release 1.0.92.0. check-in: 0d01b46d0c user: mistachkin tags: preRelease
2014-03-18
23:12
Add StickyHasRows connection flag to cause the SQLiteDataReader.HasRows property to return non-zero if there were ever any rows in the associated result sets. check-in: baf17cba3c user: mistachkin tags: trunk
2014-03-14
20:20
Add StickyHasRows connection flag to cause the SQLiteDataReader.HasRows property to return non-zero if there were ever any rows in the associated result sets. Closed-Leaf check-in: 59bbbbfcdb user: mistachkin tags: stickyHasRows
2014-03-12
22:56
Add the SQLiteDataReader.StepCount property to return the number of rows seen so far. check-in: a31cac5d59 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

45
46
47
48
49
50
51

52
53
54
55
56
57
58
    <h1 class="heading">Version History</h1>
    <p><b>1.0.92.0 - March XX, 2014 <font color="red">(release scheduled)</font></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(&quot;ReservedWords&quot;).&nbsp;<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>

      <li>When the TraceWarning connection flag is set, issue warnings about possibly malformed UNC paths. Pursuant to <a href="http://system.data.sqlite.org/index.html/info/283344397b">[283344397b]</a>.</li>
      <li>Convert the primary NuGet package, &quot;System.Data.SQLite&quot;, into a meta-package.</li>
      <li>Enhancements to the NuGet packages, including the new &quot;modular&quot; packages.</li>
    </ul>
    <p><b>1.0.91.0 - February 12, 2014</b></p>
    <ul>
      <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_3_1.html">SQLite 3.8.3.1</a>.</li>







>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
    <h1 class="heading">Version History</h1>
    <p><b>1.0.92.0 - March XX, 2014 <font color="red">(release scheduled)</font></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(&quot;ReservedWords&quot;).&nbsp;<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>
      <li>Add StickyHasRows connection flag to cause the SQLiteDataReader.HasRows property to return non-zero if there were ever any rows in the associated result sets.</li>
      <li>When the TraceWarning connection flag is set, issue warnings about possibly malformed UNC paths. Pursuant to <a href="http://system.data.sqlite.org/index.html/info/283344397b">[283344397b]</a>.</li>
      <li>Convert the primary NuGet package, &quot;System.Data.SQLite&quot;, into a meta-package.</li>
      <li>Enhancements to the NuGet packages, including the new &quot;modular&quot; packages.</li>
    </ul>
    <p><b>1.0.91.0 - February 12, 2014</b></p>
    <ul>
      <li>Updated to <a href="http://www.sqlite.org/releaselog/3_8_3_1.html">SQLite 3.8.3.1</a>.</li>

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

1030
1031
1032
1033
1034
1035
1036







1037
1038
1039
1040
1041
1042
1043
      /// cases; however, if there are no per-connection type mappings, the
      /// fallback defaults will be used for both type names and their
      /// associated <see cref="DbType" /> values.  Therefore, use of this flag
      /// is not recommended.
      /// </summary>
      NoGlobalTypes = 0x200000,








      /// <summary>
      /// When binding parameter values or returning column values, always
      /// treat them as though they were plain text (i.e. no numeric,
      /// date/time, or other conversions should be attempted).
      /// </summary>
      BindAndGetAllAsText = BindAllAsText | GetAllAsText,








>
>
>
>
>
>
>







1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
      /// cases; however, if there are no per-connection type mappings, the
      /// fallback defaults will be used for both type names and their
      /// associated <see cref="DbType" /> values.  Therefore, use of this flag
      /// is not recommended.
      /// </summary>
      NoGlobalTypes = 0x200000,

      /// <summary>
      /// When the <see cref="SQLiteDataReader.HasRows" /> property is used, it
      /// should return non-zero if there were ever any rows in the associated
      /// result sets.
      /// </summary>
      StickyHasRows = 0x400000,

      /// <summary>
      /// When binding parameter values or returning column values, always
      /// treat them as though they were plain text (i.e. no numeric,
      /// date/time, or other conversions should be attempted).
      /// </summary>
      BindAndGetAllAsText = BindAllAsText | GetAllAsText,

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

1195
1196
1197
1198
1199
1200
1201


















1202
1203
1204
1205
1206
1207
1208
    /// </summary>
    public override bool HasRows
    {
      get
      {
        CheckDisposed();
        CheckClosed();


















        return (_readingState != 1);
      }
    }

    /// <summary>
    /// Returns True if the data reader is closed
    /// </summary>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
    /// </summary>
    public override bool HasRows
    {
      get
      {
        CheckDisposed();
        CheckClosed();

        //
        // NOTE: If the "sticky" flag has been set, use the new behavior,
        //       which returns non-zero if there were ever any rows in
        //       the associated result sets.  Generally, this flag is only
        //       useful when it is necessary to retain compatibility with
        //       other ADO.NET providers that use these same semantics for
        //       the HasRows property.
        //
        if ((GetFlags(this) & SQLiteConnectionFlags.StickyHasRows) == SQLiteConnectionFlags.StickyHasRows)
          return ((_readingState != 1) || (_stepCount > 0));

        //
        // NOTE: This is the default behavior.  It returns non-zero only if
        //       more rows are available (i.e. a call to the Read method is
        //       expected to succeed).  Prior to the introduction of the
        //       "sticky" flag, this is how this property has always worked.
        //
        return (_readingState != 1);
      }
    }

    /// <summary>
    /// Returns True if the data reader is closed
    /// </summary>

Changes to Tests/basic.eagle.

3009
3010
3011
3012
3013
3014
3015























































3016
3017
3018
3019
3020
3021
3022
3023
3024
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{False True True False True True False True True 1 True 0 False 0 False False\
True True False False True False False True 1 True 1 True 0 False False False\
True False False False False False False 1 True 1 True 1 True}}

###############################################################################
























































runTest {test data-1.64 {SQLiteDataReader StepCount property} -setup {
  setupDb [set fileName data-1.64.db]
} -body {
  sql execute $db {
    CREATE TABLE t1(x);
    CREATE TABLE t2(x);
    INSERT INTO t2 (x) VALUES(1);
    CREATE TABLE t3(x);
    INSERT INTO t3 (x) VALUES(1);







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|







3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{False True True False True True False True True 1 True 0 False 0 False False\
True True False False True False False True 1 True 1 True 0 False False False\
True False False False False False False 1 True 1 True 1 True}}

###############################################################################

runTest {test data-1.64 {SQLiteDataReader sticky HasRows property} -setup {
  setupDb [set fileName data-1.64.db] "" "" "" StickyHasRows
} -body {
  sql execute $db {
    CREATE TABLE t1(x);
    CREATE TABLE t2(x);
    INSERT INTO t2 (x) VALUES(1);
    CREATE TABLE t3(x);
    INSERT INTO t3 (x) VALUES(1);
    INSERT INTO t3 (x) VALUES(2);
  }

  set reader(1) [sql execute -execute reader -format datareader -alias \
      $db "SELECT * FROM t1;"]

  set reader(2) [sql execute -execute reader -format datareader -alias \
      $db "SELECT * FROM t2;"]

  set reader(3) [sql execute -execute reader -format datareader -alias \
      $db "SELECT * FROM t3;"]

  set noRow "*: No current row*"

  list [$reader(1) HasRows] [$reader(2) HasRows] [$reader(3) HasRows] \
      [$reader(1) Read] [$reader(2) Read] [$reader(3) Read] \
      [$reader(1) HasRows] [$reader(2) HasRows] [$reader(3) HasRows] \
      [catch {$reader(1) Item x} error] [string match $noRow $error] \
      [catch {$reader(2) Item x} error] [string match $noRow $error] \
      [catch {$reader(3) Item x} error] [string match $noRow $error] \
      [$reader(1) HasRows] [$reader(2) HasRows] [$reader(3) HasRows] \
      [$reader(1) Read] [$reader(2) Read] [$reader(3) Read] \
      [$reader(1) HasRows] [$reader(2) HasRows] [$reader(3) HasRows] \
      [catch {$reader(1) Item x} error] [string match $noRow $error] \
      [catch {$reader(2) Item x} error] [string match $noRow $error] \
      [catch {$reader(3) Item x} error] [string match $noRow $error] \
      [$reader(1) HasRows] [$reader(2) HasRows] [$reader(3) HasRows] \
      [$reader(1) Read] [$reader(2) Read] [$reader(3) Read] \
      [$reader(1) HasRows] [$reader(2) HasRows] [$reader(3) HasRows] \
      [catch {$reader(1) Item x} error] [string match $noRow $error] \
      [catch {$reader(2) Item x} error] [string match $noRow $error] \
      [catch {$reader(3) Item x} error] [string match $noRow $error]
} -cleanup {
  unset -nocomplain reader

  cleanupDb $fileName

  unset -nocomplain error noRow db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{False True True False True True False True True 1 True 0 False 0 False False\
True True False False True False True True 1 True 1 True 0 False False True\
True False False False False True True 1 True 1 True 1 True}}

###############################################################################

runTest {test data-1.65 {SQLiteDataReader StepCount property} -setup {
  setupDb [set fileName data-1.65.db]
} -body {
  sql execute $db {
    CREATE TABLE t1(x);
    CREATE TABLE t2(x);
    INSERT INTO t2 (x) VALUES(1);
    CREATE TABLE t3(x);
    INSERT INTO t3 (x) VALUES(1);

Changes to readme.htm.

212
213
214
215
216
217
218

219
220
221
222
223
224
225
    <b>1.0.92.0 - March XX, 2014 <font color="red">(release scheduled)</font></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(&quot;ReservedWords&quot;).&nbsp;<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>

    <li>When the TraceWarning connection flag is set, issue warnings about possibly malformed UNC paths. Pursuant to [283344397b].</li>
    <li>Convert the primary NuGet package, &quot;System.Data.SQLite&quot;, into a meta-package.</li>
    <li>Enhancements to the NuGet packages, including the new &quot;modular&quot; packages.</li>
</ul>
<p>
    <b>1.0.91.0 - February 12, 2014</b>
</p>







>







212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
    <b>1.0.92.0 - March XX, 2014 <font color="red">(release scheduled)</font></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(&quot;ReservedWords&quot;).&nbsp;<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>
    <li>Add StickyHasRows connection flag to cause the SQLiteDataReader.HasRows property to return non-zero if there were ever any rows in the associated result sets.</li>
    <li>When the TraceWarning connection flag is set, issue warnings about possibly malformed UNC paths. Pursuant to [283344397b].</li>
    <li>Convert the primary NuGet package, &quot;System.Data.SQLite&quot;, into a meta-package.</li>
    <li>Enhancements to the NuGet packages, including the new &quot;modular&quot; packages.</li>
</ul>
<p>
    <b>1.0.91.0 - February 12, 2014</b>
</p>

Changes to www/news.wiki.

6
7
8
9
10
11
12

13
14
15
16
17
18
19
    <b>1.0.92.0 - March XX, 2014 <font color="red">(release scheduled)</font></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(&quot;ReservedWords&quot;).&nbsp;<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>

    <li>When the TraceWarning connection flag is set, issue warnings about possibly malformed UNC paths. Pursuant to [283344397b].</li>
    <li>Convert the primary NuGet package, &quot;System.Data.SQLite&quot;, into a meta-package.</li>
    <li>Enhancements to the NuGet packages, including the new &quot;modular&quot; packages.</li>
</ul>
<p>
    <b>1.0.91.0 - February 12, 2014</b>
</p>







>







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
    <b>1.0.92.0 - March XX, 2014 <font color="red">(release scheduled)</font></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(&quot;ReservedWords&quot;).&nbsp;<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>
    <li>Add StickyHasRows connection flag to cause the SQLiteDataReader.HasRows property to return non-zero if there were ever any rows in the associated result sets.</li>
    <li>When the TraceWarning connection flag is set, issue warnings about possibly malformed UNC paths. Pursuant to [283344397b].</li>
    <li>Convert the primary NuGet package, &quot;System.Data.SQLite&quot;, into a meta-package.</li>
    <li>Enhancements to the NuGet packages, including the new &quot;modular&quot; packages.</li>
</ul>
<p>
    <b>1.0.91.0 - February 12, 2014</b>
</p>