WL#9418: Permit default value to be a function or expression, support for LOBs

Affects: Server-8.0   —   Status: Complete

Currently MySQL only permits a literal value as column default.  For example:

CREATE TABLE t1 (
 a INT DEFAULT 0
);

It is useful to be able to allow functions as default values.  The most common 
use case would be to emulate a UUID-like auto_increment:

> CREATE TABLE t2 (
    ->  a BINARY(16) DEFAULT uuid_to_bin(uuid())
    -> );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use near 
'uuid_to_bin(uuid())
)' at line 2


It is also a major usability problem for GIS. If an user would like to add a
geometry column to an existing table and index on it, there is no straight forward 
way to do so. rtree index requires the column to be not nullable, however MySQL
does not allow adding a non-nullable geometry column, because it does not support
expression to be the default value, and for GIS, the default value is an
expression.

In addition, LOB fields do not currently support a default value.  This is very
much a desired feature for GIS and JSON e.g. "DEFAULT POINT(0,0)" or DEFAULT 
'[]' (default to an empty array to reduce nil handling in application).