1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Innocuous changes to help Coverity avoid false-positives.

FossilOrigin-Name: 4ec8a5a203f10d228d0b3389120638766cc343179dbe38d5dbf69b650765934c
This commit is contained in:
drh
2020-05-26 10:54:46 +00:00
parent d63c76fb31
commit bdd4f7d91c
4 changed files with 15 additions and 16 deletions

View File

@@ -504,17 +504,18 @@ static void schemaIsValid(Parse *pParse){
** attached database is returned.
*/
int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
int i = -1000000;
int i = -32768;
/* If pSchema is NULL, then return -1000000. This happens when code in
/* If pSchema is NULL, then return -32768. This happens when code in
** expr.c is trying to resolve a reference to a transient table (i.e. one
** created by a sub-select). In this case the return value of this
** function should never be used.
**
** We return -1000000 instead of the more usual -1 simply because using
** -1000000 as the incorrect index into db->aDb[] is much
** We return -32768 instead of the more usual -1 simply because using
** -32768 as the incorrect index into db->aDb[] is much
** more likely to cause a segfault than -1 (of course there are assert()
** statements too, but it never hurts to play the odds).
** statements too, but it never hurts to play the odds) and
** -32768 will still fit into a 16-bit signed integer.
*/
assert( sqlite3_mutex_held(db->mutex) );
if( pSchema ){