Virtuality is all messed up when chancing the column afterwards. #17838
Labels
affects/5.2
This issue or pull-request affects 5.2.x releases (and maybe further versions)
affects/6.0
This issue or pull-request affects 6.0.x releases (and maybe further versions)
Bug
A problem or regression with an existing feature
confirmed/5.2
This issue is confirmed to be reproduced on 5.2 at the time this label was set
confirmed/6.0
This issue is confirmed to be reproduced on 6.0 at the time this label was set
I've hit some issues with NULL-values in columns which were used for in a unique key and found the explanation on https://stackoverflow.com/questions/4081783/unique-key-with-nulls. We've tried the answer from Alexander YancharukAlexander Yancharuk, which worked nice.
For the checksum, we used a virtual generated column. When creating this database and adding this column, phpMyAdmin is working fine. Howerver, when changing the virtual generated column afterwards, for example when we wan't to change the name, the virtuality is all messed up.
To Reproduce
Steps to reproduce the behavior:
MD5(CONCAT(name, IFNULL(date_of_birth, '')))
for the virtually and click button [ save ].The executed query will be something like this:
ALTER TABLE `employee` ADD `checksun` CHAR(32) AS (MD5(CONCAT(name, IFNULL(date_of_birth, '')))) VIRTUAL NOT NULL;
The executed query was:
ALTER TABLE `employee` CHANGE `checksun` `checksum` CHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci AS (md5(concat(`name`,ifnull(`date_of_birth`,_utf8mb4\'\')))) VIRTUAL NOT NULL;
For some reason, the empty space in the concat is not prefixed with_utf8m4b
, which causes the query to fail.Expected behavior
I expected the name of the column to change. Instead, I got an error on the virtuallity for the column. It looks like a incorrect value is placed inside the edit form. Which causes a invalid value to be sent back, causing the query to fail.
Server configuration
The text was updated successfully, but these errors were encountered: