1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

:-) (CVS 25)

FossilOrigin-Name: 35a8f523e8389a1a6e41f6561500644b165d556e
This commit is contained in:
drh
2000-05-31 18:20:14 +00:00
parent 3aadb2e64c
commit da9d6c4572
5 changed files with 42 additions and 23 deletions

View File

@@ -24,7 +24,7 @@
** This file contains C code routines that are called by the parser
** to handle SELECT statements.
**
** $Id: select.c,v 1.1 2000/05/31 15:34:53 drh Exp $
** $Id: select.c,v 1.2 2000/05/31 18:20:14 drh Exp $
*/
#include "sqliteInt.h"
@@ -154,8 +154,11 @@ void sqliteSelect(
if( pTabList->nId>1 ){
char *zName = 0;
Table *pTab = pTabList->a[p->iTable].pTab;
sqliteSetString(&zName, pTab->zName, ".",
pTab->azCol[p->iField], 0);
char *zTab;
zTab = pTabList->a[p->iTable].zAlias;
if( zTab==0 ) zTab = pTab->zName;
sqliteSetString(&zName, zTab, ".", pTab->azCol[p->iField], 0);
sqliteVdbeAddOp(v, OP_ColumnName, i, 0, zName, 0);
sqliteFree(zName);
}else{
@@ -191,8 +194,10 @@ void sqliteSelect(
/* Pull the requested fields.
*/
for(i=0; i<pEList->nExpr; i++){
sqliteExprCode(pParse, pEList->a[i].pExpr);
if( !isAgg ){
for(i=0; i<pEList->nExpr; i++){
sqliteExprCode(pParse, pEList->a[i].pExpr);
}
}
/* If there is no ORDER BY clause, then we can invoke the callback