-
Notifications
You must be signed in to change notification settings - Fork 89
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
Allow the "%" character in database name #227
Allow the "%" character in database name #227
Conversation
@koleo hi, thanks for the PR and welcome to the project!
|
Codecov Report
@@ Coverage Diff @@
## main #227 +/- ##
=======================================
Coverage 77.60% 77.60%
=======================================
Files 24 24
Lines 2170 2170
Branches 510 510
=======================================
Hits 1684 1684
Misses 319 319
Partials 167 167
Continue to review full report at Codecov.
|
@Andersson007 thanks for the tips. I will complete the missing steps and rebase soon. |
@koleo cool, thanks:) When the PR is ready for review again, please let me know |
ae7de23
to
1472889
Compare
Hi @Andersson007 , so I pushed an update with Fragment, tests and rebase. The test file is inspired by the existing create/drop database tests from main.yml with a specific db_name containing the |
@koleo hi, i think
|
i think it would be much faster if you run the tests locally before pushing using this guide There are also sanity issues (you can see them by clicking "Details" in the test report box near failed tasks).
|
1472889
to
3f8c0d2
Compare
The naming rules for MySQL/MariaDB identifiers, when quoted, allow the `%` character. However, currently, the use of the `%` character in database names results in mismatch or missing databases. - Rewrite query to identify the databases in the catalog using `information_schema` instead of `SHOW DATABASES LIKE` - Escape the `%` character in `CREATE DATABASE` query. Signed-off-by: Nicolas Payart <[email protected]>
3f8c0d2
to
1c5a23b
Compare
@Andersson007 it's ready for a review.
|
@koleo thanks, i'll try to review it tomorrow @bmalynovytch @Jorge-Rodriguez could you please take a look at this PR too |
@koleo thanks for working on this! Let's wait a couple of days for @bmalynovytch and @Jorge-Rodriguez 's feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes related to the described PR look good 👍
I didn't deep dive in the tests though.
@koleo thanks for the contribution! @bmalynovytch thanks for reviewing! |
The naming rules for MySQL/MariaDB identifiers, when quoted, allow the `%` character. However, currently, the use of the `%` character in database names results in mismatch or missing databases. - Rewrite query to identify the databases in the catalog using `information_schema` instead of `SHOW DATABASES LIKE` - Escape the `%` character in `CREATE DATABASE` query. Signed-off-by: Nicolas Payart <[email protected]> (cherry picked from commit 6b12435)
* Allow the "%" character in database name (#227) The naming rules for MySQL/MariaDB identifiers, when quoted, allow the `%` character. However, currently, the use of the `%` character in database names results in mismatch or missing databases. - Rewrite query to identify the databases in the catalog using `information_schema` instead of `SHOW DATABASES LIKE` - Escape the `%` character in `CREATE DATABASE` query. Signed-off-by: Nicolas Payart <[email protected]> (cherry picked from commit 6b12435) * mysql_db: Fix assert in tests suite (#239) Signed-off-by: Nicolas Payart <[email protected]> (cherry picked from commit 5522e45) * mysql_db: Improve tests (#240) - Define variables "db_names" and "db_formats" in defaults - Use of the "vars" option in includes instead of default parameters that might be overridden by a previous task - Use of the "loop" option in includes instead of duplicating include tasks - Use a nested loop on db_names and db_formats in state_dump_import test Signed-off-by: Nicolas Payart <[email protected]> (cherry picked from commit e4de13a) * MAINTAINERS file: Add new maintainer (#248) (cherry picked from commit d411a8e) Co-authored-by: Nicolas PAYART <[email protected]>
The naming rules for MySQL/MariaDB identifiers, when quoted, allow the
%
character.However, currently, the use of the
%
character in database names results in mismatch or missing databases.SUMMARY
information_schema
instead ofSHOW DATABASES LIKE
%
character inCREATE DATABASE
query (because of the Python format string)ISSUE TYPE
COMPONENT NAME
mysql_db
ADDITIONAL INFORMATION
Check database list