diff options
author | drh <drh@noemail.net> | 2019-11-21 18:28:44 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-11-21 18:28:44 +0000 |
commit | 57f7ece78410a8aae86aa4625fb7556897db384c (patch) | |
tree | 91d8558ed6fa13ad14297bb2e33845faad5e4643 /src/expr.c | |
parent | 9c9c70920bae0ccd6216ea7fa61f387fdeb0b6ae (diff) | |
download | sqlite-57f7ece78410a8aae86aa4625fb7556897db384c.tar.gz sqlite-57f7ece78410a8aae86aa4625fb7556897db384c.zip |
Fix a problem that comes up when using generated columns that evaluate to a
constant in an index and then making use of that index in a join.
FossilOrigin-Name: 8b12e95fec7ce6e0de82a04ca3dfcf1a8e62e233b7382aa28a8a9be6e862b1af
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c index 45c053a8c..a3ed249ee 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3605,7 +3605,12 @@ expr_code_doover: ** constant. */ int iReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft,target); - int aff = sqlite3TableColumnAffinity(pExpr->y.pTab, pExpr->iColumn); + int aff; + if( pExpr->y.pTab ){ + aff = sqlite3TableColumnAffinity(pExpr->y.pTab, pExpr->iColumn); + }else{ + aff = pExpr->affExpr; + } if( aff>SQLITE_AFF_BLOB ){ static const char zAff[] = "B\000C\000D\000E"; assert( SQLITE_AFF_BLOB=='A' ); |