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

Edit/Copy/Delete links do not work with non-utf8 TEXT primary key #16777

Closed
eugen-ukraine opened this issue Mar 30, 2021 · 1 comment
Closed
Assignees
Labels
Bug A problem or regression with an existing feature
Projects
Milestone

Comments

@eugen-ukraine
Copy link

eugen-ukraine commented Mar 30, 2021

Describe the bug

Edit/Copy/Delete links in table browse mode do not work if primary key is of type TEXT and stored in non-utf8 charset.

To Reproduce

Steps to reproduce the behavior:

CREATE TABLE `test` (
  `id` text CHARACTER SET cp1251 NOT NULL
);

ALTER TABLE `test`
  ADD PRIMARY KEY (`id`(100));

INSERT INTO `test` (`id`) VALUES
  ('тест');

Go to Browse table tab, then click Edit button. Instead of edit form phpMyAdmin displays message MySQL returned an empty result set (i.e. zero rows).:

phpmyadmin-adm-tools-udevops-mysql-ukraine-com-ua-udevops_234back-test-phpMyAdmin-5-1-0

Generated query has a condition where value is converted to hex from utf8 representation of string:

SELECT * FROM `dbname`.`test` WHERE `test`.`id` = CAST(0xd182d0b5d181d182 AS BINARY);

As value in table is stored not in utf8, this condition fails to find the record.

Similar query is generated for Copy and Delete links.

Server configuration

@williamdes williamdes added the Bug A problem or regression with an existing feature label Apr 1, 2021
@williamdes williamdes added this to Needs triage in issues via automation Apr 1, 2021
@williamdes williamdes added this to the 5.1.1 milestone Apr 1, 2021
@williamdes williamdes moved this from Needs triage to to be fixed soon in issues Apr 1, 2021
@williamdes
Copy link
Member

Hi @eugen-ukraine
Thank you for the report and thank you so much for the SQL scripts to reproduce it.
I can confirm I was able to reproduce this issue and will be working to find a fix for it.

@williamdes williamdes moved this from to be fixed soon to Reproduced in issues Apr 1, 2021
shucon added a commit to shucon/phpmyadmin that referenced this issue Apr 15, 2021
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
shucon added a commit to shucon/phpmyadmin that referenced this issue Apr 15, 2021
Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
shucon added a commit to shucon/phpmyadmin that referenced this issue Apr 15, 2021
Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
shucon added a commit to shucon/phpmyadmin that referenced this issue Apr 15, 2021
Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix var

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
shucon added a commit to shucon/phpmyadmin that referenced this issue Apr 15, 2021
Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix var

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Error condition fix

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
shucon added a commit to shucon/phpmyadmin that referenced this issue Apr 15, 2021
Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix condition

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix var

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Error condition fix

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Beautify

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
@williamdes williamdes self-assigned this Apr 19, 2021
williamdes added a commit to shucon/phpmyadmin that referenced this issue Apr 19, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Apr 19, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
williamdes added a commit that referenced this issue Apr 19, 2021
Signed-off-by: William Desportes <williamdes@wdes.fr>
issues automation moved this from Reproduced to Closed Apr 19, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 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