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

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

Overview
Comment:Add BindDateTimeWithKind connection flag to force DateTime parameter values to match the DateTimeKind associated with the connection, if applicable. Fix for [a7d04fb111].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e5f6b6838786997757ec9511d1530831f6c059de
User & Date: mistachkin 2015-02-19 01:00:49
References
2015-02-19
01:02 Ticket [a7d04fb111] DateTime parameters are not bound with regards to DateTimeKind status still Closed with 5 other changes artifact: 591911dec3 user: mistachkin
Context
2015-02-20
17:22
Permit empty string values for the Password and HexPassword connection string properties. check-in: 7c2c7ba6cf user: mistachkin tags: trunk
2015-02-19
01:00
Add BindDateTimeWithKind connection flag to force DateTime parameter values to match the DateTimeKind associated with the connection, if applicable. Fix for [a7d04fb111]. check-in: e5f6b68387 user: mistachkin tags: trunk
2015-02-18
22:46
Improve the changes in the previous check-in. check-in: 470251caba user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

62
63
64
65
66
67
68

69
70
71
72
73
74
75
      <li>Make sure the interop files are copied when publishing a project that refers to a NuGet package containing them. Fix for <a href="https://system.data.sqlite.org/index.html/info/e796ac82c1">[e796ac82c1]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Make sure the interop files are copied before the PostBuildEvent. Fix for <a href="https://system.data.sqlite.org/index.html/info/f16c93a932">[f16c93a932]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Modify GetSchemaTable method to avoid setting SchemaTableColumn.IsKey column to true when more than one table is referenced. Fix for <a href="https://system.data.sqlite.org/index.html/info/47c6fa04d3">[47c6fa04d3]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Add AppendManifestToken_SQLiteProviderManifest environment variable to enable better integration between LINQ and the underlying store connection.</li>
      <li>Add SQLite_ForceLogPrepare environment variable to force logging of all prepared SQL regardless of the flags for the associated connection.</li>
      <li>Honor the DateTimeFormat, DateTimeKind, DateTimeFormatString, BinaryGUID connection string and/or provider manifest token properties from within the LINQ assembly. Fix for <a href="https://system.data.sqlite.org/index.html/info/8d928c3e88">[8d928c3e88]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Add PrepareRetries connection string property to allow the maximum number of retries when preparing a query to be overridden. Fix for <a href="https://system.data.sqlite.org/index.html/info/647d282d11">[647d282d11]</a>.</li>

    </ul>
    <p><b>1.0.94.0 - September 9, 2014</b></p>
    <ul>
      <li>Updated to <a href="https://www.sqlite.org/releaselog/3_8_6.html">SQLite 3.8.6</a>.</li>
      <li>Updated to <a href="https://www.nuget.org/packages/EntityFramework/6.1.1">Entity Framework 6.1.1</a>.</li>
      <li>Refactor and simplify NuGet packages in order to support per-solution SQLite interop assembly files.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Add RefreshFlags method to the SQLiteDataReader class to forcibly refresh its connection flags.</li>







>







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
      <li>Make sure the interop files are copied when publishing a project that refers to a NuGet package containing them. Fix for <a href="https://system.data.sqlite.org/index.html/info/e796ac82c1">[e796ac82c1]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Make sure the interop files are copied before the PostBuildEvent. Fix for <a href="https://system.data.sqlite.org/index.html/info/f16c93a932">[f16c93a932]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Modify GetSchemaTable method to avoid setting SchemaTableColumn.IsKey column to true when more than one table is referenced. Fix for <a href="https://system.data.sqlite.org/index.html/info/47c6fa04d3">[47c6fa04d3]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Add AppendManifestToken_SQLiteProviderManifest environment variable to enable better integration between LINQ and the underlying store connection.</li>
      <li>Add SQLite_ForceLogPrepare environment variable to force logging of all prepared SQL regardless of the flags for the associated connection.</li>
      <li>Honor the DateTimeFormat, DateTimeKind, DateTimeFormatString, BinaryGUID connection string and/or provider manifest token properties from within the LINQ assembly. Fix for <a href="https://system.data.sqlite.org/index.html/info/8d928c3e88">[8d928c3e88]</a>.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Add PrepareRetries connection string property to allow the maximum number of retries when preparing a query to be overridden. Fix for <a href="https://system.data.sqlite.org/index.html/info/647d282d11">[647d282d11]</a>.</li>
      <li>Add BindDateTimeWithKind connection flag to force DateTime parameter values to match the DateTimeKind associated with the connection, if applicable. Fix for <a href="https://system.data.sqlite.org/index.html/info/a7d04fb111">[a7d04fb111]</a>.</li>
    </ul>
    <p><b>1.0.94.0 - September 9, 2014</b></p>
    <ul>
      <li>Updated to <a href="https://www.sqlite.org/releaselog/3_8_6.html">SQLite 3.8.6</a>.</li>
      <li>Updated to <a href="https://www.nuget.org/packages/EntityFramework/6.1.1">Entity Framework 6.1.1</a>.</li>
      <li>Refactor and simplify NuGet packages in order to support per-solution SQLite interop assembly files.&nbsp;<b>** Potentially Incompatible Change **</b></li>
      <li>Add RefreshFlags method to the SQLiteDataReader class to forcibly refresh its connection flags.</li>

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

