From: Aki Tuomi Date: Sat, 9 Jan 2016 14:42:40 +0000 (+0200) Subject: Do not erase all metadata X-Git-Tag: dnsdist-1.0.0-alpha2~36^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acc5c7f262cf92c5e15fd61b3e3ad742cef39de1;p=pdns Do not erase all metadata --- diff --git a/modules/remotebackend/regression-tests/backend.rb b/modules/remotebackend/regression-tests/backend.rb index a7c9f5dbe..3da5d4ef6 100755 --- a/modules/remotebackend/regression-tests/backend.rb +++ b/modules/remotebackend/regression-tests/backend.rb @@ -196,11 +196,12 @@ class Handler d_id = db.get_first_value("SELECT id FROM domains WHERE name = ?", args["name"]) return false if d_id.nil? db do |tx| - sql = "DELETE FROM domainmetadata WHERE domain_id = ?" - tx.execute(sql, [d_id]) + sql = "DELETE FROM domainmetadata WHERE domain_id = ? AND kind = ?" + tx.execute(sql, [d_id, args["kind"]]) unless args["value"].nil? sql = "INSERT INTO domainmetadata (domain_id,kind,content) VALUES(?,?,?)" args["value"].each do |value| + STDERR.puts"Executing INSERT INTO domainmetadata (domain_id,kind,content) VALUES(#{d_id}, #{args["kind"]}, #{value})" tx.execute(sql,[d_id, args["kind"], value]) end end