[MDEV-8653] Persistent virtual fields don't insert with auto_incremented fields Created: 2015-08-20 Updated: 2017-01-12 Resolved: 2017-01-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Virtual Columns |
| Affects Version/s: | 5.3.12, 5.5, 10.0, 10.1 |
| Fix Version/s: | 10.2.3 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Terry Cullen | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | virtual_columns | ||
| Environment: |
Installed via yum on Redhat |
||
| Issue Links: |
|
||||||||||||
| Description |
|
|
| Comments |
| Comment by Elena Stepanova [ 2015-08-20 ] |
|
Thanks for the report. igor, If it's a known limitation, please reassign it back to me or directly to Ian Gilfillan to update the documentation. |
| Comment by Martin Rieger [ 2015-11-12 ] |
|
There is another hitch to this. An above recommended workaround is to simply update the auto_increment column with its unchanged value. Now, if the table also contains a Timestamp column with the "on update current_timestamp" attribute, the timestamp gets updated every time (not only the first time) such a pseudo update statement is executed, even though no value is changed. On the first update one might think that is OK because the persistent computed column gets changed, but on later such updates nothing is changed at all and yet the timestamp gets updated. |
| Comment by Sergei Golubchik [ 2017-01-12 ] |
|
This is "fixed" in 10.2, in a sense that 10.2 does not allow virtual columns to refer to auto-increment fields. This is what MySQL does too. Technically, it's possible to make auto-increment and virtual columns to work together, but only by completely reimplementing auto-increment code. It's doable, but a very big high-risk change, certainly not a bug fix. |