mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
In the fuzzer invariant checker, do not add new WHERE clause terms that
make use of an ambiguous column name. FossilOrigin-Name: d5b46541c30bcbeb7e57b5b5951856d564e81f7f9638d66d205157797964418c
This commit is contained in:
@ -236,7 +236,7 @@ static char *fuzz_invariant_sql(sqlite3_stmt *pStmt, int iCnt){
|
||||
const char *zIn;
|
||||
size_t nIn;
|
||||
const char *zAnd = "WHERE";
|
||||
int i;
|
||||
int i, j;
|
||||
sqlite3_str *pTest;
|
||||
sqlite3_stmt *pBase = 0;
|
||||
sqlite3 *db = sqlite3_db_handle(pStmt);
|
||||
@ -281,6 +281,14 @@ static char *fuzz_invariant_sql(sqlite3_stmt *pStmt, int iCnt){
|
||||
** WHERE clause. */
|
||||
continue;
|
||||
}
|
||||
for(j=0; j<i; j++){
|
||||
const char *zPrior = sqlite3_column_name(pBase, j);
|
||||
if( sqlite3_stricmp(zPrior, zColName)==0 ) break;
|
||||
}
|
||||
if( j<i ){
|
||||
/* Duplicate column name */
|
||||
continue;
|
||||
}
|
||||
if( iCnt==0 ) continue;
|
||||
if( iCnt>1 && i+2!=iCnt ) continue;
|
||||
if( zColName==0 ) continue;
|
||||
|
Reference in New Issue
Block a user