[MDEV-10134] Add full support for DEFAULT Created: 2016-05-27  Updated: 2019-01-24  Resolved: 2016-07-04

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table, Virtual Columns
Fix Version/s: 10.2.1

Type: Task Priority: Major
Reporter: Michael Widenius Assignee: Michael Widenius
Resolution: Fixed Votes: 1
Labels: Compatibility

Issue Links:
Blocks
is blocked by MDEV-10201 Bad results for CREATE TABLE t1 (a IN... Closed
is blocked by MDEV-10207 DEFAULT udf(x) does not return an err... Closed
PartOf
includes MDEV-9932 provide a default value of the curren... Closed
is part of MDEV-10137 Providing compatibility to other data... Open
Relates
relates to MDEV-6445 UUID column type addition for distrib... Closed
relates to MDEV-10351 Prepared statement with parameters in... Closed
relates to MDEV-10352 Server crashes in Field::set_default ... Closed
relates to MDEV-10353 New DEFAULT logic does not support us... Closed
relates to MDEV-10354 Assertion `! is_set()' failed in Diag... Closed
relates to MDEV-10355 Weird error message upon CREATE TABLE... Closed
relates to MDEV-11137 TIMESTAMP has 2-level logic for defau... Open
relates to MDEV-14700 ALTER TABLE fails with bogus "BLOB/TE... Closed
relates to MDEV-11136 Orpho error in ER_EXPRESSION_REFERS_T... Open
Epic Link: Oracle Compatibility
Sprint: Compatibility-1

 Description   

Add full support for DEFAULT

  • Support for functions: DEFAULT (1+1)
  • Referring to previous fields in the table
  • Support for DEFAULT for blobs

In addition this task will lift the current restrictions for virtual columns:

  • Non stored virtual columns can have almost any expression (including constant expression)
  • No 300 character limit. (Limit is 64K for all stored expressions + column definitions)

Example:

create table t1 (a bigint default uuid_short(), b blob DEFAULT "look at me!" NOT NULL);



 Comments   
Comment by VAROQUI Stephane [ 2016-06-10 ]

Default for the primary key should affect last_insert_id a long awaiting feature is id BIGINT UNSIGNED DEFAULT UUID_SHORT() see MDEV-6445

Generated at Thu Feb 08 07:39:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.