SQLite

Check-in [e0ce3fc089]
Login

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

Overview
Comment:When compiling with SQLITE_HAS_CODEC, honor the hexkey= query parameter on URI pathnames in sqlite3_open_v2().
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e0ce3fc089c2523b8b718b4a4f9ab8c4d0432fc7
User & Date: drh 2015-10-26 14:41:35.868
Context
2015-10-26
14:54
Fix a C99-ism and a harmless compiler warning. (check-in: 138783b553 user: drh tags: trunk)
14:41
When compiling with SQLITE_HAS_CODEC, honor the hexkey= query parameter on URI pathnames in sqlite3_open_v2(). (check-in: e0ce3fc089 user: drh tags: trunk)
12:55
Remove an unreachable branch in malloc.c. (check-in: a36b7fe923 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
2949
2950
2951
2952
2953
2954
2955















2956
2957
2958
2959
2960
2961
2962
  }
  *ppDb = db;
#ifdef SQLITE_ENABLE_SQLLOG
  if( sqlite3GlobalConfig.xSqllog ){
    /* Opening a db handle. Fourth parameter is passed 0. */
    void *pArg = sqlite3GlobalConfig.pSqllogArg;
    sqlite3GlobalConfig.xSqllog(pArg, db, zFilename, 0);















  }
#endif
  return rc & 0xff;
}

/*
** Open a new database handle.







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
  }
  *ppDb = db;
#ifdef SQLITE_ENABLE_SQLLOG
  if( sqlite3GlobalConfig.xSqllog ){
    /* Opening a db handle. Fourth parameter is passed 0. */
    void *pArg = sqlite3GlobalConfig.pSqllogArg;
    sqlite3GlobalConfig.xSqllog(pArg, db, zFilename, 0);
  }
#endif
#if defined(SQLITE_HAS_CODEC)
  if( rc==SQLITE_OK ){
    const char *zHexKey = sqlite3_uri_parameter(zOpen, "hexkey");
    if( zHexKey && zHexKey[0] ){
      u8 iByte;
      int i;
      char zKey[40];
      for(i=0, iByte=0; i<sizeof(zKey)*2 && sqlite3Isxdigit(zHexKey[i]); i++){
        iByte = (iByte<<4) + sqlite3HexToInt(zHexKey[i]);
        if( (i&1)!=0 ) zKey[i/2] = iByte;
      }
      sqlite3_key_v2(db, 0, zKey, i/2);
    }
  }
#endif
  return rc & 0xff;
}

/*
** Open a new database handle.