Bug #68775 GTID_PURGED variable makes mysql dump non backward compatible
Submitted: 26 Mar 2013 9:22 Modified: 26 Mar 2013 19:17
Reporter: Oli Sennhauser Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.6.10 OS:Any (linux)
Assigned to:
Tags: dump, GTID_PURGED, mysqldump

[26 Mar 2013 9:22] Oli Sennhauser
Description:
Restore of a dump made with MySQL 5.6 gave the following error:

mysql -u root test < /tmp/test.sql 
ERROR 1193 (HY000) at line 24: Unknown system variable 'GTID_PURGED'

How to repeat:
mysql -u root test < /tmp/test.sql 
ERROR 1193 (HY000) at line 24: Unknown system variable 'GTID_PURGED'

Suggested fix:
This "normal" behaviour known from the past would make it backward compatible:

/*!50600 SET @@GLOBAL.GTID_PURGED='c38c8785-6c46-11e2-bf93-f0def105211b:1-5879'; */;
[26 Mar 2013 19:17] Sinisa Milivojevic
Oli, my friend,

A dump produced from 5.6 server by 5.6 mysqldump is not supposed to be restorable on all or some old server and client versions,

Last version for which we had a compatibility option in mysqldump was 4.0 !!!

Hence, what you ask for would be some 5.5 compatibility version. 

We have also asked our Documentation team to further document this limitation in clear terms.
[26 Mar 2013 23:53] Luis Soares
Likely a dup of BUG#68314.
[5 Dec 2013 19:52] Sveta Smirnova
Not, this is not duplicate of bug #68314: this bug about restore of backup, made from 5.6 server and bug #68314 about taking backup of 5.5 server.

Sinisa, we still have compatibility options for servers which are newer than 4:

/*!50003 SET sql_mode              = @saved_sql_mode */ ;

I think this is valid bug report.
[29 Apr 2014 12:01] Shane Bester
this minor bug still exists in 5.6.19 and 5.7.5. mysqldump writes this:

SET @@GLOBAL.GTID_PURGED='';

instead of enclosing that statement in version-specific comment.