]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_9] quote table names
authorEvan Hunt <each@isc.org>
Thu, 2 May 2013 14:39:30 +0000 (07:39 -0700)
committerEvan Hunt <each@isc.org>
Thu, 2 May 2013 14:39:30 +0000 (07:39 -0700)
3563. [contrib] zone2sqlite failed with some table names. [RT #33375]
(cherry picked from commit 96a116178567d4eb22e57aba533073de9a2f9d84)

CHANGES
contrib/sdb/sqlite/zone2sqlite.c

diff --git a/CHANGES b/CHANGES
index ff3233793405db1a4d7e552eceefebf8fb75e27b..06530b5a321e80adc5b9702e26fdecaf3fe6a506 100644 (file)
--- 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]
                        
index b583d2bb0306a1c5d44cbd2507f6c98639e6f1a8..7b9260a25047704f94a8fe674df49b218843b6d7 100644 (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);