Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when db name in backticks it is not dropped when 'absent' #593

Open
1 task done
yosefy opened this issue Nov 16, 2023 · 1 comment
Open
1 task done

when db name in backticks it is not dropped when 'absent' #593

yosefy opened this issue Nov 16, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@yosefy
Copy link

yosefy commented Nov 16, 2023

Summary

when running module and database name is in backticks like db.test.001

and state is absent schema will not be dropped

without backticks works good

if we have dots in name so we have to use backticks otherwise we get error:

FAILED! => {"changed": false, "msg": "error creating database: MySQL does not support database with more than 1 dots"}

Issue Type

Bug Report

Component Name

mysql_db

Ansible Version

$ ansible --version
ansible [core 2.11.12]

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all

OS / Environment

RHEL

Steps to Reproduce

- name: db task
  community.mysql.mysql_db:
    login_user: root
    login_password: "{{ WP_DB_PASS }}"
    login_host: "mysql.local"
    name: "`abc`"
    state: absent

Expected Results

changed: [localhost] => {"changed": true, "db": "abc", "db_list": ["abc"], "executed_commands": ["DROP DATABASE abc"]}

Actual Results

ok:      [localhost] => {"changed": false, "db": "`abc`", "db_list": ["`abc`"], "executed_commands": []}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@Andersson007
Copy link
Collaborator

@yosefy hello, thanks for reporting the issue! Once someone has time, they'll take a closer look. I'll put the help_wanted label

@Andersson007 Andersson007 added the help wanted Extra attention is needed label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants