Bug #30123 mysqldump from 5.1.21 doesn't work with 5.1.20 & earlier servers
Submitted: 30 Jul 2007 10:51 Modified: 24 Aug 2007 10:02
Reporter: Alexander Nozdrin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S1 (Critical)
Version:5.1.21-BK OS:Any
Assigned to: Alexander Nozdrin CPU Architecture:Any

[30 Jul 2007 10:51] Alexander Nozdrin
Description:
mysqldump in 5.1.21 uses new features of the server (new SQL statement,
new columns in the output of existed SQL statements). That prevents
mysqldump to work with older servers, that do not provide this
functionality.

How to repeat:
Run mysqldump from 5.1.21 against previous version.
[31 Jul 2007 8:28] Alexander Nozdrin
Test case:
1. Start mysqld (5.0);
2. Start mysql-client (5.x);
   CREATE TABLE t1(c INT);
   CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW SET @a = 1;
3. Run mysqldump (5.1.21-BK) against the server:
   > ./mysqldump --routines --triggers -u root db1
   [cut]
   mysqldump: Couldn't execute 'SHOW CREATE TRIGGER `t1_ai`': You have
   an error in your SQL syntax; check the manual that corresponds to your
   MySQL server version for the right syntax to use near 'TRIGGER `t1_ai`'
   at line 1 (1064)
[31 Jul 2007 16:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/31904

ChangeSet@1.2573, 2007-07-31 20:02:39+04:00, anozdrin@ibm. +1 -0
  Fix for BUG#30123: mysqldump is unable to work with old servers.
  
  New server (as of 5.1.21) provides new features:
    - SHOW CREATE TRIGGER;
    - character set information for SHOW TRIGGERS and SHOW CREATE
      EVENT | FUNCTION | PROCEDURE statements.
  Mysqldump uses these features to generate proper dump.
  
  The bug happened when new mysqldump was used to dump older servers.
  The problem was that 5.1.21 new features are not available, so
  mysqldump exited with error code or just crashed.
  
  The fix is to detect if mysqldump has ben run against older server
  and don't use new 5.1.21 functionality in this case. Certainly,
  the dump generated for the older server suffers from the character
  set problems fixed by BUG#16291 and the like.
[3 Aug 2007 7:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/32052

ChangeSet@1.2574, 2007-08-03 11:50:17+04:00, anozdrin@ibm. +1 -0
  Fix for BUG#30123: mysqldump is unable to work with old servers.
  
  New server (as of 5.1.21) provides new features:
    - SHOW CREATE TRIGGER;
    - character set information for SHOW TRIGGERS and SHOW CREATE
      EVENT | FUNCTION | PROCEDURE statements.
  Mysqldump uses these features to generate proper dump.
  
  The bug happened when new mysqldump was used to dump older servers.
  The problem was that 5.1.21 new features are not available, so
  mysqldump exited with error code or just crashed.
  
  The fix is to detect if mysqldump has ben run against older server
  and don't use new 5.1.21 functionality in this case. Certainly,
  the dump generated for the older server suffers from the character
  set problems fixed by BUG#16291 and the like.
[3 Aug 2007 17:34] Alexander Nozdrin
Approved by the phone.
[3 Aug 2007 17:36] Alexander Nozdrin
Pushed into 5.1-runtime.
[9 Aug 2007 13:18] Bugs System
Pushed into 5.1.22-beta
[24 Aug 2007 10:02] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.22 changelog.
[24 Aug 2007 10:07] Jon Stephens
Also noted this this issue & fix in mysqldump section of 5.1/5.2 Manual.
[24 Aug 2007 10:08] Jon Stephens
No need to note in 5.2 Manual, noted in 5.1 version only.