1325
1326
1327
1328
1329
1330
1331













1332
1333
1334
1335
1336
1337
1338

#if !PLATFORM_COMPACTFRAMEWORK
        if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind)
        {
            LogBind(handle, index, dt);
        }
#endif














        switch (_datetimeFormat)
        {
            case SQLiteDateFormats.Ticks:
                {
                    long value = dt.Ticks;








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







1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351

#if !PLATFORM_COMPACTFRAMEWORK
        if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind)
        {
            LogBind(handle, index, dt);
        }
#endif

        if ((flags & SQLiteConnectionFlags.BindDateTimeWithKind) == SQLiteConnectionFlags.BindDateTimeWithKind)
        {
            if ((_datetimeKind != DateTimeKind.Unspecified) &&
                (dt.Kind != DateTimeKind.Unspecified) &&
                (dt.Kind != _datetimeKind))
            {
                if (_datetimeKind == DateTimeKind.Utc)
                    dt = dt.ToUniversalTime();
                else if (_datetimeKind == DateTimeKind.Local)
                    dt = dt.ToLocalTime();
            }
        }

        switch (_datetimeFormat)
        {
            case SQLiteDateFormats.Ticks:
                {
                    long value = dt.Ticks;

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

1094
1095
1096
1097
1098
1099
1100







1101
1102
1103
1104
1105
1106
1107
      /// properties are not set explicitly nor set via their connection
      /// string properties and repeated calls to determine these runtime
      /// configuration settings are seen to be a problem, this flag
      /// should be set.</b>
      /// </summary>
      NoConvertSettings = 0x8000000,








      /// <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,








>
>
>
>
>
>
>







1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
      /// properties are not set explicitly nor set via their connection
      /// string properties and repeated calls to determine these runtime
      /// configuration settings are seen to be a problem, this flag
      /// should be set.</b>
      /// </summary>
      NoConvertSettings = 0x8000000,

      /// <summary>
      /// When binding parameter values with the <see cref="DateTime" />
      /// type, take their <see cref="DateTimeKind" /> into account as
      /// well as that of the associated <see cref="SQLiteConnection" />.
      /// </summary>
      BindDateTimeWithKind = 0x10000000,

      /// <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/SQLiteConvert.cs.

Added Tests/tkt-a7d04fb111.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
###############################################################################
#
# tkt-a7d04fb111.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

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

set rawDateTimeValue "2015-02-18 00:00:00.0000000"

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

runTest {test tkt-a7d04fb111-1.1 {Bind DateTime Utc Ticks} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.1.db] "" Ticks Utc \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]]

  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{635598144000000000 635598144000000000 635598432000000000 True False False}}

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

runTest {test tkt-a7d04fb111-1.2 {Bind DateTime Local Ticks} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.2.db] "" Ticks Local \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]]

  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{635598144000000000 635597856000000000 635598144000000000 False True False}}

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

runTest {test tkt-a7d04fb111-1.3 {Bind DateTime Utc ISO8601} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.3.db] "" ISO8601 Utc \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]]

  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{{2015-02-18 00:00:00Z} {2015-02-18 00:00:00Z} {2015-02-18 08:00:00Z} True\
False False}}

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

runTest {test tkt-a7d04fb111-1.4 {Bind DateTime Local ISO8601} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.4.db] "" ISO8601 Local \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]]

  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{{2015-02-18 00:00:00} {2015-02-17 16:00:00} {2015-02-18 00:00:00} False True\
False}}

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

