Details
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 | +-----+--------+------+
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions