]> granicus.if.org Git - pdns/commitdiff
Do not erase all metadata
authorAki Tuomi <cmouse@cmouse.fi>
Sat, 9 Jan 2016 14:42:40 +0000 (16:42 +0200)
committerAki Tuomi <cmouse@cmouse.fi>
Mon, 11 Jan 2016 18:44:20 +0000 (20:44 +0200)
modules/remotebackend/regression-tests/backend.rb

index a7c9f5dbe34d47452c1ed2612777a1f3a0cf5d19..3da5d4ef6a62bdfe47dbac67aba7d828e0125489 100755 (executable)
@@ -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