mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Column names coming back from a SELECT are now just the name of the
source column without the "table." prefix. In other words, "PRAGMA short_column_names=ON" is now the default. This makes the names of columns behave more like other SQL engines. The old behavior can be restored by setting "PRAGMA short_column_names=OFF". (CVS 2231) FossilOrigin-Name: 9295050af1bf2d9d4dc63adc225a2848d67cbe17
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle SELECT statements in SQLite.
|
||||
**
|
||||
** $Id: select.c,v 1.225 2005/01/18 14:45:48 drh Exp $
|
||||
** $Id: select.c,v 1.226 2005/01/18 16:02:40 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -757,7 +757,7 @@ static void generateColumnNames(
|
||||
if( iCol<0 ) iCol = pTab->iPKey;
|
||||
assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
|
||||
if( iCol<0 ){
|
||||
zCol = "_ROWID_";
|
||||
zCol = "rowid";
|
||||
}else{
|
||||
zCol = pTab->aCol[iCol].zName;
|
||||
}
|
||||
@@ -772,7 +772,7 @@ static void generateColumnNames(
|
||||
sqlite3SetString(&zName, zTab, ".", zCol, 0);
|
||||
sqlite3VdbeSetColName(v, i, zName, P3_DYNAMIC);
|
||||
}else{
|
||||
sqlite3VdbeSetColName(v, i, zCol, 0);
|
||||
sqlite3VdbeSetColName(v, i, zCol, strlen(zCol));
|
||||
}
|
||||
}else if( p->span.z && p->span.z[0] ){
|
||||
sqlite3VdbeSetColName(v, i, p->span.z, p->span.n);
|
||||
|
||||
Reference in New Issue
Block a user