[MDEV-23144] Combination of GENERATE ALWAYS and COLLATE does not work Created: 2020-07-10 Updated: 2021-04-19 Resolved: 2020-07-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Create Table |
| Affects Version/s: | 10.5.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
E.g. CREATE TABLE a (b varchar(1) COLLATE utf8mb4_unicode_ci GENERATED ALWAYS AS ('x')); leads to a syntax error near GENERATED. The KB syntax page for CREATE TABLE says:
As CHARACTER SET and COLLATE are part of "data_type" the statement above should work. On the other hand the parser grammer says
As CHARACTER SET and COLLATE are part of "attribute_list", they indeed can't be combined with GENERATE ALWAYS. I'm not sure whether there's an actual reason for this (e.g. charset and collation always determined by the generating expression), or whether the parser syntax should indeed be fixed. |
| Comments |
| Comment by Elena Stepanova [ 2020-07-10 ] |
|
Looks like a duplicate of |
| Comment by Hartmut Holzgraefe [ 2020-07-10 ] |
|
Yes, looks like a duplicate indeed |