runTest {test tkt-a7d04fb111-1.5 {Bind DateTime Utc JulianDay} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.5.db] "" JulianDay Utc \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]]

  lappend result [expr {round2([sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]], 2)}]

  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{2457071.5 2457071.5 2457071.83 True False False}}

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

runTest {test tkt-a7d04fb111-1.6 {Bind DateTime Local JulianDay} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.6.db] "" JulianDay Local \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [expr {round2([sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]], 2)}]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]]

  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{2457071.5 2457071.17 2457071.5 False True False}}

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

runTest {test tkt-a7d04fb111-1.7 {Bind DateTime Utc UnixEpoch} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.7.db] "" UnixEpoch Utc \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]]

  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{1424217600 1424217600 1424246400 True False False}}

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

runTest {test tkt-a7d04fb111-1.8 {Bind DateTime Local UnixEpoch} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.8.db] "" UnixEpoch Local \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]]

  lappend result [expr {[lindex $result 0] == [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] == [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] == [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{1424217600 1424188800 1424217600 False True False}}

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

runTest {test tkt-a7d04fb111-1.9 {Bind DateTime Utc Invariant} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.9.db] "" InvariantCulture Utc \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]]

  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{2015-02-18T00:00:00.0000000 2015-02-18T00:00:00.0000000Z\
2015-02-18T08:00:00.0000000Z False False False}}

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

runTest {test tkt-a7d04fb111-1.10 {Bind DateTime Local Invariant} -setup {
  setupDb [set fileName tkt-a7d04fb111-1.10.db] "" InvariantCulture Local \
      BindDateTimeWithKind
} -body {
  set dateTimeValue(0) [object invoke \
      -create DateTime ParseExact $rawDateTimeValue \
      [getDateTimeFormat] null]

  set dateTimeValue(1) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Utc]

  set dateTimeValue(2) [object invoke -create -alias \
      DateTime SpecifyKind $dateTimeValue(0) Local]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(0)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(1)]]

  lappend result [sql execute -execute scalar $db "SELECT ?;" \
      [list param1 DateTime $dateTimeValue(2)]]

  lappend result [expr {[lindex $result 0] eq [lindex $result 1]}]
  lappend result [expr {[lindex $result 0] eq [lindex $result 2]}]
  lappend result [expr {[lindex $result 1] eq [lindex $result 2]}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result dateTimeValue db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{2015-02-18T00:00:00.0000000 2015-02-17T16:00:00.0000000-08:00\
2015-02-18T00:00:00.0000000-08:00 False False False}}

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

unset -nocomplain rawDateTimeValue

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

runSQLiteTestEpilogue
runTestEpilogue

Changes to readme.htm.

229
230
231
232
233
234
235

236
237
238
239
240
241
242
    <li>Make sure the interop files are copied when publishing a project that refers to a NuGet package containing them. Fix for [e796ac82c1].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Make sure the interop files are copied before the PostBuildEvent. Fix for [f16c93a932].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Modify GetSchemaTable method to avoid setting SchemaTableColumn.IsKey column to true when more than one table is referenced. Fix for [47c6fa04d3].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Add AppendManifestToken_SQLiteProviderManifest environment variable to enable better integration between LINQ and the underlying store connection.</li>
    <li>Add SQLite_ForceLogPrepare environment variable to force logging of all prepared SQL regardless of the flags for the associated connection.</li>
    <li>Honor the DateTimeFormat, DateTimeKind, DateTimeFormatString, BinaryGUID connection string and/or provider manifest token properties from within the LINQ assembly. Fix for [8d928c3e88].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Add PrepareRetries connection string property to allow the maximum number of retries when preparing a query to be overridden. Fix for [647d282d11].</li>

</ul>
<p>
    <b>1.0.94.0 - September 9, 2014</b>
</p>
<ul>
    <li>Updated to <a href="https://www.sqlite.org/releaselog/3_8_6.html">SQLite 3.8.6</a>.</li>
    <li>Updated to <a href="https://www.nuget.org/packages/EntityFramework/6.1.1">Entity Framework 6.1.1</a>.</li>







>







