From b42ff30505e60e816c2bbfb9715c7d48eb861f1b Mon Sep 17 00:00:00 2001 From: Takeharu Oshida Date: Mon, 4 Aug 2014 20:15:58 +0900 Subject: [PATCH] Escape "_" in database name for "SHOW DATABASES" statement --- database/mysql_db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/mysql_db b/database/mysql_db index 36ba6369e81..38dee608ba5 100644 --- a/database/mysql_db +++ b/database/mysql_db @@ -114,7 +114,7 @@ else: # def db_exists(cursor, db): - res = cursor.execute("SHOW DATABASES LIKE %s", (db,)) + res = cursor.execute("SHOW DATABASES LIKE %s", (db.replace("_","\_"),)) return bool(res) def db_delete(cursor, db):