/ Check-in [cb236cb9]
Login

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

Overview
Comment:Enhance the virtual table in test_schemapool.c so that it can be used to check that SHARED_SCHEMA connections are not allocating and freeing schemas when they should not be.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | reuse-schema
Files: files | file ages | folders
SHA3-256: cb236cb98564b870317ba3e481a3c7d7f9769b0294a01246bcb724f04e1e7b10
User & Date: dan 2019-02-15 19:36:47
Wiki:reuse-schema
Context
2019-02-18
18:16
Ensure that creating temp schema items does not cause an OPEN_SHARABLE_SCHEMA connection to load all schemas into memory. check-in: 88cbf54e user: dan tags: reuse-schema
2019-02-15
19:36
Enhance the virtual table in test_schemapool.c so that it can be used to check that SHARED_SCHEMA connections are not allocating and freeing schemas when they should not be. check-in: cb236cb9 user: dan tags: reuse-schema
19:00
Fix a problem with eponymous virtual tables and SHARED_SCHEMA databases. Also, after preparing statements that require all database schemas (REINDEX, ANALYZE, CREATE, DROP and some PRAGMA statements), do not allow the database connection to return more than one schema to each schema-pool. check-in: ecf6251e user: dan tags: reuse-schema
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/callback.c.

    29     29   **      SchemaPool. DB_SchemaLoaded flag is set.
    30     30   **
    31     31   **   3) pSPool!=0, pSchema points to the SchemaPool's static object
    32     32   **      (SchemaPool.sSchema).
    33     33   */
    34     34   struct SchemaPool {
    35     35     int nRef;                       /* Number of pointers to this object */
           36  +  int nDelete;                    /* Schema objects deleted by ReleaseAll() */
    36     37     u64 cksum;                      /* Checksum for this Schema contents */
    37     38     Schema *pSchema;                /* Linked list of Schema objects */
    38     39     Schema sSchema;                 /* The single dummy schema object */
    39     40     SchemaPool *pNext;              /* Next element in schemaPoolList */
    40     41   };
    41     42   
    42     43   #ifdef SQLITE_DEBUG
................................................................................
   618    619     ** at least one other copy of the schema being released, delete it instead
   619    620     ** of returning it to the schema-pool.  */
   620    621     if( db->mDbFlags & DBFLAG_FreeSchema ){
   621    622       int i;
   622    623       for(i=0; i<db->nDb; i++){
   623    624         Db *p = &db->aDb[i];
   624    625         if( p!=pDb && p->pSchema!=&pSPool->sSchema && pDb->pSPool==p->pSPool ){
          626  +        pSPool->nDelete++;
   625    627           schemaDelete(pRelease);
   626    628           return;
   627    629         }
   628    630       }
   629    631     }
   630    632   
   631    633     pRelease->pNext = pDb->pSPool->pSchema;

Changes to src/test_schemapool.c.

    25     25   /* The code in this file defines a sqlite3 virtual-table module with
    26     26   ** the following schema.
    27     27   */
    28     28   #define SCHEMAPOOL_SCHEMA \
    29     29   "CREATE TABLE x("         \
    30     30   "  cksum   INTEGER, "     \
    31     31   "  nref    INTEGER, "     \
    32         -"  nschema INTEGER  "     \
           32  +"  nschema INTEGER, "     \
           33  +"  ndelete INTEGER  "     \
    33     34   ")"
           35  +
           36  +#define SCHEMAPOOL_NFIELD 4
    34     37   
    35     38   typedef struct schemapool_vtab schemapool_vtab;
    36     39   typedef struct schemapool_cursor schemapool_cursor;
    37     40   
    38     41   /* A schema table object */
    39     42   struct schemapool_vtab {
    40     43     sqlite3_vtab base;
................................................................................
   102    105   }
   103    106   
   104    107   /*
   105    108   ** Retrieve a column of data.
   106    109   */
   107    110   static int schemaPoolColumn(sqlite3_vtab_cursor *cur, sqlite3_context *ctx, int i){
   108    111     schemapool_cursor *pCur = (schemapool_cursor*)cur;
   109         -  assert( i==0 || i==1 || i==2 );
   110         -  sqlite3_result_int64(ctx, pCur->aData[pCur->iRow*3 + i]);
          112  +  assert( i==0 || i==1 || i==2 || i==3 );
          113  +  sqlite3_result_int64(ctx, pCur->aData[pCur->iRow*SCHEMAPOOL_NFIELD + i]);
   111    114     return SQLITE_OK;
   112    115   }
   113    116   
   114    117   /*
   115    118   ** Retrieve the current rowid.
   116    119   */
   117    120   static int schemaPoolRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
