bcgov / bcgov/backup-container
Restoring to MySQL fails when tables include generated columns
- 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
Assessment
This issue has not been assessed yet.