Fix bugs in storage classes
diff --git a/src/dns-storage.cpp b/src/dns-storage.cpp
index c71789f..13a8f25 100644
--- a/src/dns-storage.cpp
+++ b/src/dns-storage.cpp
@@ -12,12 +12,15 @@
#include "exception.h"
#include <boost/filesystem.hpp>
+#include "logging.h"
using namespace std;
using namespace ndn;
namespace fs = boost::filesystem;
+INIT_LOGGER("DnsStorage");
+
const string INIT_DD_TABLE = "\
CREATE TABLE IF NOT EXISTS \n \
DnsData( \n \
@@ -77,6 +80,7 @@
if(sqlite3_step (stmt) != SQLITE_ROW)
{
+ _LOG_DEBUG("INSERT");
sqlite3_finalize(stmt);
sqlite3_prepare_v2 (m_db, "INSERT INTO DnsData (dns_identity, dns_name, dns_type, dns_value, data_name) VALUES (?, ?, ?, ?, ?)", -1, &stmt, 0);
sqlite3_bind_text(stmt, 1, identity.c_str(), identity.size(), SQLITE_TRANSIENT);
@@ -89,6 +93,7 @@
}
else
{
+ _LOG_DEBUG("UPDATE");
sqlite3_finalize(stmt);
sqlite3_prepare_v2 (m_db, "UPDATE DnsData SET dns_value=?, data_name=? WHERE dns_identity=? and dns_name=?, dns_type=?", -1, &stmt, 0);
sqlite3_bind_text(stmt, 1, data.buf(), data.size(), SQLITE_TRANSIENT);