................................................................................
   132    135     schemapool_cursor *pCur = (schemapool_cursor*)cur;
   133    136     pCur->iRow++;
   134    137     return SQLITE_OK;
   135    138   }
   136    139   
   137    140   struct SchemaPool {
   138    141     int nRef;                       /* Number of pointers to this object */
          142  +  int nDelete;                    /* Schema objects deleted by ReleaseAll() */
   139    143     u64 cksum;                      /* Checksum for this Schema contents */
   140    144     Schema *pSchema;                /* Linked list of Schema objects */
   141    145     Schema sSchema;                 /* The single dummy schema object */
   142    146     SchemaPool *pNext;              /* Next element in schemaPoolList */
   143    147   };
   144    148   extern SchemaPool *sqlite3SchemaPoolList(void);
   145    149   
................................................................................
   161    165   
   162    166     for(pSPool = sqlite3SchemaPoolList(); pSPool; pSPool=pSPool->pNext){
   163    167       pCur->nRow++;
   164    168     }
   165    169   
   166    170     if( pCur->nRow ){
   167    171       int iRow = 0;
   168         -    pCur->aData = (i64*)sqlite3_malloc(3 * pCur->nRow * sizeof(i64));
          172  +    int nByte = SCHEMAPOOL_NFIELD * pCur->nRow * sizeof(i64);
          173  +    pCur->aData = (i64*)sqlite3_malloc(nByte);
   169    174       if( pCur->aData==0 ) return SQLITE_NOMEM;
   170    175       for(pSPool = sqlite3SchemaPoolList(); pSPool; pSPool=pSPool->pNext){
   171    176         Schema *p;
   172    177         i64 nSchema = 0;
   173    178         for(p=pSPool->pSchema; p; p=p->pNext){
   174    179           nSchema++;
   175    180         }
   176         -      pCur->aData[0 + iRow*3] = pSPool->cksum;
   177         -      pCur->aData[1 + iRow*3] = (i64)pSPool->nRef;
   178         -      pCur->aData[2 + iRow*3] = nSchema;
          181  +      pCur->aData[0 + iRow*SCHEMAPOOL_NFIELD] = pSPool->cksum;
          182  +      pCur->aData[1 + iRow*SCHEMAPOOL_NFIELD] = (i64)pSPool->nRef;
          183  +      pCur->aData[2 + iRow*SCHEMAPOOL_NFIELD] = nSchema;
          184  +      pCur->aData[3 + iRow*SCHEMAPOOL_NFIELD] = (i64)pSPool->nDelete;
   179    185         iRow++;
   180    186       }
   181    187     }
   182    188   
   183    189     return SQLITE_OK;
   184    190   }
   185    191   

