Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Fix
-
None
Description
Hi MariaDB captains,
Working with custom sequences different from auto increment will break applications relying on last_insert_id()
The following bug may be extended into a task to globally improve management of sequences
Did you plan something new in 10.2. regarding sequences ?
Test case
CREATE TABLE `t` ( |
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, |
`collection` bigint(20) unsigned DEFAULT NULL, |
`content` mediumblob,
|
`inum` bigint(20) DEFAULT NULL, |
`istr` varbinary(40) DEFAULT NULL, |
PRIMARY KEY (`id`), |
KEY `idx1` (`inum`), |
KEY `idx2` (`istr`) |
) ENGINE=InnoDB AUTO_INCREMENT=10688994220565331969 DEFAULT CHARSET=utf8 |
CREATE TRIGGER before_insert_t BEFORE INSERT ON t FOR EACH ROW SET new.id = uuid_short(); |
 |
insert into t select null,1 ,"", null, null; |
select last_insert_id(); |
This returning 0 and not the last inserted auto increment
In a more generic case it would be appreciate if last_insert_id() could return at least the single column numeric PK of the last inserted record of the statement.
Attachments
Issue Links
- is part of
-
MDEV-6445 UUID column type addition for distributed systems
- Closed