/ Check-in [ca3fdfd4]
Login

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

Overview
Comment:Make sure errors encountered while initializing extensions such as FTS4 get reported out from sqlite3_open(). This fixes a bug introduced by check-in [9d347f547e7ba9]. Also remove lots of forgotten "breakpoint" commands left in test scripts over the years.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ca3fdfd41961d8d3d1e39d20dc628e8a95dabb2f
User & Date: drh 2013-12-19 16:26:05
Context
2013-12-19
17:04
Do not inject OOM faults into SQLITE_FCNTL_COMMIT_PHASE_TWO file-control invocations. It causes problems for test scripts. check-in: 8eb28d23 user: dan tags: trunk
16:26
Make sure errors encountered while initializing extensions such as FTS4 get reported out from sqlite3_open(). This fixes a bug introduced by check-in [9d347f547e7ba9]. Also remove lots of forgotten "breakpoint" commands left in test scripts over the years. check-in: ca3fdfd4 user: drh tags: trunk
14:34
Remove an unneeded column-cache flush in aggregate SELECT and an unreachable branch in the INSERT logic. check-in: ffa092e1 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

  2636   2636     ** mode.  Doing nothing at all also makes NORMAL the default.
  2637   2637     */
  2638   2638   #ifdef SQLITE_DEFAULT_LOCKING_MODE
  2639   2639     db->dfltLockMode = SQLITE_DEFAULT_LOCKING_MODE;
  2640   2640     sqlite3PagerLockingMode(sqlite3BtreePager(db->aDb[0].pBt),
  2641   2641                             SQLITE_DEFAULT_LOCKING_MODE);
  2642   2642   #endif
         2643  +
         2644  +  if( rc ) sqlite3Error(db, rc, 0);
  2643   2645   
  2644   2646     /* Enable the lookaside-malloc subsystem */
  2645   2647     setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside,
  2646   2648                           sqlite3GlobalConfig.nLookaside);
  2647   2649   
  2648   2650     sqlite3_wal_autocheckpoint(db, SQLITE_DEFAULT_WAL_AUTOCHECKPOINT);
  2649   2651   