Changes to test/reuse2.test.

    70     70   } {}
    71     71   
    72     72   do_execsql_test -db db1 3.2.1 { SELECT * FROM t1 }
    73     73   do_execsql_test -db db2 3.2.2 { SELECT * FROM t1 }
    74     74   
    75     75   register_schemapool_module db
    76     76   do_execsql_test 3.3 { 
    77         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool;
    78         -} {nref=2 nschema=1}
           77  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
           78  +  FROM schemapool;
           79  +} {nref=2 nschema=1 ndelete=0}
    79     80   
    80     81   sqlite3 db3 test.db -shared-schema 1
    81     82   register_schemapool_module db3
    82     83   
    83     84   do_execsql_test 3.5 { 
    84         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool;
    85         -} {nref=2 nschema=1}
           85  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
           86  +  FROM schemapool;
           87  +} {nref=2 nschema=1 ndelete=0}
    86     88   
    87     89   do_execsql_test -db db3 3.6 { 
    88     90     SELECT * FROM t1;
    89         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool;
    90         -} {nref=3 nschema=1}
           91  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
           92  +  FROM schemapool;
           93  +} {nref=3 nschema=1 ndelete=0}
    91     94   
    92     95   do_execsql_test 3.7 { 
    93     96     CREATE TABLE t2(x);
    94     97   }
    95     98   
    96     99   do_execsql_test 3.8 { 
    97         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool;
    98         -} {nref=3 nschema=1}
          100  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          101  +  FROM schemapool;
          102  +} {nref=3 nschema=1 ndelete=0}
    99    103   
   100    104   do_execsql_test -db db1 3.9.1 { SELECT * FROM t1 }
   101    105   do_execsql_test 3.9.2 { 
   102         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   103         -} {nref=1 nschema=1 nref=2 nschema=1}
          106  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          107  +  FROM schemapool;
          108  +} {nref=1 nschema=1 ndelete=0 nref=2 nschema=1 ndelete=0}
   104    109   
   105    110   do_execsql_test -db db2 3.10.1 { SELECT * FROM t1 }
   106    111   do_execsql_test 3.10.2 { 
   107         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   108         -} {nref=1 nschema=1 nref=2 nschema=1}
          112  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          113  +  FROM schemapool ORDER BY 1;
          114  +} {nref=1 nschema=1 ndelete=0 nref=2 nschema=1 ndelete=0}
   109    115   
   110    116   do_execsql_test -db db3 3.11.1 { SELECT * FROM t1 }
   111    117   do_execsql_test 3.11.2 { 
   112         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   113         -} {nref=3 nschema=1}
          118  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          119  +  FROM schemapool;
          120  +} {nref=3 nschema=1 ndelete=0}
   114    121   
   115    122   #--------------------------------------------------------------------------
   116    123   catch {db1 close}
   117    124   catch {db2 close}
   118    125   catch {db3 close}
   119    126   reset_db
   120    127   do_execsql_test 4.0.1 {
................................................................................
   130    137     }
   131    138     sqlite3 db  test.db
   132    139     sqlite3 db2 test.db -shared-schema 1
   133    140   } {}
   134    141   
   135    142   register_schemapool_module db
   136    143   do_execsql_test 4.0.3 {
   137         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
          144  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          145  +  FROM schemapool;
   138    146   } {}
   139    147   
   140    148   do_test 4.1.1 {
   141    149     execsql { 
   142    150       ATTACH 'test.db1' AS db1; 
   143    151       ATTACH 'test.db2' AS db2;
   144    152       ATTACH 'test.db3' AS db3;
   145    153       ATTACH 'test.db4' AS db4;
   146    154       ATTACH 'test.db5' AS db5;
   147    155     } db2
   148    156   } {}
   149    157   do_execsql_test 4.1.2 {
   150         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
          158  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          159  +  FROM schemapool;
   151    160   } {}
   152    161   do_execsql_test -db db2 4.1.3 {
   153    162     SELECT * FROM db3.x1
   154    163   }
   155    164   do_execsql_test 4.1.4 {
   156         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   157         -} {nref=1 nschema=1}
          165  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          166  +  FROM schemapool;
          167  +} {nref=1 nschema=1 ndelete=0}
   158    168   do_execsql_test -db db2 4.1.5 {
   159    169     SELECT * FROM db2.x1
   160    170   }
   161    171   do_execsql_test 4.1.6 {
   162         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   163         -} {nref=2 nschema=1}
          172  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          173  +  FROM schemapool;
          174  +} {nref=2 nschema=1 ndelete=0}
   164    175   do_execsql_test -db db2 4.1.7 {
   165    176     SELECT * FROM x1
   166    177   }
   167    178   do_execsql_test 4.1.8 {
   168         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   169         -} {nref=6 nschema=1}
          179  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          180  +  FROM schemapool;
          181  +} {nref=6 nschema=1 ndelete=0}
   170    182   
   171    183   do_test 4.2.1 {
   172    184     catchsql { SELECT * FROM abc } db2
   173    185   } {1 {no such table: abc}}
   174    186   do_execsql_test 4.2.2 {
   175         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   176         -} {nref=6 nschema=1}
          187  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          188  +  FROM schemapool;
          189  +} {nref=6 nschema=1 ndelete=0}
   177    190   
   178    191   register_schemapool_module db2
   179    192   do_execsql_test -db db2 4.3.1 {
   180    193     INSERT INTO x1 VALUES(1, 2, 3);
   181    194     INSERT INTO db1.x1 VALUES(4, 5, 6);
   182    195     INSERT INTO db2.x1 VALUES(7, 8, 9);
   183    196     INSERT INTO db3.x1 VALUES(10, 11, 12);
   184    197     INSERT INTO db4.x1 VALUES(13, 14, 15);
   185    198     INSERT INTO db5.x1 VALUES(16, 17, 18);
   186         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   187         -} {nref=6 nschema=1}
          199  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          200  +  FROM schemapool;
          201  +} {nref=6 nschema=1 ndelete=0}
   188    202   
   189    203   do_execsql_test -db db2 4.3.2 {
   190    204     SELECT * FROM db5.x1;
   191    205     SELECT * FROM db4.x1;
   192    206     SELECT * FROM db3.x1;
   193    207     SELECT * FROM db2.x1;
   194    208     SELECT * FROM db1.x1;
   195    209     SELECT * FROM x1;
   196         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
          210  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          211  +  FROM schemapool;
   197    212   } {
   198    213     16 17 18  13 14 15  10 11 12  7 8 9  4 5 6  1 2 3
   199         -  nref=6 nschema=1
          214  +  nref=6 nschema=1 ndelete=0
   200    215   }
   201    216   
   202    217   do_execsql_test -db db2 4.3.3 {
   203    218     UPDATE x1 SET a=a+10;
   204    219     UPDATE db5.x1 SET a=a+10;
   205         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
          220  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          221  +  FROM schemapool;
   206    222   } {
   207         -  nref=6 nschema=1
          223  +  nref=6 nschema=1 ndelete=0
   208    224   }
   209    225   
   210    226   do_execsql_test -db db2 4.3.4 {
   211    227     SELECT * FROM db5.x1;
   212    228     SELECT * FROM db4.x1;
   213    229     SELECT * FROM db3.x1;
   214    230     SELECT * FROM db2.x1;
   215    231     SELECT * FROM db1.x1;
   216    232     SELECT * FROM x1;
   217         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
          233  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          234  +  FROM schemapool;
   218    235   } {
   219    236     26 17 18  13 14 15  10 11 12  7 8 9  4 5 6  11 2 3
   220         -  nref=6 nschema=1
          237  +  nref=6 nschema=1 ndelete=0
   221    238   }
   222    239   
   223    240   do_execsql_test -db db2 4.3.5 {
   224    241     DELETE FROM db3.x1;
   225    242     DELETE FROM x1;
   226         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
          243  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          244  +  FROM schemapool;
   227    245   } {
   228         -  nref=6 nschema=1
          246  +  nref=6 nschema=1 ndelete=0
   229    247   }
   230    248   
   231    249   do_execsql_test -db db2 4.3.6 {
   232    250     SELECT * FROM db5.x1;
   233    251     SELECT * FROM db4.x1;
   234    252     SELECT * FROM db3.x1;
   235    253     SELECT * FROM db2.x1;
   236    254     SELECT * FROM db1.x1;
   237    255     SELECT * FROM x1;
   238         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
          256  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          257  +  FROM schemapool;
   239    258   } {
   240    259     26 17 18  13 14 15  7 8 9  4 5 6 
   241         -  nref=6 nschema=1
          260  +  nref=6 nschema=1 ndelete=0
   242    261   }
   243    262   
   244    263   do_execsql_test -db db2 4.3.6 {
   245    264     SELECT * FROM db5.x1, db4.x1, db1.x1;
   246         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   247         -} {26 17 18 13 14 15 4 5 6 nref=6 nschema=3}
          265  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          266  +  FROM schemapool;
          267  +} {26 17 18 13 14 15 4 5 6 nref=6 nschema=3 ndelete=0}
   248    268   
   249    269   #--------------------------------------------------------------------------
   250    270   # Test the incremental-blob API with REUSE_SCHEMA connections.
   251    271   #
   252    272   catch {db1 close}
   253    273   catch {db2 close}
   254    274   catch {db3 close}
................................................................................
   265    285       forcecopy test.db test.db${i}
   266    286       sqlite3 db test.db${i}
   267    287       db eval { INSERT INTO bbb VALUES(123, 'database_' || $i) }
   268    288       db close
   269    289       db2 eval "ATTACH 'test.db${i}' AS db${i}"
   270    290     }
   271    291     execsql {
   272         -    SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
          292  +    SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          293  +      FROM schemapool;
   273    294     } db2
   274         -} {nref=6 nschema=1}
          295  +} {nref=6 nschema=1 ndelete=0}
   275    296   
   276    297   do_test 5.1.1 {
   277    298     set res [list]
   278    299     for {set i 1} {$i<6} {incr i} {
   279    300       set chan [db2 incrblob db${i} bbb b 123]
   280    301       lappend res [gets $chan]
   281    302       close $chan
   282    303     }
   283    304     set res
   284    305   } {database_1 database_2 database_3 database_4 database_5}
   285    306   
   286    307   do_execsql_test -db db2 5.1.2 {
   287         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   288         -} {nref=6 nschema=1}
          308  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          309  +  FROM schemapool;
          310  +} {nref=6 nschema=1 ndelete=0}
   289    311   
   290    312   do_test 5.2.1 {
   291    313     sqlite3_table_column_metadata db2 main bbb a
   292    314   } {INTEGER BINARY 0 1 0}
   293    315   do_test 5.2.2 {
   294    316     sqlite3_table_column_metadata db2 main bbb b
   295    317   } {{} BINARY 0 0 0}
   296    318   
   297    319   do_execsql_test -db db2 5.2.3 {
   298         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   299         -} {nref=6 nschema=1}
          320  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          321  +  FROM schemapool;
          322  +} {nref=6 nschema=1 ndelete=0}
   300    323   
   301         -breakpoint
   302    324   do_execsql_test -db db2 5.2.4 {
   303    325     PRAGMA integrity_check;
   304         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool ORDER BY 1;
   305         -} {ok nref=6 nschema=1}
          326  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete
          327  +  FROM schemapool;
          328  +} {ok nref=6 nschema=1 ndelete=5}
   306    329   
   307    330   finish_test
   308    331   

