1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

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
This commit is contained in:
drh
2016-02-25 13:33:02 +00:00
parent f769cd61b2
commit d8c22ac655
3 changed files with 9 additions and 9 deletions

View File

@@ -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;
}