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

Underscore in field name structure change #16595

Closed
ChrisHSandN opened this issue Jan 26, 2021 · 3 comments
Closed

Underscore in field name structure change #16595

ChrisHSandN opened this issue Jan 26, 2021 · 3 comments
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@ChrisHSandN
Copy link

ChrisHSandN commented Jan 26, 2021

Describe the bug

Attempting to change the structure of a field containing an _ can incorrectly match the wrong field.

To Reproduce

Steps to reproduce the behavior:

  1. Create a table with fields aid and _id
CREATE TABLE `test` (
 `aid` tinyint(4) NOT NULL,
 `_id` tinyint(4) NOT NULL,
 PRIMARY KEY (`aid`)
) ENGINE=InnoDB 
  1. Click on Structure
  2. Click Change on the field _id
  3. aid field is edited

Expected behavior

_id field should be edited

Screenshots

image
image

Server configuration

  • Operating system:
  • Web server: CentOS 7
  • Database version: MariaDB 10.4.11
  • PHP version: 7.3.14
  • phpMyAdmin version: 5.0.1

Client configuration

  • Browser: Chrome Latest
  • Operating system: Windows 10
@williamdes williamdes added this to the 5.1.0 milestone Jan 30, 2021
@williamdes williamdes added the Bug A problem or regression with an existing feature label Jan 30, 2021
@williamdes williamdes added this to Needs triage in issues via automation Jan 30, 2021
@williamdes
Copy link
Member

Thank you @ChrisHSandN for the report !
I also reproduced this issue on 5.1.0-dev.

@williamdes
Copy link
Member

I found the issue 🎉
And you found the perfect test case 👍

-- says I have a unknown char at first position
SHOW FULL COLUMNS FROM `test` LIKE '_id'
-- says I have the `_` char at the first position
SHOW FULL COLUMNS FROM `test` LIKE '\_id'

To reproduce, have a column named what you want, then create another one containing a _ at least once at start.
Then be sure to have the column having a _ last.

@williamdes williamdes self-assigned this Jan 31, 2021
williamdes added a commit that referenced this issue Jan 31, 2021
I removed the escape because it is already escaped afterwards.

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Jan 31, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from Needs triage to Closed Jan 31, 2021
@williamdes
Copy link
Member

I added tests in 0a1d09b and fixed it in 8917e77
Next 5.1.0 release will contain this fix.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2022
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
Projects
issues
  
Closed
Development

No branches or pull requests

2 participants