/ Check-in [989588ab]
Login

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

Overview
Comment:Add configurations featuring the -ftrapv switch and large values for SQLITE_MAX_ATTACHED to releasetest.tcl.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 989588abf3e88e198b7224604d54f7dc24d2576f
User & Date: dan 2011-04-06 12:37:09
Context
2011-04-06
12:38
Update a comment in sqliteLimit.h. No changes to code or tests. check-in: b7296fd3 user: dan tags: trunk
12:37
Add configurations featuring the -ftrapv switch and large values for SQLITE_MAX_ATTACHED to releasetest.tcl. check-in: 989588ab user: dan tags: trunk
2011-04-05
22:08
Suppress many harmless compiler warnings, mostly signed/unsigned comparisons within asserts or unused parameters in extensions. check-in: 3eeb0ff7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added test/attach4.test.

            1  +# 200 July 1
            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.  The
           12  +# focus of this script is attaching many database files to a single
           13  +# connection.
           14  +#
           15  +
           16  +set testdir [file dirname $argv0]
           17  +source $testdir/tester.tcl
           18  +
           19  +set testprefix attach4
           20  +
           21  +ifcapable !attach {
           22  +  finish_test
           23  +  return
           24  +}
           25  +
           26  +puts "Testing with SQLITE_MAX_ATTACHED=$SQLITE_MAX_ATTACHED"
           27  +
           28  +set files {main test.db}
           29  +for {set ii 0} {$ii < $SQLITE_MAX_ATTACHED} {incr ii} {
           30  +  lappend files aux$ii "test.db$ii"
           31  +}
           32  +
           33  +do_test 1.1 {
           34  +  sqlite3_limit db SQLITE_LIMIT_ATTACHED -1
           35  +} $SQLITE_MAX_ATTACHED
           36  +
           37  +do_test 1.2.1 {
           38  +  db close
           39  +  foreach {name f} $files { forcedelete $f }
           40  +  sqlite3 db test.db
           41  +  
           42  +  foreach {name f} $files {
           43  +    if {$name == "main"} continue
           44  +    execsql "ATTACH '$f' AS $name"
           45  +  }
           46  +
           47  +  db eval {PRAGMA database_list} {
           48  +    lappend L $name [file tail $file]
           49  +  }
           50  +  set L
           51  +} $files
           52  +
           53  +do_catchsql_test 1.2.2 {
           54  +  ATTACH 'x.db' AS next;
           55  +} [list 1 "too many attached databases - max $SQLITE_MAX_ATTACHED"]
           56  +
           57  +do_test 1.3 {
           58  +  execsql BEGIN;
           59  +  foreach {name f} $files {
           60  +    execsql "CREATE TABLE $name.tbl(x)"
           61  +    execsql "INSERT INTO $name.tbl VALUES('$f')"
           62  +  }
           63  +  execsql COMMIT;
           64  +} {}
           65  +
           66  +do_test 1.4 {
           67  +  set L [list]
           68  +  foreach {name f} $files {
           69  +    lappend L $name [execsql "SELECT x FROM $name.tbl"]
           70  +  }
           71  +  set L
           72  +} $files
           73  +
           74  +set L [list]
           75  +set S ""
           76  +foreach {name f} $files {
           77  +  lappend L wal
           78  +  append S "
           79  +    PRAGMA $name.journal_mode = WAL;
           80  +    UPDATE $name.tbl SET x = '$name';
           81  +  "
           82  +}
           83  +do_execsql_test 1.5 $S $L
           84  +
           85  +do_test 1.6 {
           86  +  set L [list]
           87  +  foreach {name f} $files {
           88  +    lappend L [execsql "SELECT x FROM $name.tbl"] $f
           89  +  }
           90  +  set L
           91  +} $files
           92  +
           93  +do_test 1.7 {
           94  +  execsql BEGIN;
           95  +  foreach {name f} $files {
           96  +    execsql "UPDATE $name.tbl SET x = '$f'"
           97  +  }
           98  +  execsql COMMIT;
           99  +} {}
          100  +
          101  +do_test 1.8 {
          102  +  set L [list]
          103  +  foreach {name f} $files {
          104  +    lappend L $name [execsql "SELECT x FROM $name.tbl"]
          105  +  }
          106  +  set L
          107  +} $files
          108  +
          109  +db close
          110  +foreach {name f} $files { forcedelete $f }
          111  +
          112  +finish_test

Changes to test/releasetest.tcl.

    56     56     ########################################################
    57     57   }
    58     58   
    59     59   array set ::Configs {
    60     60     "Default" {
    61     61       -O2
    62     62     }
           63  +  "Ftrapv" {
           64  +    -O2 -ftrapv
           65  +    -DSQLITE_MAX_ATTACHED=55
           66  +    -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
           67  +  }
    63     68     "Unlock-Notify" {
    64     69       -O2
    65     70       -DSQLITE_ENABLE_UNLOCK_NOTIFY
    66     71       -DSQLITE_THREADSAFE
    67     72       -DSQLITE_TCL_DEFAULT_FULLMUTEX=1
    68     73     }
    69     74     "Secure-Delete" {
................................................................................
   140    145       -DSQLITE_MAX_LENGTH=2147483645
   141    146       -DSQLITE_MAX_VARIABLE_NUMBER=500000
   142    147       -DSQLITE_DEBUG=1 
   143    148       -DSQLITE_PREFER_PROXY_LOCKING=1
   144    149     }
   145    150     "Extra-Robustness" {
   146    151       -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1
          152  +    -DSQLITE_MAX_ATTACHED=62
   147    153     }
   148    154   }
   149    155   
   150    156   array set ::Platforms {
   151    157     Linux-x86_64 {
   152    158       "Secure-Delete"           test
   153    159       "Unlock-Notify"           "QUICKTEST_INCLUDE=notify2.test test"
   154    160       "Update-Delete-Limit"     test
   155    161       "Debug-One"               test
   156    162       "Extra-Robustness"        test
   157    163       "Device-Two"              test
          164  +    "Ftrapv"                  test
   158    165       "Default"                 "threadtest test"
   159    166       "Device-One"              fulltest
   160    167     }
   161    168     Linux-i686 {
   162    169       "Unlock-Notify"           "QUICKTEST_INCLUDE=notify2.test test"
   163    170       "Device-One"              test
   164    171       "Device-Two"              test