"No database selected" when calling mysql_database resource
jhou4 opened this issue Β· comments
π£οΈ Foreword
Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.
π» Brief Description
When calling mysql_database resource to execute a query(query action), resource fails with "No database selected" error.
π₯ Cookbook version
11.0.3
π©βπ³ Chef-Infra Version
cinc-client 16.16.13
π© Platform details
Redhat server 7.6
Steps To Reproduce
Steps to reproduce the behavior:
- Construct a sql query
- Call mysql_database resource to execute the query.
- See error
π Expected behavior
Query to be executed without error.
β Additional context
Problem seems to be with this line:
https://github.com/sous-chefs/mysql/blob/main/resources/mysql_database.rb#L60
where database name is skipped when executing a query action, while the function clearly requires the database name:
https://github.com/sous-chefs/mysql/blob/main/resources/mysql_database.rb#L84