Changes to test/reuse3.test.

   152    152     for {set i 1} {$i < 5} {incr i} {
   153    153       forcedelete test.db${i} test.db${i}-wal test.db${i}-journal
   154    154       forcecopy test.db test.db${i}
   155    155       execsql "ATTACH 'test.db${i}' AS db${i}"
   156    156     }
   157    157     register_schemapool_module db
   158    158     set {} {}
   159         -  execsql { SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool }
   160         -} {nref=5 nschema=1}
          159  +  execsql { 
          160  +    SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete 
          161  +    FROM schemapool 
          162  +  }
          163  +} {nref=5 nschema=1 ndelete=0}
   161    164   
          165  +breakpoint
   162    166   do_execsql_test 4.1.3 {
   163         -  REINDEX x1;
   164         -  REINDEX x1a;
   165         -  REINDEX x1b;
   166         -  REINDEX x1c;
   167         -  REINDEX db1.x1a;
   168         -  REINDEX db2.x1b;
   169         -  REINDEX db3.x1c;
   170         -  REINDEX;
          167  +  REINDEX  x1;
          168  +  REINDEX  x1a;
          169  +  REINDEX  x1b;
          170  +  REINDEX  x1c;
          171  +  REINDEX  db1.x1a;
          172  +  REINDEX  db2.x1b;
          173  +  REINDEX  db3.x1c;
   171    174   }
   172    175   
   173    176   do_execsql_test 4.1.4 {
   174         -  SELECT 'nref=' || nRef, 'nschema=' || nSchema FROM schemapool;
   175         -} {nref=5 nschema=1}
          177  +  SELECT 'nref=' || nRef, 'nschema=' || nSchema, 'ndelete=' || nDelete 
          178  +    FROM schemapool 
          179  +} {nref=5 nschema=1 ndelete=28}
   176    180   
   177    181   finish_test
   178    182