Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.1.67, 5.2.14, 5.3.12, 5.5(EOL), 10.0(EOL), 10.1(EOL)
-
Linux
-
10.1.9-3, 10.1.10
Description
MariaDB not use DEFAULT value even when inserted NULL for NOT NULLABLE column.
Expected similar behavior as for AUTOINCREMENT and would be usefull for generation right value in trigger.
http://stackoverflow.com/questions/15473654/mariadb-before-insert-trigger-for-uuid
Of course in described example much better if MariaDB would support UUID data type and generate automaticaly UUID for AUTOINCREMENT fields.
But I think it would be good idea if MariaDB would allow use any function for default value it would be good replacement of generators.
For example:
CREATE TABLE `c` (
|
`id` VARBINARY(36) NOT NULL DEFAULT UUID(),
|
PRIMARY KEY (`id`)
|
) ENGINE=INNODB DEFAULT CHARSET=utf8
|
And it would here appropriate analogy with the behavior of AUTOINCREMENT
And if make possible to work with property table autoincrement into functions would be generally be a bomb. It would be possible create complicated ID with concatenation static identifier if schema and autoincrement.
For example:
A-1
A-2
A-3
A-5
and on another schema for same table
B-1
B-2
B-3
B-4
Attachments
Issue Links
- causes
-
MDEV-9500 Bug after upgrade to 10.1.10 (and 10.1.11)
- Closed
- duplicates
-
MDEV-10002 Before Insert trigger does not work with NOT NULL columns
- Closed
- relates to
-
MDEV-4958 Adding datatype UUID
- Closed
-
MDEV-9428 NO_AUTO_VALUE_ON_ZERO is ignored when a trigger before insert is defined
- Closed
-
MDEV-9535 Trigger doing "SET NEW.auctionStart = NOW();" on a timestamp kills MariaDB server.
- Closed
-
MDEV-19761 Before Trigger not processed for Not Null Columns
- Open
- links to