diff options
author | drh <drh@noemail.net> | 2019-12-12 20:22:34 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-12-12 20:22:34 +0000 |
commit | 41cee66848afe40aba1e4d4a83bd50b6c33aaff0 (patch) | |
tree | d40d1f4dd674e9fc6ee4c0010f55b4fd52f35b74 /src | |
parent | 0225d819c4ca87cd29cd6f58d50c75bcee6213bc (diff) | |
download | sqlite-41cee66848afe40aba1e4d4a83bd50b6c33aaff0.tar.gz sqlite-41cee66848afe40aba1e4d4a83bd50b6c33aaff0.zip |
Change the name of the Expr.a.zName field to zEName, so that it has a name
that is distinct from other fields and variables and is hence easier to
grep for.
FossilOrigin-Name: d3783357f8fa76c42a86f12b214522f0388c37773c36ab8c5ce0623abbc4436a
Diffstat (limited to 'src')
-rw-r--r-- | src/alter.c | 8 | ||||
-rw-r--r-- | src/build.c | 14 | ||||
-rw-r--r-- | src/expr.c | 20 | ||||
-rw-r--r-- | src/insert.c | 2 | ||||
-rw-r--r-- | src/resolve.c | 4 | ||||
-rw-r--r-- | src/select.c | 14 | ||||
-rw-r--r-- | src/sqliteInt.h | 2 | ||||
-rw-r--r-- | src/treeview.c | 4 | ||||
-rw-r--r-- | src/trigger.c | 2 | ||||
-rw-r--r-- | src/update.c | 6 |
10 files changed, 38 insertions, 38 deletions
diff --git a/src/alter.c b/src/alter.c index 0fe41bd2f..f3467fa09 100644 --- a/src/alter.c +++ b/src/alter.c @@ -764,8 +764,8 @@ static int renameUnmapSelectCb(Walker *pWalker, Select *p){ if( ALWAYS(p->pEList) ){ ExprList *pList = p->pEList; for(i=0; i<pList->nExpr; i++){ - if( pList->a[i].zName ){ - sqlite3RenameTokenRemap(pParse, 0, (void*)pList->a[i].zName); + if( pList->a[i].zEName ){ + sqlite3RenameTokenRemap(pParse, 0, (void*)pList->a[i].zEName); } } } @@ -808,7 +808,7 @@ void sqlite3RenameExprlistUnmap(Parse *pParse, ExprList *pEList){ sWalker.xExprCallback = renameUnmapExprCb; sqlite3WalkExprList(&sWalker, pEList); for(i=0; i<pEList->nExpr; i++){ - sqlite3RenameTokenRemap(pParse, 0, (void*)pEList->a[i].zName); + sqlite3RenameTokenRemap(pParse, 0, (void*)pEList->a[i].zEName); } } } @@ -946,7 +946,7 @@ static void renameColumnElistNames( if( pEList ){ int i; for(i=0; i<pEList->nExpr; i++){ - char *zName = pEList->a[i].zName; + char *zName = pEList->a[i].zEName; if( 0==sqlite3_stricmp(zName, zOld) ){ renameTokenFind(pParse, pCtx, (void*)zName); } diff --git a/src/build.c b/src/build.c index 171cc68cf..196b35acf 100644 --- a/src/build.c +++ b/src/build.c @@ -3091,7 +3091,7 @@ void sqlite3CreateForeignKey( nByte = sizeof(*pFKey) + (nCol-1)*sizeof(pFKey->aCol[0]) + pTo->n + 1; if( pToCol ){ for(i=0; i<pToCol->nExpr; i++){ - nByte += sqlite3Strlen30(pToCol->a[i].zName) + 1; + nByte += sqlite3Strlen30(pToCol->a[i].zEName) + 1; } } pFKey = sqlite3DbMallocZero(db, nByte ); @@ -3116,7 +3116,7 @@ void sqlite3CreateForeignKey( for(i=0; i<nCol; i++){ int j; for(j=0; j<p->nCol; j++){ - if( sqlite3StrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){ + if( sqlite3StrICmp(p->aCol[j].zName, pFromCol->a[i].zEName)==0 ){ pFKey->aCol[i].iFrom = j; break; } @@ -3124,22 +3124,22 @@ void sqlite3CreateForeignKey( if( j>=p->nCol ){ sqlite3ErrorMsg(pParse, "unknown column \"%s\" in foreign key definition", - pFromCol->a[i].zName); + pFromCol->a[i].zEName); goto fk_end; } if( IN_RENAME_OBJECT ){ - sqlite3RenameTokenRemap(pParse, &pFKey->aCol[i], pFromCol->a[i].zName); + sqlite3RenameTokenRemap(pParse, &pFKey->aCol[i], pFromCol->a[i].zEName); } } } if( pToCol ){ for(i=0; i<nCol; i++){ - int n = sqlite3Strlen30(pToCol->a[i].zName); + int n = sqlite3Strlen30(pToCol->a[i].zEName); pFKey->aCol[i].zCol = z; if( IN_RENAME_OBJECT ){ - sqlite3RenameTokenRemap(pParse, z, pToCol->a[i].zName); + sqlite3RenameTokenRemap(pParse, z, pToCol->a[i].zEName); } - memcpy(z, pToCol->a[i].zName, n); + memcpy(z, pToCol->a[i].zEName, n); z[n] = 0; z += n+1; } diff --git a/src/expr.c b/src/expr.c index 3b2b513b6..f9c57baa9 100644 --- a/src/expr.c +++ b/src/expr.c @@ -1436,7 +1436,7 @@ ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){ pNewExpr->pLeft = pPriorSelectCol; } } - pItem->zName = sqlite3DbStrDup(db, pOldItem->zName); + pItem->zEName = sqlite3DbStrDup(db, pOldItem->zEName); pItem->zSpan = sqlite3DbStrDup(db, pOldItem->zSpan); pItem->sortFlags = pOldItem->sortFlags; pItem->done = 0; @@ -1608,9 +1608,9 @@ ExprList *sqlite3ExprListAppend( pList = pNew; } pItem = &pList->a[pList->nExpr++]; - assert( offsetof(struct ExprList_item,zName)==sizeof(pItem->pExpr) ); + assert( offsetof(struct ExprList_item,zEName)==sizeof(pItem->pExpr) ); assert( offsetof(struct ExprList_item,pExpr)==0 ); - memset(&pItem->zName,0,sizeof(*pItem)-offsetof(struct ExprList_item,zName)); + memset(&pItem->zEName,0,sizeof(*pItem)-offsetof(struct ExprList_item,zEName)); pItem->pExpr = pExpr; return pList; @@ -1667,7 +1667,7 @@ ExprList *sqlite3ExprListAppendVector( pList = sqlite3ExprListAppend(pParse, pList, pSubExpr); if( pList ){ assert( pList->nExpr==iFirst+i+1 ); - pList->a[pList->nExpr-1].zName = pColumns->a[i].zName; + pList->a[pList->nExpr-1].zEName = pColumns->a[i].zName; pColumns->a[i].zName = 0; } } @@ -1727,7 +1727,7 @@ void sqlite3ExprListSetSortOrder(ExprList *p, int iSortOrder, int eNulls){ } /* -** Set the ExprList.a[].zName element of the most recently added item +** Set the ExprList.a[].zEName element of the most recently added item ** on the expression list. ** ** pList might be NULL following an OOM error. But pName should never be @@ -1745,11 +1745,11 @@ void sqlite3ExprListSetName( struct ExprList_item *pItem; assert( pList->nExpr>0 ); pItem = &pList->a[pList->nExpr-1]; - assert( pItem->zName==0 ); - pItem->zName = sqlite3DbStrNDup(pParse->db, pName->z, pName->n); - if( dequote ) sqlite3Dequote(pItem->zName); + assert( pItem->zEName==0 ); + pItem->zEName = sqlite3DbStrNDup(pParse->db, pName->z, pName->n); + if( dequote ) sqlite3Dequote(pItem->zEName); if( IN_RENAME_OBJECT ){ - sqlite3RenameTokenMap(pParse, (void*)pItem->zName, pName); + sqlite3RenameTokenMap(pParse, (void*)pItem->zEName, pName); } } } @@ -1804,7 +1804,7 @@ static SQLITE_NOINLINE void exprListDeleteNN(sqlite3 *db, ExprList *pList){ assert( pList->nExpr>0 ); do{ sqlite3ExprDelete(db, pItem->pExpr); - sqlite3DbFree(db, pItem->zName); + sqlite3DbFree(db, pItem->zEName); sqlite3DbFree(db, pItem->zSpan); pItem++; }while( --i>0 ); diff --git a/src/insert.c b/src/insert.c index 5915f4fa9..75db13177 100644 --- a/src/insert.c +++ b/src/insert.c @@ -1635,7 +1635,7 @@ void sqlite3GenerateConstraintChecks( if( onError==OE_Ignore ){ sqlite3VdbeGoto(v, ignoreDest); }else{ - char *zName = pCheck->a[i].zName; + char *zName = pCheck->a[i].zEName; if( zName==0 ) zName = pTab->zName; if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-26383-51744 */ sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_CHECK, diff --git a/src/resolve.c b/src/resolve.c index 85db915cf..b3c331535 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -448,7 +448,7 @@ static int lookupName( pEList = pNC->uNC.pEList; assert( pEList!=0 ); for(j=0; j<pEList->nExpr; j++){ - char *zAs = pEList->a[j].zName; + char *zAs = pEList->a[j].zEName; if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){ Expr *pOrig; assert( pExpr->pLeft==0 && pExpr->pRight==0 ); @@ -1115,7 +1115,7 @@ static int resolveAsName( if( pE->op==TK_ID ){ char *zCol = pE->u.zToken; for(i=0; i<pEList->nExpr; i++){ - char *zAs = pEList->a[i].zName; + char *zAs = pEList->a[i].zEName; if( zAs!=0 && sqlite3StrICmp(zAs, zCol)==0 ){ return i+1; } diff --git a/src/select.c b/src/select.c index 26c72d6da..b99b1459b 100644 --- a/src/select.c +++ b/src/select.c @@ -918,7 +918,7 @@ static void selectInnerLoop( if( srcTab>=0 ){ for(i=0; i<nResultCol; i++){ sqlite3VdbeAddOp3(v, OP_Column, srcTab, i, regResult+i); - VdbeComment((v, "%s", p->pEList->a[i].zName)); + VdbeComment((v, "%s", p->pEList->a[i].zEName)); } }else if( eDest!=SRT_Exists ){ #ifdef SQLITE_ENABLE_SORTER_REFERENCES @@ -1539,7 +1539,7 @@ static void generateSortTail( iRead = iCol--; } sqlite3VdbeAddOp3(v, OP_Column, iSortTab, iRead, regRow+i); - VdbeComment((v, "%s", aOutEx[i].zName?aOutEx[i].zName : aOutEx[i].zSpan)); + VdbeComment((v, "%s", aOutEx[i].zEName?aOutEx[i].zEName:aOutEx[i].zSpan)); } } switch( eDest ){ @@ -1873,9 +1873,9 @@ static void generateColumnNames( assert( p!=0 ); assert( p->op!=TK_AGG_COLUMN ); /* Agg processing has not run yet */ assert( p->op!=TK_COLUMN || p->y.pTab!=0 ); /* Covering idx not yet coded */ - if( pEList->a[i].zName ){ + if( pEList->a[i].zEName ){ /* An AS clause always takes first priority */ - char *zName = pEList->a[i].zName; + char *zName = pEList->a[i].zEName; sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_TRANSIENT); }else if( srcName && p->op==TK_COLUMN ){ char *zCol; @@ -1959,7 +1959,7 @@ int sqlite3ColumnsFromExprList( for(i=0, pCol=aCol; i<nCol && !db->mallocFailed; i++, pCol++){ /* Get an appropriate name for the column */ - if( (zName = pEList->a[i].zName)!=0 ){ + if( (zName = pEList->a[i].zEName)!=0 ){ /* If the column contains an "AS <name>" phrase, use <name> as the name */ }else{ Expr *pColExpr = sqlite3ExprSkipCollateAndLikely(pEList->a[i].pExpr); @@ -5003,9 +5003,9 @@ static int selectExpander(Walker *pWalker, Select *p){ */ pNew = sqlite3ExprListAppend(pParse, pNew, a[k].pExpr); if( pNew ){ - pNew->a[pNew->nExpr-1].zName = a[k].zName; + pNew->a[pNew->nExpr-1].zEName = a[k].zEName; pNew->a[pNew->nExpr-1].zSpan = a[k].zSpan; - a[k].zName = 0; + a[k].zEName = 0; a[k].zSpan = 0; } a[k].pExpr = 0; diff --git a/src/sqliteInt.h b/src/sqliteInt.h index d01c8128b..3de659f79 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2662,7 +2662,7 @@ struct ExprList { int nExpr; /* Number of expressions on the list */ struct ExprList_item { /* For each expression in the list */ Expr *pExpr; /* The parse tree for this expression */ - char *zName; /* Token associated with this expression */ + char *zEName; /* Token associated with this expression */ char *zSpan; /* Original text of the expression */ u8 sortFlags; /* Mask of KEYINFO_ORDER_* flags */ unsigned done :1; /* A flag to indicate when processing is finished */ diff --git a/src/treeview.c b/src/treeview.c index 5b9e06454..ac0e92a08 100644 --- a/src/treeview.c +++ b/src/treeview.c @@ -106,7 +106,7 @@ void sqlite3TreeViewWith(TreeView *pView, const With *pWith, u8 moreToFollow){ char cSep = '('; int j; for(j=0; j<pCte->pCols->nExpr; j++){ - sqlite3_str_appendf(&x, "%c%s", cSep, pCte->pCols->a[j].zName); + sqlite3_str_appendf(&x, "%c%s", cSep, pCte->pCols->a[j].zEName); cSep = ','; } sqlite3_str_appendf(&x, ")"); @@ -727,7 +727,7 @@ void sqlite3TreeViewBareExprList( sqlite3TreeViewLine(pView, "%s", zLabel); for(i=0; i<pList->nExpr; i++){ int j = pList->a[i].u.x.iOrderByCol; - char *zName = pList->a[i].zName; + char *zName = pList->a[i].zEName; int moreToFollow = i<pList->nExpr - 1; if( j || zName ){ sqlite3TreeViewPush(pView, moreToFollow); diff --git a/src/trigger.c b/src/trigger.c index 5586995e3..458aa2996 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -688,7 +688,7 @@ static int checkColumnOverlap(IdList *pIdList, ExprList *pEList){ int e; if( pIdList==0 || NEVER(pEList==0) ) return 1; for(e=0; e<pEList->nExpr; e++){ - if( sqlite3IdListIndex(pIdList, pEList->a[e].zName)>=0 ) return 1; + if( sqlite3IdListIndex(pIdList, pEList->a[e].zEName)>=0 ) return 1; } return 0; } diff --git a/src/update.c b/src/update.c index 935e1d937..f4e8f696d 100644 --- a/src/update.c +++ b/src/update.c @@ -305,7 +305,7 @@ void sqlite3Update( goto update_cleanup; } for(j=0; j<pTab->nCol; j++){ - if( sqlite3StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ){ + if( sqlite3StrICmp(pTab->aCol[j].zName, pChanges->a[i].zEName)==0 ){ if( j==pTab->iPKey ){ chngRowid = 1; pRowidExpr = pChanges->a[i].pExpr; @@ -327,12 +327,12 @@ void sqlite3Update( } } if( j>=pTab->nCol ){ - if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zName) ){ + if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zEName) ){ j = -1; chngRowid = 1; pRowidExpr = pChanges->a[i].pExpr; }else{ - sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zName); + sqlite3ErrorMsg(pParse, "no such column: %s", pChanges->a[i].zEName); pParse->checkSchema = 1; goto update_cleanup; } |