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

Wrong SQL query built on table structure index for new column #16728

Closed
williamdes opened this issue Mar 11, 2021 · 3 comments · Fixed by #16737
Closed

Wrong SQL query built on table structure index for new column #16728

williamdes opened this issue Mar 11, 2021 · 3 comments · Fixed by #16737
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@williamdes
Copy link
Member

Describe the bug

The SQL preview contains Array

To Reproduce

image

POST /table/indexes

db: 2fa
table: aes
old_index[Key_name]: un1
old_index[Index_comment]: 
old_index[Index_choice]: UNIQUE
old_index[Key_block_size]: 
old_index[Parser]: 1
old_index[Index_type]: BTREE
old_index[columns][0][col_index]: 0
old_index[columns][0][size]: 
token: 3d63767e5c37734a2f4e5d3142397025
index[Key_name]: un1
index[Key_block_size]: 
index[Index_type]: BTREE
index[Parser]: 1
index[Index_comment]: 
index[columns][names][]: 0
index[columns][sub_parts][]: 
do_save_data: 1
preview_sql: 1
ajax_request: 1
_nocache: 1615504977578138470
token: 3d63767e5c37734a2f4e5d3142397025

Table::getSqlQueryForIndexCreateOrEdit thinks that it is not an array.

-- Array is incorrect
ALTER TABLE `2fa`.`aes` DROP INDEX Array, ADD UNIQUE `un1` (`0`) USING BTREE;

Expected behavior

Contain a plausible index name

Server configuration

  • phpMyAdmin version: 5.1
@williamdes williamdes added this to the 5.1.1 milestone Mar 11, 2021
@williamdes williamdes added the Bug A problem or regression with an existing feature label Mar 11, 2021
@williamdes williamdes added this to Needs triage in issues via automation Mar 11, 2021
@williamdes williamdes moved this from Needs triage to Reproduced in issues Mar 11, 2021
@shucon
Copy link
Contributor

shucon commented Mar 12, 2021

Are you working on this? I can work on it otherwise but I'm not sure about the steps to reproduce it.

@williamdes
Copy link
Member Author

Are you working on this? I can work on it otherwise but I'm not sure about the steps to reproduce it.

No, you can reproduce this by trying to add a new column, then choose an index type like UNIQUE and then just follow my screenshot and sql preview

@shucon
Copy link
Contributor

shucon commented Mar 12, 2021

Working on it! Thanks.

@williamdes williamdes self-assigned this Mar 24, 2021
@williamdes williamdes changed the title Wrong SQL query built Wrong SQL query built on table structure index for new column Mar 24, 2021
williamdes added a commit that referenced this issue Mar 24, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Mar 24, 2021
…index for new column

Pull-request: #16737
Fixes: #16728

Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Mar 24, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from Reproduced to Closed Mar 24, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 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

Successfully merging a pull request may close this issue.

2 participants