I am experiencing a strange bug with generated columns and MariaDB running in a Docker container.
The image I'm using is mariadb:10
.
I have been trying to add generated columns. The first column I add works fine; the second I add crashes the container and destroys the table.
Here's the first column that is working:
ALTER TABLE program
ADD is_current tinyint AS (
IF (
status IN ('active', 'suspended')
AND start_date >= NOW(),
1,
0
)
);
This one works just fine. The following SQL crashes the container:
ALTER TABLE program
ADD is_covered tinyint AS (
IF (
status IN ('active', 'suspended')
AND start_date <= NOW(),
1,
0
)
);
After restarting the container, I get the following errors:
SELECT * FROM program;
[42S02][1932] Table 'my_local.program' is marked as crashed and should be repaired
repair table my_local.program;
Table 'my_local.program' doesn't exist in engine / operation failed
Following the directions from this question I checked in the container for the existence of the ibdata1
file. It exists, as do the table's .ibd
and .rfm
files.
I have not been able to fix this; I had to drop the table and re-create it and re-import the data.
If anyone has any suggestions, I'd love to hear.