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

Invalid behavior in convertBitDefaultValue (escape_mysql_wildcards) helper #15831

Closed
POPSuL opened this issue Jan 22, 2020 · 6 comments
Closed
Assignees
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@POPSuL
Copy link

POPSuL commented Jan 22, 2020

Describe the bug

Page server_privileges have option list with list of databases. If database starts with b (like big) option value has ig, but title seems correct.

To Reproduce

Steps to reproduce the behavior:

  1. Create database like big_database
  2. User accounts, select any user that click Database tab
  3. Select big_database in Add privileges on the following database(s): options list and click Go
  4. See "Edit privileges: User account 'pma'@'192.168.30.%' - Databases ig_database" in page title
  5. Than try to select any role and click Go, than you will see query like GRANT SELECT, INSERT, UPDATE, DELETE ON ig_database.* TO 'pma'@'192.168.30.%';

Expected behavior

Database should be big_database

Screenshots

image

Server configuration

Demo page from https://demo.phpmyadmin.net/

Client configuration

Chrome 79, Ubuntu linux

@williamdes williamdes added this to Triage zone in Enhancements Jan 23, 2020
@CoreyBuckley
Copy link
Contributor

Hi, I'm interested in working on this issue. Is that okay? 🙂

@williamdes
Copy link
Member

hello @CoreyBuckley
You can work on this one, please use QA_5_0 as base branch and target for your PR

@williamdes williamdes removed this from Triage zone in Enhancements Jan 24, 2020
@williamdes williamdes added this to Needs triage in issues via automation Jan 24, 2020
@williamdes williamdes moved this from Needs triage to to be fixed soon in issues Jan 24, 2020
@williamdes williamdes added the Bug A problem or regression with an existing feature label Jan 24, 2020
CoreyBuckley added a commit to CoreyBuckley/phpmyadmin that referenced this issue Jan 24, 2020
Fixes the issue described in phpmyadmin#15831.

Signed-off-by: Corey Buckley <coreybuckley13@gmail.com>
CoreyBuckley added a commit to CoreyBuckley/phpmyadmin that referenced this issue Jan 25, 2020
Fixes the issue described in phpmyadmin#15831.

Signed-off-by: Corey Buckley <coreybuckley13@gmail.com>
@POPSuL
Copy link
Author

POPSuL commented Jan 25, 2020

Maybe write tests for that?

@CoreyBuckley
Copy link
Contributor

I'm not sure how to do that 😅

I can see that there is a function for testing convertBitDefaultValue already in test/classes/UtilTest.php, but I'm not sure where I would add the actual test case..

@CoreyBuckley
Copy link
Contributor

CoreyBuckley commented Jan 25, 2020

I noticed in the log from Travis that for the test I'm failing it uses the input b' and expects this to become the empty string.

In Util.php convertBitDefaultValue has the comment

/*
Converts a BIT type default value
     * for example, b'010' becomes 010
*/

Should there also be an example in the comment like:

/*
Converts a BIT type default value
     * for example, b'010' becomes 010
     * or, "b'01" becomes "01"
*/

?

CoreyBuckley added a commit to CoreyBuckley/phpmyadmin that referenced this issue Jan 25, 2020
Fixes the issue described in phpmyadmin#15831.

Signed-off-by: Corey Buckley <coreybuckley13@gmail.com>
@williamdes
Copy link
Member

I'm not sure how to do that

I will add comments on the PR to help you

@williamdes williamdes added the has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete label Jan 25, 2020
williamdes pushed a commit to CoreyBuckley/phpmyadmin that referenced this issue Jan 25, 2020
Fixes the issue described in phpmyadmin#15831.

Signed-off-by: Corey Buckley <coreybuckley13@gmail.com>
@williamdes williamdes self-assigned this Jan 25, 2020
@williamdes williamdes added this to the 5.0.2 milestone Jan 25, 2020
williamdes added a commit that referenced this issue Jan 25, 2020
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from to be fixed soon to Closed Jan 25, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A problem or regression with an existing feature has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
issues
  
Closed
Development

No branches or pull requests

3 participants