Commit 38444dd8 authored by Evan Hunt's avatar Evan Hunt
Browse files

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).


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1189 e5f2f494-b856-4b98-b285-d166d9295462
parent d08ed40d
......@@ -256,7 +256,8 @@ Sqlite3DataSrc::findRecords(const Name& name, const RRType& rdtype,
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 @@ Sqlite3DataSrc::setupPreparedStatements(void) {
}
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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment