SQLite

Check-in [e64a568179]
Login

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

Overview
Comment:More test output refinements.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | testerOutput
Files: files | file ages | folders
SHA1: e64a5681793238fa04fe3636f48d34b2dd36cdfa
User & Date: mistachkin 2015-06-10 23:02:38.561
Context
2015-06-11
14:19
Remove stray outputs from the test suite. (check-in: afc6db9b10 user: drh tags: trunk)
2015-06-10
23:02
More test output refinements. (Closed-Leaf check-in: e64a568179 user: mistachkin tags: testerOutput)
22:51
Remove possibly stray output from various tests. (check-in: f38e0be56f user: mistachkin tags: testerOutput)
Changes
Unified Diff Ignore Whitespace Patch
Changes to test/progress.test.
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
    CREATE TABLE abc(a, b, c);
    INSERT INTO abc VALUES(1, 2, 3);
    INSERT INTO abc VALUES(4, 5, 6);
    INSERT INTO abc VALUES(7, 8, 9);
  }

  set ::res [list]
  explain {SELECT a, b, c FROM abc} 
  db eval {SELECT a, b, c FROM abc} {
    lappend ::res $a $b $c
    db progress 5 "expr 1"
    catch {db eval {SELECT a, b, c FROM abc} { }} msg
    db progress 5 "expr 0"
    lappend ::res $msg
  }







<







160
161
162
163
164
165
166

167
168
169
170
171
172
173
    CREATE TABLE abc(a, b, c);
    INSERT INTO abc VALUES(1, 2, 3);
    INSERT INTO abc VALUES(4, 5, 6);
    INSERT INTO abc VALUES(7, 8, 9);
  }

  set ::res [list]

  db eval {SELECT a, b, c FROM abc} {
    lappend ::res $a $b $c
    db progress 5 "expr 1"
    catch {db eval {SELECT a, b, c FROM abc} { }} msg
    db progress 5 "expr 0"
    lappend ::res $msg
  }
Changes to test/tester.tcl.
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
  lappend r $msg
  return $r
}

# Do an VDBE code dump on the SQL given
#
proc explain {sql {db db}} {
  output1 ""
  output1 "addr  opcode        p1      p2      p3      p4               p5  #"
  output1 "----  ------------  ------  ------  ------  ---------------  --  -"
  $db eval "explain $sql" {} {
    output1 [format {%-4d  %-12.12s  %-6d  %-6d  %-6d  % -17s %s  %s} \
      $addr $opcode $p1 $p2 $p3 $p4 $p5 $comment
    ]
  }
}

proc explain_i {sql {db db}} {
  output1 ""
  output1 "addr  opcode        p1      p2      p3      p4                p5  #"
  output1 "----  ------------  ------  ------  ------  ----------------  --  -"


  # Set up colors for the different opcodes. Scheme is as follows:
  #
  #   Red:   Opcodes that write to a b-tree.
  #   Blue:  Opcodes that reposition or seek a cursor. 
  #   Green: The ResultRow opcode.







|
|
|

|






|
|
|







1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
  lappend r $msg
  return $r
}

# Do an VDBE code dump on the SQL given
#
proc explain {sql {db db}} {
  output2 ""
  output2 "addr  opcode        p1      p2      p3      p4               p5  #"
  output2 "----  ------------  ------  ------  ------  ---------------  --  -"
  $db eval "explain $sql" {} {
    output2 [format {%-4d  %-12.12s  %-6d  %-6d  %-6d  % -17s %s  %s} \
      $addr $opcode $p1 $p2 $p3 $p4 $p5 $comment
    ]
  }
}

proc explain_i {sql {db db}} {
  output2 ""
  output2 "addr  opcode        p1      p2      p3      p4                p5  #"
  output2 "----  ------------  ------  ------  ------  ----------------  --  -"


  # Set up colors for the different opcodes. Scheme is as follows:
  #
  #   Red:   Opcodes that write to a b-tree.
  #   Blue:  Opcodes that reposition or seek a cursor. 
  #   Green: The ResultRow opcode.
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
    if {$opcode == "Halt" && $comment == "End of coroutine"} {
      set linebreak([expr $addr+1]) 1
    }
  }

  $db eval "explain $sql" {} {
    if {[info exists linebreak($addr)]} {
      puts ""
    }
    set I [string repeat " " $x($addr)]

    set col ""
    catch { set col $color($opcode) }

    output1 [format {%-4d  %s%s%-12.12s%s  %-6d  %-6d  %-6d  % -17s %s  %s} \
      $addr $I $col $opcode $D $p1 $p2 $p3 $p4 $p5 $comment
    ]
  }
  output1 "----  ------------  ------  ------  ------  ----------------  --  -"
}

# Show the VDBE program for an SQL statement but omit the Trace
# opcode at the beginning.  This procedure can be used to prove
# that different SQL statements generate exactly the same VDBE code.
#
proc explain_no_trace {sql} {







|






|



|







1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
    if {$opcode == "Halt" && $comment == "End of coroutine"} {
      set linebreak([expr $addr+1]) 1
    }
  }

  $db eval "explain $sql" {} {
    if {[info exists linebreak($addr)]} {
      output2 ""
    }
    set I [string repeat " " $x($addr)]

    set col ""
    catch { set col $color($opcode) }

    output2 [format {%-4d  %s%s%-12.12s%s  %-6d  %-6d  %-6d  % -17s %s  %s} \
      $addr $I $col $opcode $D $p1 $p2 $p3 $p4 $p5 $comment
    ]
  }
  output2 "----  ------------  ------  ------  ------  ----------------  --  -"
}

# Show the VDBE program for an SQL statement but omit the Trace
# opcode at the beginning.  This procedure can be used to prove
# that different SQL statements generate exactly the same VDBE code.
#
proc explain_no_trace {sql} {
Changes to test/vtab1.test.
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#----------------------------------------------------------------------
# Test cases vtab1.1.*
#

# We cannot create a virtual table if the module has not been registered.
#
do_test vtab1-1.1.1 {
  explain {
    CREATE VIRTUAL TABLE t1 USING echo;
  }
  catchsql {
    CREATE VIRTUAL TABLE t1 USING echo;
  }
} {1 {no such module: echo}}
do_test vtab1-1.1.2 {
  catchsql {
    CREATE VIRTUAL TABLE IF NOT EXISTS t1 USING echo;







<
<
<







52
53
54
55
56
57
58



59
60
61
62
63
64
65
#----------------------------------------------------------------------
# Test cases vtab1.1.*
#

# We cannot create a virtual table if the module has not been registered.
#
do_test vtab1-1.1.1 {



  catchsql {
    CREATE VIRTUAL TABLE t1 USING echo;
  }
} {1 {no such module: echo}}
do_test vtab1-1.1.2 {
  catchsql {
    CREATE VIRTUAL TABLE IF NOT EXISTS t1 USING echo;