aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-06-11 21:02:15 +0000
committerdrh <drh@noemail.net>2019-06-11 21:02:15 +0000
commita7d6db6ac05cb7d51c19494feba51a65c6a21cd2 (patch)
tree592d8e6375267375ab6ebb24dea92078fef5b3e9 /src/expr.c
parent42be2ad30bad38f15a4c33956d6fe2b9c4b00989 (diff)
downloadsqlite-a7d6db6ac05cb7d51c19494feba51a65c6a21cd2.tar.gz
sqlite-a7d6db6ac05cb7d51c19494feba51a65c6a21cd2.zip
The affinity of the unlikely() function and its cousins should be "none".
Ticket [0c620df60bffd9ef] FossilOrigin-Name: 614ecb0af47038848e8ba2aed6b92db6f33ddc4aea6361795dbde440380f5a35
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index f69b2a621..763c7b8ad 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -45,7 +45,11 @@ char sqlite3TableColumnAffinity(Table *pTab, int iCol){
char sqlite3ExprAffinity(Expr *pExpr){
int op;
if( pExpr->flags & EP_Generic ) return 0;
- pExpr = sqlite3ExprSkipCollate(pExpr);
+ while( ExprHasProperty(pExpr, EP_Skip) ){
+ assert( pExpr->op==TK_COLLATE );
+ pExpr = pExpr->pLeft;
+ assert( pExpr!=0 );
+ }
op = pExpr->op;
if( op==TK_SELECT ){
assert( pExpr->flags&EP_xIsSelect );
@@ -106,7 +110,7 @@ Expr *sqlite3ExprAddCollateString(Parse *pParse, Expr *pExpr, const char *zC){
** or likelihood() function at the root of an expression.
*/
Expr *sqlite3ExprSkipCollate(Expr *pExpr){
- while( pExpr && ExprHasProperty(pExpr, EP_Skip) ){
+ while( pExpr && ExprHasProperty(pExpr, EP_Skip|EP_Unlikely) ){
if( ExprHasProperty(pExpr, EP_Unlikely) ){
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
assert( pExpr->x.pList->nExpr>0 );