/ Check-in [05df5f7a]
Login

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

Overview
Comment:Use the full 64-bit integer value in the argument to randomblob().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 05df5f7aeaf2132810452e8871132d1e66650a841991cb2a9ce32f2d03e20bf4
User & Date: drh 2019-01-18 14:53:15
Context
2019-01-18
16:06
Fix a fairly obscure problem allowing an "ALTER TABLE RENAME col TO ..." statement to modify the schema in such a way as to break a reference within a trigger program. check-in: 64bec9e6 user: dan tags: trunk
14:53
Use the full 64-bit integer value in the argument to randomblob(). check-in: 05df5f7a user: drh tags: trunk
2019-01-17
20:19
Disable the xfer-optimization if the two tables have the same root page due to schema corruption. check-in: f31b3bd2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/func.c.

   510    510   ** that is N bytes long.
   511    511   */
   512    512   static void randomBlob(
   513    513     sqlite3_context *context,
   514    514     int argc,
   515    515     sqlite3_value **argv
   516    516   ){
   517         -  int n;
          517  +  sqlite3_int64 n;
   518    518     unsigned char *p;
   519    519     assert( argc==1 );
   520    520     UNUSED_PARAMETER(argc);
   521         -  n = sqlite3_value_int(argv[0]);
          521  +  n = sqlite3_value_int64(argv[0]);
   522    522     if( n<1 ){
   523    523       n = 1;
   524    524     }
   525    525     p = contextMalloc(context, n);
   526    526     if( p ){
   527    527       sqlite3_randomness(n, p);
   528    528       sqlite3_result_blob(context, (char*)p, n, sqlite3_free);