mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
More rollback problems: Fix two more errors introduced by checking (410) that
can cause database corruption after a ROLLBACK. Also add new tests to make sure everything is working this time. (CVS 663) FossilOrigin-Name: f6e24d5ccbcfcf5863ffbd65860dafa2f5663e99
This commit is contained in:
10
src/os.c
10
src/os.c
@@ -717,13 +717,19 @@ int sqliteOsUnlock(OsFile *id){
|
||||
*/
|
||||
int sqliteOsRandomSeed(char *zBuf){
|
||||
static int once = 1;
|
||||
#if OS_UNIX
|
||||
#ifdef SQLITE_TEST
|
||||
/* When testing, always use the same random number sequence.
|
||||
** This makes the tests repeatable.
|
||||
*/
|
||||
memset(zBuf, 0, 256);
|
||||
#endif
|
||||
#if OS_UNIX && !defined(SQLITE_TEST)
|
||||
int pid;
|
||||
time((time_t*)zBuf);
|
||||
pid = getpid();
|
||||
memcpy(&zBuf[sizeof(time_t)], &pid, sizeof(pid));
|
||||
#endif
|
||||
#if OS_WIN
|
||||
#if OS_WIN && !defined(SQLITE_TEST)
|
||||
GetSystemTime((LPSYSTEMTIME)zBuf);
|
||||
#endif
|
||||
if( once ){
|
||||
|
Reference in New Issue
Block a user