1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Deterministically initialize the PRNG used as a tie-breaker in the ANALYZE

command, so that the analysis is always the same given the same database.
This simplifies testing.

FossilOrigin-Name: 48ed8b565b84c8fa7898c2f9817c01f7e9c9182e
This commit is contained in:
drh
2013-09-10 01:41:25 +00:00
parent 0259bc3da2
commit 1d2b3c1f8a
4 changed files with 12 additions and 13 deletions

View File

@@ -347,7 +347,7 @@ static void statInit(
p->mxSample = mxSample;
p->nPSample = (tRowcnt)(sqlite3_value_int64(argv[1])/(mxSample/3+1) + 1);
p->current.anLt = &p->current.anEq[nColUp];
sqlite3_randomness(sizeof(p->iPrn), &p->iPrn);
p->iPrn = nCol*0x689e962d ^ sqlite3_value_int(argv[1])*0xd0944565;
/* Set up the Stat4Accum.a[] and aBest[] arrays */
p->a = (struct Stat4Sample*)&p->current.anLt[nColUp];