/ Check-in [62d38308]
Login

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

Overview
Comment:Updates to evidence marks and requirements. No changes to code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 62d38308b519a5362f559b296a0cf1acccf8f673
User & Date: drh 2014-08-11 15:54:11
Context
2014-08-11
17:37
Add a few more requirements tests. check-in: b5652439 user: drh tags: trunk
15:54
Updates to evidence marks and requirements. No changes to code. check-in: 62d38308 user: drh tags: trunk
14:21
Fix harmless compiler warnings. check-in: 52b03f04 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/legacy.c.

    92     92               if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){
    93     93                 db->mallocFailed = 1;
    94     94                 goto exec_out;
    95     95               }
    96     96             }
    97     97           }
    98     98           if( xCallback(pArg, nCol, azVals, azCols) ){
           99  +          /* EVIDENCE-OF: R-38229-40159 If the callback function to
          100  +          ** sqlite3_exec() returns non-zero, then sqlite3_exec() will
          101  +          ** return SQLITE_ABORT. */
    99    102             rc = SQLITE_ABORT;
   100    103             sqlite3VdbeFinalize((Vdbe *)pStmt);
   101    104             pStmt = 0;
   102    105             sqlite3Error(db, SQLITE_ABORT, 0);
   103    106             goto exec_out;
   104    107           }
   105    108         }

