1
0
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:
drh
2002-07-07 16:52:46 +00:00
parent af1c9661a4
commit 193a6b4142
11 changed files with 190 additions and 36 deletions

View File

@@ -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 ){