/ Check-in [45277238]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add many new integer boundary value tests. Ticket #3536. (CVS 6025)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 45277238d355caa1fbeea67c6c6d1a8f231eabda
User & Date: drh 2008-12-12 19:19:22
Context
2008-12-14
02:55
Fix the name of the source algorithm in the comments of the script generators for the recently checked-in test cases for integer boundary-value testing. (CVS 6026) check-in: adba0f3c user: drh tags: trunk
2008-12-12
19:19
Add many new integer boundary value tests. Ticket #3536. (CVS 6025) check-in: 45277238 user: drh tags: trunk
17:56
Rework the rowid lookup logic in the query optimizer to fix various boundary value problems. Ticket #3536. Renamed the OP_MoveXX opcodes to OP_SeekXX. (CVS 6024) check-in: e545490a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added test/boundary1.tcl.

            1  +puts {# 2008 December 11
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library.
           12  +#
           13  +# This file is automatically generated from a separate TCL script.
           14  +# This file seeks to exercise integer boundary values.
           15  +#
           16  +# $Id: boundary1.tcl,v 1.1 2008/12/12 19:19:22 drh Exp $
           17  +
           18  +set testdir [file dirname $argv0]
           19  +source $testdir/tester.tcl
           20  +}
           21  +
           22  +expr srand(0)
           23  +
           24  +# Generate interesting boundary numbers
           25  +#
           26  +foreach x {
           27  +  0
           28  +  1
           29  +  0x7f
           30  +  0x7fff
           31  +  0x7fffff
           32  +  0x7fffffff
           33  +  0x7fffffffff
           34  +  0x7fffffffffff
           35  +  0x7fffffffffffff
           36  +  0x7fffffffffffffff
           37  +} {
           38  +  set x [expr {wide($x)}]
           39  +  set boundarynum($x) 1
           40  +  set boundarynum([expr {$x+1}]) 1
           41  +  set boundarynum([expr {-($x+1)}]) 1
           42  +  set boundarynum([expr {-($x+2)}]) 1
           43  +  set boundarynum([expr {$x+$x+1}]) 1
           44  +  set boundarynum([expr {$x+$x+2}]) 1
           45  +}
           46  +set x [expr {wide(127)}]
           47  +for {set i 1} {$i<=9} {incr i} {
           48  +  set boundarynum($x) 1
           49  +  set boundarynum([expr {$x+1}]) 1
           50  +  set x [expr {wide($x*128 + 127)}]
           51  +}
           52  +
           53  +# Scramble the $inlist into a random order.
           54  +#
           55  +proc scramble {inlist} {
           56  +  set y {}
           57  +  foreach x $inlist {
           58  +    lappend y [list [expr {rand()}] $x]
           59  +  }
           60  +  set y [lsort $y]
           61  +  set outlist {}
           62  +  foreach x $y {
           63  +    lappend outlist [lindex $x 1]
           64  +  }
           65  +  return $outlist
           66  +}
           67  +
           68  +# A simple magnitude source.  Not trying to be efficient.
           69  +#
           70  +proc sort {inlist} {
           71  +  set outlist {}
           72  +  set mn [lindex $inlist 0]
           73  +  foreach x $inlist {
           74  +    if {$x<$mn} {set mn $x}
           75  +  }
           76  +  set outlist $mn
           77  +  set mx $mn
           78  +  while {1} {
           79  +    set valid 0
           80  +    foreach x $inlist {
           81  +      if {$x>$mx && (!$valid || $mn>$x)} {
           82  +        set mn $x
           83  +        set valid 1
           84  +      }
           85  +    }
           86  +    if {!$valid} break
           87  +    lappend outlist $mn
           88  +    set mx $mn
           89  +  }
           90  +  return $outlist
           91  +}
           92  +
           93  +# Reverse the order of a list
           94  +#
           95  +proc reverse {inlist} {
           96  +  set i [llength $inlist]
           97  +  set outlist {}
           98  +  for {incr i -1} {$i>=0} {incr i -1} {
           99  +    lappend outlist [lindex $inlist $i]
          100  +  }
          101  +  return $outlist
          102  +}
          103  +
          104  +set nums1 [scramble [array names boundarynum]]
          105  +set nums2 [scramble [array names boundarynum]]
          106  +
          107  +set tname boundary1
          108  +puts "do_test $tname-1.1 \173"
          109  +puts "  db eval \173"
          110  +puts "    CREATE TABLE t1(a,x);"
          111  +set a 0
          112  +foreach r $nums1 {
          113  +  incr a
          114  +  set t1ra($r) $a
          115  +  set t1ar($a) $r
          116  +  set x [format %08x%08x [expr {wide($r)>>32}] $r]
          117  +  set t1rx($r) $x
          118  +  set t1xr($x) $r
          119  +  puts "    INSERT INTO t1(oid,a,x) VALUES($r,$a,'$x');"
          120  +}
          121  +puts "    CREATE INDEX t1i1 ON t1(a);"
          122  +puts "    CREATE INDEX t1i2 ON t1(x);"
          123  +puts "  \175"
          124  +puts "\175 {}"
          125  +
          126  +puts "do_test $tname-1.2 \173"
          127  +puts "  db eval \173"
          128  +puts "    SELECT count(*) FROM t1"
          129  +puts "  \175"
          130  +puts "\175 {64}"
          131  +
          132  +set nums3 $nums2
          133  +lappend nums3 9.22337303685477580800e+18
          134  +lappend nums3 -9.22337303685477580800e+18
          135  +
          136  +set i 0
          137  +foreach r $nums3 {
          138  +  incr i
          139  +
          140  +  if {abs($r)<9.22337203685477580800e+18} {
          141  +    set x $t1rx($r)
          142  +    set a $t1ra($r)
          143  +    set r5 $r.5
          144  +    set r0 $r.0
          145  +    puts "do_test $tname-2.$i.1 \173"
          146  +    puts "  db eval \173"
          147  +    puts "    SELECT * FROM t1 WHERE rowid=$r"
          148  +    puts "  \175"
          149  +    puts "\175 {$a $x}"
          150  +    puts "do_test $tname-2.$i.2 \173"
          151  +    puts "  db eval \173"
          152  +    puts "    SELECT rowid, a FROM t1 WHERE x='$x'"
          153  +    puts "  \175"
          154  +    puts "\175 {$r $a}"
          155  +    puts "do_test $tname-2.$i.3 \173"
          156  +    puts "  db eval \173"
          157  +    puts "    SELECT rowid, x FROM t1 WHERE a=$a"
          158  +    puts "  \175"
          159  +    puts "\175 {$r $x}"
          160  +  }
          161  +
          162  +  foreach op {> >= < <=} subno {gt ge lt le} {
          163  +
          164  +    ################################################################ 2.x.y.1
          165  +    set rset {}
          166  +    set aset {}
          167  +    foreach rx $nums2 {
          168  +      if "\$rx $op \$r" {
          169  +        lappend rset $rx
          170  +        lappend aset $t1ra($rx)
          171  +      }
          172  +    }
          173  +    puts "do_test $tname-2.$i.$subno.1 \173"
          174  +    puts "  db eval \173"
          175  +    puts "    SELECT a FROM t1 WHERE rowid $op $r ORDER BY a"
          176  +    puts "  \175"
          177  +    puts "\175 {[sort $aset]}"
          178  +  
          179  +    ################################################################ 2.x.y.2
          180  +    puts "do_test $tname-2.$i.$subno.2 \173"
          181  +    puts "  db eval \173"
          182  +    puts "    SELECT a FROM t1 WHERE rowid $op $r ORDER BY a DESC"
          183  +    puts "  \175"
          184  +    puts "\175 {[reverse [sort $aset]]}"
          185  +  
          186  +    ################################################################ 2.x.y.3
          187  +    set aset {}
          188  +    foreach rx [sort $rset] {
          189  +      lappend aset $t1ra($rx)
          190  +    }
          191  +    puts "do_test $tname-2.$i.$subno.3 \173"
          192  +    puts "  db eval \173"
          193  +    puts "    SELECT a FROM t1 WHERE rowid $op $r ORDER BY rowid"
          194  +    puts "  \175"
          195  +    puts "\175 {$aset}"
          196  +  
          197  +    ################################################################ 2.x.y.4
          198  +    set aset {}
          199  +    foreach rx [reverse [sort $rset]] {
          200  +      lappend aset $t1ra($rx)
          201  +    }
          202  +    puts "do_test $tname-2.$i.$subno.4 \173"
          203  +    puts "  db eval \173"
          204  +    puts "    SELECT a FROM t1 WHERE rowid $op $r ORDER BY rowid DESC"
          205  +    puts "  \175"
          206  +    puts "\175 {$aset}"
          207  +  
          208  +    ################################################################ 2.x.y.5
          209  +    set aset {}
          210  +    set xset {}
          211  +    foreach rx $rset {
          212  +      lappend xset $t1rx($rx)
          213  +    }
          214  +    foreach x [sort $xset] {
          215  +      set rx $t1xr($x)
          216  +      lappend aset $t1ra($rx)
          217  +    }
          218  +    puts "do_test $tname-2.$i.$subno.5 \173"
          219  +    puts "  db eval \173"
          220  +    puts "    SELECT a FROM t1 WHERE rowid $op $r ORDER BY x"
          221  +    puts "  \175"
          222  +    puts "\175 {$aset}"
          223  +  
          224  +    ################################################################ 2.x.y.10
          225  +    if {abs($r)>9223372036854775808 || [string length $r5]>15} continue
          226  +    set rset {}
          227  +    set aset {}
          228  +    foreach rx $nums2 {
          229  +      if "\$rx $op \$r0" {
          230  +        lappend rset $rx
          231  +      }
          232  +    }
          233  +    foreach rx [sort $rset] {
          234  +      lappend aset $t1ra($rx)
          235  +    }
          236  +    puts "do_test $tname-2.$i.$subno.10 \173"
          237  +    puts "  db eval \173"
          238  +    puts "    SELECT a FROM t1 WHERE rowid $op $r0 ORDER BY rowid"
          239  +    puts "  \175"
          240  +    puts "\175 {$aset}"
          241  +  
          242  +    ################################################################ 2.x.y.11
          243  +    set aset {}
          244  +    foreach rx [reverse [sort $rset]] {
          245  +      lappend aset $t1ra($rx)
          246  +    }
          247  +    puts "do_test $tname-2.$i.$subno.11 \173"
          248  +    puts "  db eval \173"
          249  +    puts "    SELECT a FROM t1 WHERE rowid $op $r0 ORDER BY rowid DESC"
          250  +    puts "  \175"
          251  +    puts "\175 {$aset}"
          252  +
          253  +
          254  +    ################################################################ 2.x.y.12
          255  +    set rset {}
          256  +    set aset {}
          257  +    foreach rx $nums2 {
          258  +      if "\$rx $op \$r5" {
          259  +        lappend rset $rx
          260  +      }
          261  +    }
          262  +    foreach rx [sort $rset] {
          263  +      lappend aset $t1ra($rx)
          264  +    }
          265  +    puts "do_test $tname-2.$i.$subno.12 \173"
          266  +    puts "  db eval \173"
          267  +    puts "    SELECT a FROM t1 WHERE rowid $op $r5 ORDER BY rowid"
          268  +    puts "  \175"
          269  +    puts "\175 {$aset}"
          270  +  
          271  +    ################################################################ 2.x.y.13
          272  +    set aset {}
          273  +    foreach rx [reverse [sort $rset]] {
          274  +      lappend aset $t1ra($rx)
          275  +    }
          276  +    puts "do_test $tname-2.$i.$subno.13 \173"
          277  +    puts "  db eval \173"
          278  +    puts "    SELECT a FROM t1 WHERE rowid $op $r5 ORDER BY rowid DESC"
          279  +    puts "  \175"
          280  +    puts "\175 {$aset}"
          281  +  }
          282  +  
          283  +}
          284  +
          285  +
          286  +puts {finish_test}

