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

Fix a problem in the sessions module causing sqlite3session_apply_strm() to

allocate enough memory for the entire input buffer - which defeats the point
of a streaming interface.

FossilOrigin-Name: 7594e60935b0b5dcf764476dccdf9b403303818a0419a30bc2c16d58e44f6d04
This commit is contained in:
dan
2018-04-06 16:22:25 +00:00
parent 9a3c375fce
commit 3e259bcd96
5 changed files with 77 additions and 11 deletions

View File

@ -170,3 +170,29 @@ proc changeset_to_list {c} {
lsort $list
}
set ones {zero one two three four five six seven eight nine
ten eleven twelve thirteen fourteen fifteen sixteen seventeen
eighteen nineteen}
set tens {{} ten twenty thirty forty fifty sixty seventy eighty ninety}
proc number_name {n} {
if {$n>=1000} {
set txt "[number_name [expr {$n/1000}]] thousand"
set n [expr {$n%1000}]
} else {
set txt {}
}
if {$n>=100} {
append txt " [lindex $::ones [expr {$n/100}]] hundred"
set n [expr {$n%100}]
}
if {$n>=20} {
append txt " [lindex $::tens [expr {$n/10}]]"
set n [expr {$n%10}]
}
if {$n>0} {
append txt " [lindex $::ones $n]"
}
set txt [string trim $txt]
if {$txt==""} {set txt zero}
return $txt
}