1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add tests for updates of without-rowid tables that use non-BINARY collation sequences for the primary key columns. And a minor bugfix to the same.

FossilOrigin-Name: 99b1fa4b1664a79eae1dddce2b9a848384cdb1d7
This commit is contained in:
dan
2013-11-05 14:19:22 +00:00
parent f9c8ce3ced
commit e83267da54
5 changed files with 121 additions and 31 deletions

View File

@ -1023,6 +1023,50 @@ proc explain {sql {db db}} {
}
}
proc explain_i {sql {db db}} {
puts ""
puts "addr opcode p1 p2 p3 p4 p5 #"
puts "---- ------------ ------ ------ ------ ---------------- -- -"
set addrTail 0
$db eval "explain $sql" {} {
set x($addr) 0
set op($addr) $opcode
if {$opcode == "Goto" && $addrTail==0} {
set addrTail $p2
}
if {$opcode == "Next"} {
for {set i $p2} {$i<$addr} {incr i} {
incr x($i) 2
}
}
if {$opcode == "Goto" && $p2<$addr && $op($p2)=="Yield"} {
for {set i [expr $p2+1]} {$i<$addr} {incr i} {
incr x($i) 2
}
}
}
$db eval "explain $sql" {} {
if {$addr == $addrTail} {
puts ""
}
set I [string repeat " " $x($addr)]
puts [format {%-4d %s%-12.12s %-6d %-6d %-6d % -17s %s %s} \
$addr $I $opcode $p1 $p2 $p3 $p4 $p5 $comment
]
if {$opcode == "Halt" && $comment == "End of coroutine"} {
puts ""
}
}
puts "---- ------------ ------ ------ ------ ---------------- -- -"
}
# 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.