Added test/boundary2.tcl.

            1  +puts {# 2008 December 11
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library.
           12  +#
           13  +# This file is automatically generated from a separate TCL script.
           14  +# This file seeks to exercise integer boundary values.
           15  +#
           16  +# $Id: boundary2.tcl,v 1.1 2008/12/12 19:19:22 drh Exp $
           17  +
           18  +set testdir [file dirname $argv0]
           19  +source $testdir/tester.tcl
           20  +}
           21  +
           22  +expr srand(0)
           23  +
           24  +# Generate interesting boundary numbers
           25  +#
           26  +foreach x {
           27  +  0
           28  +  1
           29  +  0x7f
           30  +  0x7fff
           31  +  0x7fffff
           32  +  0x7fffffff
           33  +  0x7fffffffff
           34  +  0x7fffffffffff
           35  +  0x7fffffffffffff
           36  +  0x7fffffffffffffff
           37  +} {
           38  +  set x [expr {wide($x)}]
           39  +  set boundarynum($x) 1
           40  +  set boundarynum([expr {$x+1}]) 1
           41  +  set boundarynum([expr {-($x+1)}]) 1
           42  +  set boundarynum([expr {-($x+2)}]) 1
           43  +  set boundarynum([expr {$x+$x+1}]) 1
           44  +  set boundarynum([expr {$x+$x+2}]) 1
           45  +}
           46  +set x [expr {wide(127)}]
           47  +for {set i 1} {$i<=9} {incr i} {
           48  +  set boundarynum($x) 1
           49  +  set boundarynum([expr {$x+1}]) 1
           50  +  set x [expr {wide($x*128 + 127)}]
           51  +}
           52  +
           53  +# Scramble the $inlist into a random order.
           54  +#
           55  +proc scramble {inlist} {
           56  +  set y {}
           57  +  foreach x $inlist {
           58  +    lappend y [list [expr {rand()}] $x]
           59  +  }
           60  +  set y [lsort $y]
           61  +  set outlist {}
           62  +  foreach x $y {
           63  +    lappend outlist [lindex $x 1]
           64  +  }
           65  +  return $outlist
           66  +}
           67  +
           68  +# A simple magnitude source.  Not trying to be efficient.
           69  +#
           70  +proc sort {inlist} {
           71  +  set outlist {}
           72  +  set mn [lindex $inlist 0]
           73  +  foreach x $inlist {
           74  +    if {$x<$mn} {set mn $x}
           75  +  }
           76  +  set outlist $mn
           77  +  set mx $mn
           78  +  while {1} {
           79  +    set valid 0
           80  +    foreach x $inlist {
           81  +      if {$x>$mx && (!$valid || $mn>$x)} {
           82  +        set mn $x
           83  +        set valid 1
           84  +      }
           85  +    }
           86  +    if {!$valid} break
           87  +    lappend outlist $mn
           88  +    set mx $mn
           89  +  }
           90  +  return $outlist
           91  +}
           92  +
           93  +# Reverse the order of a list
           94  +#
           95  +proc reverse {inlist} {
           96  +  set i [llength $inlist]
           97  +  set outlist {}
           98  +  for {incr i -1} {$i>=0} {incr i -1} {
           99  +    lappend outlist [lindex $inlist $i]
          100  +  }
          101  +  return $outlist
          102  +}
          103  +
          104  +set nums1 [scramble [array names boundarynum]]
          105  +set nums2 [scramble [array names boundarynum]]
          106  +
          107  +set tname boundary2
          108  +puts "do_test $tname-1.1 \173"
          109  +puts "  db eval \173"
          110  +puts "    CREATE TABLE t1(r INTEGER, a INTEGER, x TEXT);"
          111  +set a 0
          112  +foreach r $nums1 {
          113  +  incr a
          114  +  set t1ra($r) $a
          115  +  set t1ar($a) $r
          116  +  set x [format %08x%08x [expr {wide($r)>>32}] $r]
          117  +  set t1rx($r) $x
          118  +  set t1xr($x) $r
          119  +  puts "    INSERT INTO t1 VALUES($r,$a,'$x');"
          120  +}
          121  +puts "    CREATE INDEX t1i1 ON t1(r);"
          122  +puts "    CREATE INDEX t1i2 ON t1(a);"
          123  +puts "    CREATE INDEX t1i3 ON t1(x);"
          124  +puts "  \175"
          125  +puts "\175 {}"
          126  +
          127  +puts "do_test $tname-1.2 \173"
          128  +puts "  db eval \173"
          129  +puts "    SELECT count(*) FROM t1"
          130  +puts "  \175"
          131  +puts "\175 {64}"
          132  +
          133  +set nums3 $nums2
          134  +lappend nums3 9.22337303685477580800e+18
          135  +lappend nums3 -9.22337303685477580800e+18
          136  +
          137  +set i 0
          138  +foreach r $nums3 {
          139  +  incr i
          140  +
          141  +  if {abs($r)<9.22337203685477580800e+18} {
          142  +    set x $t1rx($r)
          143  +    set a $t1ra($r)
          144  +    set r5 $r.5
          145  +    set r0 $r.0
          146  +    puts "do_test $tname-2.$i.1 \173"
          147  +    puts "  db eval \173"
          148  +    puts "    SELECT * FROM t1 WHERE r=$r"
          149  +    puts "  \175"
          150  +    puts "\175 {$r $a $x}"
          151  +    puts "do_test $tname-2.$i.2 \173"
          152  +    puts "  db eval \173"
          153  +    puts "    SELECT r, a FROM t1 WHERE x='$x'"
          154  +    puts "  \175"
          155  +    puts "\175 {$r $a}"
          156  +    puts "do_test $tname-2.$i.3 \173"
          157  +    puts "  db eval \173"
          158  +    puts "    SELECT r, x FROM t1 WHERE a=$a"
          159  +    puts "  \175"
          160  +    puts "\175 {$r $x}"
          161  +  }
          162  +
          163  +  foreach op {> >= < <=} subno {gt ge lt le} {
          164  +
          165  +    ################################################################ 2.x.y.1
          166  +    set rset {}
          167  +    set aset {}
          168  +    foreach rx $nums2 {
          169  +      if "\$rx $op \$r" {
          170  +        lappend rset $rx
          171  +        lappend aset $t1ra($rx)
          172  +      }
          173  +    }
          174  +    puts "do_test $tname-2.$i.$subno.1 \173"
          175  +    puts "  db eval \173"
          176  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY a"
          177  +    puts "  \175"
          178  +    puts "\175 {[sort $aset]}"
          179  +  
          180  +    ################################################################ 2.x.y.2
          181  +    puts "do_test $tname-2.$i.$subno.2 \173"
          182  +    puts "  db eval \173"
          183  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY a DESC"
          184  +    puts "  \175"
          185  +    puts "\175 {[reverse [sort $aset]]}"
          186  +  
          187  +    ################################################################ 2.x.y.3
          188  +    set aset {}
          189  +    foreach rx [sort $rset] {
          190  +      lappend aset $t1ra($rx)
          191  +    }
          192  +    puts "do_test $tname-2.$i.$subno.3 \173"
          193  +    puts "  db eval \173"
          194  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY r"
          195  +    puts "  \175"
          196  +    puts "\175 {$aset}"
          197  +  
          198  +    ################################################################ 2.x.y.4
          199  +    set aset {}
          200  +    foreach rx [reverse [sort $rset]] {
          201  +      lappend aset $t1ra($rx)
          202  +    }
          203  +    puts "do_test $tname-2.$i.$subno.4 \173"
          204  +    puts "  db eval \173"
          205  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY r DESC"
          206  +    puts "  \175"
          207  +    puts "\175 {$aset}"
          208  +  
          209  +    ################################################################ 2.x.y.5
          210  +    set aset {}
          211  +    set xset {}
          212  +    foreach rx $rset {
          213  +      lappend xset $t1rx($rx)
          214  +    }
          215  +    foreach x [sort $xset] {
          216  +      set rx $t1xr($x)
          217  +      lappend aset $t1ra($rx)
          218  +    }
          219  +    puts "do_test $tname-2.$i.$subno.5 \173"
          220  +    puts "  db eval \173"
          221  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY x"
          222  +    puts "  \175"
          223  +    puts "\175 {$aset}"
          224  +  
          225  +    ################################################################ 2.x.y.10
          226  +    if {abs($r)>9223372036854775808 || [string length $r5]>15} continue
          227  +    set rset {}
          228  +    set aset {}
          229  +    foreach rx $nums2 {
          230  +      if "\$rx $op \$r0" {
          231  +        lappend rset $rx
          232  +      }
          233  +    }
          234  +    foreach rx [sort $rset] {
          235  +      lappend aset $t1ra($rx)
          236  +    }
          237  +    puts "do_test $tname-2.$i.$subno.10 \173"
          238  +    puts "  db eval \173"
          239  +    puts "    SELECT a FROM t1 WHERE r $op $r0 ORDER BY r"
          240  +    puts "  \175"
          241  +    puts "\175 {$aset}"
          242  +  
          243  +    ################################################################ 2.x.y.11
          244  +    set aset {}
          245  +    foreach rx [reverse [sort $rset]] {
          246  +      lappend aset $t1ra($rx)
          247  +    }
          248  +    puts "do_test $tname-2.$i.$subno.11 \173"
          249  +    puts "  db eval \173"
          250  +    puts "    SELECT a FROM t1 WHERE r $op $r0 ORDER BY r DESC"
          251  +    puts "  \175"
          252  +    puts "\175 {$aset}"
          253  +
          254  +
          255  +    ################################################################ 2.x.y.12
          256  +    set rset {}
          257  +    set aset {}
          258  +    foreach rx $nums2 {
          259  +      if "\$rx $op \$r5" {
          260  +        lappend rset $rx
          261  +      }
          262  +    }
          263  +    foreach rx [sort $rset] {
          264  +      lappend aset $t1ra($rx)
          265  +    }
          266  +    puts "do_test $tname-2.$i.$subno.12 \173"
          267  +    puts "  db eval \173"
          268  +    puts "    SELECT a FROM t1 WHERE r $op $r5 ORDER BY r"
          269  +    puts "  \175"
          270  +    puts "\175 {$aset}"
          271  +  
          272  +    ################################################################ 2.x.y.13
          273  +    set aset {}
          274  +    foreach rx [reverse [sort $rset]] {
          275  +      lappend aset $t1ra($rx)
          276  +    }
          277  +    puts "do_test $tname-2.$i.$subno.13 \173"
          278  +    puts "  db eval \173"
          279  +    puts "    SELECT a FROM t1 WHERE r $op $r5 ORDER BY r DESC"
          280  +    puts "  \175"
          281  +    puts "\175 {$aset}"
          282  +  }
          283  +}
          284  +
          285  +puts "do_test $tname-3.1 \173"
          286  +puts "  db eval \173"
          287  +puts "    DROP INDEX t1i1;"
          288  +puts "    DROP INDEX t1i2;"
          289  +puts "    DROP INDEX t1i3;"
          290  +puts "  \175"
          291  +puts "\175 {}"
          292  +
          293  +set i 0
          294  +foreach r $nums3 {
          295  +  incr i
          296  +
          297  +  if {abs($r)<9.22337203685477580800e+18} {
          298  +    set x $t1rx($r)
          299  +    set a $t1ra($r)
          300  +    set r5 $r.5
          301  +    set r0 $r.0
          302  +    puts "do_test $tname-4.$i.1 \173"
          303  +    puts "  db eval \173"
          304  +    puts "    SELECT * FROM t1 WHERE r=$r"
          305  +    puts "  \175"
          306  +    puts "\175 {$r $a $x}"
          307  +    puts "do_test $tname-4.$i.2 \173"
          308  +    puts "  db eval \173"
          309  +    puts "    SELECT r, a FROM t1 WHERE x='$x'"
          310  +    puts "  \175"
          311  +    puts "\175 {$r $a}"
          312  +    puts "do_test $tname-4.$i.3 \173"
          313  +    puts "  db eval \173"
          314  +    puts "    SELECT r, x FROM t1 WHERE a=$a"
          315  +    puts "  \175"
          316  +    puts "\175 {$r $x}"
          317  +  }
          318  +
          319  +  foreach op {> >= < <=} subno {gt ge lt le} {
          320  +
          321  +    ################################################################ 2.x.y.1
          322  +    set rset {}
          323  +    set aset {}
          324  +    foreach rx $nums2 {
          325  +      if "\$rx $op \$r" {
          326  +        lappend rset $rx
          327  +        lappend aset $t1ra($rx)
          328  +      }
          329  +    }
          330  +    puts "do_test $tname-4.$i.$subno.1 \173"
          331  +    puts "  db eval \173"
          332  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY a"
          333  +    puts "  \175"
          334  +    puts "\175 {[sort $aset]}"
          335  +  
          336  +    ################################################################ 2.x.y.2
          337  +    puts "do_test $tname-4.$i.$subno.2 \173"
          338  +    puts "  db eval \173"
          339  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY a DESC"
          340  +    puts "  \175"
          341  +    puts "\175 {[reverse [sort $aset]]}"
          342  +  
          343  +    ################################################################ 2.x.y.3
          344  +    set aset {}
          345  +    foreach rx [sort $rset] {
          346  +      lappend aset $t1ra($rx)
          347  +    }
          348  +    puts "do_test $tname-4.$i.$subno.3 \173"
          349  +    puts "  db eval \173"
          350  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY r"
          351  +    puts "  \175"
          352  +    puts "\175 {$aset}"
          353  +  
          354  +    ################################################################ 2.x.y.4
          355  +    set aset {}
          356  +    foreach rx [reverse [sort $rset]] {
          357  +      lappend aset $t1ra($rx)
          358  +    }
          359  +    puts "do_test $tname-4.$i.$subno.4 \173"
          360  +    puts "  db eval \173"
          361  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY r DESC"
          362  +    puts "  \175"
          363  +    puts "\175 {$aset}"
          364  +  
          365  +    ################################################################ 2.x.y.5
          366  +    set aset {}
          367  +    set xset {}
          368  +    foreach rx $rset {
          369  +      lappend xset $t1rx($rx)
          370  +    }
          371  +    foreach x [sort $xset] {
          372  +      set rx $t1xr($x)
          373  +      lappend aset $t1ra($rx)
          374  +    }
          375  +    puts "do_test $tname-4.$i.$subno.5 \173"
          376  +    puts "  db eval \173"
          377  +    puts "    SELECT a FROM t1 WHERE r $op $r ORDER BY x"
          378  +    puts "  \175"
          379  +    puts "\175 {$aset}"
          380  +  
          381  +    ################################################################ 2.x.y.10
          382  +    if {abs($r)>9223372036854775808 || [string length $r5]>15} continue
          383  +    set rset {}
          384  +    set aset {}
          385  +    foreach rx $nums2 {
          386  +      if "\$rx $op \$r0" {
          387  +        lappend rset $rx
          388  +      }
          389  +    }
          390  +    foreach rx [sort $rset] {
          391  +      lappend aset $t1ra($rx)
          392  +    }
          393  +    puts "do_test $tname-4.$i.$subno.10 \173"
          394  +    puts "  db eval \173"
          395  +    puts "    SELECT a FROM t1 WHERE r $op $r0 ORDER BY r"
          396  +    puts "  \175"
          397  +    puts "\175 {$aset}"
          398  +  
          399  +    ################################################################ 2.x.y.11
          400  +    set aset {}
          401  +    foreach rx [reverse [sort $rset]] {
          402  +      lappend aset $t1ra($rx)
          403  +    }
          404  +    puts "do_test $tname-4.$i.$subno.11 \173"
          405  +    puts "  db eval \173"
          406  +    puts "    SELECT a FROM t1 WHERE r $op $r0 ORDER BY r DESC"
          407  +    puts "  \175"
          408  +    puts "\175 {$aset}"
          409  +
          410  +
          411  +    ################################################################ 2.x.y.12
          412  +    set rset {}
          413  +    set aset {}
          414  +    foreach rx $nums2 {
          415  +      if "\$rx $op \$r5" {
          416  +        lappend rset $rx
          417  +      }
          418  +    }
          419  +    foreach rx [sort $rset] {
          420  +      lappend aset $t1ra($rx)
          421  +    }
          422  +    puts "do_test $tname-4.$i.$subno.12 \173"
          423  +    puts "  db eval \173"
          424  +    puts "    SELECT a FROM t1 WHERE r $op $r5 ORDER BY r"
          425  +    puts "  \175"
          426  +    puts "\175 {$aset}"
          427  +  
          428  +    ################################################################ 2.x.y.13
          429  +    set aset {}
          430  +    foreach rx [reverse [sort $rset]] {
          431  +      lappend aset $t1ra($rx)
          432  +    }
          433  +    puts "do_test $tname-4.$i.$subno.13 \173"
          434  +    puts "  db eval \173"
          435  +    puts "    SELECT a FROM t1 WHERE r $op $r5 ORDER BY r DESC"
          436  +    puts "  \175"
          437  +    puts "\175 {$aset}"
          438  +  }
          439  +}
          440  +
          441  +
          442  +puts {finish_test}