Changes to test/attach3.test.

   318    318   do_test attach3-12.9 {
   319    319     execsql {
   320    320       ATTACH DATABASE '' AS NULL
   321    321     }
   322    322     db_list
   323    323   } {main temp {}}
   324    324   do_test attach3-12.10 {
   325         -breakpoint
   326    325     execsql {
   327    326       DETACH ?
   328    327     }
   329    328     db_list
   330    329   } {main temp}
   331    330   do_test attach3-12.11 {
   332    331     catchsql {

Changes to test/capi3.test.

  1187   1187     db2 close
  1188   1188     sqlite3_step $STMT
  1189   1189   } {SQLITE_ERROR}
  1190   1190   do_test capi3-18.2 {
  1191   1191     sqlite3_reset $STMT
  1192   1192     sqlite3_errcode db
  1193   1193   } {SQLITE_SCHEMA}
  1194         -breakpoint
  1195   1194   do_test capi3-18.3 {
  1196   1195     sqlite3_errmsg db
  1197   1196   } {database schema has changed}
  1198   1197   # The error persist on retry when sqlite3_prepare() has been used.
  1199   1198   do_test capi3-18.4 {
  1200   1199     sqlite3_step $STMT
  1201   1200   } {SQLITE_ERROR}

Changes to test/collate1.test.

    71     71   } {}
    72     72   do_test collate1-1.1 {
    73     73     execsql {
    74     74       SELECT c2 FROM collate1t1 ORDER BY 1;
    75     75     }
    76     76   } {{} 0x119 0x2D}
    77     77   do_test collate1-1.2 {
    78         -breakpoint
    79     78     execsql {
    80     79       SELECT c2 FROM collate1t1 ORDER BY 1 COLLATE hex;
    81     80     }
    82     81   } {{} 0x2D 0x119}
    83     82   do_test collate1-1.3 {
    84     83     execsql {
    85     84       SELECT c2 FROM collate1t1 ORDER BY 1 COLLATE hex DESC;

Changes to test/exclusive2.test.

   297    297     execsql {
   298    298       PRAGMA locking_mode = exclusive;
   299    299       INSERT INTO t1 VALUES(randstr(200, 200));
   300    300     }
   301    301     readPagerChangeCounter test.db
   302    302   } {4}
   303    303   do_test exclusive2-3.4 {
   304         -breakpoint
   305    304     execsql {
   306    305       INSERT INTO t1 VALUES(randstr(200, 200));
   307    306     }
   308    307     readPagerChangeCounter test.db
   309    308   } {4}
   310    309   do_test exclusive2-3.5 {
   311    310     execsql {

Changes to test/fts3aa.test.

   142    142   do_test fts3aa-3.2 {
   143    143     execsql {SELECT rowid FROM t1 WHERE content MATCH 'one -two'}
   144    144   } {1 5 9 13 17 21 25 29}
   145    145   do_test fts3aa-3.3 {
   146    146     execsql {SELECT rowid FROM t1 WHERE content MATCH '-two one'}
   147    147   } {1 5 9 13 17 21 25 29}
   148    148   
   149         -breakpoint
   150    149   do_test fts3aa-4.1 {
   151    150     execsql {SELECT rowid FROM t1 WHERE content MATCH 'one OR two'}
   152    151   } {1 2 3 5 6 7 9 10 11 13 14 15 17 18 19 21 22 23 25 26 27 29 30 31}
   153    152   do_test fts3aa-4.2 {
   154    153     execsql {SELECT rowid FROM t1 WHERE content MATCH '"one two" OR three'}
   155    154   } {3 4 5 6 7 11 12 13 14 15 19 20 21 22 23 27 28 29 30 31}
   156    155   do_test fts3aa-4.3 {

Changes to test/fts3ab.test.

   111    111      CREATE VIRTUAL TABLE t4 USING fts3([norm],'plusone',"invert");
   112    112   }
   113    113   for {set i 1} {$i<=15} {incr i} {
   114    114     set vset [list [wordset $i] [wordset [expr {$i+1}]] [wordset [expr {~$i}]]]
   115    115     db eval "INSERT INTO t4(norm,plusone,invert) VALUES([join $vset ,]);"
   116    116   }
   117    117   
   118         -breakpoint
   119    118   do_test fts3ab-4.1 {
   120    119     execsql {SELECT rowid FROM t4 WHERE t4 MATCH 'norm:one'}
   121    120   } {1 3 5 7 9 11 13 15}
   122    121   do_test fts3ab-4.2 {
   123    122     execsql {SELECT rowid FROM t4 WHERE norm MATCH 'one'}
   124    123   } {1 3 5 7 9 11 13 15}
   125    124   do_test fts3ab-4.3 {

Changes to test/fts3ag.test.

    74     74   do_test fts3ag-1.10 {
    75     75     catchsql {SELECT rowid FROM t1 WHERE t1 MATCH '-this -something'}
    76     76   } {1 {malformed MATCH expression: [-this -something]}}
    77     77   
    78     78   # Test that docListOrMerge() correctly handles reaching the end of one
    79     79   # doclist before it reaches the end of the other.
    80     80   do_test fts3ag-1.11 {
    81         -breakpoint
    82     81     execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'this OR also'}
    83     82   } {1 2}
    84     83   do_test fts3ag-1.12 {
    85     84     execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'also OR this'}
    86     85   } {1 2}
    87     86   
    88     87   # Empty left and right in docListOrMerge().  Each term matches neither
    89     88   # row, and when combined there was an assertion failure.
    90     89   do_test fts3ag-1.13 {
    91     90     execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'something OR nothing'}
    92     91   } {}
    93     92   
    94     93   finish_test

Changes to test/fts3d.test.

   249    249   check_doclist fts3d-4.4.7  1 0 this {[1 0[0]] [3 0[0]]}
   250    250   check_doclist fts3d-4.4.8  1 0 three {[1] [2] [3]}
   251    251   check_doclist fts3d-4.4.9  1 0 two {[1] [2] [3]}
   252    252   check_doclist fts3d-4.4.10 1 0 was {[2 0[1]]}
   253    253   
   254    254   # Optimize should leave the result in the level of the highest-level
   255    255   # prior segment.
   256         -breakpoint
   257    256   do_test fts3d-4.5 {
   258    257     execsql {
   259    258       SELECT OPTIMIZE(t1) FROM t1 LIMIT 1;
   260    259       SELECT level, idx FROM t1_segdir ORDER BY level, idx;
   261    260     }
   262    261   } {{Index optimized} 1 0}
   263    262   

Changes to test/fts3near.test.

   161    161     execsql {SELECT offsets(t1) FROM t1 WHERE content MATCH 'two NEAR/2 three'}
   162    162   } {{0 0 4 3 0 1 8 5 0 0 14 3 0 1 27 5}}
   163    163   do_test fts3near-3.6 {
   164    164     execsql {
   165    165       SELECT offsets(t1) FROM t1 WHERE content MATCH 'three NEAR/0 "two four"'
   166    166     }
   167    167   } {{0 0 8 5 0 1 14 3 0 2 18 4}}
   168         -breakpoint
   169    168   do_test fts3near-3.7 {
   170    169     execsql {
   171    170       SELECT offsets(t1) FROM t1 WHERE content MATCH '"two four" NEAR/0 three'}
   172    171   } {{0 2 8 5 0 0 14 3 0 1 18 4}}
   173    172   
   174    173   db eval {
   175    174     INSERT INTO t1(content) VALUES('

Changes to test/fts3tok1.test.

    86     86   }
    87     87   
    88     88   do_execsql_test 1.13.1 {
    89     89     CREATE TABLE c1(x);
    90     90     INSERT INTO c1(x) VALUES('a b c');
    91     91     INSERT INTO c1(x) VALUES('d e f');
    92     92   }
    93         -breakpoint
    94     93   do_execsql_test 1.13.2 {
    95     94     SELECT * FROM c1, t1 WHERE input = x AND c1.rowid=t1.rowid;
    96     95   } {
    97     96     {a b c} {a b c} a 0 1 0 
    98     97     {d e f} {d e f} e 2 3 1 
    99     98   }
   100     99   

Changes to test/fts4unicode.test.

   388    388     do_isspace_test 6.$T.22 $T   {8200 8201 8202 8239}
   389    389     do_isspace_test 6.$T.23 $T   {8287 12288}
   390    390   }
   391    391   
   392    392   #-------------------------------------------------------------------------
   393    393   # Test that the private use ranges are treated as alphanumeric.
   394    394   #
   395         -breakpoint
   396    395   foreach {tn1 c} {
   397    396     1 \ue000 2 \ue001 3 \uf000 4 \uf8fe 5 \uf8ff
   398    397   } {
   399    398     foreach {tn2 config res} {
   400    399       1 ""             "0 hello*world hello*world"
   401    400       2 "separators=*" "0 hello hello 1 world world"
   402    401     } {
................................................................................
   553    552     );
   554    553     SELECT token FROM ft1 WHERE input = 'berlin@street123sydney.road';
   555    554   } {
   556    555     berlin@street sydney.road
   557    556   }
   558    557   
   559    558   finish_test
   560         -
   561         -
   562         -
   563         -

