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

mysqldump: unknown variable 'max-statement-time' when included via --defaults-file or --defaults-extra-file

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • 10.8.3
    • N/A
    • Scripts & Clients
    • None

    Description

      mariadb-dump --help includes:

      The following groups are read: mysqldump mariadb-dump client client-server client-mariadb
      The following specify which files/extra groups are read (specified before remaining options):
      --defaults-file=#         Only read default options from the given file #.
      --defaults-extra-file=#   Read this file after the global files are read.
      

      The documentation for max_statement_time indicates it can be set dynamically for a session.

      However attempts to set this variable in any of the listed groups result in 'unknown variable' error:

      eg

      root@ubuntu-server~# cat custom.cnf
       
      [mysqldump]
      max_statement_time = 0
       
      root@ubuntu-server~# mysqldump --defaults-extra-file=custom.cnf my_database >/dev/null
      mysqldump: unknown variable 'max_execution_time=0'
      

      Where the client and server are hosted on different servers and the user lacks SUPER, I'm not aware of any workaround available.

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            Andrew Ryan, do you want to add the code to set this unconditionally, like mariabackup in MDEV-18702, somewhere about: https://github.com/MariaDB/server/blob/10.10/client/mysqldump.c line 2045.

            I'm happy to take this as a bug fix to 10.3 (and then merge to later branches).

            danblack Daniel Black added a comment - Andrew Ryan , do you want to add the code to set this unconditionally, like mariabackup in MDEV-18702 , somewhere about: https://github.com/MariaDB/server/blob/10.10/client/mysqldump.c line 2045. I'm happy to take this as a bug fix to 10.3 (and then merge to later branches).
            Andrew Ryan Andrew Ryan added a comment -

            Thanks Daniel.

            While setting this unconditionally to 0 would suit our scenarios, I wonder whether that may impact/surprise users who rely on the current behaviour and whether it would be inconsistent with the documentation. Eg if a non-0 value configured in my.cnf suddenly became ineffective for mysqldump that seems like a significant behavioural change.

            If possible, I think it would be safer if the value in the extra file was applied. Given this config currently generates an error, a change to this behaviour shouldn't cause any surprise/break for any user/application.

            Andrew Ryan Andrew Ryan added a comment - Thanks Daniel. While setting this unconditionally to 0 would suit our scenarios, I wonder whether that may impact/surprise users who rely on the current behaviour and whether it would be inconsistent with the documentation. Eg if a non-0 value configured in my.cnf suddenly became ineffective for mysqldump that seems like a significant behavioural change. If possible, I think it would be safer if the value in the extra file was applied. Given this config currently generates an error, a change to this behaviour shouldn't cause any surprise/break for any user/application.
            danblack Daniel Black added a comment -

            I can't think of a case where user's expect partial mariadb-dump contents. What is more likely surprise them in their current state with an incomplete restore. It hasn't surprised mariabackup users enough to create a bug.

            If I was going for a config option, it would be for a generic init_sql to account for other changes, potentially even reverting a default session max_statement_time=0.

            danblack Daniel Black added a comment - I can't think of a case where user's expect partial mariadb-dump contents. What is more likely surprise them in their current state with an incomplete restore. It hasn't surprised mariabackup users enough to create a bug. If I was going for a config option, it would be for a generic init_sql to account for other changes, potentially even reverting a default session max_statement_time=0.
            Andrew Ryan Andrew Ryan added a comment -

            Good point (I just realised we now have to check backups across several hundred servers).

            Yes, either setting this variable unconditionally or adding a config option would be great.

            Thanks again.

            Andrew Ryan Andrew Ryan added a comment - Good point (I just realised we now have to check backups across several hundred servers). Yes, either setting this variable unconditionally or adding a config option would be great. Thanks again.

            People

              Unassigned Unassigned
              Andrew Ryan Andrew Ryan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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