ansible/ansible — pull request #8419 by georgeOsdDev (2014-08-04 11:38:43+00:00)
Title: mysql_db module: Escape "_" in database name for "SHOW DATABASES" statement

##### Issue Type:

“Bugfix Pull Request”

##### Ansible Version:

ansible 1.7 (devel fafc35911a) last updated 2014/07/11 10:18:42 (GMT +900)

##### Environment:

Centos 6, MySQL5.5.28

##### Summary:

mysql_db module check database existence with "SHOW DATABASES LIKE %s" statement.
If database name contains "_", it works as wildcard.
So if it match existing database name, I cant create database which name contains "_".
This PR escape "_".

##### Steps To Reproduce:

Create database contains "_" as database name.

tasks:
- mysql_db: >
name=company state=present
- mysql_db: >
name=com_any state=present

##### Expected Results:

Database named "company" and "com_any" will be created.

##### Actual Results:

Only database named "company" is created.