Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6203

Mysqldump output comments to .sql files without respect to --compact option

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: 5.1.67, 5.2.14, 5.3.12, 5.5.37, 10.0.10
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • 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 */;
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            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.

            Show
            elenst Elena Stepanova added a comment - 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.

              People

              • Assignee:
                Unassigned
                Reporter:
                Foobar Nick L
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 hours
                  2h
                  Remaining:
                  Remaining Estimate - 2 hours
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified