This is translation for my early post in Japanese.
As of MySQL 5.7.6, generated column was introduced as 5.7's new
feature.
I found that generated column could behave like CHECK
constraint.
Let's start :)
mysql57> CREATE TABLE t1 (num int primary key, val varchar(32)) Engine= InnoDB;
Query OK, 0 rows affected (0.03 sec)
mysql57> INSERT INTO t1 (num, val) VALUES (1, '2015-08-06');
Query OK, 1 row affected (0.01 sec)
mysql57> SELECT * FROM t1;
+-----+------------+
| num | val |
+-----+------------+
| 1 | 2015-08-06 |
+-----+------------+
1 row in set (0.00 sec)
First, there's the bad …