[v9_6] quote table names

3563.	[contrib]	zone2sqlite failed with some table names. [RT #33375]
(cherry picked from commit 96a1161785)
(cherry picked from commit ed0d1d96c1)
This commit is contained in:
Evan Hunt
2013-05-02 07:39:59 -07:00
parent b334e3ea5d
commit 6485a82866
2 changed files with 5 additions and 3 deletions

View File

@@ -1,3 +1,5 @@
3563. [contrib] zone2sqlite failed with some table names. [RT #33375]
3561. [bug] dig: issue a warning if an EDNS query returns FORMERR
or NOTIMP. Adjust usage message. [RT #33363]

View File

@@ -129,7 +129,7 @@ addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata)
dataarray[isc_buffer_usedlength(&b)] = 0;
sql = sqlite3_mprintf(
"INSERT INTO %q (NAME, TTL, RDTYPE, RDATA)"
"INSERT INTO %Q (NAME, TTL, RDTYPE, RDATA)"
" VALUES ('%q', %d, '%q', '%q') ",
dbi.table,
namearray, ttl, typearray, dataarray);
@@ -208,7 +208,7 @@ main(int argc, char *argv[])
closeandexit(1);
}
sql = sqlite3_mprintf("DROP TABLE %q ", dbi.table);
sql = sqlite3_mprintf("DROP TABLE %Q ", dbi.table);
printf("%s\n", sql);
res = sqlite3_exec(dbi.db, sql, NULL, NULL, &errmsg);
sqlite3_free(sql);
@@ -231,7 +231,7 @@ main(int argc, char *argv[])
#endif
sql = sqlite3_mprintf(
"CREATE TABLE %q "
"CREATE TABLE %Q "
"(NAME TEXT, TTL INTEGER, RDTYPE TEXT, RDATA TEXT) ",
dbi.table);
printf("%s\n", sql);