Bug #3045 mysqldump --help message inaccurracy
Submitted: 2 Mar 2004 13:36 Modified: 3 Mar 2004 1:20
Reporter: Tite Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version: Ver 10.2 Distrib 4.1.1-alpha OS:pc-linux (i686)
Assigned to: Dean Ellis CPU Architecture:Any

[2 Mar 2004 13:36] Tite
The --help command line switch's output states:

  --compatible=name   Change the dump to be compatible with a given mode. By
                      default tables are dumped without any restrictions. Legal
                      modes are: mysql323, mysql40, postgresql, oracle, mssql,
                      db2, sapdb, no_key_options, no_table_options,
                      no_field_options. One can use several modes separated by
                      commas. Note: Requires MySQL server version 4.1.0 or
                      higher. This option does a no operation on earlier server

How to repeat:

But, when doing a mysqldump --compatible=mysql323 I get the following:

--{ (inmersa@localhost) $ mysqldump --compatible=mysql323
mysqldump: ERROR: unknown variable 'compatible=mysql323'

The version I am trying it against is:

--{ (inmersa@localhost) $ mysqldump -V
mysqldump  Ver 9.08 Distrib 4.0.13, for apple-darwin6.6 (powerpc)

Keep it up.

[2 Mar 2004 15:44] Dean Ellis
Are you sure the mysqldump you are using is the one included in the 4.1.1 binary?  Since it is reporting version 4.0.13 (the option not did not exist in that version), you should verify this.
[3 Mar 2004 0:31] Tite
I am sorry, maybe I did not make my self clear enough.

It _is_ in the mysqldump binary from 4.1.1 where you can read that the --compatible switch 'does a no operation on earlier server versions'. The mysqldump binary that came with 4.0.13 said nothing at all about the --compatible option. But, it didn't do a 'no operation' on that switch, but an error. 

That was my point. I expected, from the --help message on 4.1.1, that the mysqldump binary from 4.0.13 would ignore the switch, not to fail.

[3 Mar 2004 0:37] Tite
I think that I got the meaning of the --help message now. It is the mysqldump 10.2 that will do a no operation on any other server but 4.1.1. _not_ that the switch would be ignored on mysqldump 9.x

My Bad.
[3 Mar 2004 1:20] Sergei Golubchik
The logic is as follows:
mysqldump that comes with 4.0.14 does not know about --compatible option, so it reports an error.

mysqldump in 4.1.1 does know it, so it parses it and sets an appropriate variable (sql_mode) on the server.

*sever* below 4.1 does not understand some sql_mode values, so though a SET command succeeds, the value is ignored. Note that from mysqldump point of view everything is ok - it sent a command and got no error back.

And, finally, server 4.1+ takes into account new value of sql_mode adjusting the output accordingly.