1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Return the error "ambiguous column name: rowid", instead of "no such column: rowid", when a "rowid" reference is ambiguous.

FossilOrigin-Name: 021f34fcfed41b607be8169bbda59aef93f130108d944f4741b46e8e345b2bbb
This commit is contained in:
dan
2024-03-19 14:55:49 +00:00
parent 1fe31dcfab
commit a10c2a9055
6 changed files with 23 additions and 19 deletions

View File

@@ -596,13 +596,13 @@ static int lookupName(
** Perhaps the name is a reference to the ROWID
*/
if( cnt==0
&& cntTab==1
&& cntTab>=1
&& pMatch
&& (pNC->ncFlags & (NC_IdxExpr|NC_GenCol))==0
&& sqlite3IsRowid(zCol)
&& ALWAYS(VisibleRowid(pMatch->pTab) || pMatch->fg.isNestedFrom)
){
cnt = 1;
cnt = cntTab;
if( pMatch->fg.isNestedFrom==0 ) pExpr->iColumn = -1;
pExpr->affExpr = SQLITE_AFF_INTEGER;
}