mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Omit all rowid-in-view restrictions from the fuzzinvariant.c test module
as they are no longer necessary, as of the previous check-in. FossilOrigin-Name: 6431538f0bb3bb8606786f3c3e5c055c4bc387098dd3bdc8a94f6fda61c47f52
This commit is contained in:
@ -223,19 +223,6 @@ not_a_fault:
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
/*
|
||||
** Return TRUE if the i-th column of pStmt might be a ROWID value.
|
||||
*/
|
||||
static int column_might_be_rowid(sqlite3_stmt *pStmt, int i){
|
||||
const char *zColName = sqlite3_column_name(pStmt, i);
|
||||
if( sqlite3_strlike("%rowid%",zColName,0)==0 ) return 1;
|
||||
if( sqlite3_strlike("%oid%",zColName,0)==0 ) return 1;
|
||||
return 0;
|
||||
}
|
||||
#endif /* SQLITE_ALLOW_ROWID_IN_VIEW */
|
||||
|
||||
|
||||
/*
|
||||
** Generate SQL used to test a statement invariant.
|
||||
**
|
||||
@ -308,12 +295,6 @@ static char *fuzz_invariant_sql(sqlite3_stmt *pStmt, int iCnt){
|
||||
** WHERE clause. */
|
||||
continue;
|
||||
}
|
||||
#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
if( column_might_be_rowid(pBase,i) ){
|
||||
/* ROWID values are unreliable if SQLITE_ALLOW_ROWID_IN_VIEW is used */
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
for(j=0; j<i; j++){
|
||||
const char *zPrior = sqlite3_column_name(pBase, j);
|
||||
if( sqlite3_stricmp(zPrior, zColName)==0 ) break;
|
||||
@ -342,11 +323,6 @@ static char *fuzz_invariant_sql(sqlite3_stmt *pStmt, int iCnt){
|
||||
|
||||
/*
|
||||
** Return true if and only if v1 and is the same as v2.
|
||||
**
|
||||
** When compiled with SQLITE_ALLOW_ROWID_IN_VIEW, and if either
|
||||
** v1 or v2 has a column name that indicates that it is a rowid
|
||||
** then a NULL value in the rowid column will compare equal to
|
||||
** an integer value in the other.
|
||||
*/
|
||||
static int sameValue(
|
||||
sqlite3_stmt *pS1, int i1, /* Value to text on the left */
|
||||
@ -361,20 +337,6 @@ static int sameValue(
|
||||
|| (t1==SQLITE_FLOAT && t2==SQLITE_INTEGER)
|
||||
){
|
||||
/* Comparison of numerics is ok */
|
||||
#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
|
||||
}else
|
||||
if( t1==SQLITE_INTEGER
|
||||
&& t2==SQLITE_NULL
|
||||
&& column_might_be_rowid(pS2,i2)
|
||||
){
|
||||
return 1;
|
||||
}else
|
||||
if( t2==SQLITE_INTEGER
|
||||
&& t1==SQLITE_NULL
|
||||
&& column_might_be_rowid(pS1,i1)
|
||||
){
|
||||
return 1;
|
||||
#endif /* SQLITE_ALLOW_ROWID_IN_VIEW */
|
||||
}else{
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user