Better handling of NULL column names. (CVS 3317)
FossilOrigin-Name: 9f13972b93a3cac95b4319d3e75343e02a30a38f
This commit is contained in:
parent
f9cb7f58a7
commit
2cc55698cd
16
manifest
16
manifest
@ -1,5 +1,5 @@
|
||||
C Move\sthe\ssqlite3_sleep()\sand\ssqlite3_clear_bindings()\sinterfaces\sinto\sthe\nmain\slibrary\sand\smake\sthis\sofficial.\s(CVS\s3316)
|
||||
D 2006-06-27T20:06:45
|
||||
C Better\shandling\sof\sNULL\scolumn\snames.\s(CVS\s3317)
|
||||
D 2006-06-27T20:39:04
|
||||
F Makefile.in 9c2a76055c305868cc5f5b73e29a252ff3632c0a
|
||||
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
|
||||
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
||||
@ -71,11 +71,11 @@ F src/printf.c b179b6ed12f793e028dd169e2e2e2b2a37eedc63
|
||||
F src/random.c d40f8d356cecbd351ccfab6eaedd7ec1b54f5261
|
||||
F src/select.c 380fa06c99ae01050c0054c4b1db91e9f1d8322d
|
||||
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
|
||||
F src/shell.c 48d8e65784c2fcb8c906d464f3c441640ff21c9d
|
||||
F src/shell.c 359551ab5cdd8f8fe5f3fe170fd330b108b08d7d
|
||||
F src/sqlite.h.in a1ae5f372affd1313d9bea98155f01626f538fbd
|
||||
F src/sqlite3ext.h c611255287e9a11ce4f1fe6251c2a0b9d32a828b
|
||||
F src/sqliteInt.h e07a49b3e349c2c5f1bcb7dd9371fc3faf5ba338
|
||||
F src/table.c e707e822aad688034d391b93df63d6b2d302fdca
|
||||
F src/table.c d8817f43a6c6bf139487db161760b9e1e02da3f1
|
||||
F src/tclsqlite.c 32d9e0147077f2e2c127c5f214fb3fe03ef97d18
|
||||
F src/test1.c 42c423aad0d9477b1fc229e4d0aa000f2b3310b4
|
||||
F src/test2.c ca74a1d8aeb7d9606e8f6b762c5daf85c1a3f92b
|
||||
@ -250,7 +250,7 @@ F test/subquery.test ae324ee928c5fb463a3ce08a8860d6e7f1ca5797
|
||||
F test/subselect.test 2d13fb7f450db3595adcdd24079a0dd1d2d6abc2
|
||||
F test/sync.test d05397b8f89f423dd6dba528692019ab036bc1c3
|
||||
F test/table.test 1c1539af8db89c68e467df02ec2607ec61c67bac
|
||||
F test/tableapi.test 6a66d58b37d46dc0f2b3c7d4bd2617d209399bd1
|
||||
F test/tableapi.test a1982276274d292110d549206bc365b2da43e2ee
|
||||
F test/tclsqlite.test 93c399414273d829f3fc5fc4a8349b484fe84d5b
|
||||
F test/temptable.test c36f3e5a94507abb64f7ba23deeb4e1a8a8c3821
|
||||
F test/tester.tcl 0436eda9b45cd937662b9766262cc2527448413f
|
||||
@ -375,7 +375,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
|
||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
|
||||
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
|
||||
P c7477459e92209ad792f0e11e4a4dd8abf0f2f11
|
||||
R 52123310555fce7d05407190dc5a314c
|
||||
P eb3442c44ef1dbf8895195bb08fbeeea315b44c1
|
||||
R 950547ff05ca6adfe4c9ef0816623482
|
||||
U drh
|
||||
Z 8242f839c9f5ef79d75ea82732d8a51d
|
||||
Z 442e3d34de52d4352748481f67186145
|
||||
|
@ -1 +1 @@
|
||||
eb3442c44ef1dbf8895195bb08fbeeea315b44c1
|
||||
9f13972b93a3cac95b4319d3e75343e02a30a38f
|
10
src/shell.c
10
src/shell.c
@ -12,7 +12,7 @@
|
||||
** This file contains code to implement the "sqlite" command line
|
||||
** utility for accessing SQLite databases.
|
||||
**
|
||||
** $Id: shell.c,v 1.143 2006/06/27 15:16:15 drh Exp $
|
||||
** $Id: shell.c,v 1.144 2006/06/27 20:39:04 drh Exp $
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -388,12 +388,12 @@ static int callback(void *pArg, int nArg, char **azArg, char **azCol){
|
||||
int w = 5;
|
||||
if( azArg==0 ) break;
|
||||
for(i=0; i<nArg; i++){
|
||||
int len = strlen(azCol[i]);
|
||||
int len = strlen(azCol[i] ? azCol[i] : "");
|
||||
if( len>w ) w = len;
|
||||
}
|
||||
if( p->cnt++>0 ) fprintf(p->out,"\n");
|
||||
for(i=0; i<nArg; i++){
|
||||
fprintf(p->out,"%*s = %s\n", w, azCol[i],
|
||||
fprintf(p->out,"%*s = %s\n", w, azCol[i],
|
||||
azArg[i] ? azArg[i] : p->nullvalue);
|
||||
}
|
||||
break;
|
||||
@ -490,7 +490,7 @@ static int callback(void *pArg, int nArg, char **azArg, char **azCol){
|
||||
case MODE_Tcl: {
|
||||
if( p->cnt++==0 && p->showHeader ){
|
||||
for(i=0; i<nArg; i++){
|
||||
output_c_string(p->out,azCol[i]);
|
||||
output_c_string(p->out,azCol[i] ? azCol[i] : "");
|
||||
fprintf(p->out, "%s", p->separator);
|
||||
}
|
||||
fprintf(p->out,"\n");
|
||||
@ -506,7 +506,7 @@ static int callback(void *pArg, int nArg, char **azArg, char **azCol){
|
||||
case MODE_Csv: {
|
||||
if( p->cnt++==0 && p->showHeader ){
|
||||
for(i=0; i<nArg; i++){
|
||||
output_csv(p, azCol[i], i<nArg-1);
|
||||
output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1);
|
||||
}
|
||||
fprintf(p->out,"\n");
|
||||
}
|
||||
|
@ -71,11 +71,9 @@ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
|
||||
p->nColumn = nCol;
|
||||
for(i=0; i<nCol; i++){
|
||||
if( colv[i]==0 ){
|
||||
z = 0;
|
||||
z = sqlite3_mprintf("");
|
||||
}else{
|
||||
z = sqlite3_malloc( strlen(colv[i])+1 );
|
||||
if( z==0 ) goto malloc_failed;
|
||||
strcpy(z, colv[i]);
|
||||
z = sqlite3_mprintf("%s", colv[i]);
|
||||
}
|
||||
p->azResult[p->nData++] = z;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
# focus of this file is testing the sqlite_exec_printf() and
|
||||
# sqlite_get_table_printf() APIs.
|
||||
#
|
||||
# $Id: tableapi.test,v 1.10 2005/01/21 03:12:16 danielk1977 Exp $
|
||||
# $Id: tableapi.test,v 1.11 2006/06/27 20:39:05 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -206,6 +206,10 @@ do_test tableapi-5.2 {
|
||||
sqlite3_get_table_printf $::dbx {SELECT * FROM t2} {}
|
||||
} {0 2 100 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39 x40 x41 x42 x43 x44 x45 x46 x47 x48 x49 x50 x51 x52 x53 x54 x55 x56 x57 x58 x59 x60 x61 x62 x63 x64 x65 x66 x67 x68 x69 x70 x71 x72 x73 x74 x75 x76 x77 x78 x79 x80 x81 x82 x83 x84 x85 x86 x87 x88 x89 x90 x91 x92 x93 x94 x95 x96 x97 x98 x99 x100 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100}
|
||||
|
||||
do_test tableapi-6.1 {
|
||||
sqlite3_get_table_printf $::dbx {PRAGMA user_version} {}
|
||||
} {0 1 1 {} 0}
|
||||
|
||||
do_test tableapi-99.0 {
|
||||
sqlite3_close $::dbx
|
||||
} {SQLITE_OK}
|
||||
|
Loading…
Reference in New Issue
Block a user