From a543c82d753fcfac5cfc18c3282ec5b455acf600 Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 8 Jun 2006 16:10:14 +0000 Subject: [PATCH] In the shell, make sure the database is opened before trying to do an ".import". Bug reported on the mailing list. (CVS 3209) FossilOrigin-Name: 39e3427813135601a7417c96e55b410fa89ac1f5 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 2faa123ee1..fd6933a15e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Unload\sshared\slibraries\swhen\sa\sdatabase\sconnection\scloses.\s(CVS\s3208) -D 2006-06-08T15:48:01 +C In\sthe\sshell,\smake\ssure\sthe\sdatabase\sis\sopened\sbefore\strying\sto\sdo\nan\s".import".\s\sBug\sreported\son\sthe\smailing\slist.\s(CVS\s3209) +D 2006-06-08T16:10:15 F Makefile.in 50d948a8c4eda30ebb5799b661bd4c2de11824d0 F Makefile.linux-gcc 74ba0eadf88748a9ce3fd03d2a3ede2e6715baec F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -71,7 +71,7 @@ F src/printf.c 7029e5f7344a478394a02c52837ff296ee1ab240 F src/random.c d40f8d356cecbd351ccfab6eaedd7ec1b54f5261 F src/select.c 8daba07a04a6d41f5267ea8353324cbe5a210e14 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 -F src/shell.c 4f1e4a4d3e7aadd1369604a30293fc3e1726c78c +F src/shell.c b9eb3ed4d3ab41fbf630eabb602f3c9d20fc737a F src/sqlite.h.in d33c4688ba292af5f84fea49b2e3946b9129673a F src/sqlite3ext.h 127bd394c8eea481f2ac9b754bf399dbfc818b75 F src/sqliteInt.h 029ae294180139e3ead077b548dd9e08f99010aa @@ -360,7 +360,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 4ca932d3ae9bb97b819b5baf6fd3e1cebda9e0e2 -R 0158de9b8b4c84dbf29d65b8d8634e42 +P 327e6909c9d35b651ab6f3a1a270022b354538c6 +R 021001a8617a3717aaf8a0dc8bd5a726 U drh -Z 1d4147161dab15313c86f0f2346a379f +Z b4d12d966b938862d92a3ccf0d06a9d1 diff --git a/manifest.uuid b/manifest.uuid index 78ac619122..66d4fd9192 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -327e6909c9d35b651ab6f3a1a270022b354538c6 \ No newline at end of file +39e3427813135601a7417c96e55b410fa89ac1f5 \ No newline at end of file diff --git a/src/shell.c b/src/shell.c index 4392ec5d31..dd83e8e2bd 100644 --- a/src/shell.c +++ b/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.139 2006/06/08 15:28:44 drh Exp $ +** $Id: shell.c,v 1.140 2006/06/08 16:10:15 drh Exp $ */ #include #include @@ -1033,6 +1033,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){ FILE *in; /* The input file */ int lineno = 0; /* Line number of input file */ + open_db(p); nSep = strlen(p->separator); if( nSep==0 ){ fprintf(stderr, "non-null separator required for import\n");