1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Unless the destination table is completely empty, disable the xfer optimization for WITHOUT ROWID tables.

FossilOrigin-Name: 3877c9f50582b51817dcf3cd75d836891a34e590
This commit is contained in:
dan
2013-11-05 16:39:31 +00:00
parent 7b3d1860af
commit 427ebba10c
5 changed files with 91 additions and 45 deletions

View File

@ -1028,14 +1028,15 @@ proc explain_i {sql {db db}} {
puts "addr opcode p1 p2 p3 p4 p5 #"
puts "---- ------------ ------ ------ ------ ---------------- -- -"
set addrTail 0
set bSeenGoto 0
$db eval "explain $sql" {} {
set x($addr) 0
set op($addr) $opcode
if {$opcode == "Goto" && $addrTail==0} {
set addrTail $p2
if {$opcode == "Goto" && ($bSeenGoto==0 || ($p2 > $addr+10))} {
set linebreak($p2) 1
set bSeenGoto 1
}
if {$opcode == "Next"} {
@ -1049,20 +1050,20 @@ proc explain_i {sql {db db}} {
incr x($i) 2
}
}
if {$opcode == "Halt" && $comment == "End of coroutine"} {
set linebreak([expr $addr+1]) 1
}
}
$db eval "explain $sql" {} {
if {$addr == $addrTail} {
if {[info exists linebreak($addr)]} {
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 "---- ------------ ------ ------ ------ ---------------- -- -"
}