Added test/boundary2.test.

more than 10,000 changes

Added test/boundary3.tcl.

            1  +puts {# 2008 December 11
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library.
           12  +#
           13  +# This file is automatically generated from a separate TCL script.
           14  +# This file seeks to exercise integer boundary values.
           15  +#
           16  +# $Id: boundary3.tcl,v 1.1 2008/12/12 19:19:22 drh Exp $
           17  +
           18  +set testdir [file dirname $argv0]
           19  +source $testdir/tester.tcl
           20  +}
           21  +
           22  +expr srand(0)
           23  +
           24  +# Generate interesting boundary numbers
           25  +#
           26  +foreach x {
           27  +  0
           28  +  1
           29  +  0x7f
           30  +  0x7fff
           31  +  0x7fffff
           32  +  0x7fffffff
           33  +  0x7fffffffff
           34  +  0x7fffffffffff
           35  +  0x7fffffffffffff
           36  +  0x7fffffffffffffff
           37  +} {
           38  +  set x [expr {wide($x)}]
           39  +  set boundarynum($x) 1
           40  +  set boundarynum([expr {$x+1}]) 1
           41  +  set boundarynum([expr {-($x+1)}]) 1
           42  +  set boundarynum([expr {-($x+2)}]) 1
           43  +  set boundarynum([expr {$x+$x+1}]) 1
           44  +  set boundarynum([expr {$x+$x+2}]) 1
           45  +}
           46  +set x [expr {wide(127)}]
           47  +for {set i 1} {$i<=9} {incr i} {
           48  +  set boundarynum($x) 1
           49  +  set boundarynum([expr {$x+1}]) 1
           50  +  set x [expr {wide($x*128 + 127)}]
           51  +}
           52  +
           53  +# Scramble the $inlist into a random order.
           54  +#
           55  +proc scramble {inlist} {
           56  +  set y {}
           57  +  foreach x $inlist {
           58  +    lappend y [list [expr {rand()}] $x]
           59  +  }
           60  +  set y [lsort $y]
           61  +  set outlist {}
           62  +  foreach x $y {
           63  +    lappend outlist [lindex $x 1]
           64  +  }
           65  +  return $outlist
           66  +}
           67  +
           68  +# A simple magnitude source.  Not trying to be efficient.
           69  +#
           70  +proc sort {inlist} {
           71  +  set outlist {}
           72  +  set mn [lindex $inlist 0]
           73  +  foreach x $inlist {
           74  +    if {$x<$mn} {set mn $x}
           75  +  }
           76  +  set outlist $mn
           77  +  set mx $mn
           78  +  while {1} {
           79  +    set valid 0
           80  +    foreach x $inlist {
           81  +      if {$x>$mx && (!$valid || $mn>$x)} {
           82  +        set mn $x
           83  +        set valid 1
           84  +      }
           85  +    }
           86  +    if {!$valid} break
           87  +    lappend outlist $mn
           88  +    set mx $mn
           89  +  }
           90  +  return $outlist
           91  +}
           92  +
           93  +# Reverse the order of a list
           94  +#
           95  +proc reverse {inlist} {
           96  +  set i [llength $inlist]
           97  +  set outlist {}
           98  +  for {incr i -1} {$i>=0} {incr i -1} {
           99  +    lappend outlist [lindex $inlist $i]
          100  +  }
          101  +  return $outlist
          102  +}
          103  +
          104  +set nums1 [scramble [array names boundarynum]]
          105  +set nums2 [scramble [array names boundarynum]]
          106  +
          107  +set tname boundary3
          108  +puts "do_test $tname-1.1 \173"
          109  +puts "  db eval \173"
          110  +puts "    CREATE TABLE t1(a,x);"
          111  +set a 0
          112  +foreach r $nums1 {
          113  +  incr a
          114  +  set t1ra($r) $a
          115  +  set t1ar($a) $r
          116  +  set x [format %08x%08x [expr {wide($r)>>32}] $r]
          117  +  set t1rx($r) $x
          118  +  set t1xr($x) $r
          119  +  puts "    INSERT INTO t1(oid,a,x) VALUES($r,$a,'$x');"
          120  +}
          121  +puts "    CREATE INDEX t1i1 ON t1(a);"
          122  +puts "    CREATE INDEX t1i2 ON t1(x);"
          123  +puts "  \175"
          124  +puts "\175 {}"
          125  +
          126  +puts "do_test $tname-1.2 \173"
          127  +puts "  db eval \173"
          128  +puts "    SELECT count(*) FROM t1"
          129  +puts "  \175"
          130  +puts "\175 {64}"
          131  +
          132  +puts "do_test $tname-1.3 \173"
          133  +puts "  db eval \173"
          134  +puts "    CREATE TABLE t2(r,a);"
          135  +puts "    INSERT INTO t2 SELECT rowid, a FROM t1;"
          136  +puts "    CREATE INDEX t2i1 ON t2(r);"
          137  +puts "    CREATE INDEX t2i2 ON t2(a);"
          138  +puts "    INSERT INTO t2 VALUES(9.22337303685477580800e+18,65);"
          139  +set t1ra(9.22337303685477580800e+18) 65
          140  +set t1ar(65) 9.22337303685477580800e+18)
          141  +puts "    INSERT INTO t2 VALUES(-9.22337303685477580800e+18,66);"
          142  +set t1ra(-9.22337303685477580800e+18) 66
          143  +set t1ar(66) -9.22337303685477580800e+18)
          144  +puts "    SELECT count(*) FROM t2;"
          145  +puts "  \175"
          146  +puts "\175 {66}"
          147  +
          148  +set nums3 $nums2
          149  +lappend nums3 9.22337303685477580800e+18
          150  +lappend nums3 -9.22337303685477580800e+18
          151  +
          152  +set i 0
          153  +foreach r $nums3 {
          154  +  incr i
          155  +
          156  +  set r5 $r.5
          157  +  set r0 $r.0
          158  +  if {abs($r)<9.22337203685477580800e+18} {
          159  +    set x $t1rx($r)
          160  +    set a $t1ra($r)
          161  +    puts "do_test $tname-2.$i.1 \173"
          162  +    puts "  db eval \173"
          163  +    puts "    SELECT t1.* FROM t1, t2 WHERE t1.rowid=$r AND t2.a=t1.a"
          164  +    puts "  \175"
          165  +    puts "\175 {$a $x}"
          166  +    puts "do_test $tname-2.$i.2 \173"
          167  +    puts "  db eval \173"
          168  +    puts "    SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='$x'"
          169  +    puts "  \175"
          170  +    puts "\175 {$r $a}"
          171  +    puts "do_test $tname-2.$i.3 \173"
          172  +    puts "  db eval \173"
          173  +    puts "    SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=$a"
          174  +    puts "  \175"
          175  +    puts "\175 {$r $x}"
          176  +  }
          177  +
          178  +  foreach op {> >= < <=} subno {gt ge lt le} {
          179  +
          180  +    ################################################################ 2.x.y.1
          181  +    set rset {}
          182  +    set aset {}
          183  +    foreach rx $nums2 {
          184  +      if "\$rx $op \$r" {
          185  +        lappend rset $rx
          186  +        lappend aset $t1ra($rx)
          187  +      }
          188  +    }
          189  +    puts "do_test $tname-2.$i.$subno.1 \173"
          190  +    puts "  db eval \173"
          191  +    puts "    SELECT t2.a FROM t1 JOIN t2 USING(a)"
          192  +    puts "     WHERE t1.rowid $op $r ORDER BY t2.a"
          193  +    puts "  \175"
          194  +    puts "\175 {[sort $aset]}"
          195  +  
          196  +    ################################################################ 2.x.y.2
          197  +    puts "do_test $tname-2.$i.$subno.2 \173"
          198  +    puts "  db eval \173"
          199  +    puts "    SELECT t2.a FROM t2 NATURAL JOIN t1"
          200  +    puts "     WHERE t1.rowid $op $r ORDER BY t1.a DESC"
          201  +    puts "  \175"
          202  +    puts "\175 {[reverse [sort $aset]]}"
          203  +
          204  +
          205  +    ################################################################ 2.x.y.3
          206  +    set ax $t1ra($r)
          207  +    set aset {}
          208  +    foreach rx [sort $rset] {
          209  +      lappend aset $t1ra($rx)
          210  +    }
          211  +    puts "do_test $tname-2.$i.$subno.3 \173"
          212  +    puts "  db eval \173"
          213  +    puts "    SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op t2.r"
          214  +    puts "     WHERE t2.a=$ax"
          215  +    puts "     ORDER BY t1.rowid"
          216  +    puts "  \175"
          217  +    puts "\175 {$aset}"
          218  +  
          219  +    ################################################################ 2.x.y.4
          220  +    set aset {}
          221  +    foreach rx [reverse [sort $rset]] {
          222  +      lappend aset $t1ra($rx)
          223  +    }
          224  +    puts "do_test $tname-2.$i.$subno.4 \173"
          225  +    puts "  db eval \173"
          226  +    puts "    SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op t2.r"
          227  +    puts "     WHERE t2.a=$ax"
          228  +    puts "     ORDER BY t1.rowid DESC"
          229  +    puts "  \175"
          230  +    puts "\175 {$aset}"
          231  +  
          232  +    ################################################################ 2.x.y.5
          233  +    set aset {}
          234  +    set xset {}
          235  +    foreach rx $rset {
          236  +      lappend xset $t1rx($rx)
          237  +    }
          238  +    foreach x [sort $xset] {
          239  +      set rx $t1xr($x)
          240  +      lappend aset $t1ra($rx)
          241  +    }
          242  +    puts "do_test $tname-2.$i.$subno.5 \173"
          243  +    puts "  db eval \173"
          244  +    puts "    SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op t2.r"
          245  +    puts "     WHERE t2.a=$ax"
          246  +    puts "     ORDER BY x"
          247  +    puts "  \175"
          248  +    puts "\175 {$aset}"
          249  +  
          250  +    ################################################################ 2.x.y.10
          251  +    if {[string length $r5]>15} continue
          252  +    set rset {}
          253  +    set aset {}
          254  +    foreach rx $nums2 {
          255  +      if "\$rx $op \$r0" {
          256  +        lappend rset $rx
          257  +      }
          258  +    }
          259  +    foreach rx [sort $rset] {
          260  +      lappend aset $t1ra($rx)
          261  +    }
          262  +    puts "do_test $tname-2.$i.$subno.10 \173"
          263  +    puts "  db eval \173"
          264  +    puts "    SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op CAST(t2.r AS real)"
          265  +    puts "     WHERE t2.a=$ax"
          266  +    puts "     ORDER BY t1.rowid"
          267  +    puts "  \175"
          268  +    puts "\175 {$aset}"
          269  +  
          270  +    ################################################################ 2.x.y.11
          271  +    set aset {}
          272  +    foreach rx [reverse [sort $rset]] {
          273  +      lappend aset $t1ra($rx)
          274  +    }
          275  +    puts "do_test $tname-2.$i.$subno.11 \173"
          276  +    puts "  db eval \173"
          277  +    puts "    SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op CAST(t2.r AS real)"
          278  +    puts "     WHERE t2.a=$ax"
          279  +    puts "     ORDER BY t1.rowid DESC"
          280  +    puts "  \175"
          281  +    puts "\175 {$aset}"
          282  +  }
          283  +  
          284  +}
          285  +
          286  +
          287  +puts {finish_test}

