Fossil SCM
minor th1 doc and script code cleanups.
Commit
2b4b2a5091dc81ae770c47f915210d4be3275710
Parent
c01764b0d10c644…
3 files changed
+2
-2
+2
-2
+2
-2
+2
-2
| --- test/th1-query-api-1.th1 | ||
| +++ test/th1-query-api-1.th1 | ||
| @@ -19,11 +19,11 @@ | ||
| 19 | 19 | for {set i 0} {$i < $colCount} {incr i} { |
| 20 | 20 | set colNames($i) [query $stmt col name $i] |
| 21 | 21 | puts "colNames($i)=" $colNames($i) "\n" |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | -for {set row 0} {0 < [query $stmt step]} {incr row} { | |
| 24 | +for {set row 0} {[query $stmt step]} {incr row} { | |
| 25 | 25 | for {set i 0} {$i < $colCount} {incr i} { |
| 26 | 26 | if {$i > 0} { |
| 27 | 27 | puts $sep |
| 28 | 28 | } else { |
| 29 | 29 | puts "#$row: $sep" |
| @@ -43,11 +43,11 @@ | ||
| 43 | 43 | set colCount [query $stmt col count] |
| 44 | 44 | for {set i 0} {$i < $colCount} {incr i} { |
| 45 | 45 | set colNames($i) [query $stmt col name $i] |
| 46 | 46 | } |
| 47 | 47 | upvar cb $callback |
| 48 | - for {set row 0} {0 < [query $stmt step]} {incr row} { | |
| 48 | + for {set row 0} {[query $stmt step]} {incr row} { | |
| 49 | 49 | #puts "Calling callback: $stmt $colCount colNames\n" |
| 50 | 50 | $callback $stmt $colCount |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 |
| --- test/th1-query-api-1.th1 | |
| +++ test/th1-query-api-1.th1 | |
| @@ -19,11 +19,11 @@ | |
| 19 | for {set i 0} {$i < $colCount} {incr i} { |
| 20 | set colNames($i) [query $stmt col name $i] |
| 21 | puts "colNames($i)=" $colNames($i) "\n" |
| 22 | } |
| 23 | |
| 24 | for {set row 0} {0 < [query $stmt step]} {incr row} { |
| 25 | for {set i 0} {$i < $colCount} {incr i} { |
| 26 | if {$i > 0} { |
| 27 | puts $sep |
| 28 | } else { |
| 29 | puts "#$row: $sep" |
| @@ -43,11 +43,11 @@ | |
| 43 | set colCount [query $stmt col count] |
| 44 | for {set i 0} {$i < $colCount} {incr i} { |
| 45 | set colNames($i) [query $stmt col name $i] |
| 46 | } |
| 47 | upvar cb $callback |
| 48 | for {set row 0} {0 < [query $stmt step]} {incr row} { |
| 49 | #puts "Calling callback: $stmt $colCount colNames\n" |
| 50 | $callback $stmt $colCount |
| 51 | } |
| 52 | } |
| 53 | |
| 54 |
| --- test/th1-query-api-1.th1 | |
| +++ test/th1-query-api-1.th1 | |
| @@ -19,11 +19,11 @@ | |
| 19 | for {set i 0} {$i < $colCount} {incr i} { |
| 20 | set colNames($i) [query $stmt col name $i] |
| 21 | puts "colNames($i)=" $colNames($i) "\n" |
| 22 | } |
| 23 | |
| 24 | for {set row 0} {[query $stmt step]} {incr row} { |
| 25 | for {set i 0} {$i < $colCount} {incr i} { |
| 26 | if {$i > 0} { |
| 27 | puts $sep |
| 28 | } else { |
| 29 | puts "#$row: $sep" |
| @@ -43,11 +43,11 @@ | |
| 43 | set colCount [query $stmt col count] |
| 44 | for {set i 0} {$i < $colCount} {incr i} { |
| 45 | set colNames($i) [query $stmt col name $i] |
| 46 | } |
| 47 | upvar cb $callback |
| 48 | for {set row 0} {[query $stmt step]} {incr row} { |
| 49 | #puts "Calling callback: $stmt $colCount colNames\n" |
| 50 | $callback $stmt $colCount |
| 51 | } |
| 52 | } |
| 53 | |
| 54 |
+2
-2
| --- test/th1-query-api-2.th1 | ||
| +++ test/th1-query-api-2.th1 | ||
| @@ -6,14 +6,14 @@ | ||
| 6 | 6 | AND mtime IS NOT NULL |
| 7 | 7 | }] |
| 8 | 8 | puts "stmt ID=$stmt\n" |
| 9 | 9 | # query bind int $stmt 1 2 |
| 10 | 10 | # query $stmt bind int 1 2 |
| 11 | - query $stmt bind 1 int 2 | |
| 11 | + query $stmt bind 1 int 5 | |
| 12 | 12 | # segfault: query bind 1 int $stmt 2 |
| 13 | 13 | set sep "\n" |
| 14 | - for {} {0 < [query $stmt step]} {} { | |
| 14 | + for {} {[query $stmt step]} {} { | |
| 15 | 15 | puts [query $stmt col string 0] $sep |
| 16 | 16 | puts [query $stmt col time 2 {%Y%m%d @ %H:%M:%S}] $sep |
| 17 | 17 | puts [query $stmt col time 2 {%Y%m%d @ %H:%M:%S} {+10 years}] $sep |
| 18 | 18 | puts [query $stmt col 2 time {%Y%m%d @ %H:%M:%S} {+10 years}] $sep |
| 19 | 19 | # puts [query col time $stmt 2 %s] $sep |
| 20 | 20 |
| --- test/th1-query-api-2.th1 | |
| +++ test/th1-query-api-2.th1 | |
| @@ -6,14 +6,14 @@ | |
| 6 | AND mtime IS NOT NULL |
| 7 | }] |
| 8 | puts "stmt ID=$stmt\n" |
| 9 | # query bind int $stmt 1 2 |
| 10 | # query $stmt bind int 1 2 |
| 11 | query $stmt bind 1 int 2 |
| 12 | # segfault: query bind 1 int $stmt 2 |
| 13 | set sep "\n" |
| 14 | for {} {0 < [query $stmt step]} {} { |
| 15 | puts [query $stmt col string 0] $sep |
| 16 | puts [query $stmt col time 2 {%Y%m%d @ %H:%M:%S}] $sep |
| 17 | puts [query $stmt col time 2 {%Y%m%d @ %H:%M:%S} {+10 years}] $sep |
| 18 | puts [query $stmt col 2 time {%Y%m%d @ %H:%M:%S} {+10 years}] $sep |
| 19 | # puts [query col time $stmt 2 %s] $sep |
| 20 |
| --- test/th1-query-api-2.th1 | |
| +++ test/th1-query-api-2.th1 | |
| @@ -6,14 +6,14 @@ | |
| 6 | AND mtime IS NOT NULL |
| 7 | }] |
| 8 | puts "stmt ID=$stmt\n" |
| 9 | # query bind int $stmt 1 2 |
| 10 | # query $stmt bind int 1 2 |
| 11 | query $stmt bind 1 int 5 |
| 12 | # segfault: query bind 1 int $stmt 2 |
| 13 | set sep "\n" |
| 14 | for {} {[query $stmt step]} {} { |
| 15 | puts [query $stmt col string 0] $sep |
| 16 | puts [query $stmt col time 2 {%Y%m%d @ %H:%M:%S}] $sep |
| 17 | puts [query $stmt col time 2 {%Y%m%d @ %H:%M:%S} {+10 years}] $sep |
| 18 | puts [query $stmt col 2 time {%Y%m%d @ %H:%M:%S} {+10 years}] $sep |
| 19 | # puts [query col time $stmt 2 %s] $sep |
| 20 |
+2
-2
| --- www/th1_query.wiki | ||
| +++ www/th1_query.wiki | ||
| @@ -8,12 +8,12 @@ | ||
| 8 | 8 | <nowiki><pre> |
| 9 | 9 | <th1> |
| 10 | 10 | catch { |
| 11 | 11 | set stmt [query prepare "SELECT login, cap FROM user"] |
| 12 | 12 | puts "stmt ID=$stmt\n" |
| 13 | - for {} {0 < [query $stmt step]} {} { | |
| 14 | - puts [query $stmt col string 0] ": " [query $stmt col string 1] "\n" | |
| 13 | + for {} {[query $stmt step]} {} { | |
| 14 | + puts [query $stmt col string 0] " " [query $stmt col string 1] \n | |
| 15 | 15 | } |
| 16 | 16 | query $stmt finalize |
| 17 | 17 | return 0 |
| 18 | 18 | } rc |
| 19 | 19 | if {0 != $rc} { |
| 20 | 20 |
| --- www/th1_query.wiki | |
| +++ www/th1_query.wiki | |
| @@ -8,12 +8,12 @@ | |
| 8 | <nowiki><pre> |
| 9 | <th1> |
| 10 | catch { |
| 11 | set stmt [query prepare "SELECT login, cap FROM user"] |
| 12 | puts "stmt ID=$stmt\n" |
| 13 | for {} {0 < [query $stmt step]} {} { |
| 14 | puts [query $stmt col string 0] ": " [query $stmt col string 1] "\n" |
| 15 | } |
| 16 | query $stmt finalize |
| 17 | return 0 |
| 18 | } rc |
| 19 | if {0 != $rc} { |
| 20 |
| --- www/th1_query.wiki | |
| +++ www/th1_query.wiki | |
| @@ -8,12 +8,12 @@ | |
| 8 | <nowiki><pre> |
| 9 | <th1> |
| 10 | catch { |
| 11 | set stmt [query prepare "SELECT login, cap FROM user"] |
| 12 | puts "stmt ID=$stmt\n" |
| 13 | for {} {[query $stmt step]} {} { |
| 14 | puts [query $stmt col string 0] " " [query $stmt col string 1] \n |
| 15 | } |
| 16 | query $stmt finalize |
| 17 | return 0 |
| 18 | } rc |
| 19 | if {0 != $rc} { |
| 20 |