diff options
author | drh <> | 2023-12-19 14:54:52 +0000 |
---|---|---|
committer | drh <> | 2023-12-19 14:54:52 +0000 |
commit | 611b9d3efd03c771811175f7a8d25bd7a3007ffd (patch) | |
tree | 43e425e26a35b624194d8044bffe80c218270f52 /src | |
parent | 09259aff6c4ad61b3bbad8228c0a398fa0f92d08 (diff) | |
download | sqlite-611b9d3efd03c771811175f7a8d25bd7a3007ffd.tar.gz sqlite-611b9d3efd03c771811175f7a8d25bd7a3007ffd.zip |
More precise computation of the size of data structures in the query planner.
Response to [forum:/forumpost/7d8685d49d|Forum post 7d8685d49d].
FossilOrigin-Name: 0c8d88e41167ea92341dd1129be01b596a73f46bdcd5b0dd931441a979c013d0
Diffstat (limited to 'src')
-rw-r--r-- | src/where.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/where.c b/src/where.c index c98f92d5a..15f206a09 100644 --- a/src/where.c +++ b/src/where.c @@ -6038,7 +6038,10 @@ WhereInfo *sqlite3WhereBegin( ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = ROUND8P(sizeof(WhereInfo)+(nTabList-1)*sizeof(WhereLevel)); + nByteWInfo = ROUND8P(sizeof(WhereInfo)); + if( nTabList>1 ){ + nByteWInfo = ROUND8P(nByteWInfo + (nTabList-1)*sizeof(WhereLevel)); + } pWInfo = sqlite3DbMallocRawNN(db, nByteWInfo + sizeof(WhereLoop)); if( db->mallocFailed ){ sqlite3DbFree(db, pWInfo); |