Changes to src/main.c.

   823    823   }
   824    824   
   825    825   /*
   826    826   ** Close an existing SQLite database
   827    827   */
   828    828   static int sqlite3Close(sqlite3 *db, int forceZombie){
   829    829     if( !db ){
          830  +    /* EVIDENCE-OF: R-63257-11740 Calling sqlite3_close() or
          831  +    ** sqlite3_close_v2() with a NULL pointer argument is a harmless no-op. */
   830    832       return SQLITE_OK;
   831    833     }
   832    834     if( !sqlite3SafetyCheckSickOrOk(db) ){
   833    835       return SQLITE_MISUSE_BKPT;
   834    836     }
   835    837     sqlite3_mutex_enter(db->mutex);
   836    838   

Changes to src/resolve.c.

   706    706                                         "constant between 0.0 and 1.0");
   707    707                 pNC->nErr++;
   708    708               }
   709    709             }else{
   710    710               /* EVIDENCE-OF: R-61304-29449 The unlikely(X) function is equivalent to
   711    711               ** likelihood(X, 0.0625).
   712    712               ** EVIDENCE-OF: R-01283-11636 The unlikely(X) function is short-hand for
   713         -            ** likelihood(X,0.0625). */
          713  +            ** likelihood(X,0.0625).
          714  +            ** EVIDENCE-OF: R-36850-34127 The likely(X) function is short-hand for
          715  +            ** likelihood(X,0.9375).
          716  +            ** EVIDENCE-OF: R-53436-40973 The likely(X) function is equivalent to
          717  +            ** likelihood(X,0.9375). */
   714    718               /* TUNING: unlikely() probability is 0.0625.  likely() is 0.9375 */
   715    719               pExpr->iTable = pDef->zName[0]=='u' ? 62 : 938;
   716    720             }             
   717    721           }
   718    722         }
   719    723   #ifndef SQLITE_OMIT_AUTHORIZATION
   720    724         if( pDef ){

Changes to src/sqlite.h.in.

   268    268   ** the [sqlite3] object is successfully destroyed and all associated
   269    269   ** resources are deallocated.
   270    270   **
   271    271   ** ^If the database connection is associated with unfinalized prepared
   272    272   ** statements or unfinished sqlite3_backup objects then sqlite3_close()
   273    273   ** will leave the database connection open and return [SQLITE_BUSY].
   274    274   ** ^If sqlite3_close_v2() is called with unfinalized prepared statements
   275         -** and unfinished sqlite3_backups, then the database connection becomes
          275  +** and/or unfinished sqlite3_backups, then the database connection becomes
   276    276   ** an unusable "zombie" which will automatically be deallocated when the
   277    277   ** last prepared statement is finalized or the last sqlite3_backup is
   278    278   ** finished.  The sqlite3_close_v2() interface is intended for use with
   279    279   ** host languages that are garbage collected, and where the order in which
   280    280   ** destructors are called is arbitrary.
   281    281   **
   282    282   ** Applications should [sqlite3_finalize | finalize] all [prepared statements],
   283    283   ** [sqlite3_blob_close | close] all [BLOB handles], and 
   284    284   ** [sqlite3_backup_finish | finish] all [sqlite3_backup] objects associated
   285    285   ** with the [sqlite3] object prior to attempting to close the object.  ^If
   286    286   ** sqlite3_close_v2() is called on a [database connection] that still has
   287    287   ** outstanding [prepared statements], [BLOB handles], and/or
   288         -** [sqlite3_backup] objects then it returns [SQLITE_OK] but the deallocation
          288  +** [sqlite3_backup] objects then it returns [SQLITE_OK] and the deallocation
   289    289   ** of resources is deferred until all [prepared statements], [BLOB handles],
   290    290   ** and [sqlite3_backup] objects are also destroyed.
   291    291   **
   292    292   ** ^If an [sqlite3] object is destroyed while a transaction is open,
   293    293   ** the transaction is automatically rolled back.
   294    294   **
   295    295   ** The C parameter to [sqlite3_close(C)] and [sqlite3_close_v2(C)]

Changes to test/func3.test.

   149    149   # the code generator optimizes away so that it consumes no CPU cycles at
   150    150   # run-time (that is, during calls to sqlite3_step()).
   151    151   #
   152    152   do_test func3-5.39 {
   153    153     db eval {EXPLAIN SELECT unlikely(min(1.0+'2.0',4*11))}
   154    154   } [db eval {EXPLAIN SELECT min(1.0+'2.0',4*11)}]
   155    155   
   156         -do_execsql_test func3-5.40 {
          156  +
          157  +# EVIDENCE-OF: R-23735-03107 The likely(X) function returns the argument
          158  +# X unchanged.
          159  +#
          160  +do_execsql_test func3-5.50 {
   157    161     SELECT likely(9223372036854775807);
   158    162   } {9223372036854775807}
   159         -do_execsql_test func3-5.41 {
          163  +do_execsql_test func3-5.51 {
   160    164     SELECT likely(-9223372036854775808);
   161    165   } {-9223372036854775808}
   162         -do_execsql_test func3-5.42 {
          166  +do_execsql_test func3-5.52 {
   163    167     SELECT likely(14.125);
   164    168   } {14.125}
   165         -do_execsql_test func3-5.43 {
          169  +do_execsql_test func3-5.53 {
   166    170     SELECT likely(NULL);
   167    171   } {{}}
   168         -do_execsql_test func3-5.44 {
          172  +do_execsql_test func3-5.54 {
   169    173     SELECT likely('test-string');
   170    174   } {test-string}
   171         -do_execsql_test func3-5.45 {
          175  +do_execsql_test func3-5.55 {
   172    176     SELECT quote(likely(x'010203000405'));
   173    177   } {X'010203000405'}
   174         -do_test func3-5.49 {
          178  +
          179  +# EVIDENCE-OF: R-43464-09689 The likely(X) function is a no-op that the
          180  +# code generator optimizes away so that it consumes no CPU cycles at
          181  +# run-time (that is, during calls to sqlite3_step()).
          182  +#
          183  +do_test func3-5.59 {
   175    184     db eval {EXPLAIN SELECT likely(min(1.0+'2.0',4*11))}
   176    185   } [db eval {EXPLAIN SELECT min(1.0+'2.0',4*11)}]
          186  +
   177    187   
   178    188   
   179    189   
   180    190   finish_test