I have a standard mysqlbackup script that runs in cron. We recently had an issue where we removed a column from a table that a view was referencing. As such, our backup script was failing with an error similar to the following:
mysqldump: Couldn't execute 'show create table `v`': View 'foo_breakage.v'
references invalid table(s) or column(s) or function(s) or definer/invoker of
view lack rights to use them (1356)
If you simply drop this view, backups will work again. What I'm trying to solve is to be either a) notified in the future when this error happens, or b) (this is probably unlikely), but force the backup to go through regardless with an error like this if at all possible.
What's the best way to approach this problem? I'm assuming the only, and best approach for this is to check an exit status code and send an email notification to sysops in the event of failure. Will the above failure show up in an exit status code? Looking for creative/easy solutions.