Fossil SCM

Update SQLite to the latest from the 3.8.2 branch.

mistachkin 2014-01-15 00:26 UTC branch-1.28
Commit 2447b2d7ed9353a66e3d1abbf7cbdb95ea2af7dd
2 files changed +38 -17 +7 -5
+38 -17
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -135,11 +135,11 @@
135135
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
136136
** [sqlite_version()] and [sqlite_source_id()].
137137
*/
138138
#define SQLITE_VERSION "3.8.2"
139139
#define SQLITE_VERSION_NUMBER 3008002
140
-#define SQLITE_SOURCE_ID "2013-12-06 14:53:30 27392118af4c38c5203a04b8013e1afdb1cebd0d"
140
+#define SQLITE_SOURCE_ID "2014-01-15 00:24:22 c697d2f83c2d8ea0a100b84b0debb6a322c3a876"
141141
142142
/*
143143
** CAPI3REF: Run-Time Library Version Numbers
144144
** KEYWORDS: sqlite3_version, sqlite3_sourceid
145145
**
@@ -2401,15 +2401,17 @@
24012401
** already uses the largest possible [ROWID]. The PRNG is also used for
24022402
** the build-in random() and randomblob() SQL functions. This interface allows
24032403
** applications to access the same PRNG for other purposes.
24042404
**
24052405
** ^A call to this routine stores N bytes of randomness into buffer P.
2406
+** ^If N is less than one, then P can be a NULL pointer.
24062407
**
2407
-** ^The first time this routine is invoked (either internally or by
2408
-** the application) the PRNG is seeded using randomness obtained
2409
-** from the xRandomness method of the default [sqlite3_vfs] object.
2410
-** ^On all subsequent invocations, the pseudo-randomness is generated
2408
+** ^If this routine has not been previously called or if the previous
2409
+** call had N less than one, then the PRNG is seeded using randomness
2410
+** obtained from the xRandomness method of the default [sqlite3_vfs] object.
2411
+** ^If the previous call to this routine had an N of 1 or more then
2412
+** the pseudo-randomness is generated
24112413
** internally and without recourse to the [sqlite3_vfs] xRandomness
24122414
** method.
24132415
*/
24142416
SQLITE_API void sqlite3_randomness(int N, void *P);
24152417
@@ -12227,11 +12229,10 @@
1222712229
SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
1222812230
SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr*, SrcList*);
1222912231
SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
1223012232
SQLITE_PRIVATE void sqlite3PrngSaveState(void);
1223112233
SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
12232
-SQLITE_PRIVATE void sqlite3PrngResetState(void);
1223312234
SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*,int);
1223412235
SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int);
1223512236
SQLITE_PRIVATE void sqlite3CodeVerifyNamedSchema(Parse*, const char *zDb);
1223612237
SQLITE_PRIVATE void sqlite3BeginTransaction(Parse*, int);
1223712238
SQLITE_PRIVATE void sqlite3CommitTransaction(Parse*);
@@ -20750,10 +20751,16 @@
2075020751
2075120752
#if SQLITE_THREADSAFE
2075220753
sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PRNG);
2075320754
sqlite3_mutex_enter(mutex);
2075420755
#endif
20756
+
20757
+ if( N<=0 ){
20758
+ wsdPrng.isInit = 0;
20759
+ sqlite3_mutex_leave(mutex);
20760
+ return;
20761
+ }
2075520762
2075620763
/* Initialize the state of the random number generator once,
2075720764
** the first time this routine is called. The seed value does
2075820765
** not need to contain a lot of randomness since we are not
2075920766
** trying to do secure encryption or anything like that...
@@ -20778,19 +20785,20 @@
2077820785
wsdPrng.s[i] = t;
2077920786
}
2078020787
wsdPrng.isInit = 1;
2078120788
}
2078220789
20783
- while( N-- ){
20790
+ assert( N>0 );
20791
+ do{
2078420792
wsdPrng.i++;
2078520793
t = wsdPrng.s[wsdPrng.i];
2078620794
wsdPrng.j += t;
2078720795
wsdPrng.s[wsdPrng.i] = wsdPrng.s[wsdPrng.j];
2078820796
wsdPrng.s[wsdPrng.j] = t;
2078920797
t += wsdPrng.s[wsdPrng.i];
2079020798
*(zBuf++) = wsdPrng.s[t];
20791
- }
20799
+ }while( --N );
2079220800
sqlite3_mutex_leave(mutex);
2079320801
}
2079420802
2079520803
#ifndef SQLITE_OMIT_BUILTIN_TEST
2079620804
/*
@@ -20815,13 +20823,10 @@
2081520823
&GLOBAL(struct sqlite3PrngType, sqlite3Prng),
2081620824
&GLOBAL(struct sqlite3PrngType, sqlite3SavedPrng),
2081720825
sizeof(sqlite3Prng)
2081820826
);
2081920827
}
20820
-SQLITE_PRIVATE void sqlite3PrngResetState(void){
20821
- GLOBAL(struct sqlite3PrngType, sqlite3Prng).isInit = 0;
20822
-}
2082320828
#endif /* SQLITE_OMIT_BUILTIN_TEST */
2082420829
2082520830
/************** End of random.c **********************************************/
2082620831
/************** Begin file utf.c *********************************************/
2082720832
/*
@@ -23355,10 +23360,16 @@
2335523360
** it is larger than the struct CrashFile defined in test6.c.
2335623361
*/
2335723362
char aPadding[32];
2335823363
#endif
2335923364
};
23365
+
23366
+/* This variable holds the process id (pid) from when the xRandomness()
23367
+** method was called. If xOpen() is called from a different process id,
23368
+** indicating that a fork() has occurred, the PRNG will be reset.
23369
+*/
23370
+static int randomnessPid = 0;
2336023371
2336123372
/*
2336223373
** Allowed values for the unixFile.ctrlFlags bitmask:
2336323374
*/
2336423375
#define UNIXFILE_EXCL 0x01 /* Connections from one process only */
@@ -28944,10 +28955,20 @@
2894428955
assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB
2894528956
|| eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL
2894628957
|| eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL
2894728958
|| eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL
2894828959
);
28960
+
28961
+ /* Detect a pid change and reset the PRNG. There is a race condition
28962
+ ** here such that two or more threads all trying to open databases at
28963
+ ** the same instant might all reset the PRNG. But multiple resets
28964
+ ** are harmless.
28965
+ */
28966
+ if( randomnessPid!=getpid() ){
28967
+ randomnessPid = getpid();
28968
+ sqlite3_randomness(0,0);
28969
+ }
2894928970
2895028971
memset(p, 0, sizeof(unixFile));
2895128972
2895228973
if( eType==SQLITE_OPEN_MAIN_DB ){
2895328974
UnixUnusedFd *pUnused;
@@ -29332,22 +29353,22 @@
2933229353
** When testing, initializing zBuf[] to zero is all we do. That means
2933329354
** that we always use the same random number sequence. This makes the
2933429355
** tests repeatable.
2933529356
*/
2933629357
memset(zBuf, 0, nBuf);
29358
+ randomnessPid = getpid();
2933729359
#if !defined(SQLITE_TEST)
2933829360
{
29339
- int pid, fd, got;
29361
+ int fd, got;
2934029362
fd = robust_open("/dev/urandom", O_RDONLY, 0);
2934129363
if( fd<0 ){
2934229364
time_t t;
2934329365
time(&t);
2934429366
memcpy(zBuf, &t, sizeof(t));
29345
- pid = getpid();
29346
- memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid));
29347
- assert( sizeof(t)+sizeof(pid)<=(size_t)nBuf );
29348
- nBuf = sizeof(t) + sizeof(pid);
29367
+ memcpy(&zBuf[sizeof(t)], &randomnessPid, sizeof(randomnessPid));
29368
+ assert( sizeof(t)+sizeof(randomnessPid)<=(size_t)nBuf );
29369
+ nBuf = sizeof(t) + sizeof(randomnessPid);
2934929370
}else{
2935029371
do{ got = osRead(fd, zBuf, nBuf); }while( got<0 && errno==EINTR );
2935129372
robust_close(0, fd, __LINE__);
2935229373
}
2935329374
}
@@ -122094,11 +122115,11 @@
122094122115
** Reset the PRNG back to its uninitialized state. The next call
122095122116
** to sqlite3_randomness() will reseed the PRNG using a single call
122096122117
** to the xRandomness method of the default VFS.
122097122118
*/
122098122119
case SQLITE_TESTCTRL_PRNG_RESET: {
122099
- sqlite3PrngResetState();
122120
+ sqlite3_randomness(0,0);
122100122121
break;
122101122122
}
122102122123
122103122124
/*
122104122125
** sqlite3_test_control(BITVEC_TEST, size, program)
122105122126
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -135,11 +135,11 @@
135 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
136 ** [sqlite_version()] and [sqlite_source_id()].
137 */
138 #define SQLITE_VERSION "3.8.2"
139 #define SQLITE_VERSION_NUMBER 3008002
140 #define SQLITE_SOURCE_ID "2013-12-06 14:53:30 27392118af4c38c5203a04b8013e1afdb1cebd0d"
141
142 /*
143 ** CAPI3REF: Run-Time Library Version Numbers
144 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
145 **
@@ -2401,15 +2401,17 @@
2401 ** already uses the largest possible [ROWID]. The PRNG is also used for
2402 ** the build-in random() and randomblob() SQL functions. This interface allows
2403 ** applications to access the same PRNG for other purposes.
2404 **
2405 ** ^A call to this routine stores N bytes of randomness into buffer P.
 
2406 **
2407 ** ^The first time this routine is invoked (either internally or by
2408 ** the application) the PRNG is seeded using randomness obtained
2409 ** from the xRandomness method of the default [sqlite3_vfs] object.
2410 ** ^On all subsequent invocations, the pseudo-randomness is generated
 
2411 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2412 ** method.
2413 */
2414 SQLITE_API void sqlite3_randomness(int N, void *P);
2415
@@ -12227,11 +12229,10 @@
12227 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
12228 SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr*, SrcList*);
12229 SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
12230 SQLITE_PRIVATE void sqlite3PrngSaveState(void);
12231 SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
12232 SQLITE_PRIVATE void sqlite3PrngResetState(void);
12233 SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*,int);
12234 SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int);
12235 SQLITE_PRIVATE void sqlite3CodeVerifyNamedSchema(Parse*, const char *zDb);
12236 SQLITE_PRIVATE void sqlite3BeginTransaction(Parse*, int);
12237 SQLITE_PRIVATE void sqlite3CommitTransaction(Parse*);
@@ -20750,10 +20751,16 @@
20750
20751 #if SQLITE_THREADSAFE
20752 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PRNG);
20753 sqlite3_mutex_enter(mutex);
20754 #endif
 
 
 
 
 
 
20755
20756 /* Initialize the state of the random number generator once,
20757 ** the first time this routine is called. The seed value does
20758 ** not need to contain a lot of randomness since we are not
20759 ** trying to do secure encryption or anything like that...
@@ -20778,19 +20785,20 @@
20778 wsdPrng.s[i] = t;
20779 }
20780 wsdPrng.isInit = 1;
20781 }
20782
20783 while( N-- ){
 
20784 wsdPrng.i++;
20785 t = wsdPrng.s[wsdPrng.i];
20786 wsdPrng.j += t;
20787 wsdPrng.s[wsdPrng.i] = wsdPrng.s[wsdPrng.j];
20788 wsdPrng.s[wsdPrng.j] = t;
20789 t += wsdPrng.s[wsdPrng.i];
20790 *(zBuf++) = wsdPrng.s[t];
20791 }
20792 sqlite3_mutex_leave(mutex);
20793 }
20794
20795 #ifndef SQLITE_OMIT_BUILTIN_TEST
20796 /*
@@ -20815,13 +20823,10 @@
20815 &GLOBAL(struct sqlite3PrngType, sqlite3Prng),
20816 &GLOBAL(struct sqlite3PrngType, sqlite3SavedPrng),
20817 sizeof(sqlite3Prng)
20818 );
20819 }
20820 SQLITE_PRIVATE void sqlite3PrngResetState(void){
20821 GLOBAL(struct sqlite3PrngType, sqlite3Prng).isInit = 0;
20822 }
20823 #endif /* SQLITE_OMIT_BUILTIN_TEST */
20824
20825 /************** End of random.c **********************************************/
20826 /************** Begin file utf.c *********************************************/
20827 /*
@@ -23355,10 +23360,16 @@
23355 ** it is larger than the struct CrashFile defined in test6.c.
23356 */
23357 char aPadding[32];
23358 #endif
23359 };
 
 
 
 
 
 
23360
23361 /*
23362 ** Allowed values for the unixFile.ctrlFlags bitmask:
23363 */
23364 #define UNIXFILE_EXCL 0x01 /* Connections from one process only */
@@ -28944,10 +28955,20 @@
28944 assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB
28945 || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL
28946 || eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL
28947 || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL
28948 );
 
 
 
 
 
 
 
 
 
 
28949
28950 memset(p, 0, sizeof(unixFile));
28951
28952 if( eType==SQLITE_OPEN_MAIN_DB ){
28953 UnixUnusedFd *pUnused;
@@ -29332,22 +29353,22 @@
29332 ** When testing, initializing zBuf[] to zero is all we do. That means
29333 ** that we always use the same random number sequence. This makes the
29334 ** tests repeatable.
29335 */
29336 memset(zBuf, 0, nBuf);
 
29337 #if !defined(SQLITE_TEST)
29338 {
29339 int pid, fd, got;
29340 fd = robust_open("/dev/urandom", O_RDONLY, 0);
29341 if( fd<0 ){
29342 time_t t;
29343 time(&t);
29344 memcpy(zBuf, &t, sizeof(t));
29345 pid = getpid();
29346 memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid));
29347 assert( sizeof(t)+sizeof(pid)<=(size_t)nBuf );
29348 nBuf = sizeof(t) + sizeof(pid);
29349 }else{
29350 do{ got = osRead(fd, zBuf, nBuf); }while( got<0 && errno==EINTR );
29351 robust_close(0, fd, __LINE__);
29352 }
29353 }
@@ -122094,11 +122115,11 @@
122094 ** Reset the PRNG back to its uninitialized state. The next call
122095 ** to sqlite3_randomness() will reseed the PRNG using a single call
122096 ** to the xRandomness method of the default VFS.
122097 */
122098 case SQLITE_TESTCTRL_PRNG_RESET: {
122099 sqlite3PrngResetState();
122100 break;
122101 }
122102
122103 /*
122104 ** sqlite3_test_control(BITVEC_TEST, size, program)
122105
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -135,11 +135,11 @@
135 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
136 ** [sqlite_version()] and [sqlite_source_id()].
137 */
138 #define SQLITE_VERSION "3.8.2"
139 #define SQLITE_VERSION_NUMBER 3008002
140 #define SQLITE_SOURCE_ID "2014-01-15 00:24:22 c697d2f83c2d8ea0a100b84b0debb6a322c3a876"
141
142 /*
143 ** CAPI3REF: Run-Time Library Version Numbers
144 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
145 **
@@ -2401,15 +2401,17 @@
2401 ** already uses the largest possible [ROWID]. The PRNG is also used for
2402 ** the build-in random() and randomblob() SQL functions. This interface allows
2403 ** applications to access the same PRNG for other purposes.
2404 **
2405 ** ^A call to this routine stores N bytes of randomness into buffer P.
2406 ** ^If N is less than one, then P can be a NULL pointer.
2407 **
2408 ** ^If this routine has not been previously called or if the previous
2409 ** call had N less than one, then the PRNG is seeded using randomness
2410 ** obtained from the xRandomness method of the default [sqlite3_vfs] object.
2411 ** ^If the previous call to this routine had an N of 1 or more then
2412 ** the pseudo-randomness is generated
2413 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2414 ** method.
2415 */
2416 SQLITE_API void sqlite3_randomness(int N, void *P);
2417
@@ -12227,11 +12229,10 @@
12229 SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*);
12230 SQLITE_PRIVATE int sqlite3FunctionUsesThisSrc(Expr*, SrcList*);
12231 SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*);
12232 SQLITE_PRIVATE void sqlite3PrngSaveState(void);
12233 SQLITE_PRIVATE void sqlite3PrngRestoreState(void);
 
