[MDEV-10370] Check constraints on virtual columns fails on INSERT when column not specified Created: 2016-07-13 Updated: 2017-03-29 Resolved: 2017-03-29 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Virtual Columns |
| Affects Version/s: | 10.2.1 |
| Fix Version/s: | 10.2.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Anders Karlsson | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 10.2-ga | ||
| Issue Links: |
|
||||||||
| Description |
|
When having a check constraint on a virtual column, the column in question must be present in any insert statement and have a value that fulfills the check constraint, despite this value being overwritten by the virtual column formula later, like this:
The following fails, which is correct (c2 is 2 which is wrong):
But the following also fails:
The following also fails (again as c2 is 2):
But the following works:
Which you would think is the same as:
But as shown above it is not |