Added test/boundary3.test.

more than 10,000 changes

Added test/boundary4.tcl.

            1  +puts {# 2008 December 11
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library.
           12  +#
           13  +# This file is automatically generated from a separate TCL script.
           14  +# This file seeks to exercise integer boundary values.
           15  +#
           16  +# $Id: boundary4.tcl,v 1.1 2008/12/12 19:19:22 drh Exp $
           17  +
           18  +set testdir [file dirname $argv0]
           19  +source $testdir/tester.tcl
           20  +}
           21  +
           22  +expr srand(0)
           23  +
           24  +# Generate interesting boundary numbers
           25  +#
           26  +foreach x {
           27  +  0x7f
           28  +  0x7fff
           29  +  0x7fffff
           30  +  0x7fffffff
           31  +  0x7fffffffff
           32  +  0x7fffffffffff
           33  +  0x7fffffffffffff
           34  +  0x7fffffffffffffff
           35  +} {
           36  +  set x [expr {wide($x)}]
           37  +  set boundarynum($x) 1
           38  +  set boundarynum([expr {$x+1}]) 1
           39  +  set boundarynum([expr {-($x+1)}]) 1
           40  +  set boundarynum([expr {-($x+2)}]) 1
           41  +  set boundarynum([expr {$x+$x+1}]) 1
           42  +  set boundarynum([expr {$x+$x+2}]) 1
           43  +}
           44  +set x [expr {wide(127)}]
           45  +for {set i 127} {$i<=9} {incr i} {
           46  +  set boundarynum($x) 1
           47  +  set boundarynum([expr {$x+1}]) 1
           48  +  set x [expr {wide($x*128 + 127)}]
           49  +}
           50  +
           51  +# Scramble the $inlist into a random order.
           52  +#
           53  +proc scramble {inlist} {
           54  +  set y {}
           55  +  foreach x $inlist {
           56  +    lappend y [list [expr {rand()}] $x]
           57  +  }
           58  +  set y [lsort $y]
           59  +  set outlist {}
           60  +  foreach x $y {
           61  +    lappend outlist [lindex $x 1]
           62  +  }
           63  +  return $outlist
           64  +}
           65  +
           66  +# A simple magnitude source.  Not trying to be efficient.
           67  +#
           68  +proc sort {inlist} {
           69  +  set outlist {}
           70  +  set mn [lindex $inlist 0]
           71  +  foreach x $inlist {
           72  +    if {$x<$mn} {set mn $x}
           73  +  }
           74  +  set outlist $mn
           75  +  set mx $mn
           76  +  while {1} {
           77  +    set valid 0
           78  +    foreach x $inlist {
           79  +      if {$x>$mx && (!$valid || $mn>$x)} {
           80  +        set mn $x
           81  +        set valid 1
           82  +      }
           83  +    }
           84  +    if {!$valid} break
           85  +    lappend outlist $mn
           86  +    set mx $mn
           87  +  }
           88  +  return $outlist
           89  +}
           90  +
           91  +# Reverse the order of a list
           92  +#
           93  +proc reverse {inlist} {
           94  +  set i [llength $inlist]
           95  +  set outlist {}
           96  +  for {incr i -1} {$i>=0} {incr i -1} {
           97  +    lappend outlist [lindex $inlist $i]
           98  +  }
           99  +  return $outlist
          100  +}
          101  +
          102  +set nums1 [scramble [array names boundarynum]]
          103  +set nums2 [scramble [array names boundarynum]]
          104  +
          105  +set tname boundary4
          106  +puts "do_test $tname-1.1 \173"
          107  +puts "  db eval \173"
          108  +puts "    CREATE TABLE t1(a,x);"
          109  +set a 0
          110  +set all_rowid {}
          111  +set all_a {}
          112  +set all_x {}
          113  +foreach r $nums1 {
          114  +  incr a
          115  +  set t1ra($r) $a
          116  +  set t1ar($a) $r
          117  +  set x [format %08x%08x [expr {wide($r)>>32}] $r]
          118  +  set t1rx($r) $x
          119  +  set t1xr($x) $r
          120  +  puts "    INSERT INTO t1(oid,a,x) VALUES($r,$a,'$x');"
          121  +  lappend all_rowid $r
          122  +  lappend all_a $a
          123  +  lappend all_x $x
          124  +}
          125  +puts "    CREATE INDEX t1i1 ON t1(a);"
          126  +puts "    CREATE INDEX t1i2 ON t1(x);"
          127  +puts "  \175"
          128  +puts "\175 {}"
          129  +
          130  +puts "do_test $tname-1.2 \173"
          131  +puts "  db eval \173"
          132  +puts "    SELECT count(*) FROM t1"
          133  +puts "  \175"
          134  +puts "\175 {[llength $nums1]}"
          135  +
          136  +proc maketest {tnum sql answer} {
          137  +  puts "do_test $::tname-$tnum \173"
          138  +  puts "  db eval \173"
          139  +  puts "    $sql"
          140  +  puts "  \175"
          141  +  puts "\175 {$answer}"
          142  +}
          143  +
          144  +set ans {}
          145  +foreach r [sort $all_rowid] {
          146  +  lappend ans $r $t1ra($r) $t1rx($r)
          147  +}
          148  +maketest 1.3 {SELECT rowid, a, x FROM t1 ORDER BY +rowid} $ans
          149  +maketest 1.4 {SELECT rowid, a, x FROM t1 ORDER BY rowid} $ans
          150  +
          151  +set ans {}
          152  +foreach r [reverse [sort $all_rowid]] {
          153  +  lappend ans $r $t1ra($r) $t1rx($r)
          154  +}
          155  +maketest 1.5 {SELECT rowid, a, x FROM t1 ORDER BY +rowid DESC} $ans
          156  +maketest 1.6 {SELECT rowid, a, x FROM t1 ORDER BY rowid DESC} $ans
          157  +
          158  +set ans {}
          159  +foreach a [sort $all_a] {
          160  +  set r $t1ar($a)
          161  +  lappend ans $r $a $t1rx($r)
          162  +}
          163  +maketest 1.7 {SELECT rowid, a, x FROM t1 ORDER BY +a} $ans
          164  +maketest 1.8 {SELECT rowid, a, x FROM t1 ORDER BY a} $ans
          165  +
          166  +set ans {}
          167  +foreach a [reverse [sort $all_a]] {
          168  +  set r $t1ar($a)
          169  +  lappend ans $r $a $t1rx($r)
          170  +}
          171  +maketest 1.9 {SELECT rowid, a, x FROM t1 ORDER BY +a DESC} $ans
          172  +maketest 1.10 {SELECT rowid, a, x FROM t1 ORDER BY a DESC} $ans
          173  +
          174  +set ans {}
          175  +foreach x [sort $all_x] {
          176  +  set r $t1xr($x)
          177  +  lappend ans $r $t1ra($r) $x
          178  +}
          179  +maketest 1.11 {SELECT rowid, a, x FROM t1 ORDER BY +x} $ans
          180  +maketest 1.12 {SELECT rowid, a, x FROM t1 ORDER BY x} $ans
          181  +
          182  +set ans {}
          183  +foreach x [reverse [sort $all_x]] {
          184  +  set r $t1xr($x)
          185  +  lappend ans $r $t1ra($r) $x
          186  +}
          187  +maketest 1.13 {SELECT rowid, a, x FROM t1 ORDER BY +x DESC} $ans
          188  +maketest 1.14 {SELECT rowid, a, x FROM t1 ORDER BY x DESC} $ans
          189  +
          190  +maketest 2.1 {UPDATE t1 SET rowid=a, a=rowid} {}
          191  +
          192  +set ans {}
          193  +foreach r [sort $all_rowid] {
          194  +  lappend ans $r $t1ra($r) $t1rx($r)
          195  +}
          196  +maketest 2.3 {SELECT a, rowid, x FROM t1 ORDER BY +a} $ans
          197  +maketest 2.4 {SELECT a, rowid, x FROM t1 ORDER BY a} $ans
          198  +
          199  +set ans {}
          200  +foreach r [reverse [sort $all_rowid]] {
          201  +  lappend ans $r $t1ra($r) $t1rx($r)
          202  +}
          203  +maketest 2.5 {SELECT a, rowid, x FROM t1 ORDER BY +a DESC} $ans
          204  +maketest 2.6 {SELECT a, rowid, x FROM t1 ORDER BY a DESC} $ans
          205  +
          206  +set ans {}
          207  +foreach a [sort $all_a] {
          208  +  set r $t1ar($a)
          209  +  lappend ans $r $a $t1rx($r)
          210  +}
          211  +maketest 2.7 {SELECT a, rowid, x FROM t1 ORDER BY +rowid} $ans
          212  +maketest 2.8 {SELECT a, rowid, x FROM t1 ORDER BY rowid} $ans
          213  +
          214  +set ans {}
          215  +foreach a [reverse [sort $all_a]] {
          216  +  set r $t1ar($a)
          217  +  lappend ans $r $a $t1rx($r)
          218  +}
          219  +maketest 2.9 {SELECT a, rowid, x FROM t1 ORDER BY +rowid DESC} $ans
          220  +maketest 2.10 {SELECT a, rowid, x FROM t1 ORDER BY rowid DESC} $ans
          221  +
          222  +set ans {}
          223  +foreach x [sort $all_x] {
          224  +  set r $t1xr($x)
          225  +  lappend ans $r $t1ra($r) $x
          226  +}
          227  +maketest 2.11 {SELECT a, rowid, x FROM t1 ORDER BY +x} $ans
          228  +maketest 2.12 {SELECT a, rowid, x FROM t1 ORDER BY x} $ans
          229  +
          230  +set ans {}
          231  +foreach x [reverse [sort $all_x]] {
          232  +  set r $t1xr($x)
          233  +  lappend ans $r $t1ra($r) $x
          234  +}
          235  +maketest 2.13 {SELECT a, rowid, x FROM t1 ORDER BY +x DESC} $ans
          236  +maketest 2.14 {SELECT a, rowid, x FROM t1 ORDER BY x DESC} $ans
          237  +
          238  +maketest 3.1 {UPDATE t1 SET rowid=a, a=rowid} {}
          239  +maketest 3.2 {ALTER TABLE t1 ADD COLUMN z; UPDATE t1 SET z=zeroblob(600)} {}
          240  +
          241  +set ans {}
          242  +foreach r [sort $all_rowid] {
          243  +  lappend ans $r $t1ra($r) $t1rx($r)
          244  +}
          245  +maketest 3.3 {SELECT rowid, a, x FROM t1 ORDER BY +rowid} $ans
          246  +maketest 3.4 {SELECT rowid, a, x FROM t1 ORDER BY rowid} $ans
          247  +
          248  +set ans {}
          249  +foreach r [reverse [sort $all_rowid]] {
          250  +  lappend ans $r $t1ra($r) $t1rx($r)
          251  +}
          252  +maketest 3.5 {SELECT rowid, a, x FROM t1 ORDER BY +rowid DESC} $ans
          253  +maketest 3.6 {SELECT rowid, a, x FROM t1 ORDER BY rowid DESC} $ans
          254  +
          255  +set ans {}
          256  +foreach a [sort $all_a] {
          257  +  set r $t1ar($a)
          258  +  lappend ans $r $a $t1rx($r)
          259  +}
          260  +maketest 3.7 {SELECT rowid, a, x FROM t1 ORDER BY +a} $ans
          261  +maketest 3.8 {SELECT rowid, a, x FROM t1 ORDER BY a} $ans
          262  +
          263  +set ans {}
          264  +foreach a [reverse [sort $all_a]] {
          265  +  set r $t1ar($a)
          266  +  lappend ans $r $a $t1rx($r)
          267  +}
          268  +maketest 3.9 {SELECT rowid, a, x FROM t1 ORDER BY +a DESC} $ans
          269  +maketest 3.10 {SELECT rowid, a, x FROM t1 ORDER BY a DESC} $ans
          270  +
          271  +set ans {}
          272  +foreach x [sort $all_x] {
          273  +  set r $t1xr($x)
          274  +  lappend ans $r $t1ra($r) $x
          275  +}
          276  +maketest 3.11 {SELECT rowid, a, x FROM t1 ORDER BY +x} $ans
          277  +maketest 3.12 {SELECT rowid, a, x FROM t1 ORDER BY x} $ans
          278  +
          279  +set ans {}
          280  +foreach x [reverse [sort $all_x]] {
          281  +  set r $t1xr($x)
          282  +  lappend ans $r $t1ra($r) $x
          283  +}
          284  +maketest 3.13 {SELECT rowid, a, x FROM t1 ORDER BY +x DESC} $ans
          285  +maketest 3.14 {SELECT rowid, a, x FROM t1 ORDER BY x DESC} $ans
          286  +
          287  +
          288  +maketest 4.1 {UPDATE t1 SET rowid=a, a=rowid, x=z, z=x} {}
          289  +
          290  +set ans {}
          291  +foreach r [sort $all_rowid] {
          292  +  lappend ans $r $t1ra($r) $t1rx($r)
          293  +}
          294  +maketest 4.3 {SELECT a, rowid, z FROM t1 ORDER BY +a} $ans
          295  +maketest 4.4 {SELECT a, rowid, z FROM t1 ORDER BY a} $ans
          296  +
          297  +set ans {}
          298  +foreach r [reverse [sort $all_rowid]] {
          299  +  lappend ans $r $t1ra($r) $t1rx($r)
          300  +}
          301  +maketest 4.5 {SELECT a, rowid, z FROM t1 ORDER BY +a DESC} $ans
          302  +maketest 4.6 {SELECT a, rowid, z FROM t1 ORDER BY a DESC} $ans
          303  +
          304  +set ans {}
          305  +foreach a [sort $all_a] {
          306  +  set r $t1ar($a)
          307  +  lappend ans $r $a $t1rx($r)
          308  +}
          309  +maketest 4.7 {SELECT a, rowid, z FROM t1 ORDER BY +rowid} $ans
          310  +maketest 4.8 {SELECT a, rowid, z FROM t1 ORDER BY rowid} $ans
          311  +
          312  +set ans {}
          313  +foreach a [reverse [sort $all_a]] {
          314  +  set r $t1ar($a)
          315  +  lappend ans $r $a $t1rx($r)
          316  +}
          317  +maketest 4.9 {SELECT a, rowid, z FROM t1 ORDER BY +rowid DESC} $ans
          318  +maketest 4.10 {SELECT a, rowid, z FROM t1 ORDER BY rowid DESC} $ans
          319  +
          320  +set ans {}
          321  +foreach x [sort $all_x] {
          322  +  set r $t1xr($x)
          323  +  lappend ans $r $t1ra($r) $x
          324  +}
          325  +maketest 4.11 {SELECT a, rowid, z FROM t1 ORDER BY +z} $ans
          326  +maketest 4.12 {SELECT a, rowid, z FROM t1 ORDER BY z} $ans
          327  +
          328  +set ans {}
          329  +foreach x [reverse [sort $all_x]] {
          330  +  set r $t1xr($x)
          331  +  lappend ans $r $t1ra($r) $x
          332  +}
          333  +maketest 4.13 {SELECT a, rowid, z FROM t1 ORDER BY +z DESC} $ans
          334  +maketest 4.14 {SELECT a, rowid, z FROM t1 ORDER BY z DESC} $ans
          335  +
          336  +puts {finish_test}

