System.Data.SQLite

Check-in [984585f3ac]
Login

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

Overview
Comment:First attempt to reproduce the issue in ticket [e1b2e0f769].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 984585f3ac46fb1709a529c6885a7f4b375e813f
User & Date: mistachkin 2011-07-05 10:05:14.108
Context
2011-07-05
10:13
Fix for [201128cc88]. check-in: 3e063f371f user: mistachkin tags: trunk
10:05
First attempt to reproduce the issue in ticket [e1b2e0f769]. check-in: 984585f3ac user: mistachkin tags: trunk
07:47
Fix for [2c630bffa7] and [b0a5990f48]. check-in: eb6a22a1a9 user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Tests/common.eagle.
1
2
3
4
5
6
7
8
9
10
11
12
13
14















15
16
17
18
19
20
21
###############################################################################
#
# common.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

if {[isEagle]} then {
  proc loadAssembly { fileName } {
    set fileName [file join [file dirname $::path] bin \
        [expr {[haveConstraint imageRuntime40] ? "2010" : "2008"}] \
        $::test_configuration bin $fileName]
















    if {[catch {set assembly \
        [object load -loadtype File $fileName]}] == 0} then {
      #
      # NOTE: Now, add the necessary test constraint.
      #
      addConstraint [file rootname [file tail $fileName]]










|
|


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







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
###############################################################################
#
# common.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

if {[isEagle]} then {
  proc getAssemblyFileName { fileName } {
    return [file join [file dirname $::path] bin \
        [expr {[haveConstraint imageRuntime40] ? "2010" : "2008"}] \
        $::test_configuration bin $fileName]
  }

  proc copyAssembly { fileName } {
    #
    # NOTE: If we cannot copy the file then it is probably already loaded,
    #       ignore the error.
    #
    catch {
      file copy -force [getAssemblyFileName $fileName] \
          [file join [info binary] $fileName]
    }
  }

  proc loadAssembly { fileName } {
    set fileName [getAssemblyFileName $fileName]

    if {[catch {set assembly \
        [object load -loadtype File $fileName]}] == 0} then {
      #
      # NOTE: Now, add the necessary test constraint.
      #
      addConstraint [file rootname [file tail $fileName]]
Added Tests/tkt-e1b2e0f769.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
###############################################################################
#
# tkt-e1b2e0f769.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

package require EagleLibrary
package require EagleTest

runTestPrologue

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

source [file join $path common.eagle]
loadAssembly System.Data.SQLite.dll

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

runTest {test tkt-e1b2e0f769-1.1 {command cleanup} -setup {
  copyAssembly SQLite.Interop.dll
  copyAssembly System.Data.SQLite.dll
  setupDb [set fileName tkt-e1b2e0f769-1.1.db]
} -body {
  sql execute $db "CREATE TABLE t1(x INTEGER);"

  foreach x [list 1 2 3] {
    sql execute $db "INSERT INTO t1 (x) VALUES($x);"
  }

  set id [object invoke Interpreter.GetActive NextId]
  set dataSource [file join [getTemporaryPath] tkt-e1b2e0f769-1.1.db]
  set sql "SELECT * FROM t1 ORDER BY x ASC; SELECT * FROM t1 ORDER BY x DESC;"

  unset -nocomplain results errors

  set code [compileCSharp [subst {
    using System.Data.SQLite;

    namespace _Dynamic${id}
    {
      public class Test${id}
      {
        public static bool Tkt_e1b2e0f769(SQLiteConnection connection)
        {
          using (SQLiteTransaction transaction = connection.BeginTransaction())
          {
            using (SQLiteCommand command = connection.CreateCommand())
            {
              command.CommandText = "${sql}";

              using (SQLiteDataReader dataReader = command.ExecuteReader())
              {
                if (!dataReader.HasRows)
                  return false;

                while (dataReader.Read())
                  ;

                return true;
              }
            }

            transaction.Commit();
          }
        }

        public static void Main()
        {
          using (SQLiteConnection connection = new SQLiteConnection(
              "Data Source=${dataSource}"))
          {
            connection.Open();

            Tkt_e1b2e0f769(connection);
            Tkt_e1b2e0f769(connection);
          }
        }
      }
    }
  }] results errors ReferencedAssemblies.Add System.dll \
      ReferencedAssemblies.Add System.Data.dll \
      ReferencedAssemblies.Add [getAssemblyFileName System.Data.SQLite.dll]]

  list $code $results [expr {[info exists errors] ? $errors : ""}] [expr {$code\
      eq "Ok" ? [object invoke _Dynamic${id}.Test${id} Main] : ""}]
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain code results errors x db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA System.Data.SQLite} -match regexp \
-result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} \{\}$}}

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

runTestEpilogue