mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-05 04:30:38 +03:00
In the shell, allow arbitrary table names on the ".import" command.
Ticket [d1d84037b90a449]. FossilOrigin-Name: f4dd32d30ed54f847319664cf749fd0b92b4af3f
This commit is contained in:
@@ -1678,7 +1678,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
fprintf(stderr, "Error: non-null separator required for import\n");
|
||||
return 1;
|
||||
}
|
||||
zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable);
|
||||
zSql = sqlite3_mprintf("SELECT * FROM %s", zTable);
|
||||
if( zSql==0 ){
|
||||
fprintf(stderr, "Error: out of memory\n");
|
||||
return 1;
|
||||
@@ -1700,7 +1700,7 @@ static int do_meta_command(char *zLine, struct callback_data *p){
|
||||
fprintf(stderr, "Error: out of memory\n");
|
||||
return 1;
|
||||
}
|
||||
sqlite3_snprintf(nByte+20, zSql, "INSERT INTO '%q' VALUES(?", zTable);
|
||||
sqlite3_snprintf(nByte+20, zSql, "INSERT INTO %s VALUES(?", zTable);
|
||||
j = strlen30(zSql);
|
||||
for(i=1; i<nCol; i++){
|
||||
zSql[j++] = ',';
|
||||
|
||||
Reference in New Issue
Block a user