]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1899] Allow other RRtypes in nsec3 table (for RRSIGs)
authorMukund Sivaraman <muks@isc.org>
Mon, 8 Oct 2012 07:06:20 +0000 (12:36 +0530)
committerMukund Sivaraman <muks@isc.org>
Mon, 8 Oct 2012 07:06:28 +0000 (12:36 +0530)
* The unique constraint on NSEC3 owner per zone is now removed
* NSEC3 RRSIGs are now returned next to their RR set
* Test was adjusted to check for RRSIGs too

src/bin/dbutil/dbutil.py.in
src/bin/dbutil/tests/testdata/v2_1.sqlite3
src/lib/datasrc/sqlite3_accessor.cc
src/lib/datasrc/tests/sqlite3_accessor_unittest.cc
src/lib/datasrc/tests/testdata/example.org.sqlite3
src/lib/python/isc/datasrc/sqlite3_ds.py

index f91c2768b76b976e3eb696fcf87d024a57852547..a84448457fedd3811756a3fe9b92b99fbf089f89 100755 (executable)
@@ -197,10 +197,8 @@ UPGRADES = [
 
     {'from': (2, 0), 'to': (2, 1),
      'statements': [
-            # Enforce that only one NSEC3 RR exists for an owner name in
-            # the zone.
-            "CREATE UNIQUE INDEX nsec3_by_zoneid_and_owner ON nsec3 " +
-                "(zone_id, owner)"
+            "CREATE INDEX nsec3_byhash_and_rdtype ON nsec3 " +
+                "(hash, rdtype)"
         ]
     }
 
index 9eea287452496300f899d15c6bd727e8d26ecdfd..ca2dee92b7749a5ead4b46f8359718e7a7b173ba 100644 (file)
Binary files a/src/bin/dbutil/tests/testdata/v2_1.sqlite3 and b/src/bin/dbutil/tests/testdata/v2_1.sqlite3 differ
index 1b2ec8e4991e544d0d25df4e66d9f1ec714cfb1e..dc7c794ad34a05a4c72c5839af234c942d97200d 100644 (file)
@@ -104,11 +104,9 @@ const char* const text_statements[NUM_STATEMENTS] = {
 
     // ITERATE_NSEC3:
     // The following iterates the whole zone in the nsec3 table. As the
-    // RRSIGs are for NSEC3s, we can hardcode the sigtype. As there is
-    // only one RR per-owner per-zone, there's no need to order these
-    // for the sake of any post-processing.
+    // RRSIGs are for NSEC3s, we can hardcode the sigtype.
     "SELECT rdtype, ttl, \"NSEC3\", rdata, owner FROM nsec3 "
-        "WHERE zone_id = ?1",
+        "WHERE zone_id = ?1 ORDER BY hash, rdtype",
     /*
      * This one looks for previous name with NSEC record. It is done by
      * using the reversed name. The NSEC is checked because we need to
@@ -352,8 +350,7 @@ const char* const SCHEMA_LIST[] = {
         "ttl INTEGER NOT NULL, rdtype TEXT NOT NULL COLLATE NOCASE, "
         "rdata TEXT NOT NULL)",
     "CREATE INDEX nsec3_byhash ON nsec3 (hash)",
-    // Enforce that only one NSEC3 RR exists for an owner name in the zone.
-    "CREATE UNIQUE INDEX nsec3_by_zoneid_and_owner ON nsec3 (zone_id, owner)",
+    "CREATE INDEX nsec3_byhash_and_rdtype ON nsec3 (hash, rdtype)",
     "CREATE TABLE diffs (id INTEGER PRIMARY KEY, "
         "zone_id INTEGER NOT NULL, "
         "version INTEGER NOT NULL, "
index 48d1193cf4557614a2868a3f35e57a8683608d43..700d75d11701a8a29d919a95b7e55c3e2280dd0f 100644 (file)
@@ -193,6 +193,9 @@ TEST_F(SQLite3AccessorTest, iterator) {
     checkRR(context, "www.example.org.", "3600", "A", "192.0.2.1");
     checkRR(context, "ns3.example.org.", "3600", "NSEC3",
             "1 1 12 aabbccdd 2T7B4G4VSA5SMI47K61MV5BV1A22BOJR A RRSIG");
+    checkRR(context, "ns3.example.org.", "3600", "RRSIG",
+            "NSEC3 5 3 3600 20000101000000 20000201000000 "
+            "12345 ns3.example.org. FAKEFAKEFAKE");
 
     // Check there's no other
     EXPECT_FALSE(context->getNext(data));
index 939e5e4c85206d975102149f1e41c16e0812841a..c799d2ef5a97bebeaf2f6f61203789e227fd321e 100644 (file)
Binary files a/src/lib/datasrc/tests/testdata/example.org.sqlite3 and b/src/lib/datasrc/tests/testdata/example.org.sqlite3 differ
index ef1245a3035a974855ec10238aa25fca209a7dcb..dc80afdfbf5119c981d921c3c9902f36013c93d5 100644 (file)
@@ -81,9 +81,7 @@ def create(cur):
                     rdtype TEXT NOT NULL COLLATE NOCASE,
                     rdata TEXT NOT NULL)""")
         cur.execute("CREATE INDEX nsec3_byhash ON nsec3 (hash)")
-        # Enforce that only one NSEC3 RR exists for an owner name in the zone.
-        cur.execute("""CREATE UNIQUE INDEX nsec3_by_zoneid_and_owner ON nsec3
-                        (zone_id, owner)""");
+        cur.execute("CREATE INDEX nsec3_byhash_and_rdtype ON nsec3 (hash, rdtype)")
         cur.execute("""CREATE TABLE diffs (id INTEGER PRIMARY KEY,
                     zone_id INTEGER NOT NULL,
                     version INTEGER NOT NULL,