Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Incomplete
-
10.3.17
-
linux Ubuntu 18.04 mariadb 10.3.17
Description
Using this table with virtual column 'trDomain' I'm experiencing no problems
CREATE TABLE `sslinfo` (
`domain` varchar(255) NOT NULL,
`fromDate` datetime DEFAULT NULL,
`toDate` datetime DEFAULT NULL,
`ExpireInDays` smallint(4) unsigned GENERATED ALWAYS AS (to_days(`toDate`) - to_days(curdate())) VIRTUAL,
`trDomain` varchar(255) GENERATED ALWAYS AS (concat('<tr data-color=\'',(to_days(`toDate`) - to_days(curdate())) DIV 20,'\'><td>',`domain`,'</td><td>',`fromDate`,'</td><td>',`toDate`,'</td><td>',`ExpireInDays`,'</td></tr>')) VIRTUAL, `shRenew` varchar(255) GENERATED ALWAYS AS (concat('./letsencrypt-auto --apache --force-renew certonly -n -d ',`domain`)) VIRTUAL,
`shForceRenew` varchar(255) GENERATED ALWAYS AS (concat('certbot --apache --force-renew certonly -n -d ',`domain`,' --cert-name ',`domain`)) VIRTUAL,
PRIMARY KEY (`domain`) USING BTREE,
KEY `fromDate` (`fromDate`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
But when I change the column trDomain to:
* `trDomain` varchar(255) GENERATED ALWAYS AS (concat('<tr data-color=\'',(to_days(`toDate`) - to_days(curdate())) DIV 20,'\'><td>',`domain`,'</td><td>',date_format(`fromDate`,'%Y-%m-%d %H:%i'),'</td><td>',date_format(`toDate`,'%Y-%m-%d %H:%i'),'</td><td>',`ExpireInDays`,'</td></tr>')) VIRTUAL,
mariadb db gives a 2013 error upon insert.