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

phpMyAdmin allows to specify length for JSON field. MySQL rejects it #16641

Closed
surruk51 opened this issue Feb 13, 2021 · 2 comments · Fixed by #16643
Closed

phpMyAdmin allows to specify length for JSON field. MySQL rejects it #16641

surruk51 opened this issue Feb 13, 2021 · 2 comments · Fixed by #16643
Assignees
Labels
Bug A problem or regression with an existing feature good first issue has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
Milestone

Comments

@surruk51
Copy link

surruk51 commented Feb 13, 2021

I added a JSON type column to an existing table and specified a length. When I ran the request, MySQL reported a syntax error.

Reproduction

Steps to reproduce the behavior:
Open an existing table
Click on Structure
Choose 'Add 1 column'
specify Type as JSON
specify Size/Values as 255
Click Save
MySQL reports a syntax error. See screenshot

Expected behavior

The Size/Values should be disabled if the type is JSON, or PHPMyadmin shoudl warn against putting anything in the field.

Screenshots

Screen shot of error message added

Server configuration

  • Operating system: Linux Mint 20.1 Cinnamon
  • Web server: Apache 2.4.41-4Ubuntu3.1
  • Database version: MySQL 8.0.23
  • PHP version: 2:7.4+75
  • phpMyAdmin version: 4.9.5

Client configuration

  • Browser: Brave Version 1.19.92 Chromium: 88.0.4324.152 (Official Build) (64-bit)
  • Operating system: Linux Mint 20.1 Cinnamon

Screenshot from 2021-02-13 08-56-24

Additional context

Add any other context about the problem here.

@williamdes
Copy link
Member

Hi @surruk51

As far as I know JSON fields do not have a length, it seems it is a query generation bug to allow JSON type to have a length :)

@williamdes williamdes added Bug A problem or regression with an existing feature good first issue labels Feb 14, 2021
@williamdes williamdes added this to Needs triage in issues via automation Feb 14, 2021
@williamdes williamdes moved this from Needs triage to to be fixed soon in issues Feb 14, 2021
@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 Feb 14, 2021
williamdes added a commit that referenced this issue Feb 14, 2021
…to have length

Pull-request: #16643
Fixes: #16641

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Feb 14, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from to be fixed soon to Closed Feb 14, 2021
@williamdes williamdes self-assigned this Feb 14, 2021
@williamdes williamdes added this to the 5.1.0 milestone Feb 14, 2021
@williamdes
Copy link
Member

Hi @surruk51
This will be fixed in 5.1.0
Thank you for reporting this issue

@williamdes williamdes changed the title PHPMyadmin allows to specify length for JSON field. MySQL rejects it phpMyAdmin allows to specify length for JSON field. MySQL rejects it Feb 14, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 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 good first issue has-pr An issue that has a pull request pending that may fix this issue. The pull request may be incomplete
Projects
issues
  
Closed
2 participants