12234 SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*,int);
12235 SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int);
12236 SQLITE_PRIVATE void sqlite3CodeVerifyNamedSchema(Parse*, const char *zDb);
12237 SQLITE_PRIVATE void sqlite3BeginTransaction(Parse*, int);
12238 SQLITE_PRIVATE void sqlite3CommitTransaction(Parse*);
@@ -20750,10 +20751,16 @@
20751
20752 #if SQLITE_THREADSAFE
20753 sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PRNG);
20754 sqlite3_mutex_enter(mutex);
20755 #endif
20756
20757 if( N<=0 ){
20758 wsdPrng.isInit = 0;
20759 sqlite3_mutex_leave(mutex);
20760 return;
20761 }
20762
20763 /* Initialize the state of the random number generator once,
20764 ** the first time this routine is called. The seed value does
20765 ** not need to contain a lot of randomness since we are not
20766 ** trying to do secure encryption or anything like that...
@@ -20778,19 +20785,20 @@
20785 wsdPrng.s[i] = t;
20786 }
20787 wsdPrng.isInit = 1;
20788 }
20789
20790 assert( N>0 );
20791 do{
20792 wsdPrng.i++;
20793 t = wsdPrng.s[wsdPrng.i];
20794 wsdPrng.j += t;
20795 wsdPrng.s[wsdPrng.i] = wsdPrng.s[wsdPrng.j];
20796 wsdPrng.s[wsdPrng.j] = t;
20797 t += wsdPrng.s[wsdPrng.i];
20798 *(zBuf++) = wsdPrng.s[t];
20799 }while( --N );
20800 sqlite3_mutex_leave(mutex);
20801 }
20802
20803 #ifndef SQLITE_OMIT_BUILTIN_TEST
20804 /*
@@ -20815,13 +20823,10 @@
20823 &GLOBAL(struct sqlite3PrngType, sqlite3Prng),
20824 &GLOBAL(struct sqlite3PrngType, sqlite3SavedPrng),
20825 sizeof(sqlite3Prng)
20826 );
20827 }
 
 
 
20828 #endif /* SQLITE_OMIT_BUILTIN_TEST */
20829
20830 /************** End of random.c **********************************************/
20831 /************** Begin file utf.c *********************************************/
20832 /*
@@ -23355,10 +23360,16 @@
23360 ** it is larger than the struct CrashFile defined in test6.c.
23361 */
23362 char aPadding[32];
23363 #endif
23364 };
23365
23366 /* This variable holds the process id (pid) from when the xRandomness()
23367 ** method was called. If xOpen() is called from a different process id,
23368 ** indicating that a fork() has occurred, the PRNG will be reset.
23369 */
23370 static int randomnessPid = 0;
23371
23372 /*
23373 ** Allowed values for the unixFile.ctrlFlags bitmask:
23374 */
23375 #define UNIXFILE_EXCL 0x01 /* Connections from one process only */
@@ -28944,10 +28955,20 @@
28955 assert( eType==SQLITE_OPEN_MAIN_DB || eType==SQLITE_OPEN_TEMP_DB
28956 || eType==SQLITE_OPEN_MAIN_JOURNAL || eType==SQLITE_OPEN_TEMP_JOURNAL
28957 || eType==SQLITE_OPEN_SUBJOURNAL || eType==SQLITE_OPEN_MASTER_JOURNAL
28958 || eType==SQLITE_OPEN_TRANSIENT_DB || eType==SQLITE_OPEN_WAL
28959 );
28960
28961 /* Detect a pid change and reset the PRNG. There is a race condition
28962 ** here such that two or more threads all trying to open databases at
28963 ** the same instant might all reset the PRNG. But multiple resets
28964 ** are harmless.
28965 */
28966 if( randomnessPid!=getpid() ){
28967 randomnessPid = getpid();
28968 sqlite3_randomness(0,0);
28969 }
28970
28971 memset(p, 0, sizeof(unixFile));
28972
28973 if( eType==SQLITE_OPEN_MAIN_DB ){
28974 UnixUnusedFd *pUnused;
@@ -29332,22 +29353,22 @@
29353 ** When testing, initializing zBuf[] to zero is all we do. That means
29354 ** that we always use the same random number sequence. This makes the
29355 ** tests repeatable.
29356 */
29357 memset(zBuf, 0, nBuf);
29358 randomnessPid = getpid();
29359 #if !defined(SQLITE_TEST)
29360 {
29361 int fd, got;
29362 fd = robust_open("/dev/urandom", O_RDONLY, 0);
29363 if( fd<0 ){
29364 time_t t;
29365 time(&t);
29366 memcpy(zBuf, &t, sizeof(t));
29367 memcpy(&zBuf[sizeof(t)], &randomnessPid, sizeof(randomnessPid));
29368 assert( sizeof(t)+sizeof(randomnessPid)<=(size_t)nBuf );
29369 nBuf = sizeof(t) + sizeof(randomnessPid);
 
29370 }else{
29371 do{ got = osRead(fd, zBuf, nBuf); }while( got<0 && errno==EINTR );
29372 robust_close(0, fd, __LINE__);
29373 }
29374 }
@@ -122094,11 +122115,11 @@
122115 ** Reset the PRNG back to its uninitialized state. The next call
122116 ** to sqlite3_randomness() will reseed the PRNG using a single call
122117 ** to the xRandomness method of the default VFS.
122118 */
122119 case SQLITE_TESTCTRL_PRNG_RESET: {
122120 sqlite3_randomness(0,0);
122121 break;
122122 }
122123
122124 /*
122125 ** sqlite3_test_control(BITVEC_TEST, size, program)
122126
+7 -5
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110110
#define SQLITE_VERSION "3.8.2"
111111
#define SQLITE_VERSION_NUMBER 3008002
112
-#define SQLITE_SOURCE_ID "2013-12-06 14:53:30 27392118af4c38c5203a04b8013e1afdb1cebd0d"
112
+#define SQLITE_SOURCE_ID "2014-01-15 00:24:22 c697d2f83c2d8ea0a100b84b0debb6a322c3a876"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
@@ -2373,15 +2373,17 @@
23732373
** already uses the largest possible [ROWID]. The PRNG is also used for
23742374
** the build-in random() and randomblob() SQL functions. This interface allows
23752375
** applications to access the same PRNG for other purposes.
23762376
**
23772377
** ^A call to this routine stores N bytes of randomness into buffer P.
2378
+** ^If N is less than one, then P can be a NULL pointer.
23782379
**
2379
-** ^The first time this routine is invoked (either internally or by
2380
-** the application) the PRNG is seeded using randomness obtained
2381
-** from the xRandomness method of the default [sqlite3_vfs] object.
2382
-** ^On all subsequent invocations, the pseudo-randomness is generated
2380
+** ^If this routine has not been previously called or if the previous
2381
+** call had N less than one, then the PRNG is seeded using randomness
2382
+** obtained from the xRandomness method of the default [sqlite3_vfs] object.
2383
+** ^If the previous call to this routine had an N of 1 or more then
2384
+** the pseudo-randomness is generated
23832385
** internally and without recourse to the [sqlite3_vfs] xRandomness
23842386
** method.
23852387
*/
23862388
SQLITE_API void sqlite3_randomness(int N, void *P);
23872389
23882390
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.2"
111 #define SQLITE_VERSION_NUMBER 3008002
112 #define SQLITE_SOURCE_ID "2013-12-06 14:53:30 27392118af4c38c5203a04b8013e1afdb1cebd0d"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -2373,15 +2373,17 @@
2373 ** already uses the largest possible [ROWID]. The PRNG is also used for
2374 ** the build-in random() and randomblob() SQL functions. This interface allows
2375 ** applications to access the same PRNG for other purposes.
2376 **
2377 ** ^A call to this routine stores N bytes of randomness into buffer P.
 
2378 **
2379 ** ^The first time this routine is invoked (either internally or by
2380 ** the application) the PRNG is seeded using randomness obtained
2381 ** from the xRandomness method of the default [sqlite3_vfs] object.
2382 ** ^On all subsequent invocations, the pseudo-randomness is generated
 
2383 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2384 ** method.
2385 */
2386 SQLITE_API void sqlite3_randomness(int N, void *P);
2387
2388
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.8.2"
111 #define SQLITE_VERSION_NUMBER 3008002
112 #define SQLITE_SOURCE_ID "2014-01-15 00:24:22 c697d2f83c2d8ea0a100b84b0debb6a322c3a876"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
@@ -2373,15 +2373,17 @@
2373 ** already uses the largest possible [ROWID]. The PRNG is also used for
2374 ** the build-in random() and randomblob() SQL functions. This interface allows
2375 ** applications to access the same PRNG for other purposes.
2376 **
2377 ** ^A call to this routine stores N bytes of randomness into buffer P.
2378 ** ^If N is less than one, then P can be a NULL pointer.
2379 **
2380 ** ^If this routine has not been previously called or if the previous
2381 ** call had N less than one, then the PRNG is seeded using randomness
2382 ** obtained from the xRandomness method of the default [sqlite3_vfs] object.
2383 ** ^If the previous call to this routine had an N of 1 or more then
2384 ** the pseudo-randomness is generated
2385 ** internally and without recourse to the [sqlite3_vfs] xRandomness
2386 ** method.
2387 */
2388 SQLITE_API void sqlite3_randomness(int N, void *P);
2389
2390

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button