[svn] commit: r1189 - /trunk/src/lib/auth/data_source_sqlite3.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Sun Mar 7 23:26:41 UTC 2010


Author: each
Date: Sun Mar  7 23:26:41 2010
New Revision: 1189

Log:
use reverse-name lookup to find empty non-terminals (sqlite3's doc
claims this is optimized, but at present it looks as if it isn't).

Modified:
    trunk/src/lib/auth/data_source_sqlite3.cc

Modified: trunk/src/lib/auth/data_source_sqlite3.cc
==============================================================================
--- trunk/src/lib/auth/data_source_sqlite3.cc (original)
+++ trunk/src/lib/auth/data_source_sqlite3.cc Sun Mar  7 23:26:41 2010
@@ -256,7 +256,8 @@
         throw("Could not bind 1 (count)");
     }
 
-    rc = sqlite3_bind_text(q_count, 2, c_name, -1, SQLITE_STATIC);
+    rc = sqlite3_bind_text(q_count, 2, name.reverse().toText().c_str(), -1,
+                           SQLITE_STATIC);
     if (rc != SQLITE_OK) {
         throw("Could not bind 2 (count)");
     }
@@ -374,8 +375,8 @@
     }
 
     const char* q_count_str = "SELECT COUNT(*) FROM records "
-                              "WHERE zone_id=?1 AND (name=?2 OR "
-                              "name LIKE '%.' || ?2);";
+                              "WHERE zone_id=?1 AND "
+                              "rname LIKE (?2 || '%');";
     try {
         q_count = prepare(q_count_str);
     } catch (const char* e) {




More information about the bind10-changes mailing list