Escape "_" in database name for "SHOW DATABASES" statement

reviewable/pr18780/r1
Takeharu Oshida 10 years ago
parent eeabda4831
commit b42ff30505

@ -114,7 +114,7 @@ else:
# #
def db_exists(cursor, db): 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) return bool(res)
def db_delete(cursor, db): def db_delete(cursor, db):

Loading…
Cancel
Save