/ Check-in [c036db62]
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:Fix for #2281. This was a problem with the test-case only. (CVS 3795)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c036db6251ca4671fc3388a4f37955c18adeca1d
User & Date: danielk1977 2007-04-02 12:29:01
Context
2007-04-02
14:19
Cover an extra case in sqlite3PagerMovepage(). (CVS 3796) check-in: 7313688b user: danielk1977 tags: trunk
12:29
Fix for #2281. This was a problem with the test-case only. (CVS 3795) check-in: c036db62 user: danielk1977 tags: trunk
12:28
Cover a corrupt-db case in pager.c. (CVS 3794) check-in: 84077fa1 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test1.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing all sorts of SQLite interfaces.  This code
    13     13   ** is not included in the SQLite library.  It is used for automated
    14     14   ** testing of the SQLite library.
    15     15   **
    16         -** $Id: test1.c,v 1.232 2007/03/31 15:02:49 drh Exp $
           16  +** $Id: test1.c,v 1.233 2007/04/02 12:29:01 danielk1977 Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "tcl.h"
    20     20   #include "os.h"
    21     21   #include <stdlib.h>
    22     22   #include <string.h>
    23     23   
................................................................................
  4069   4069   #endif
  4070   4070   
  4071   4071   #ifdef SQLITE_OMIT_VIRTUALTABLE
  4072   4072     Tcl_SetVar2(interp, "sqlite_options", "vtab", "0", TCL_GLOBAL_ONLY);
  4073   4073   #else
  4074   4074     Tcl_SetVar2(interp, "sqlite_options", "vtab", "1", TCL_GLOBAL_ONLY);
  4075   4075   #endif
         4076  +
         4077  +#ifdef SQLITE_DEFAULT_FILE_FORMAT
         4078  +  Tcl_ObjSetVar2(interp, 
         4079  +      Tcl_NewStringObj("sqlite_default_file_format", -1), 0, 
         4080  +      Tcl_NewIntObj(SQLITE_DEFAULT_FILE_FORMAT), TCL_GLOBAL_ONLY
         4081  +  );
         4082  +#endif
  4076   4083   }
  4077   4084   
  4078   4085   /*
  4079   4086   ** tclcmd:   working_64bit_int
  4080   4087   **
  4081   4088   ** Some TCL builds (ex: cygwin) do not support 64-bit integers.  This
  4082   4089   ** leads to a number of test failures.  The present command checks the

Changes to test/alter2.test.

     9      9   #
    10     10   #*************************************************************************
    11     11   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this script is testing that SQLite can handle a subtle 
    13     13   # file format change that may be used in the future to implement
    14     14   # "ALTER TABLE ... ADD COLUMN".
    15     15   #
    16         -# $Id: alter2.test,v 1.6 2007/01/04 14:36:02 drh Exp $
           16  +# $Id: alter2.test,v 1.7 2007/04/02 12:29:01 danielk1977 Exp $
    17     17   #
    18     18   
    19     19   set testdir [file dirname $argv0]
    20     20   source $testdir/tester.tcl
    21     21   
    22     22   # We have to have pragmas in order to do this test
    23     23   ifcapable {!pragma} return
................................................................................
   254    254     sqlite3_errcode $::DB
   255    255   } {SQLITE_ERROR}
   256    256   
   257    257   #---------------------------------------------------------------------
   258    258   # Check that executing VACUUM on a file with file-format version 2
   259    259   # resets the file format to 1.
   260    260   #
          261  +set default_file_format [expr $sqlite_default_file_format==4 ? 4 : 1]
   261    262   do_test alter2-5.1 {
   262    263     set_file_format 2
   263    264     get_file_format
   264    265   } {2}
   265    266   do_test alter2-5.2 {
   266    267     execsql {
   267    268       VACUUM;
   268    269     }
   269    270   } {}
   270    271   do_test alter2-5.3 {
   271    272     get_file_format
   272         -} {1}
          273  +} $default_file_format
   273    274    
   274    275   #---------------------------------------------------------------------
   275    276   # Test that when a database with file-format 2 is opened, new 
   276    277   # databases are still created with file-format 1.
   277    278   #
   278    279   do_test alter2-6.1 {
   279    280     db close
................................................................................
   286    287     file delete -force test2.db-journal
   287    288     file delete -force test2.db
   288    289     execsql {
   289    290       ATTACH 'test2.db' AS aux;
   290    291       CREATE TABLE aux.t1(a, b);
   291    292     }
   292    293     get_file_format test2.db
   293         -} {1}
          294  +} $default_file_format
   294    295   do_test alter2-6.3 {
   295    296     execsql {
   296    297       CREATE TABLE t1(a, b);
   297    298     }
   298    299     get_file_format 
   299    300   } {2}
   300    301