I had problems with generated columns in HeidiSQL 11.2 and 11.1.
The following example script works:
CREATE TABLE table22 (
b VARCHAR(32), d VARCHAR(5) AS (left(b,5)) PERSISTENT
When I try to use the generated create script below (or try to alter the table in HeidiSQL). I get an error. Reason seems to be that HeidiSQL (?) adds DEFAULT NULL and COLLATE '...' for the generated column which provoke the error. When I remove these two in script or change the values in HeidiSQL it works - but HeidiSQL again adds them to the table definition, so next time create or alter will again fail.
`b` VARCHAR(32) NULL DEFAULT NULL COLLATE 'utf8_general_ci', `d` VARCHAR(5) **DEFAULT NULL** AS (left(`b`,6)) stored **COLLATE 'utf8_general_ci'**
) COLLATE='utf8_general_ci' ENGINE=InnoDB ;