From f5dba0318fce4e2f4dc6ee65fa37fb2b7c0b3c86 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Wed, 20 May 2015 22:15:56 +0200 Subject: [PATCH] little error in mysql plugin --- plugins/MySQL/MySQL.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/MySQL/MySQL.py b/plugins/MySQL/MySQL.py index 2f3ef58..b3eb8ff 100644 --- a/plugins/MySQL/MySQL.py +++ b/plugins/MySQL/MySQL.py @@ -33,7 +33,7 @@ def run(typ,freq,data): elif typ == "ZVEI": #data = {"zvei":zvei_id} - cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableZVEI")+" (time,zvei) VALUES (NOW(),"+data["zvei"]+")") + cursor.execute("INSERT INTO "+globals.config.get("MySQL","tableZVEI")+" (time,zvei) VALUES (NOW(),%s)",(data["zvei"])) elif typ == "POC": #data = {"ric":poc_id, "function":poc_sub, "msg":poc_text} @@ -45,6 +45,7 @@ def run(typ,freq,data): logging.exception("cannot Insert %s", typ) finally: + logging.debug("close MySQL") cursor.close() connection.close() #Close connection in every case except: