aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/upsert.c7
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++){