mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Fix where.c handling of "IN (SELECT ...)" expressions when the SELECT returns more than one result column. Also error handling for other row value constructor cases.
FossilOrigin-Name: 061b8006034f06a0311b4304c8b14d2c8b0153df
This commit is contained in:
@ -1288,9 +1288,9 @@ proc explain_i {sql {db db}} {
|
||||
set D ""
|
||||
}
|
||||
foreach opcode {
|
||||
Seek SeekGe SeekGt SeekLe SeekLt NotFound Last Rewind
|
||||
Seek SeekGE SeekGT SeekLE SeekLT NotFound Last Rewind
|
||||
NoConflict Next Prev VNext VPrev VFilter
|
||||
SorterSort SorterNext
|
||||
SorterSort SorterNext NextIfOpen
|
||||
} {
|
||||
set color($opcode) $B
|
||||
}
|
||||
@ -1311,9 +1311,15 @@ proc explain_i {sql {db db}} {
|
||||
set bSeenGoto 1
|
||||
}
|
||||
|
||||
if {$opcode=="Once"} {
|
||||
for {set i $addr} {$i<$p2} {incr i} {
|
||||
set star($i) $addr
|
||||
}
|
||||
}
|
||||
|
||||
if {$opcode=="Next" || $opcode=="Prev"
|
||||
|| $opcode=="VNext" || $opcode=="VPrev"
|
||||
|| $opcode=="SorterNext"
|
||||
|| $opcode=="SorterNext" || $opcode=="NextIfOpen"
|
||||
} {
|
||||
for {set i $p2} {$i<$addr} {incr i} {
|
||||
incr x($i) 2
|
||||
@ -1337,6 +1343,12 @@ proc explain_i {sql {db db}} {
|
||||
}
|
||||
set I [string repeat " " $x($addr)]
|
||||
|
||||
if {[info exists star($addr)]} {
|
||||
set ii [expr $x($star($addr))]
|
||||
append I " "
|
||||
set I [string replace $I $ii $ii *]
|
||||
}
|
||||
|
||||
set col ""
|
||||
catch { set col $color($opcode) }
|
||||
|
||||
|
Reference in New Issue
Block a user