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

Do not automatically assume that ROWID is NOT NULL when compiled with

SQLITE_ALLOW_ROWID_IN_VIEW.
dbsqlfuzz 31b38eeb63a4e1562de665078f52b7b47a7543cf

FossilOrigin-Name: 80c4223098c1827ff3a564f1f9a4203164a943e9a83eef99df68378fa3c4764b
This commit is contained in:
drh
2024-03-24 16:33:31 +00:00
parent d9eee787bd
commit a631eb378d
4 changed files with 31 additions and 11 deletions

View File

@@ -2801,9 +2801,12 @@ int sqlite3ExprCanBeNull(const Expr *p){
return 0;
case TK_COLUMN:
assert( ExprUseYTab(p) );
return ExprHasProperty(p, EP_CanBeNull) ||
NEVER(p->y.pTab==0) || /* Reference to column of index on expr */
(p->iColumn>=0
return ExprHasProperty(p, EP_CanBeNull)
|| NEVER(p->y.pTab==0) /* Reference to column of index on expr */
#ifdef SQLITE_ALLOW_ROWID_IN_VIEW
|| (p->iColumn==XN_ROWID && IsView(p->y.pTab))
#endif
|| (p->iColumn>=0
&& p->y.pTab->aCol!=0 /* Possible due to prior error */
&& ALWAYS(p->iColumn<p->y.pTab->nCol)
&& p->y.pTab->aCol[p->iColumn].notNull==0);