/ Check-in [fcf480cc]
Login

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

Overview
Comment:Fix a couple of harmless compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | experimental
Files: files | file ages | folders
SHA1: fcf480cc630976b619aabd5f7fb7b09601a178fb
User & Date: drh 2014-03-03 21:46:55
Context
2014-03-03
21:59
Refactor the sqlite3VdbeRecordCompare() routine used to compare btree records. Create a couple of fast-track routines to handle the common cases of a string with BINARY collation or integer values as the left-most column. This gives a significant performance boost in common use. Oops: This build does not work on the Beaglebone where "char" defaults to unsigned. check-in: aec5473a user: drh tags: broken-on-arm
21:46
Fix a couple of harmless compiler warnings. Closed-Leaf check-in: fcf480cc user: drh tags: experimental
20:48
Avoid a buffer overread in vdbeCompareRecordInt() that might occur if the database is corrupt. check-in: 7c0b4381 user: dan tags: experimental
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  4571   4571   
  4572   4572     if( pIdxKey ){
  4573   4573       xRecordCompare = sqlite3VdbeFindCompare(pIdxKey);
  4574   4574       assert( pIdxKey->default_rc==1 
  4575   4575            || pIdxKey->default_rc==0 
  4576   4576            || pIdxKey->default_rc==-1
  4577   4577       );
         4578  +  }else{
         4579  +    xRecordCompare = 0; /* Not actually used.  Avoids a compiler warning. */
  4578   4580     }
  4579   4581   
  4580   4582     rc = moveToRoot(pCur);
  4581   4583     if( rc ){
  4582   4584       return rc;
  4583   4585     }
  4584   4586     assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage] );

Changes to src/vdbeaux.c.

  3571   3571   ** byte (i.e. is less than 128).
  3572   3572   */
  3573   3573   static int vdbeRecordCompareInt(
  3574   3574     int nKey1, const void *pKey1, /* Left key */
  3575   3575     const UnpackedRecord *pPKey2, /* Right key */
  3576   3576     int bSkip                     /* Ignored */
  3577   3577   ){
  3578         -  int szHdr = *(const u8*)pKey1;
  3579   3578     const u8 *aKey = &((const u8*)pKey1)[*(const u8*)pKey1 & 0x3F];
  3580   3579     int serial_type = ((const u8*)pKey1)[1];
  3581   3580     int res;
  3582   3581     i64 v = pPKey2->aMem[0].u.i;
  3583   3582     i64 lhs;
  3584   3583     UNUSED_PARAMETER(bSkip);
  3585   3584