From: Evan Hunt Date: Thu, 2 May 2013 14:39:30 +0000 (-0700) Subject: [v9_9] quote table names X-Git-Tag: v9.9.3~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed0d1d96c111006fa2bae9fb75c28c55a904ce40;p=thirdparty%2Fbind9.git [v9_9] quote table names 3563. [contrib] zone2sqlite failed with some table names. [RT #33375] (cherry picked from commit 96a116178567d4eb22e57aba533073de9a2f9d84) --- diff --git a/CHANGES b/CHANGES index ff323379340..06530b5a321 100644 --- a/CHANGES +++ b/CHANGES @@ -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] diff --git a/contrib/sdb/sqlite/zone2sqlite.c b/contrib/sdb/sqlite/zone2sqlite.c index b583d2bb030..7b9260a2504 100644 --- a/contrib/sdb/sqlite/zone2sqlite.c +++ b/contrib/sdb/sqlite/zone2sqlite.c @@ -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);