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

Fix problems with RANGE windows and string, blob and NULL values.

FossilOrigin-Name: cebe09e11cc91d9776f259dd9b87e9c760a460f53ba6fa36481dfe58f77ad417
This commit is contained in:
dan
2019-03-16 20:29:54 +00:00
parent bf84515a2b
commit 1e7cb19be3
8 changed files with 2205 additions and 165 deletions

View File

@ -40,17 +40,26 @@ proc execsql {sql} {
#puts $lSql
set ret ""
set nChar 0
foreach stmt $lSql {
set res [pg_exec $::db $stmt]
set err [pg_result $res -error]
if {$err!=""} { error $err }
for {set i 0} {$i < [pg_result $res -numTuples]} {incr i} {
if {$i==0} {
set ret [pg_result $res -getTuple 0]
set t [pg_result $res -getTuple $i]
set nNew [string length $t]
if {$nChar>0 && ($nChar+$nNew+3)>75} {
append ret "\n "
set nChar 0
} else {
append ret " [pg_result $res -getTuple $i]"
if {$nChar>0} {
append ret " "
incr nChar 3
}
}
# lappend ret {*}[pg_result $res -getTuple $i]
incr nChar $nNew
append ret $t
}
pg_result $res -clear
}