-C Fix\sa\sbug\sin\ssubquery\sgeneration\swhen\sthe\ssubquery\sis\sa\scompound\sselect.\nAlso\sadded\snew\stests\sto\scover\sthis\scase.\s(CVS\s435)
-D 2002-03-23T00:31:29
+C The\ssqlite_get_table()\sfunction\snow\sreturns\san\serror\sif\syou\spass\sin\stwo\nor\smore\sSELECT\sstatements\sthat\sreturn\sdifferent\snumbers\sof\scolumns.\s(CVS\s436)
+D 2002-03-23T00:52:01
F Makefile.in 50f1b3351df109b5774771350d8c1b8d3640130d
F Makefile.template 89e373b2dad0321df00400fa968dc14b61a03296
F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0
F src/shell.tcl 27ecbd63dd88396ad16d81ab44f73e6c0ea9d20e
F src/sqlite.h.in 1dae50411aee9439860d7fbe315183c582d27197
F src/sqliteInt.h 73e7d0f39a3c11d395fc422986959261bd193eba
-F src/table.c 203a09d5d0009eeeb1f670370d52b4ce163a3b52
+F src/table.c eed2098c9b577aa17f8abe89313a9c4413f57d63
F src/tclsqlite.c df847b71b28277f1cfa1ee1e3e51452ffe5a9a26
F src/test1.c d46ab7a82a9c16a3b1ee363cb4c0f98c5ff65743
F src/test2.c d410dbd8a90faa466c3ab694fa0aa57f5a773aa6
F test/sort.test 3b996ce7ca385f9cd559944ac0f4027a23aa546b
F test/subselect.test 335d3dad8d585726c447dfee8d9c4f7383c76b78
F test/table.test 17b0b6eafa3faaee5545b7a94e6c1ff73f0880f3
-F test/tableapi.test 51d0c209aa6b1158cb952ec917c656d4ce66e9e4
+F test/tableapi.test 3c80421a889e1d106df16e5800fa787f0d2914a6
F test/tclsqlite.test ca8dd89b02ab68bd4540163c24551756a69f6783
F test/temptable.test 0e9934283259a5e637eec756a7eefd6964c0f79b
F test/tester.tcl dc1b56bd628b487e4d75bfd1e7480b5ed8810ac6
F www/arch.png 82ef36db1143828a7abc88b1e308a5f55d4336f4
F www/arch.tcl 72a0c80e9054cc7025a50928d28d9c75c02c2b8b
F www/c_interface.tcl 567cda531aac9d68a61ef02e26c6b202bd856db2
-F www/changes.tcl 65c1e63566ddbe09ef016c4c78ed21b6537af512
+F www/changes.tcl 7137167dc4193b4658096559d94ce14fde33ddec
F www/conflict.tcl 81dd21f9a679e60aae049e9dd8ab53d59570cda2
F www/crosscompile.tcl 3622ebbe518927a3854a12de51344673eb2dd060
F www/download.tcl a6d75b8b117cd33dcb090bef7e80d7556d28ebe0
F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279
F www/tclsqlite.tcl 829b393d1ab187fd7a5e978631b3429318885c49
F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218
-P 49d032325553fa1dd7f31b852753cc6c9226d8f7
-R afbadc87908df7153445a9059806e384
+P aaf7fd4cef04d3d70a0444aad1b606bfc663c3e8
+R b3affb1ebed689441f43f9512795f044
U drh
-Z 20aa27678bc9a0889ed47e36fd4764d7
+Z a9859b001a58df50bd87dfcc98d0ee86
*/
#include <stdlib.h>
#include <string.h>
-#include "sqlite.h"
+#include "sqliteInt.h"
/*
** This structure is used to pass data from sqlite_get_table() through
*/
typedef struct TabResult {
char **azResult;
+ char *zErrMsg;
int nResult;
int nAlloc;
int nRow;
}
p->azResult[p->nData++] = z;
}
+ }else if( p->nColumn!=nCol ){
+ sqliteSetString(&p->zErrMsg,
+ "sqlite_get_table() called with two or more incompatible queries", 0);
+ p->rc = SQLITE_ERROR;
+ return 1;
}
/* Copy over the row data
*pazResult = 0;
if( pnColumn ) *pnColumn = 0;
if( pnRow ) *pnRow = 0;
+ res.zErrMsg = 0;
res.nResult = 0;
res.nRow = 0;
res.nColumn = 0;
}
if( rc==SQLITE_ABORT ){
sqlite_free_table(&res.azResult[1]);
+ if( res.zErrMsg ){
+ if( pzErrMsg ){
+ free(*pzErrMsg);
+ *pzErrMsg = res.zErrMsg;
+ sqliteStrRealloc(pzErrMsg);
+ }else{
+ sqliteFree(res.zErrMsg);
+ }
+ }
return res.rc;
}
+ sqliteFree(res.zErrMsg);
if( rc!=SQLITE_OK ){
sqlite_free_table(&res.azResult[1]);
return rc;
# focus of this file is testing the sqlite_exec_printf() and
# sqlite_get_table_printf() APIs.
#
-# $Id: tableapi.test,v 1.4 2001/10/20 12:30:12 drh Exp $
+# $Id: tableapi.test,v 1.5 2002/03/23 00:52:01 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
} {}
} {0 0 2 a b}
+do_test tableapi-4.1 {
+ set rc [catch {
+ sqlite_get_table_printf $::dbx {
+ SELECT * FROM xyz; SELECT * FROM sqlite_master
+ } {}
+ } msg]
+ concat $rc $msg
+} {0 1 {sqlite_get_table() called with two or more incompatible queries}}
+
do_test tableapi-99.0 {
sqlite_close $::dbx
} {}