1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Do not allow rowid in a UNIQUE or PRIMARY KEY constraint. (This restores the

same behavior exhibited by all prior releases.)

FossilOrigin-Name: b1278301e37220a075c1bae88c0fcca2ef7a7d5c
This commit is contained in:
drh
2015-09-19 03:07:30 +00:00
parent e63e8a6c78
commit 4cbc54b042
5 changed files with 28 additions and 11 deletions

View File

@@ -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;