[MDEV-7655] SHOW CREATE TABLE returns invalid DDL when using virtual columns along with a table collation Created: 2015-03-02 Updated: 2015-12-12 Resolved: 2015-12-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Virtual Columns |
| Affects Version/s: | 10.0.17 |
| Fix Version/s: | 5.5.48, 10.0.23, 10.1.10 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | patch, verified | ||
| Attachments: |
|
| Sprint: | 10.0.23 |
| Description |
|
We can create a table with a virtual column and a collation:
noted: edited to make copy/paste easier Then let's see the definition with SHOW CREATE TABLE:
Let's drop the table and try to recreate it:
|
| Comments |
| Comment by Elena Stepanova [ 2015-03-02 ] | |||||||||
|
There are two problems here. First, that COLLATE clause is propagated from the table level to column level. This part doesn't relate to virtual columns, it happens for all columns. Secondly, that COLLATE is not accepted for virtual columns. | |||||||||
| Comment by Daniel Black [ 2015-11-03 ] | |||||||||
|
The second part is due to sql_yacc.yy
opt_attribute includes the COLLATE (and COMMENT) bits that should also possible with virtual columns. I've included a patch. Patch doesn't work because the same options are on both sides o the yacc |. I don't know how to resolve that. | |||||||||
| Comment by Daniel Black [ 2015-11-03 ] | |||||||||
|
Solved part 2 of allowing collation on a virtual column.. Part 1, displaying collation (and character sets) on virtual columns when set as table options still remains. | |||||||||
| Comment by Daniel Black [ 2015-11-04 ] | |||||||||
|
tried porting same patch to 10.0 however the collation was ignored. Didn't put a lot of effort in there. As such pull request is against 10.1. 10.0 has a different parser constructs as you know. |