Details
-
Task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Duplicate
Description
From the manual I can find out that:
There are two types of virtual , or computed, columns: PERSISTENT, which are stored in the table, and VIRTUAL, which are generated when the table is queried.
Why PERSISTENT column is Computed when it is stored in the table?
DROP TABLE IF EXISTS `raw__categories`;
create table `raw__categories` (
`id` BINARY(32) as (md5(CONCAT_WS('~',`ID_CATEGORY`,`ID_LANG`))) PERSISTENT,
`ID_CATEGORY` varchar(29) NOT NULL,
`ID_LANG` varchar(2) NOT NULL,
`NAME` varchar(40) NOT NULL,
PRIMARY KEY(`id`)
)
engine=InnoDB CHARSET=utf8;
I have an error:
#1903 - Primary key cannot be defined upon a computed column
It would be very useful to set up an ID algorithm using DDL
Attachments
Issue Links
- is duplicated by
-
MDEV-5590 Primary key cannot be defined upon persistent virtual column
- Open