[MDEV-17429] mysqldump uses 10.3 options with pre-10.3 servers and breaks Created: 2018-10-11  Updated: 2019-07-24  Resolved: 2019-06-24

Status: Closed
Project: MariaDB Server
Component/s: Admin statements, Scripts & Clients
Affects Version/s: 10.3.10
Fix Version/s: 10.3.17, 10.4.7

Type: Bug Priority: Critical
Reporter: Rick Pizzi Assignee: Anel Husakovic
Resolution: Fixed Votes: 5
Labels: None

Issue Links:
Duplicate
duplicates MDEV-17621 mysqldump from 10.3.5 + does not work... Closed
duplicates MDEV-18312 mysqldump fails to work on any lower-... Closed

 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)



 Comments   
Comment by Elena Stepanova [ 2018-10-13 ]

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?

Comment by Rick Pizzi [ 2018-10-15 ]

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

Comment by Sergei Golubchik [ 2018-10-16 ]

I think it's a bug

Comment by Anel Husakovic [ 2019-01-30 ]

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 ?

Comment by Philip orleans [ 2019-01-30 ]

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

Comment by Alan Schmidt [ 2019-03-07 ]

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.

Comment by Anel Husakovic [ 2019-03-11 ]

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 

Comment by Alan Schmidt [ 2019-06-04 ]

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.

Comment by Tobias Munk [ 2019-06-11 ]

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)

Comment by Anel Husakovic [ 2019-06-24 ]

Closed with 620f4f8af98666e2

Comment by Most Motte [ 2019-07-24 ]

Nice and thanks to share it with us.


Thanks & Regards
WebHostingReviewsX

Generated at Thu Feb 08 08:36:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.