aboutsummaryrefslogtreecommitdiff
path: root/src/shell.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-02-25 13:33:02 +0000
committerdrh <drh@noemail.net>2016-02-25 13:33:02 +0000
commitd8c22ac655458ce388fe7517e3ff472ce2daf603 (patch)
tree04d9b64bfaccb40c0ee80be7aefbc7252bb77759 /src/shell.c
parentf769cd61b2af2d5bc2168b8f0aeeee3118694d2d (diff)
downloadsqlite-d8c22ac655458ce388fe7517e3ff472ce2daf603.tar.gz
sqlite-d8c22ac655458ce388fe7517e3ff472ce2daf603.zip
In the command-line shell: When the ".import" command is creating a new
table using column names from the first row of CSV input, make sure double-quotes in the name are properly escaped. FossilOrigin-Name: 2e67a1c823c7003e7d2619c7d8b6db6ce046c527
Diffstat (limited to 'src/shell.c')
-rw-r--r--src/shell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shell.c b/src/shell.c
index 85e36a88d..95b75fa87 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -3171,7 +3171,7 @@ static int do_meta_command(char *zLine, ShellState *p){
char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable);
char cSep = '(';
while( xRead(&sCtx) ){
- zCreate = sqlite3_mprintf("%z%c\n \"%s\" TEXT", zCreate, cSep, sCtx.z);
+ zCreate = sqlite3_mprintf("%z%c\n \"%w\" TEXT", zCreate, cSep, sCtx.z);
cSep = ',';
if( sCtx.cTerm!=sCtx.cColSep ) break;
}