aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifest18
-rw-r--r--manifest.uuid2
-rw-r--r--src/build.c10
-rw-r--r--src/select.c24
-rw-r--r--src/sqliteInt.h4
-rw-r--r--src/tclsqlite.c35
6 files changed, 56 insertions, 37 deletions
diff --git a/manifest b/manifest
index 52c7f8f29..4692776cd 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C When\sreporting\sback\sthe\sdatatype\sof\scolumns,\suse\sthe\stext\sof\sthe\sdatatype\r\nas\sit\sappears\sin\sthe\sCREATE\sTABLE\sstatement,\sif\savailable.\s\sAlso:\sremoved\r\nthe\s".reindex"\scommand\sfrom\sthe\sshell.\s(CVS\s669)
-D 2002-07-10T21:26:01
+C Turn\sof\sthe\sreporting\sof\sdatatypes\sin\sthe\s4th\scallback\sargument\sunless\sthe\nSHOW_DATATYPES\spragma\sis\sON.\s\sEliminate\sthe\sNULL\spointer\sthat\sused\sto\sseparate\nthe\sbeginning\sof\sdatatypes\sfrom\sthe\send\sof\scolumn\snames\sso\sthat\sthe\scallback\ncan\stest\sto\ssee\swhether\sor\snot\sdatatypes\sare\sprovided.\s\sThis\sis\san\nincompatible\schanges,\sbut\ssince\sthe\sprior\sbehavior\swas\snever\sdocumented,\swe\nwill\slet\sit\sin.\s(CVS\s670)
+D 2002-07-11T12:18:16
F Makefile.in 6291a33b87d2a395aafd7646ee1ed562c6f2c28c
F Makefile.template 4e11752e0b5c7a043ca50af4296ec562857ba495
F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
@@ -20,7 +20,7 @@ F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea
F src/TODO af7f3cab0228e34149cf98e073aa83d45878e7e6
F src/btree.c db8cd1bd46cd30a1763c3cc80602571d1b30a329
F src/btree.h 8abeabfe6e0b1a990b64fa457592a6482f6674f3
-F src/build.c e5a3e6bcd43cbae2c2ae631759f51a0f2fc73d81
+F src/build.c d8318cd8aa1d8175740515e3b2bc55f6f8ad512d
F src/delete.c 215492ffcea4262a993e55f3c4a67dc9fea4da9c
F src/encode.c 346b12b46148506c32038524b95c4631ab46d760
F src/expr.c 4b25ee5e65f351d40dea8575b998605762556d76
@@ -37,13 +37,13 @@ F src/pager.h 6fddfddd3b73aa8abc081b973886320e3c614f0e
F src/parse.y 9267b7681882205f904f6564fff733d8fbcd58a3
F src/printf.c 06f4c8725063e0faf0e34824ab70feace7146bf7
F src/random.c 19e8e00fe0df32a742f115773f57651be327cabe
-F src/select.c 9e67a79bda57a587b919074df8d8a18cb95c3ba8
+F src/select.c f4e7221a319da25f549a434a6c664eedcbce4dec
F src/shell.c 16cb2db27f2d3045f78e74e83bac965a8249357b
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in 75c5bbb066d0faf34424b7d1babf8b44d5b31af2
-F src/sqliteInt.h ad5a60c1b28356c956bea4f947509206725519ce
+F src/sqliteInt.h a4f79f88e6b2cf970a8ea91c0a2c32430bbd0a7d
F src/table.c eed2098c9b577aa17f8abe89313a9c4413f57d63
-F src/tclsqlite.c f5d194f1d3e2ddd615c9784affbb8c840e30b3fd
+F src/tclsqlite.c ba454c5166252a55cb4db8af4d29d2a18b6e6f3d
F src/test1.c 456cb080db85056be723e770435d9509afc3a83a
F src/test2.c 669cc22781c6461a273416ec1a7414d25c081730
F src/test3.c fda085b4cdd5a2d7f65786ce679036e955f4bfa2
@@ -140,7 +140,7 @@ F www/speed.tcl da8afcc1d3ccc5696cfb388a68982bc3d9f7f00f
F www/sqlite.tcl ae3dcfb077e53833b59d4fcc94d8a12c50a44098
F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
-P 87cd10c1f638db5d1f47bc12669f150485415b3e
-R dfabcf7e6ad6024dc64e99aa6198b20c
+P ff8b6f4ee8099a7170cb786b8ead9a3e42ab5869
+R 4c9a5cc2cec864756c678ced0f23d593
U drh
-Z a0a55547557628906064ab1285cc2b8e
+Z 840152c064bf52b6a31a6b9344474a04
diff --git a/manifest.uuid b/manifest.uuid
index 47a74df0d..4c55e546a 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-ff8b6f4ee8099a7170cb786b8ead9a3e42ab5869 \ No newline at end of file
+b98727246d5fcc1b097b577be498a77e954c5dc4 \ No newline at end of file
diff --git a/src/build.c b/src/build.c
index 74bd54817..1f2fc7829 100644
--- a/src/build.c
+++ b/src/build.c
@@ -25,7 +25,7 @@
** ROLLBACK
** PRAGMA
**
-** $Id: build.c,v 1.102 2002/07/08 22:03:32 drh Exp $
+** $Id: build.c,v 1.103 2002/07/11 12:18:16 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -2044,6 +2044,14 @@ void sqlitePragma(Parse *pParse, Token *pLeft, Token *pRight, int minusFlag){
}
}else
+ if( sqliteStrICmp(zLeft, "show_datatypes")==0 ){
+ if( getBoolean(zRight) ){
+ db->flags |= SQLITE_ReportTypes;
+ }else{
+ db->flags &= ~SQLITE_ReportTypes;
+ }
+ }else
+
if( sqliteStrICmp(zLeft, "result_set_details")==0 ){
if( getBoolean(zRight) ){
db->flags |= SQLITE_ResultDetails;
diff --git a/src/select.c b/src/select.c
index 73c1f6a3d..61be40e9c 100644
--- a/src/select.c
+++ b/src/select.c
@@ -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.104 2002/07/10 21:26:01 drh Exp $
+** $Id: select.c,v 1.105 2002/07/11 12:18:17 drh Exp $
*/
#include "sqliteInt.h"
@@ -612,7 +612,11 @@ static void generateColumnNames(
int i;
if( pParse->colNamesSet || v==0 || sqlite_malloc_failed ) return;
pParse->colNamesSet = 1;
- sqliteVdbeAddOp(v, OP_ColumnCount, pEList->nExpr*2+1, 0);
+ if( pParse->db->flags & SQLITE_ReportTypes ){
+ sqliteVdbeAddOp(v, OP_ColumnCount, pEList->nExpr*2, 0);
+ }else{
+ sqliteVdbeAddOp(v, OP_ColumnCount, pEList->nExpr, 0);
+ }
for(i=0; i<pEList->nExpr; i++){
Expr *p;
char *zType = 0;
@@ -672,15 +676,17 @@ static void generateColumnNames(
sqliteVdbeAddOp(v, OP_ColumnName, i, 0);
sqliteVdbeChangeP3(v, -1, zName, strlen(zName));
}
- if( zType==0 ){
- if( sqliteExprType(p)==SQLITE_SO_TEXT ){
- zType = "TEXT";
- }else{
- zType = "NUMERIC";
+ if( pParse->db->flags & SQLITE_ReportTypes ){
+ if( zType==0 ){
+ if( sqliteExprType(p)==SQLITE_SO_TEXT ){
+ zType = "TEXT";
+ }else{
+ zType = "NUMERIC";
+ }
}
+ sqliteVdbeAddOp(v, OP_ColumnName, i + pEList->nExpr, 0);
+ sqliteVdbeChangeP3(v, -1, zType, P3_STATIC);
}
- sqliteVdbeAddOp(v, OP_ColumnName, i + pEList->nExpr + 1, 0);
- sqliteVdbeChangeP3(v, -1, zType, P3_STATIC);
}
}
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 5f9056745..910bd5b5d 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.135 2002/07/08 22:03:32 drh Exp $
+** @(#) $Id: sqliteInt.h,v 1.136 2002/07/11 12:18:17 drh Exp $
*/
#include "sqlite.h"
#include "hash.h"
@@ -230,6 +230,8 @@ struct sqlite {
#define SQLITE_ResultDetails 0x00000100 /* Details added to result set */
#define SQLITE_UnresetViews 0x00000200 /* True if one or more views have */
/* defined column names */
+#define SQLITE_ReportTypes 0x00000400 /* Include information on datatypes */
+ /* in 4th argument of callback */
/*
** Possible values for the sqlite.magic field.
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index b8e2a5ee3..93cf71846 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.37 2002/07/10 21:26:01 drh Exp $
+** $Id: tclsqlite.c,v 1.38 2002/07/11 12:18:17 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -93,18 +93,20 @@ static int DbEvalCallback(
return 1;
}
if( cbData->zArray[0] ){
- Tcl_DString dType;
- Tcl_DStringInit(&dType);
Tcl_SetVar2(cbData->interp, cbData->zArray, "*",
Tcl_DStringValue(&dCol), TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
- Tcl_DStringAppend(&dType, "typeof:", -1);
- Tcl_DStringAppend(&dType, Tcl_DStringValue(&dCol), -1);
- Tcl_DStringFree(&dCol);
- Tcl_ExternalToUtfDString(NULL, azN[i+argc+1], -1, &dCol);
- Tcl_SetVar2(cbData->interp, cbData->zArray,
- Tcl_DStringValue(&dType), Tcl_DStringValue(&dCol),
- TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
- Tcl_DStringFree(&dType);
+ if( azN[nCol]!=0 } {
+ Tcl_DString dType;
+ Tcl_DStringInit(&dType);
+ Tcl_DStringAppend(&dType, "typeof:", -1);
+ Tcl_DStringAppend(&dType, Tcl_DStringValue(&dCol), -1);
+ Tcl_DStringFree(&dCol);
+ Tcl_ExternalToUtfDString(NULL, azN[i+nCol], -1, &dCol);
+ Tcl_SetVar2(cbData->interp, cbData->zArray,
+ Tcl_DStringValue(&dType), Tcl_DStringValue(&dCol),
+ TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
+ Tcl_DStringFree(&dType);
+ }
}
Tcl_DStringFree(&dCol);
@@ -163,13 +165,14 @@ static int DbEvalCallback(
if( azCol==0 || (cbData->once && cbData->zArray[0]) ){
Tcl_SetVar2(cbData->interp, cbData->zArray, "*", "", 0);
for(i=0; i<nCol; i++){
- char *z;
Tcl_SetVar2(cbData->interp, cbData->zArray, "*", azN[i],
TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
- z = sqlite_mprintf("typeof:%s", azN[i]);
- Tcl_SetVar2(cbData->interp, cbData->zArray, z, azN[i+nCol+1],
- TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
- sqlite_freemem(z);
+ if( azN[nCol] ){
+ char *z = sqlite_mprintf("typeof:%s", azN[i]);
+ Tcl_SetVar2(cbData->interp, cbData->zArray, z, azN[i+nCol],
+ TCL_LIST_ELEMENT|TCL_APPEND_VALUE);
+ sqlite_freemem(z);
+ }
}
cbData->once = 0;
}