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

mysqldump uses 10.3 options with pre-10.3 servers and breaks

Details

    Description

      When issuing a 10.3 mysqldump command to dump triggers and routines from a 10.2 server, the tool breaks because it tries to issue a SHOW PACKAGES command which is not supported in 10.2 and earlier releases.

      mysqldump --quick --routines --triggers --no-create-info --skip-lock-tables --no-data --compress -h 10.10.16.138 -u mariadb_mock_import -p myschema

      ....

      mysqldump: Couldn't execute 'SHOW PACKAGE STATUS WHERE Db = 'myschema'': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PACKAGE STATUS WHERE Db = 'myschema'' at line 1 (1064)

      Attachments

        Issue Links

          Activity

            rpizzi Rick Pizzi (Inactive) created issue -
            rpizzi Rick Pizzi (Inactive) made changes -
            Field Original Value New Value
            Description When issuing a 10.3 mysqldump command to dump triggers and routines from a 10.2 server, the tool breaks because it tries to issue a SHOW PACKAGES command which is not supported in 10.2 and earlier releases.

            mysqldump --quick --routines --triggers --no-create-info --skip-lock-tables --no-data --compress -h 10.225.16.138 -u mariadb_mock_import -p ccfi_ecash

            ....

            mysqldump: Couldn't execute 'SHOW PACKAGE STATUS WHERE Db = 'ccfi_ecash'': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PACKAGE STATUS WHERE Db = 'ccfi_ecash'' at line 1 (1064)
            When issuing a 10.3 mysqldump command to dump triggers and routines from a 10.2 server, the tool breaks because it tries to issue a SHOW PACKAGES command which is not supported in 10.2 and earlier releases.

            mysqldump --quick --routines --triggers --no-create-info --skip-lock-tables --no-data --compress -h 10.10.16.138 -u mariadb_mock_import -p myschema

            ....

            mysqldump: Couldn't execute 'SHOW PACKAGE STATUS WHERE Db = 'myschema'': You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PACKAGE STATUS WHERE Db = 'myschema'' at line 1 (1064)
            elenst Elena Stepanova made changes -
            Component/s Scripts & Clients [ 11002 ]

            I would think that cross-version mysqldump is not expected to work, but unfortunately the documentation not only doesn't support this claim, but implies otherwise by having "mysqldump and old versions of MySQL" section. Of course the use case described there is different, it's about dumping the current schema and loading it somewhere else; but still, if we start documenting incompatibilities as special cases, it means that everything is compatible otherwise, and if it's not, it must be mentioned in the documentation as well.

            serg, what do you think? Do we want to support the backward compatibility of clients with older servers, or document that we don't?

            elenst Elena Stepanova added a comment - I would think that cross-version mysqldump is not expected to work, but unfortunately the documentation not only doesn't support this claim, but implies otherwise by having "mysqldump and old versions of MySQL" section. Of course the use case described there is different, it's about dumping the current schema and loading it somewhere else; but still, if we start documenting incompatibilities as special cases, it means that everything is compatible otherwise, and if it's not, it must be mentioned in the documentation as well. serg , what do you think? Do we want to support the backward compatibility of clients with older servers, or document that we don't?
            elenst Elena Stepanova made changes -
            Labels need_feedback

            I would suggest to implement a check around the "SHOW PACKAGES" command, which is a 10.3 thing, so it is not fired when server doesn't support it, or at least do not error out on it.

            I guess some customers may find 10.3 client installed by default on many linux distros soon,
            and their databases will still be 10.1 or 10.2...

            rpizzi Rick Pizzi (Inactive) added a comment - I would suggest to implement a check around the "SHOW PACKAGES" command, which is a 10.3 thing, so it is not fired when server doesn't support it, or at least do not error out on it. I guess some customers may find 10.3 client installed by default on many linux distros soon, and their databases will still be 10.1 or 10.2...
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            serg Sergei Golubchik made changes -
            Labels need_feedback

            I think it's a bug

            serg Sergei Golubchik added a comment - I think it's a bug
            elenst Elena Stepanova made changes -
            Fix Version/s 10.3 [ 22126 ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            serg Sergei Golubchik made changes -
            Assignee Anel Husakovic [ anel ]

            Hi I couldn't reproduce this error.
            The steps that I did:
            1) Run 10.2 server
            2) Create table,procedure in database called `dbdump`
            3) Dump database [with the flags from MDEV] `dbdump` in file `dbdump.sql`
            4) Run 10.3 server
            5) Insert data from file `dbdump.sql` in a database `test`
            6) Dump database `test` [with the flags from MDEV]
            Right ?

            anel Anel Husakovic added a comment - Hi I couldn't reproduce this error. The steps that I did: 1) Run 10.2 server 2) Create table,procedure in database called `dbdump` 3) Dump database [with the flags from MDEV] `dbdump` in file `dbdump.sql` 4) Run 10.3 server 5) Insert data from file `dbdump.sql` in a database `test` 6) Dump database `test` [with the flags from MDEV] Right ?

            Try to dump a database 10.2 with mysqldump 10.3, it fails.
            The import is unimportant, the issue is dumping it.

            philip_38 Philip orleans added a comment - Try to dump a database 10.2 with mysqldump 10.3, it fails. The import is unimportant, the issue is dumping it.
            aschmidt Alan Schmidt added a comment - - edited

            Well, another month has gone by. Perhaps a different scenario might help communicate that this is a problem that needs a solution sooner rather than later.

            1) Run 10.2 Server or less on a remote server. Perhaps a web host somewhere.
            2) Have 10.3 installed on your workstation (perhaps you are a web developer working for clients on all kinds of hosts, and 10.3 is just what comes with your distribution).
            3) From your workstation, run mysqldump, giving the proper connection information for the server machine.
            4) The dump will fail.

            If you do not have shell access to the remote server (it is not uncommon for web hosts to disallow this access), the most practical approach is to install the Oracle version of the software, just for interoperability. It is easier to do this with your distribution's package manager than to downgrade.

            aschmidt Alan Schmidt added a comment - - edited Well, another month has gone by. Perhaps a different scenario might help communicate that this is a problem that needs a solution sooner rather than later. 1) Run 10.2 Server or less on a remote server. Perhaps a web host somewhere. 2) Have 10.3 installed on your workstation (perhaps you are a web developer working for clients on all kinds of hosts, and 10.3 is just what comes with your distribution). 3) From your workstation, run mysqldump, giving the proper connection information for the server machine. 4) The dump will fail. If you do not have shell access to the remote server (it is not uncommon for web hosts to disallow this access), the most practical approach is to install the Oracle version of the software, just for interoperability. It is easier to do this with your distribution's package manager than to downgrade.
            anel Anel Husakovic added a comment - - edited

            Hi Alan, thanks, will try to do that.
            I have tried dumping file (10.3) to remote (10.2) and this works

            mysql -u user <10.3_file.sql 

            anel Anel Husakovic added a comment - - edited Hi Alan, thanks, will try to do that. I have tried dumping file (10.3) to remote (10.2) and this works mysql -u user <10.3_file.sql
            anel Anel Husakovic made changes -
            Assignee Anel Husakovic [ anel ] Alexander Barkov [ bar ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.4 [ 22408 ]
            aschmidt Alan Schmidt added a comment - - edited

            Using mysqldump from 10.3 do this:

            mysqldump -u user -h 10.2-host schema_from_10.2_server >> 10.2_file.sql

            It will fail.

            Please, please, please, try to reproduce the problem as stated. Please do not substitute versions.

            aschmidt Alan Schmidt added a comment - - edited Using mysqldump from 10.3 do this: mysqldump -u user -h 10.2-host schema_from_10.2_server >> 10.2_file.sql It will fail. Please, please, please, try to reproduce the problem as stated. Please do not substitute versions.
            t.munk Tobias Munk added a comment - - edited

            I ran into the same issue. This is a very annoying, ie. on Arch Linux, where you have to build older versions, which takes hours.

            And especially when taking this into account

            mysqldump from an earlier MariaDB release cannot be used on MariaDB 10.3 and beyond.

            from https://mariadb.com/kb/en/library/mysqldump/

            We need some kind of --flag to be able to use mysqldump from Maria 10.3 with older versions.

            [addon] Works without --routines (for me)

            t.munk Tobias Munk added a comment - - edited I ran into the same issue. This is a very annoying, ie. on Arch Linux, where you have to build older versions, which takes hours. And especially when taking this into account mysqldump from an earlier MariaDB release cannot be used on MariaDB 10.3 and beyond. from https://mariadb.com/kb/en/library/mysqldump/ We need some kind of --flag to be able to use mysqldump from Maria 10.3 with older versions. [addon] Works without --routines (for me)
            serg Sergei Golubchik made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            anel Anel Husakovic made changes -
            Assignee Alexander Barkov [ bar ] Anel Husakovic [ anel ]
            anel Anel Husakovic made changes -
            Assignee Anel Husakovic [ anel ] Alexander Barkov [ bar ]
            Status Confirmed [ 10101 ] In Review [ 10002 ]

            Closed with 620f4f8af98666e2

            anel Anel Husakovic added a comment - Closed with 620f4f8af98666e2
            anel Anel Husakovic made changes -
            issue.field.resolutiondate 2019-06-24 09:51:58.0 2019-06-24 09:51:58.014
            anel Anel Husakovic made changes -
            Fix Version/s 10.3.17 [ 23411 ]
            Fix Version/s 10.4.7 [ 23720 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Assignee Alexander Barkov [ bar ] Anel Husakovic [ anel ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]
            Mosinmotte2 Most Motte added a comment -

            Nice and thanks to share it with us.

            –
            Thanks & Regards
            WebHostingReviewsX

            Mosinmotte2 Most Motte added a comment - Nice and thanks to share it with us. – Thanks & Regards WebHostingReviewsX
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 90050 ] MariaDB v4 [ 155048 ]

            People

              anel Anel Husakovic
              rpizzi Rick Pizzi (Inactive)
              Votes:
              5 Vote for this issue
              Watchers:
              11 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.