Syntax
DEFAULT(col_name)
Purpose
You can call this function to return the default value of a column. If the specified column does not have a default value, the system returns NULL.
Examples
obclient> CREATE TABLE t1 (id int,i int DEFAULT 1);
Query OK, 0 rows affected (0.04 sec)
obclient> INSERT INTO t1 VALUES (1,3);
Query OK, 1 row affected (0.00 sec)
obclient> UPDATE t1 SET i = DEFAULT(i)+1 WHERE id < 100;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
obclient> SELECT * FROM t;
+------+------+
id i
+------+------+
1 2
+------+------+
1 row in set (0.00 sec)
obclient> CREATE TABLE t2 (id int,i int);
Query OK, 0 rows affected (0.04 sec)
obclient> INSERT INTO t2 VALUES (1,3);
Query OK, 1 row affected (0.00 sec)
obclient> UPDATE t2 SET i = DEFAULT(i)+1 WHERE id < 100;
obclient> SELECT * FROM t2;
+------+------+
id i
+------+------+
1 NULL
+------+------+
1 row in set (0.00 sec)