diff options
author | Rob Austein <sra@hactrn.net> | 2011-03-27 00:03:26 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2011-03-27 00:03:26 +0000 |
commit | 31686f62cf347b0c4f526f4b28611c0e3be03bda (patch) | |
tree | 3d9636bce7a5b3e1e5fde82186f0f53f11d7c8e6 | |
parent | 913bf30e84a0ba61d31ef8b3afbb577a8364f5a2 (diff) |
MySQL gets tetchy when asked to insert an empty list of values
svn path=/rpkid/rpki/myrpki.py; revision=3744
-rw-r--r-- | rpkid/rpki/myrpki.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/rpkid/rpki/myrpki.py b/rpkid/rpki/myrpki.py index dc6ca4ab..3773f934 100644 --- a/rpkid/rpki/myrpki.py +++ b/rpkid/rpki/myrpki.py @@ -984,7 +984,9 @@ class IRDB(object): ((a.min, a.max, child_id) for a in ipv6)) cur.execute("DELETE FROM ghostbuster_request WHERE self_handle = %s", (handle,)) - cur.executemany("INSERT INTO ghostbuster_request (self_handle, parent_handle, vcard) VALUES (%s, %s, %s)", ((handle, parent_handle, vcard) for parent_handle, vcard in ghostbusters)) + if ghostbusters: + cur.executemany("INSERT INTO ghostbuster_request (self_handle, parent_handle, vcard) VALUES (%s, %s, %s)", + ((handle, parent_handle, vcard) for parent_handle, vcard in ghostbusters)) self.db.commit() |