Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 10.0.14, 10.0, 10.1
-
Fix Version/s: 10.2.3
-
Component/s: Virtual Columns
-
Labels:
Description
Persistent columns don't work if they are based on an auto increment column.
CREATE TABLE `orgs` ( |
`oid` int(11) unsigned NOT NULL AUTO_INCREMENT, |
`name` varchar(60) NOT NULL DEFAULT '', |
`oid2` int(11) unsigned as (`oid`) PERSISTENT, |
PRIMARY KEY (`oid`)); |
 |
insert into orgs ( name) values ('test 1'), ('test 2'); |
MariaDB [tim_test]> select * from orgs;
|
+-----+--------+------+
|
| oid | name | oid2 |
|
+-----+--------+------+
|
| 1 | test 1 | 0 |
|
| 2 | test 2 | 0 |
|
+-----+--------+------+
|
I would expect the oid2 column to mirror the oid field.
It works on update.
update orgs set oid=5 where oid=2; |
MariaDB [tim_test]> select * from orgs;
|
+-----+--------+------+
|
| oid | name | oid2 |
|
+-----+--------+------+
|
| 1 | test 1 | 0 |
|
| 5 | test 2 | 5 |
|
+-----+--------+------+
|
Attachments
Issue Links
- duplicates
-
MDEV-8653 Persistent virtual fields don't insert with auto_incremented fields
-
- Closed
-