SQLite

Check-in [05df5f7aea]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 05df5f7aeaf2132810452e8871132d1e66650a841991cb2a9ce32f2d03e20bf4
User & Date: drh 2019-01-18 14:53:15.315
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: 64bec9e621 user: dan tags: trunk)
14:53
Use the full 64-bit integer value in the argument to randomblob(). (check-in: 05df5f7aea 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: f31b3bd2a6 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/func.c.
510
511
512
513
514
515
516
517

518
519
520
521

522
523
524
525
526
527
528
510
511
512
513
514
515
516

517
518
519
520

521
522
523
524
525
526
527
528







-
+



-
+







** that is N bytes long.
*/
static void randomBlob(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int n;
  sqlite3_int64 n;
  unsigned char *p;
  assert( argc==1 );
  UNUSED_PARAMETER(argc);
  n = sqlite3_value_int(argv[0]);
  n = sqlite3_value_int64(argv[0]);
  if( n<1 ){
    n = 1;
  }
  p = contextMalloc(context, n);
  if( p ){
    sqlite3_randomness(n, p);
    sqlite3_result_blob(context, (char*)p, n, sqlite3_free);