/ Check-in [9406c0a6]
Login

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

Overview
Comment:Stricter test cases.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | location-function
Files: files | file ages | folders
SHA3-256: 9406c0a685fd5ff3516a66402b0514a1440652822a5eecf0b7af85929f3079e8
User & Date: drh 2017-12-29 16:37:33
Context
2017-12-29
17:21
Add support for the sqlite_unsupported_offset() SQL function if and only if compiled using -DSQLITE_ENABLE_OFFSET_SQL_FUNC. Use that definition when compiling the command-line shell. check-in: 4f1f1f52 user: drh tags: trunk
16:37
Stricter test cases. Closed-Leaf check-in: 9406c0a6 user: drh tags: location-function
15:19
Fix a typo in the MSVC makefile. check-in: 89e5720a user: drh tags: location-function
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/func6.test.

     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #*************************************************************************
    11     11   #
    12     12   # Test cases for the sqlite_unsupported_offset() function.
    13     13   #
           14  +# Some of the tests in this file depend on the exact placement of content
           15  +# within b-tree pages.  Such placement is at the implementations discretion,
           16  +# and so it is possible for results to change from one release to the next.
           17  +#
    14     18   set testdir [file dirname $argv0]
    15     19   source $testdir/tester.tcl
    16     20   ifcapable !offset_sql_func {
    17     21     finish_test
    18     22     return
    19     23   }
    20     24   
    21     25   do_execsql_test func6-100 {
           26  +  PRAGMA page_size=4096;
           27  +  PRAGMA auto_vacuum=NONE;
    22     28     CREATE TABLE t1(a,b,c,d);
    23     29     WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100)
    24     30      INSERT INTO t1(a,b,c,d) SELECT printf('abc%03x',x), x, 1000-x, NULL FROM c;
           31  +  CREATE INDEX t1a ON t1(a);
           32  +  CREATE INDEX t1bc ON t1(b,c);
           33  +  CREATE TABLE t2(x TEXT PRIMARY KEY, y) WITHOUT ROWID;
           34  +  INSERT INTO t2(x,y) SELECT a, b FROM t1;
    25     35   }
    26     36   do_execsql_test func6-110 {
    27         -  SELECT a, typeof(sqlite_unsupported_offset(a)) FROM t1
           37  +  SELECT a, sqlite_unsupported_offset(d)/4096 + 1,
           38  +            sqlite_unsupported_offset(d)%4096 FROM t1
    28     39      ORDER BY rowid LIMIT 2;
    29         -} {abc001 integer abc002 integer}
           40  +} {abc001 2 4084 abc002 2 4069}
    30     41   do_execsql_test func6-120 {
    31     42     SELECT a, typeof(sqlite_unsupported_offset(+a)) FROM t1
    32     43      ORDER BY rowid LIMIT 2;
    33     44   } {abc001 null abc002 null}
    34     45   do_execsql_test func6-130 {
    35         -  CREATE INDEX t1a ON t1(a);
    36         -  SELECT a, typeof(sqlite_unsupported_offset(a)) FROM t1
           46  +  SELECT a, sqlite_unsupported_offset(a)/4096+1, 
           47  +         sqlite_unsupported_offset(a)%4096
           48  +   FROM t1
    37     49      ORDER BY a LIMIT 2;
    38         -} {abc001 integer abc002 integer}
           50  +} {abc001 3 4087 abc002 3 4076}
    39     51   do_execsql_test func6-140 {
    40         -  SELECT a, typeof(sqlite_unsupported_offset(a)) FROM t1 NOT INDEXED
           52  +  SELECT a, sqlite_unsupported_offset(d)/4096+1, 
           53  +         sqlite_unsupported_offset(d)%4096
           54  +   FROM t1
           55  +   ORDER BY a LIMIT 2;
           56  +} {abc001 2 4084 abc002 2 4069}
           57  +do_execsql_test func6-150 {
           58  +  SELECT a,
           59  +         sqlite_unsupported_offset(a)/4096+1, 
           60  +         sqlite_unsupported_offset(a)%4096,
           61  +         sqlite_unsupported_offset(d)/4096+1, 
           62  +         sqlite_unsupported_offset(d)%4096
           63  +   FROM t1
    41     64      ORDER BY a LIMIT 2;
    42         -} {abc001 integer abc002 integer}
           65  +} {abc001 3 4087 2 4084 abc002 3 4076 2 4069}
           66  +do_execsql_test func6-160 {
           67  +  SELECT b,
           68  +         sqlite_unsupported_offset(b)/4096+1, 
           69  +         sqlite_unsupported_offset(b)%4096,
           70  +         sqlite_unsupported_offset(c)/4096+1, 
           71  +         sqlite_unsupported_offset(c)%4096,
           72  +         sqlite_unsupported_offset(d)/4096+1, 
           73  +         sqlite_unsupported_offset(d)%4096
           74  +   FROM t1
           75  +   ORDER BY b LIMIT 2;
           76  +} {1 4 4090 4 4090 2 4084 2 4 4081 4 4081 2 4069}
           77  +
           78  +
           79  +do_execsql_test func6-200 {
           80  +  SELECT y, sqlite_unsupported_offset(y)/4096+1,
           81  +         sqlite_unsupported_offset(y)%4096
           82  +   FROM t2
           83  +   ORDER BY x LIMIT 2;
           84  +} {1 5 4087 2 5 4076}
    43     85   
    44     86   finish_test