bcgov / bcgov/backup-container

Restoring to MySQL fails when tables include generated columns

Open
#150 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Shell
Stars
44
Forks
65
PR merge metrics
No merged PRs in 30d

Description

Judging from https://dba.stackexchange.com/a/279248, it sounds like

> MariaDB's mysqldump dumps the generated values, but MySQL only accepts DEFAULT as value for a virtual generated column.

Creating the backup works no problem, but I get the following error when running `./backup.sh -r HOST:PORT/DATABASE`:

```
ERROR 3105 (HY000) at line 2517: The value specified for generated column 'foo' in table 'bar' is not allowed.
```

I imagine this issue could be resolved by either:
- Including the workaround using `sed` as described in the stackexchange answer as part of the restore script
- Using an image which executes a non-mariadb version of `mysqldump`

I'll look to add reproduction steps soon!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.