[MDEV-22800] Support PURGE BINARY LOGS TO with non-constant parameter in procedure code somehow Created: 2020-06-04 Updated: 2020-07-06 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Hartmut Holzgraefe | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Right now PURGE BINARY LOGS TO apparently can only be used in a stored procedure with static filename string as parameter. I'd like to create a procedure that only keeps the last N binary log files, and purges any extra binlog files beyond that. For this I'd need to determine the name of the oldest log name I want to keep, and then somehow need to pass this into the PURGE statement. But:
So all three possible ways to pass in a binlog file name from a variable do not work here. Being able to run PURGE BINARY LOGS TO ...calculated_filename... looks like something that *should* be possible from within a stored procedure somehow, e.g. to perform such purges from within the server using EVENTs, instead of having to fall back to external scripts and cron jobs to do this ... |