Start pushing for Semantic Versioning to be adopted at MySQL, and you will avoid this kind of miscommunications— Giuseppe Maxia (@datacharmer) February 1-st 2019
MySQL ServerSo, what's new in the new release of the server. Here are my picks.
Here's my first example. I think it's quite common to have two dates in a table (e.g. start and end date) that should represent the beginning and end of something, so they should be in chronological order. Let's try to do this on the emp table from the example DEPT and EMP schema of Oracle, which I adapted for MySQL.
ADD COLUMN retdate DATE AFTER hiredate,
ADD CONSTRAINT ret_after_hire CHECK (retdate > hiredate);
SET retdate = STR_TO_DATE('1019-04-25', '%Y-%m-%d')
WHERE empno = 7369;
1 row(s) affected Rows matched: 1 Changed: 1 Warnings: 0
ADD CONSTRAINT emp_chks CHECK (hiredate >= CURDATE() AND sal > 0);
ADD COLUMN created DATE DEFAULT (hiredate);
MODIFY COLUMN created DATE NOT NULL DEFAULT (CURDATE()),
ADD CONSTRAINT emp_chks CHECK (hiredate >= created AND sal > 0);
INSERT INTO emp
(empno, ename, job, mgr, hiredate, sal)
(9999, 'MULDER', 'INVESTIG.', 7839, '2019-04-25', 4242);
Server does all upgrades
--validate-configfor validation of server configuration much like system administrators are used to do so with other servers (e.g. Apache). It's really important especially for production environments where unexpected downtime could be extremely unpleasant. Read more in Server Configuration Validation.