Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.1.6
-
None
-
Linux OpenSUSE 13.2
Description
If a persistent computed column uses an auto_increment column in its defining expression, upon inserting a new row into the table the value of the auto_increment column is taken to be zero and not the value it gets automatically assigned. The same problem does not happen with a virtual computed column.
Example:
create table test (a int key auto_increment, b int as(a) persistent);
|
insert test set a=null;
|
select * from test;
|
+---+------+
|
| a | b |
|
+---+------+
|
| 1 | 0 |
|
+---+------+
|
One would, however, expect that b is 1, just like a. As it stands, persistent computed columns cannot meaningfully use auto_increment columns.
Attachments
Issue Links
- duplicates
-
MDEV-8653 Persistent virtual fields don't insert with auto_incremented fields
- Closed