[MDEV-20941] virtual column causes 2013 error upon insert Created: 2019-11-01  Updated: 2019-12-09  Resolved: 2019-12-09

Status: Closed
Project: MariaDB Server
Component/s: Data Manipulation - Insert
Affects Version/s: 10.3.17
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: V H Lemoine Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

linux Ubuntu 18.04 mariadb 10.3.17


Attachments: Text File error.log    

 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.



 Comments   
Comment by Elena Stepanova [ 2019-11-05 ]

It doesn't fail for me, and unfortunately since the server didn't produce a proper stack trace, we can't compare the failure with other known bugs regarding virtual columns. If it happens for you all the time, maybe you have an example of a crash with a better stack trace in the log? Or, could you maybe try to install dbgsym packages and enable the coredump, then possibly the crash report will be better, and if not, you'll be able to get a stack trace from the core file?

Generated at Thu Feb 08 09:03:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.