Added test/boundary4.test.

            1  +# 2008 December 11
            2  +#
            3  +# The author disclaims copyright to this source code.  In place of
            4  +# a legal notice, here is a blessing:
            5  +#
            6  +#    May you do good and not evil.
            7  +#    May you find forgiveness for yourself and forgive others.
            8  +#    May you share freely, never taking more than you give.
            9  +#
           10  +#***********************************************************************
           11  +# This file implements regression tests for SQLite library.
           12  +#
           13  +# This file is automatically generated from a separate TCL script.
           14  +# This file seeks to exercise integer boundary values.
           15  +#
           16  +# $Id: boundary4.test,v 1.1 2008/12/12 19:19:22 drh Exp $
           17  +
           18  +set testdir [file dirname $argv0]
           19  +source $testdir/tester.tcl
           20  +
           21  +do_test boundary4-1.1 {
           22  +  db eval {
           23  +    CREATE TABLE t1(a,x);
           24  +    INSERT INTO t1(oid,a,x) VALUES(549755813887,1,'0000007fffffffff');
           25  +    INSERT INTO t1(oid,a,x) VALUES(-8388608,2,'ffffffffff800000');
           26  +    INSERT INTO t1(oid,a,x) VALUES(0,3,'0000000000000000');
           27  +    INSERT INTO t1(oid,a,x) VALUES(-129,4,'ffffffffffffff7f');
           28  +    INSERT INTO t1(oid,a,x) VALUES(8388608,5,'0000000000800000');
           29  +    INSERT INTO t1(oid,a,x) VALUES(65535,6,'000000000000ffff');
           30  +    INSERT INTO t1(oid,a,x) VALUES(8388607,7,'00000000007fffff');
           31  +    INSERT INTO t1(oid,a,x) VALUES(1099511627776,8,'0000010000000000');
           32  +    INSERT INTO t1(oid,a,x) VALUES(16777215,9,'0000000000ffffff');
           33  +    INSERT INTO t1(oid,a,x) VALUES(32767,10,'0000000000007fff');
           34  +    INSERT INTO t1(oid,a,x) VALUES(4294967296,11,'0000000100000000');
           35  +    INSERT INTO t1(oid,a,x) VALUES(-549755813888,12,'ffffff8000000000');
           36  +    INSERT INTO t1(oid,a,x) VALUES(-140737488355328,13,'ffff800000000000');
           37  +    INSERT INTO t1(oid,a,x) VALUES(256,14,'0000000000000100');
           38  +    INSERT INTO t1(oid,a,x) VALUES(16777216,15,'0000000001000000');
           39  +    INSERT INTO t1(oid,a,x) VALUES(72057594037927936,16,'0100000000000000');
           40  +    INSERT INTO t1(oid,a,x) VALUES(-1,17,'ffffffffffffffff');
           41  +    INSERT INTO t1(oid,a,x) VALUES(9223372036854775807,18,'7fffffffffffffff');
           42  +    INSERT INTO t1(oid,a,x) VALUES(281474976710655,19,'0000ffffffffffff');
           43  +    INSERT INTO t1(oid,a,x) VALUES(1099511627775,20,'000000ffffffffff');
           44  +    INSERT INTO t1(oid,a,x) VALUES(-8388609,21,'ffffffffff7fffff');
           45  +    INSERT INTO t1(oid,a,x) VALUES(32768,22,'0000000000008000');
           46  +    INSERT INTO t1(oid,a,x) VALUES(36028797018963968,23,'0080000000000000');
           47  +    INSERT INTO t1(oid,a,x) VALUES(-32769,24,'ffffffffffff7fff');
           48  +    INSERT INTO t1(oid,a,x) VALUES(127,25,'000000000000007f');
           49  +    INSERT INTO t1(oid,a,x) VALUES(-9223372036854775808,26,'8000000000000000');
           50  +    INSERT INTO t1(oid,a,x) VALUES(72057594037927935,27,'00ffffffffffffff');
           51  +    INSERT INTO t1(oid,a,x) VALUES(-549755813889,28,'ffffff7fffffffff');
           52  +    INSERT INTO t1(oid,a,x) VALUES(255,29,'00000000000000ff');
           53  +    INSERT INTO t1(oid,a,x) VALUES(-36028797018963969,30,'ff7fffffffffffff');
           54  +    INSERT INTO t1(oid,a,x) VALUES(-2147483648,31,'ffffffff80000000');
           55  +    INSERT INTO t1(oid,a,x) VALUES(281474976710656,32,'0001000000000000');
           56  +    INSERT INTO t1(oid,a,x) VALUES(65536,33,'0000000000010000');
           57  +    INSERT INTO t1(oid,a,x) VALUES(140737488355328,34,'0000800000000000');
           58  +    INSERT INTO t1(oid,a,x) VALUES(549755813888,35,'0000008000000000');
           59  +    INSERT INTO t1(oid,a,x) VALUES(2147483648,36,'0000000080000000');
           60  +    INSERT INTO t1(oid,a,x) VALUES(4294967295,37,'00000000ffffffff');
           61  +    INSERT INTO t1(oid,a,x) VALUES(140737488355327,38,'00007fffffffffff');
           62  +    INSERT INTO t1(oid,a,x) VALUES(-2147483649,39,'ffffffff7fffffff');
           63  +    INSERT INTO t1(oid,a,x) VALUES(36028797018963967,40,'007fffffffffffff');
           64  +    INSERT INTO t1(oid,a,x) VALUES(128,41,'0000000000000080');
           65  +    INSERT INTO t1(oid,a,x) VALUES(-32768,42,'ffffffffffff8000');
           66  +    INSERT INTO t1(oid,a,x) VALUES(-36028797018963968,43,'ff80000000000000');
           67  +    INSERT INTO t1(oid,a,x) VALUES(-140737488355329,44,'ffff7fffffffffff');
           68  +    INSERT INTO t1(oid,a,x) VALUES(-128,45,'ffffffffffffff80');
           69  +    INSERT INTO t1(oid,a,x) VALUES(2147483647,46,'000000007fffffff');
           70  +    CREATE INDEX t1i1 ON t1(a);
           71  +    CREATE INDEX t1i2 ON t1(x);
           72  +  }
           73  +} {}
           74  +do_test boundary4-1.2 {
           75  +  db eval {
           76  +    SELECT count(*) FROM t1
           77  +  }
           78  +} {46}
           79  +do_test boundary4-1.3 {
           80  +  db eval {
           81  +    SELECT rowid, a, x FROM t1 ORDER BY +rowid
           82  +  }
           83  +} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff}
           84  +do_test boundary4-1.4 {
           85  +  db eval {
           86  +    SELECT rowid, a, x FROM t1 ORDER BY rowid
           87  +  }
           88  +} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff}
           89  +do_test boundary4-1.5 {
           90  +  db eval {
           91  +    SELECT rowid, a, x FROM t1 ORDER BY +rowid DESC
           92  +  }
           93  +} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000}
           94  +do_test boundary4-1.6 {
           95  +  db eval {
           96  +    SELECT rowid, a, x FROM t1 ORDER BY rowid DESC
           97  +  }
           98  +} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000}
           99  +do_test boundary4-1.7 {
          100  +  db eval {
          101  +    SELECT rowid, a, x FROM t1 ORDER BY +a
          102  +  }
          103  +} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff}
          104  +do_test boundary4-1.8 {
          105  +  db eval {
          106  +    SELECT rowid, a, x FROM t1 ORDER BY a
          107  +  }
          108  +} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff}
          109  +do_test boundary4-1.9 {
          110  +  db eval {
          111  +    SELECT rowid, a, x FROM t1 ORDER BY +a DESC
          112  +  }
          113  +} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff}
          114  +do_test boundary4-1.10 {
          115  +  db eval {
          116  +    SELECT rowid, a, x FROM t1 ORDER BY a DESC
          117  +  }
          118  +} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff}
          119  +do_test boundary4-1.11 {
          120  +  db eval {
          121  +    SELECT rowid, a, x FROM t1 ORDER BY +x
          122  +  }
          123  +} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff}
          124  +do_test boundary4-1.12 {
          125  +  db eval {
          126  +    SELECT rowid, a, x FROM t1 ORDER BY x
          127  +  }
          128  +} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff}
          129  +do_test boundary4-1.13 {
          130  +  db eval {
          131  +    SELECT rowid, a, x FROM t1 ORDER BY +x DESC
          132  +  }
          133  +} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000}
          134  +do_test boundary4-1.14 {
          135  +  db eval {
          136  +    SELECT rowid, a, x FROM t1 ORDER BY x DESC
          137  +  }
          138  +} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000}
          139  +do_test boundary4-2.1 {
          140  +  db eval {
          141  +    UPDATE t1 SET rowid=a, a=rowid
          142  +  }
          143  +} {}
          144  +do_test boundary4-2.3 {
          145  +  db eval {
          146  +    SELECT a, rowid, x FROM t1 ORDER BY +a
          147  +  }
          148  +} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff}
          149  +do_test boundary4-2.4 {
          150  +  db eval {
          151  +    SELECT a, rowid, x FROM t1 ORDER BY a
          152  +  }
          153  +} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff}
          154  +do_test boundary4-2.5 {
          155  +  db eval {
          156  +    SELECT a, rowid, x FROM t1 ORDER BY +a DESC
          157  +  }
          158  +} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000}
          159  +do_test boundary4-2.6 {
          160  +  db eval {
          161  +    SELECT a, rowid, x FROM t1 ORDER BY a DESC
          162  +  }
          163  +} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000}
          164  +do_test boundary4-2.7 {
          165  +  db eval {
          166  +    SELECT a, rowid, x FROM t1 ORDER BY +rowid
          167  +  }
          168  +} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff}
          169  +do_test boundary4-2.8 {
          170  +  db eval {
          171  +    SELECT a, rowid, x FROM t1 ORDER BY rowid
          172  +  }
          173  +} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff}
          174  +do_test boundary4-2.9 {
          175  +  db eval {
          176  +    SELECT a, rowid, x FROM t1 ORDER BY +rowid DESC
          177  +  }
          178  +} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff}
          179  +do_test boundary4-2.10 {
          180  +  db eval {
          181  +    SELECT a, rowid, x FROM t1 ORDER BY rowid DESC
          182  +  }
          183  +} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff}
          184  +do_test boundary4-2.11 {
          185  +  db eval {
          186  +    SELECT a, rowid, x FROM t1 ORDER BY +x
          187  +  }
          188  +} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff}
          189  +do_test boundary4-2.12 {
          190  +  db eval {
          191  +    SELECT a, rowid, x FROM t1 ORDER BY x
          192  +  }
          193  +} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff}
          194  +do_test boundary4-2.13 {
          195  +  db eval {
          196  +    SELECT a, rowid, x FROM t1 ORDER BY +x DESC
          197  +  }
          198  +} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000}
          199  +do_test boundary4-2.14 {
          200  +  db eval {
          201  +    SELECT a, rowid, x FROM t1 ORDER BY x DESC
          202  +  }
          203  +} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000}
          204  +do_test boundary4-3.1 {
          205  +  db eval {
          206  +    UPDATE t1 SET rowid=a, a=rowid
          207  +  }
          208  +} {}
          209  +do_test boundary4-3.2 {
          210  +  db eval {
          211  +    ALTER TABLE t1 ADD COLUMN z; UPDATE t1 SET z=zeroblob(600)
          212  +  }
          213  +} {}
          214  +do_test boundary4-3.3 {
          215  +  db eval {
          216  +    SELECT rowid, a, x FROM t1 ORDER BY +rowid
          217  +  }
          218  +} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff}
          219  +do_test boundary4-3.4 {
          220  +  db eval {
          221  +    SELECT rowid, a, x FROM t1 ORDER BY rowid
          222  +  }
          223  +} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff}
          224  +do_test boundary4-3.5 {
          225  +  db eval {
          226  +    SELECT rowid, a, x FROM t1 ORDER BY +rowid DESC
          227  +  }
          228  +} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000}
          229  +do_test boundary4-3.6 {
          230  +  db eval {
          231  +    SELECT rowid, a, x FROM t1 ORDER BY rowid DESC
          232  +  }
          233  +} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000}
          234  +do_test boundary4-3.7 {
          235  +  db eval {
          236  +    SELECT rowid, a, x FROM t1 ORDER BY +a
          237  +  }
          238  +} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff}
          239  +do_test boundary4-3.8 {
          240  +  db eval {
          241  +    SELECT rowid, a, x FROM t1 ORDER BY a
          242  +  }
          243  +} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff}
          244  +do_test boundary4-3.9 {
          245  +  db eval {
          246  +    SELECT rowid, a, x FROM t1 ORDER BY +a DESC
          247  +  }
          248  +} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff}
          249  +do_test boundary4-3.10 {
          250  +  db eval {
          251  +    SELECT rowid, a, x FROM t1 ORDER BY a DESC
          252  +  }
          253  +} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff}
          254  +do_test boundary4-3.11 {
          255  +  db eval {
          256  +    SELECT rowid, a, x FROM t1 ORDER BY +x
          257  +  }
          258  +} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff}
          259  +do_test boundary4-3.12 {
          260  +  db eval {
          261  +    SELECT rowid, a, x FROM t1 ORDER BY x
          262  +  }
          263  +} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff}
          264  +do_test boundary4-3.13 {
          265  +  db eval {
          266  +    SELECT rowid, a, x FROM t1 ORDER BY +x DESC
          267  +  }
          268  +} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000}
          269  +do_test boundary4-3.14 {
          270  +  db eval {
          271  +    SELECT rowid, a, x FROM t1 ORDER BY x DESC
          272  +  }
          273  +} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000}
          274  +do_test boundary4-4.1 {
          275  +  db eval {
          276  +    UPDATE t1 SET rowid=a, a=rowid, x=z, z=x
          277  +  }
          278  +} {}
          279  +do_test boundary4-4.3 {
          280  +  db eval {
          281  +    SELECT a, rowid, z FROM t1 ORDER BY +a
          282  +  }
          283  +} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff}
          284  +do_test boundary4-4.4 {
          285  +  db eval {
          286  +    SELECT a, rowid, z FROM t1 ORDER BY a
          287  +  }
          288  +} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff}
          289  +do_test boundary4-4.5 {
          290  +  db eval {
          291  +    SELECT a, rowid, z FROM t1 ORDER BY +a DESC
          292  +  }
          293  +} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000}
          294  +do_test boundary4-4.6 {
          295  +  db eval {
          296  +    SELECT a, rowid, z FROM t1 ORDER BY a DESC
          297  +  }
          298  +} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000}
          299  +do_test boundary4-4.7 {
          300  +  db eval {
          301  +    SELECT a, rowid, z FROM t1 ORDER BY +rowid
          302  +  }
          303  +} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff}
          304  +do_test boundary4-4.8 {
          305  +  db eval {
          306  +    SELECT a, rowid, z FROM t1 ORDER BY rowid
          307  +  }
          308  +} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff}
          309  +do_test boundary4-4.9 {
          310  +  db eval {
          311  +    SELECT a, rowid, z FROM t1 ORDER BY +rowid DESC
          312  +  }
          313  +} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff}
          314  +do_test boundary4-4.10 {
          315  +  db eval {
          316  +    SELECT a, rowid, z FROM t1 ORDER BY rowid DESC
          317  +  }
          318  +} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff}
          319  +do_test boundary4-4.11 {
          320  +  db eval {
          321  +    SELECT a, rowid, z FROM t1 ORDER BY +z
          322  +  }
          323  +} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff}
          324  +do_test boundary4-4.12 {
          325  +  db eval {
          326  +    SELECT a, rowid, z FROM t1 ORDER BY z
          327  +  }
          328  +} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff}
          329  +do_test boundary4-4.13 {
          330  +  db eval {
          331  +    SELECT a, rowid, z FROM t1 ORDER BY +z DESC
          332  +  }
          333  +} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000}
          334  +do_test boundary4-4.14 {
          335  +  db eval {
          336  +    SELECT a, rowid, z FROM t1 ORDER BY z DESC
          337  +  }
          338  +} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000}
          339  +finish_test