Changes to test/mmapfault.test.

    37     37     faultsim_save_and_close
    38     38   } {}
    39     39   
    40     40   
    41     41   do_faultsim_test 1 -prep {
    42     42     faultsim_restore_and_reopen
    43     43     db func a_string a_string
    44         -  breakpoint
    45     44     execsql {
    46     45       PRAGMA mmap_size = 1000000;
    47     46       PRAGMA cache_size = 5;
    48     47       BEGIN;
    49     48         INSERT INTO t1 SELECT a_string(200), a_string(300) FROM t1;
    50     49         INSERT INTO t1 SELECT a_string(200), a_string(300) FROM t1;
    51     50         INSERT INTO t1 SELECT a_string(200), a_string(300) FROM t1;

Changes to test/securedel.test.

    43     43   do_test securedel-1.3 {
    44     44     db eval {
    45     45       PRAGMA secure_delete=OFF;
    46     46       PRAGMA db2.secure_delete;
    47     47     }
    48     48   } {0 0}
    49     49   do_test securedel-1.4 {
    50         -breakpoint
    51     50     db eval {
    52     51       PRAGMA secure_delete=ON;
    53     52       PRAGMA db2.secure_delete;
    54     53     }
    55     54   } {1 1}
    56     55   
    57     56   do_test securedel-2.1 {

Changes to test/stat.test.

   160    160     t5 / 19 leaf 0 0 1016 0 \
   161    161   ]
   162    162   
   163    163   db close
   164    164   forcedelete test.db
   165    165   sqlite3 db test.db
   166    166   register_dbstat_vtab db
   167         -breakpoint
   168    167   do_execsql_test stat-5.1 {
   169    168     PRAGMA auto_vacuum = OFF;
   170    169     CREATE VIRTUAL TABLE temp.stat USING dbstat;
   171    170     CREATE TABLE t1(x);
   172    171     INSERT INTO t1 VALUES(zeroblob(1513));
   173    172     INSERT INTO t1 VALUES(zeroblob(1514));
   174    173     SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload

Changes to test/tkt-94c04eaadb.test.

    40     40   
    41     41   # Read from and write to the db just past the 4096MB mark.
    42     42   #
    43     43   do_test tkt-94c94-2.1 {
    44     44     execsql { CREATE TABLE t2(x, y) } db
    45     45   } {}
    46     46   do_test tkt-94c94-2.2 {
    47         -breakpoint
    48     47     execsql { INSERT INTO t2 VALUES(1, 2) } db2
    49     48   } {}
    50     49   do_test tkt-94c94-2.3 {
    51     50     execsql { SELECT * FROM t2 } db
    52     51   } {1 2}
    53     52   do_test tkt-94c94-2.4 {
    54     53     sqlite3async_control halt idle

Changes to test/vtab_shared.test.

   112    112       set error [catchsql { DROP TABLE t1 } db2]
   113    113       break
   114    114     }
   115    115     set error
   116    116   } {1 {database table is locked: sqlite_master}}
   117    117   
   118    118   do_test vtab_shared-1.11 {
   119         -breakpoint
   120    119     execsql {
   121    120       CREATE VIRTUAL TABLE t2 USING echo(t0);
   122    121       CREATE VIRTUAL TABLE t3 USING echo(t0);
   123    122     }
   124    123     execsql { SELECT * FROM t3 } db2
   125    124   } {1 2 3 4 5 6}
   126    125   

Changes to test/wal.test.

   848    848     set fd [open test.db-wal w]
   849    849     seek $fd [expr 200*1024*1024]
   850    850     puts $fd ""
   851    851     close $fd
   852    852     sqlite3 db test.db
   853    853     execsql { SELECT * FROM t2 }
   854    854   } {B 2}
   855         -breakpoint
   856    855   do_test wal-13.1.3 {
   857    856     db close
   858    857     file exists test.db-wal
   859    858   } {0}
   860    859   
   861    860   do_test wal-13.2.1 {
   862    861     sqlite3 db test.db

Changes to test/wal2.test.

  1275   1275       PRAGMA wal_autocheckpoint = OFF;
  1276   1276       PRAGMA journal_mode = WAL;
  1277   1277       PRAGMA checkpoint_fullfsync = [lindex $settings 0];
  1278   1278       PRAGMA fullfsync = [lindex $settings 1];
  1279   1279       PRAGMA synchronous = [lindex $settings 2];
  1280   1280     " {0 wal}
  1281   1281   
  1282         -if { $tn==2} breakpoint
  1283   1282     do_test 15.$tn.2 {
  1284   1283       set sync(normal) 0
  1285   1284       set sync(full) 0
  1286   1285       execsql { INSERT INTO t1 VALUES('abc') }
  1287   1286       list $::sync(normal) $::sync(full)
  1288   1287     } $restart_sync
  1289   1288   

Changes to test/walfault.test.

   563    563         INSERT INTO abc VALUES(randomblob(1500));
   564    564       COMMIT;
   565    565     }
   566    566     faultsim_save_and_close
   567    567   } {}
   568    568   do_faultsim_test walfault-14 -prep {
   569    569     faultsim_restore_and_reopen
   570         -  breakpoint
   571    570     execsql {
   572    571       SELECT count(*) FROM abc;
   573    572       PRAGMA locking_mode = exclusive;
   574    573       BEGIN;
   575    574         INSERT INTO abc VALUES(randomblob(1500));
   576    575       COMMIT;
   577    576     }