aboutsummaryrefslogtreecommitdiff
path: root/src/tclsqlite.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2002-07-10 21:26:00 +0000
committerdrh <drh@noemail.net>2002-07-10 21:26:00 +0000
commitfa173a764a713e8ac9f9a6733c4612edfc904f28 (patch)
tree1c118e4b0c914eba81581854ca8da97382cdd4bf /src/tclsqlite.c
parent6276c1cbf0f7f52bb1f1aa216676ce63044e034e (diff)
downloadsqlite-fa173a764a713e8ac9f9a6733c4612edfc904f28.tar.gz
sqlite-fa173a764a713e8ac9f9a6733c4612edfc904f28.zip
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
Diffstat (limited to 'src/tclsqlite.c')
-rw-r--r--src/tclsqlite.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/tclsqlite.c b/src/tclsqlite.c
index fecc6ab58..b8e2a5ee3 100644
--- a/src/tclsqlite.c
+++ b/src/tclsqlite.c
@@ -11,7 +11,7 @@
*************************************************************************
** A TCL Interface to SQLite
**
-** $Id: tclsqlite.c,v 1.36 2002/07/07 17:12:36 drh Exp $
+** $Id: tclsqlite.c,v 1.37 2002/07/10 21:26:01 drh Exp $
*/
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -93,9 +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);
}
+
Tcl_DStringFree(&dCol);
}
}
@@ -152,8 +163,13 @@ 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);
}
cbData->once = 0;
}