aboutsummaryrefslogtreecommitdiff
path: root/src/resolve.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-09-19 03:07:30 +0000
committerdrh <drh@noemail.net>2015-09-19 03:07:30 +0000
commit4cbc54b042d12b0684dc4fa2e0056e7422dd7a9a (patch)
treef7c47e3e8242fb7dc6506d72050a75feb39d1275 /src/resolve.c
parente63e8a6c78b49a1f59b721dfaf234a545026e963 (diff)
downloadsqlite-4cbc54b042d12b0684dc4fa2e0056e7422dd7a9a.tar.gz
sqlite-4cbc54b042d12b0684dc4fa2e0056e7422dd7a9a.zip
Do not allow rowid in a UNIQUE or PRIMARY KEY constraint. (This restores the
same behavior exhibited by all prior releases.) FossilOrigin-Name: b1278301e37220a075c1bae88c0fcca2ef7a7d5c
Diffstat (limited to 'src/resolve.c')
-rw-r--r--src/resolve.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 2c4212ba7..ac1706b59 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -355,8 +355,13 @@ static int lookupName(
/*
** Perhaps the name is a reference to the ROWID
*/
- if( cnt==0 && cntTab==1 && pMatch && sqlite3IsRowid(zCol)
- && VisibleRowid(pMatch->pTab) ){
+ if( cnt==0
+ && cntTab==1
+ && pMatch
+ && (pNC->ncFlags & NC_IdxExpr)==0
+ && sqlite3IsRowid(zCol)
+ && VisibleRowid(pMatch->pTab)
+ ){
cnt = 1;
pExpr->iColumn = -1; /* IMP: R-44911-55124 */
pExpr->affinity = SQLITE_AFF_INTEGER;