System.Data.SQLite

Check-in [41413183d3]
Login

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

Overview
Comment:Update test case for ticket [343d392b51] as it now reproduces the issue.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | tkt-343d392b51
Files: files | file ages | folders
SHA1: 41413183d31f4629d8e9ce199adf2cfde50efe08
User & Date: mistachkin 2011-10-06 10:54:25.993
Context
2011-10-07
00:30
Start of work to resolve ticket [343d392b51]. check-in: 030e404034 user: mistachkin tags: tkt-343d392b51
2011-10-06
10:54
Update test case for ticket [343d392b51] as it now reproduces the issue. check-in: 41413183d3 user: mistachkin tags: tkt-343d392b51
05:33
Refinements to test case (issue still does not reproduce). check-in: a272ddc559 user: mistachkin tags: tkt-343d392b51
Changes
Unified Diff Ignore Whitespace Patch
Changes to Tests/tkt-343d392b51.eagle.
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
} -body {
  set id [object invoke Interpreter.GetActive NextId]
  set dataSource [file join [getTemporaryPath] $fileName]
  set otherDataSource [file join [getTemporaryPath] $otherFileName]
  set otherDbName otherDb
  set table [appendArgs $otherDbName .t1]


  set sql(1) [subst { \
    ATTACH DATABASE '${otherDataSource}' AS ${otherDbName}; \
    CREATE TABLE ${table}(x INTEGER PRIMARY KEY, y); \
    [for {set i 1} {$i < 200} {incr i} {
      append sql(inserts) \
          "INSERT INTO ${table} (x, y) VALUES($i, '$i'); "

    }; return [expr {[info exists sql(inserts)] ? $sql(inserts) : ""}]] \
  }]

  set sql(2) [subst { \
    SELECT x, y FROM ${table} ORDER BY x; \
  }]

  unset -nocomplain results errors

  set code [compileCSharpWith [subst {

    using System.Data;
    using System.Data.SQLite;

    namespace _Dynamic${id}
    {
      public class Test${id}
      {







>


|
|
|
|
>










>







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
} -body {
  set id [object invoke Interpreter.GetActive NextId]
  set dataSource [file join [getTemporaryPath] $fileName]
  set otherDataSource [file join [getTemporaryPath] $otherFileName]
  set otherDbName otherDb
  set table [appendArgs $otherDbName .t1]

  set sql(inserts) ""
  set sql(1) [subst { \
    ATTACH DATABASE '${otherDataSource}' AS ${otherDbName}; \
    CREATE TABLE ${table}(x INTEGER PRIMARY KEY, y DATETIME); \
    [for {set i 1} {$i < 2} {incr i} {
      append sql(inserts) [appendArgs \
          "INSERT INTO " ${table} " (x, y) VALUES(" $i ", '" \
          [clock format $i -format {yyyy-MM-ddTHH:mm:ss}] "'); "]
    }; return [expr {[info exists sql(inserts)] ? $sql(inserts) : ""}]] \
  }]

  set sql(2) [subst { \
    SELECT x, y FROM ${table} ORDER BY x; \
  }]

  unset -nocomplain results errors

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

    namespace _Dynamic${id}
    {
      public class Test${id}
      {
85
86
87
88
89
90
91
92

93
94
95
96
97
98
99
100
101
102
103

                foreach (DataRow dataRow in dataTable.Rows)
                {
                  //
                  // NOTE: Update even rows and delete odd rows.
                  //
                  if ((long)dataRow\["x"\] % 2 == 0)
                    dataRow\["y"\] = "zero";

                  else
                    dataRow.Delete();

                  break;
                }

                dataAdapter.Update(dataTable); // DBConcurrencyException (?)
              }
            }
          }
        }







|
>


<
<







88
89
90
91
92
93
94
95
96
97
98


99
100
101
102
103
104
105

                foreach (DataRow dataRow in dataTable.Rows)
                {
                  //
                  // NOTE: Update even rows and delete odd rows.
                  //
                  if ((long)dataRow\["x"\] % 2 == 0)
                    dataRow\["y"\] =
                        DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss");
                  else
                    dataRow.Delete();


                }

                dataAdapter.Update(dataTable); // DBConcurrencyException (?)
              }
            }
          }
        }