1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

When reporting back the datatype of columns, use the text of the datatype

as it appears in the CREATE TABLE statement, if available.  Also: removed
the ".reindex" command from the shell. (CVS 669)

FossilOrigin-Name: ff8b6f4ee8099a7170cb786b8ead9a3e42ab5869
This commit is contained in:
drh
2002-07-10 21:26:00 +00:00
parent 6276c1cbf0
commit fa173a764a
8 changed files with 61 additions and 87 deletions

View File

@@ -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.103 2002/07/05 21:42:37 drh Exp $
** $Id: select.c,v 1.104 2002/07/10 21:26:01 drh Exp $
*/
#include "sqliteInt.h"
@@ -626,11 +626,7 @@ static void generateColumnNames(
p = pEList->a[i].pExpr;
if( p==0 ) continue;
showFullNames = (pParse->db->flags & SQLITE_FullColNames)!=0;
if( p->span.z && p->span.z[0] && !showFullNames ){
int addr = sqliteVdbeAddOp(v,OP_ColumnName, i, 0);
sqliteVdbeChangeP3(v, -1, p->span.z, p->span.n);
sqliteVdbeCompressSpace(v, addr);
}else if( p->op==TK_COLUMN && pTabList ){
if( p->op==TK_COLUMN && pTabList ){
Table *pTab = pTabList->a[p->iTable - base].pTab;
char *zCol;
int iCol = p->iColumn;
@@ -643,7 +639,11 @@ static void generateColumnNames(
zCol = pTab->aCol[iCol].zName;
zType = pTab->aCol[iCol].zType;
}
if( pTabList->nSrc>1 || showFullNames ){
if( p->span.z && p->span.z[0] && !showFullNames ){
int addr = sqliteVdbeAddOp(v,OP_ColumnName, i, 0);
sqliteVdbeChangeP3(v, -1, p->span.z, p->span.n);
sqliteVdbeCompressSpace(v, addr);
}else if( pTabList->nSrc>1 || showFullNames ){
char *zName = 0;
char *zTab;
@@ -657,6 +657,10 @@ static void generateColumnNames(
sqliteVdbeAddOp(v, OP_ColumnName, i, 0);
sqliteVdbeChangeP3(v, -1, zCol, 0);
}
}else if( p->span.z && p->span.z[0] && !showFullNames ){
int addr = sqliteVdbeAddOp(v,OP_ColumnName, i, 0);
sqliteVdbeChangeP3(v, -1, p->span.z, p->span.n);
sqliteVdbeCompressSpace(v, addr);
}else if( p->span.z && p->span.z[0] ){
int addr = sqliteVdbeAddOp(v,OP_ColumnName, i, 0);
sqliteVdbeChangeP3(v, -1, p->span.z, p->span.n);