[MDEV-6203] Mysqldump output comments to .sql files without respect to --compact option Created: 2014-05-02  Updated: 2014-05-10  Resolved: 2014-05-10

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.37, 10.0.10
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Nick L Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: upstream
Environment:

mysqldump.EXE Ver 10.15 Distrib 10.0.10-MariaDB, for Win64 (x86)



 Description   

Create sample db and some table, then use mysqldump:

mysqldump --compact --user=root --password= --tab=./csv db1 --fields-enclosed-by=\" --fields-terminated-by=,

Sample from csv/table.sql:

/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
<<CREATE TABLE HERE>>
/*!40101 SET character_set_client = @saved_cs_client */;



 Comments   
Comment by Elena Stepanova [ 2014-05-04 ]

It works the same way in all versions of MySQL (starting from 5.1 at least) and MariaDB.

From documentation on mysqldump it's not clear whether this is a bug or not. It says ( http://dev.mysql.com/doc/refman/5.5/en/mysqldump.html#option_mysqldump_comments ):

--compact

Produce more compact output. This option enables the --skip-add-drop-table, --skip-add-locks, --skip-comments, --skip-disable-keys, and --skip-set-charset options.

--skip-comments option does not mean that all comments, including executable ones, must be skipped, it is defined as

--comments, -i

Write additional information in the dump file such as program version, server version, and host. This option is enabled by default. To suppress this additional information, use --skip-comments.

Same way, --skip-set-charset does not mean that all charset-related settings must be skipped, it is defined as

--set-charset

Add SET NAMES default_character_set to the output. This option is enabled by default. To suppress the SET NAMES statement, use --skip-set-charset.

All the above is true with --compact option.

If you wish, you could try to raise the issue with upstream at http://bugs.mysql.com/ and see what they say.

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