1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Sometimes a TK_COLUMN Expr node can have Expr.pTab==0 if it is a reference

to an expression column in an index on and expression.  Fix for ticket
[aa98619ad08ddcab].

FossilOrigin-Name: d0da791ba0edfb65186459345e43500d8364a086a5a1651d828fecc1a1dd1edb
This commit is contained in:
drh
2017-08-14 14:53:24 +00:00
parent 1112cc797b
commit 4dd89d5a24
6 changed files with 37 additions and 12 deletions

View File

@@ -1973,8 +1973,8 @@ int sqlite3ExprCanBeNull(const Expr *p){
case TK_BLOB:
return 0;
case TK_COLUMN:
assert( p->pTab!=0 );
return ExprHasProperty(p, EP_CanBeNull) ||
p->pTab==0 || /* Reference to column of index on expression */
(p->iColumn>=0 && p->pTab->aCol[p->iColumn].notNull==0);
default:
return 1;