diff options
author | drh <drh@noemail.net> | 2018-04-18 18:18:12 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-04-18 18:18:12 +0000 |
commit | 277434e9a75fb9a3a3a4b5577da283189f4510bc (patch) | |
tree | 9618305432c86013218c8bca7089fe8a9f556304 /src/upsert.c | |
parent | 370c32628fe2eec7d57a902c077f4c765878c15a (diff) | |
download | sqlite-277434e9a75fb9a3a3a4b5577da283189f4510bc.tar.gz sqlite-277434e9a75fb9a3a3a4b5577da283189f4510bc.zip |
Improved matching of COLLATE clauses within the ON CONFLICT conflict-target.
FossilOrigin-Name: 8f4376e52b6124986937a3837ad83a18863c3144ef3b438a0d5e9231bf6c8980
Diffstat (limited to 'src/upsert.c')
-rw-r--r-- | src/upsert.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/upsert.c b/src/upsert.c index 25fcf6d67..866f9b953 100644 --- a/src/upsert.c +++ b/src/upsert.c @@ -148,13 +148,18 @@ int sqlite3UpsertAnalyzeTarget( nn = pIdx->nKeyCol; for(ii=0; ii<nn; ii++){ Expr *pExpr; + sCol[0].u.zToken = (char*)pIdx->azColl[ii]; if( pIdx->aiColumn[ii]==XN_EXPR ){ assert( pIdx->aColExpr!=0 ); assert( pIdx->aColExpr->nExpr>ii ); pExpr = pIdx->aColExpr->a[ii].pExpr; + if( pExpr->op!=TK_COLLATE ){ + sCol[0].pLeft = pExpr; + pExpr = &sCol[0]; + } }else{ + sCol[0].pLeft = &sCol[1]; sCol[1].iColumn = pIdx->aiColumn[ii]; - sCol[0].u.zToken = (char*)pIdx->azColl[ii]; pExpr = &sCol[0]; } for(jj=0; jj<nn; jj++){ |