From 972b06ee5dd6dbedd78b14106a04797910ec82f3 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 --- library/database/mysql_db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/database/mysql_db b/library/database/mysql_db index 36ba6369e8..38dee608ba 100644 --- a/library/database/mysql_db +++ b/library/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):