229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
    <li>Make sure the interop files are copied when publishing a project that refers to a NuGet package containing them. Fix for [e796ac82c1].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Make sure the interop files are copied before the PostBuildEvent. Fix for [f16c93a932].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Modify GetSchemaTable method to avoid setting SchemaTableColumn.IsKey column to true when more than one table is referenced. Fix for [47c6fa04d3].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Add AppendManifestToken_SQLiteProviderManifest environment variable to enable better integration between LINQ and the underlying store connection.</li>
    <li>Add SQLite_ForceLogPrepare environment variable to force logging of all prepared SQL regardless of the flags for the associated connection.</li>
    <li>Honor the DateTimeFormat, DateTimeKind, DateTimeFormatString, BinaryGUID connection string and/or provider manifest token properties from within the LINQ assembly. Fix for [8d928c3e88].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Add PrepareRetries connection string property to allow the maximum number of retries when preparing a query to be overridden. Fix for [647d282d11].</li>
    <li>Add BindDateTimeWithKind connection flag to force DateTime parameter values to match the DateTimeKind associated with the connection, if applicable. Fix for [a7d04fb111].</li>
</ul>
<p>
    <b>1.0.94.0 - September 9, 2014</b>
</p>
<ul>
    <li>Updated to <a href="https://www.sqlite.org/releaselog/3_8_6.html">SQLite 3.8.6</a>.</li>
    <li>Updated to <a href="https://www.nuget.org/packages/EntityFramework/6.1.1">Entity Framework 6.1.1</a>.</li>

Changes to www/news.wiki.

23
24
25
26
27
28
29

30
31
32
33
34
35
36
    <li>Make sure the interop files are copied when publishing a project that refers to a NuGet package containing them. Fix for [e796ac82c1].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Make sure the interop files are copied before the PostBuildEvent. Fix for [f16c93a932].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Modify GetSchemaTable method to avoid setting SchemaTableColumn.IsKey column to true when more than one table is referenced. Fix for [47c6fa04d3].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Add AppendManifestToken_SQLiteProviderManifest environment variable to enable better integration between LINQ and the underlying store connection.</li>
    <li>Add SQLite_ForceLogPrepare environment variable to force logging of all prepared SQL regardless of the flags for the associated connection.</li>
    <li>Honor the DateTimeFormat, DateTimeKind, DateTimeFormatString, BinaryGUID connection string and/or provider manifest token properties from within the LINQ assembly. Fix for [8d928c3e88].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Add PrepareRetries connection string property to allow the maximum number of retries when preparing a query to be overridden. Fix for [647d282d11].</li>

</ul>
<p>
    <b>1.0.94.0 - September 9, 2014</b>
</p>
<ul>
    <li>Updated to [https://www.sqlite.org/releaselog/3_8_6.html|SQLite 3.8.6].</li>
    <li>Updated to [https://www.nuget.org/packages/EntityFramework/6.1.1|Entity Framework 6.1.1].</li>







>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    <li>Make sure the interop files are copied when publishing a project that refers to a NuGet package containing them. Fix for [e796ac82c1].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Make sure the interop files are copied before the PostBuildEvent. Fix for [f16c93a932].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Modify GetSchemaTable method to avoid setting SchemaTableColumn.IsKey column to true when more than one table is referenced. Fix for [47c6fa04d3].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Add AppendManifestToken_SQLiteProviderManifest environment variable to enable better integration between LINQ and the underlying store connection.</li>
    <li>Add SQLite_ForceLogPrepare environment variable to force logging of all prepared SQL regardless of the flags for the associated connection.</li>
    <li>Honor the DateTimeFormat, DateTimeKind, DateTimeFormatString, BinaryGUID connection string and/or provider manifest token properties from within the LINQ assembly. Fix for [8d928c3e88].&nbsp;<b>** Potentially Incompatible Change **</b></li>
    <li>Add PrepareRetries connection string property to allow the maximum number of retries when preparing a query to be overridden. Fix for [647d282d11].</li>
    <li>Add BindDateTimeWithKind connection flag to force DateTime parameter values to match the DateTimeKind associated with the connection, if applicable. Fix for [a7d04fb111].</li>
</ul>
<p>
    <b>1.0.94.0 - September 9, 2014</b>
</p>
<ul>
    <li>Updated to [https://www.sqlite.org/releaselog/3_8_6.html|SQLite 3.8.6].</li>
    <li>Updated to [https://www.nuget.org/packages/EntityFramework/6.1.1|Entity Framework 6.1.1].</li>