/ Check-in [c3b38efd]
Login

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

Overview
Comment:Minor code simplifications.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c3b38efd50c3c07b6dee5dea4c1f95b37d1c0994
User & Date: drh 2016-02-15 18:02:13
Context
2016-02-15
18:15
Add the SQLITE_NOMEM_BKPT macro to enhance the ability to debug OOM errors. Only effective with compiling with SQLITE_DEBUG. check-in: 9b345476 user: drh tags: trunk
18:02
Minor code simplifications. check-in: c3b38efd user: drh tags: trunk
17:56
Make the application-defined SQL function logic more compact and faster, especially faster for the case where an application defines thousands of new SQL functions. check-in: 7d49ed32 user: drh tags: trunk
2016-02-11
13:30
Minor simplifications deferred to the next release. Closed-Leaf check-in: a863729c user: drh tags: simplify
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/build.c.

706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
....
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
** function returns the index of the named database in db->aDb[], or
** -1 if the named db cannot be found.
*/
int sqlite3FindDbName(sqlite3 *db, const char *zName){
  int i = -1;         /* Database number */
  if( zName ){
    Db *pDb;
    int n = sqlite3Strlen30(zName);
    for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){
      if( (!OMIT_TEMPDB || i!=1 ) && n==sqlite3Strlen30(pDb->zName) && 
          0==sqlite3StrICmp(pDb->zName, zName) ){
        break;
      }
    }
  }
  return i;
}

/*
** The token *pName contains the name of a database (either "main" or
................................................................................
      for(k=0; k<pIdx->nKeyCol; k++){
        const char *z1;
        const char *z2;
        assert( pIdx->aiColumn[k]>=0 );
        if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break;
        z1 = pIdx->azColl[k];
        z2 = pIndex->azColl[k];
        if( z1!=z2 && sqlite3StrICmp(z1, z2) ) break;
      }
      if( k==pIdx->nKeyCol ){
        if( pIdx->onError!=pIndex->onError ){
          /* This constraint creates the same index as a previous
          ** constraint specified somewhere in the CREATE TABLE statement.
          ** However the ON CONFLICT clauses are different. If both this 
          ** constraint and the previous equivalent constraint have explicit







<

<
|
<
<







 







|







706
707
708
709
710
711
712

713

714


715
716
717
718
719
720
721
....
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
** function returns the index of the named database in db->aDb[], or
** -1 if the named db cannot be found.
*/
int sqlite3FindDbName(sqlite3 *db, const char *zName){
  int i = -1;         /* Database number */
  if( zName ){
    Db *pDb;

    for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){

      if( 0==sqlite3StrICmp(pDb->zName, zName) ) break;


    }
  }
  return i;
}

/*
** The token *pName contains the name of a database (either "main" or
................................................................................
      for(k=0; k<pIdx->nKeyCol; k++){
        const char *z1;
        const char *z2;
        assert( pIdx->aiColumn[k]>=0 );
        if( pIdx->aiColumn[k]!=pIndex->aiColumn[k] ) break;
        z1 = pIdx->azColl[k];
        z2 = pIndex->azColl[k];
        if( sqlite3StrICmp(z1, z2) ) break;
      }
      if( k==pIdx->nKeyCol ){
        if( pIdx->onError!=pIndex->onError ){
          /* This constraint creates the same index as a previous
          ** constraint specified somewhere in the CREATE TABLE statement.
          ** However the ON CONFLICT clauses are different. If both this 
          ** constraint and the previous equivalent constraint have explicit