CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
orderby8.test42 linesDownload Raw Back to test
1# 2015-01-192#3# The author disclaims copyright to this source code.  In place of4# 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.  The12# focus of this file is testing ORDER BY and LIMIT on tables with13# many columns.14#15# These tests verify that ticket [f97c4637102a3ae72b7911167e1d4da12ce60722]16# from 2015-01-19 has been fixed.17#18 19set testdir [file dirname $argv0]20source $testdir/tester.tcl21set ::testprefix orderby822 23do_test 1.0 {24  db eval {25    CREATE TABLE t1(x);26    INSERT INTO t1(x) VALUES(1),(5),(9),(7),(3),(2),(4),(6),(8);27  }28  set ::result_set "x"29} {x}30for {set i 1} {$i<200} {incr i} {31  append ::result_set ", x+$i"32  do_test 1.$i {33    set res {}34    db eval "SELECT $::result_set FROM t1 ORDER BY x LIMIT -1" {35      lappend res $x36    }37    set res38  } {1 2 3 4 5 6 7 8 9}39}40 41finish_test42