Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-22800

Support PURGE BINARY LOGS TO with non-constant parameter in procedure code somehow

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • 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:

      • PURGE does not accept a simple @ user variable as argument here
      • PURGE inside a procedure does not accept a procedure variable containing the file name either
      • PURGE is not supported by PREPARE/EXECUTE either

      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 ...

      Attachments

        Activity

          People

            Unassigned Unassigned
            hholzgra Hartmut Holzgraefe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.