[MDEV-11850] Can't create foreign key referencing a virtual column Created: 2017-01-20 Updated: 2017-01-31 Resolved: 2017-01-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2 |
| Fix Version/s: | 10.2.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Jan Lindström (Inactive) | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 10.2-rc | ||
| Description |
|
|
| Comments |
| Comment by Jan Lindström (Inactive) [ 2017-01-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
http://lists.askmonty.org/pipermail/commits/2017-January/010471.html | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-01-30 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Is it possible to match the columns by position (with a debug assertion that the names match with strcmp), instead of looping over all columns and looking for a matching name using a case-insensitive search? Also, please import (and if necessary, adapt) all the virtual column tests from MySQL 5.7 that are related to foreign keys, such as innodb.virtual_basic, innodb.virtual_fk, innodb.virtual_fk_restart. We want to make sure that the patch is not breaking other functionality. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-01-31 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I could not find easy way to map column positions to virtual column number. Tests you mention are already part of the gcol suite. Note that MySQL 5.7 does not support the above syntax or foreign keys to virtual columns:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-01-31 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
commit 45f451c769668e6a351b0c023a994fdf9c07b1f7 Both dict_foreign_find_index and dict_foreign_qualify_index Fixed by also looking referencing and referenced column |