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

mysqldump --wildcards=on -L -B forms query with the syntax error, when there are no db, that should be returned

    XMLWordPrintable

Details

    • Unexpected results
    • Q3/2025 Maintenance

    Description

      SET GLOBAL log_output='TABLE';
      --exec $MYSQL_DUMP --compact --debug-info -L -B  a%
       
      SELECT * FROM mysql.general_log;
      

      if I execute it from bash, then I get "mysqldump: Error: 'You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '))) GROUP BY LOGFILE_GROUP_NAME, FILE_NAME, ENGINE, TOTAL_EXTENTS, INITIAL_SI...' at line 1' when trying to dump tablespaces"

      from mtr it is somehow different, so I added general log- note WHERE TABLE_SCHEMA IN )

      Query	SELECT LOGFILE_GROUP_NAME, FILE_NAME, TOTAL_EXTENTS, INITIAL_SIZE, ENGINE, EXTRA FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'UNDO LOG' AND FILE_NAME IS NOT NULL AND LOGFILE_GROUP_NAME IS NOT NULL AND LOGFILE_GROUP_NAME IN (SELECT DISTINCT LOGFILE_GROUP_NAME FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE = 'DATAFILE' AND TABLESPACE_NAME IN (SELECT DISTINCT TABLESPACE_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA IN ))) GROUP BY LOGFILE_GROUP_NAME, FILE_NAME, ENGINE, TOTAL_EXTENTS, INITIAL_SIZE ORDER BY LOGFILE_GROUP_NAME
      

      Without -L option mysqldump fails with " Got error: 1049: "Unknown database 'b'" when selecting the database" after the first database in a row, that does not exist .

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.