/ Check-in [85483c8f]
Login

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

Overview
Comment:Add a test to verify that IN(...) WHERE clause terms are not handled by virtual table implemetations. (CVS 5221)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 85483c8fb3b45281ce07e84349841fc80e560b1f
User & Date: danielk1977 2008-06-16 06:31:35
Context
2008-06-16
14:19
Fix a problem with the incremental blob API. sqlite3_blob_open() was always reading the data for the leftmost column of the row that the opened blob was stored in. If this column happened to contain a (the) large blob, sqlite would make a large memory allocation to read the data into. Which defeats the purpose of using incremental blobs. (CVS 5222) check-in: 1b9478da user: danielk1977 tags: trunk
06:31
Add a test to verify that IN(...) WHERE clause terms are not handled by virtual table implemetations. (CVS 5221) check-in: 85483c8f user: danielk1977 tags: trunk
2008-06-15
02:51
Continuing work on the new memory allocation subsystem. Added routines for temporary memory allocation. Right the btree balance mechanism to only do one temporary allocation at a time. (CVS 5220) check-in: 65fe7b62 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/vtab1.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   # This file implements regression tests for SQLite library.  The
    12     12   # focus of this file is creating and dropping virtual tables.
    13     13   #
    14         -# $Id: vtab1.test,v 1.52 2008/04/10 16:42:59 drh Exp $
           14  +# $Id: vtab1.test,v 1.53 2008/06/16 06:31:35 danielk1977 Exp $
    15     15   
    16     16   set testdir [file dirname $argv0]
    17     17   source $testdir/tester.tcl
    18     18   
    19     19   ifcapable !vtab||!schema_pragmas {
    20     20     finish_test
    21     21     return
................................................................................
    36     36   #
    37     37   # This file uses the "echo" module (see src/test8.c). Refer to comments
    38     38   # in that file for the special behaviour of the Tcl $echo_module variable.
    39     39   #
    40     40   # TODO: 
    41     41   #   * How to test the sqlite3_index_constraint_usage.omit field?
    42     42   #   * vtab1-5.*
           43  +#
           44  +# vtab1-14.*: Test 'IN' constraints - i.e. "SELECT * FROM t1 WHERE id IN(...)"
    43     45   #
    44     46   
    45     47   
    46     48   #----------------------------------------------------------------------
    47     49   # Test cases vtab1.1.*
    48     50   #
    49     51   
................................................................................
  1006   1008   do_test vtab1.12-2 {
  1007   1009     catchsql { INSERT INTO echo_c SELECT * FROM b; }
  1008   1010   } {1 {constraint failed}}
  1009   1011   do_test vtab1.12-3 {
  1010   1012     execsql { SELECT * FROM c }
  1011   1013   } {3 G H}
  1012   1014   
  1013         -breakpoint
  1014         -
  1015   1015   # Now the real test - wrapped in a transaction.
  1016   1016   do_test vtab1.12-4 {
  1017   1017     execsql  {BEGIN}
  1018   1018     catchsql { INSERT INTO echo_c SELECT * FROM b; }
  1019   1019   } {1 {constraint failed}}
  1020   1020   do_test vtab1.12-5 {
  1021   1021     execsql { SELECT * FROM c }
................................................................................
  1051   1051   } {15 {} 16}
  1052   1052   do_test vtab1.13-3 {
  1053   1053     execsql { 
  1054   1054       SELECT * FROM echo_c WHERE b IS NULL AND a = 15;
  1055   1055     }
  1056   1056   } {15 {} 16}
  1057   1057   
         1058  +
         1059  +do_test vtab1-14.1 {
         1060  +  execsql { DELETE FROM c }
         1061  +  set echo_module ""
         1062  +  execsql { SELECT * FROM echo_c WHERE rowid IN (1, 2, 3) }
         1063  +  set echo_module
         1064  +} [list xBestIndex {SELECT rowid, * FROM 'c'} xFilter {SELECT rowid, * FROM 'c'}]
         1065  +
         1066  +do_test vtab1-14.2 {
         1067  +  set echo_module ""
         1068  +  execsql { SELECT * FROM echo_c WHERE rowid = 1 }
         1069  +  set echo_module
         1070  +} [list xBestIndex {SELECT rowid, * FROM 'c' WHERE rowid = ?} xFilter {SELECT rowid, * FROM 'c' WHERE rowid = ?} 1]
         1071  +
         1072  +do_test vtab1-14.3 {
         1073  +  set echo_module ""
         1074  +  execsql { SELECT * FROM echo_c WHERE a = 1 }
         1075  +  set echo_module
         1076  +} [list xBestIndex {SELECT rowid, * FROM 'c' WHERE a = ?} xFilter {SELECT rowid, * FROM 'c' WHERE a = ?} 1]
         1077  +
         1078  +do_test vtab1-14.4 {
         1079  +  set echo_module ""
         1080  +  execsql { SELECT * FROM echo_c WHERE a IN (1, 2) }
         1081  +  set echo_module
         1082  +} [list xBestIndex {SELECT rowid, * FROM 'c'} xFilter {SELECT rowid, * FROM 'c'}]
         1083  +
  1058   1084   unset -nocomplain echo_module_begin_fail
  1059   1085   finish_test