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

No feedback on errors from mariadb-dump

    XMLWordPrintable

Details

    Description

      When dumping from a very old server (in my case 5.1.x) the program exits with correct status code 2 but now textual error:

      $ mariadb-dump -hold-mysql.example.com -uuser -p --routines --triggers --events the_db > the_db.sql
      Enter password: 
      $ echo $?
      2
      

      But when using with a non-existent option:

      $ mariadb-dump -hold-mysql.example.com -uuser -p --routines --triggers --some-unknown-option --events the_db > the_db.sql
      Enter password: 
      mariadb-dump: unknown option '--some-unknown-option'
      $ echo $?
      2
      

      The sql file only contains:

      -- MariaDB dump 10.19  Distrib 10.5.10-MariaDB, for Linux (x86_64)
      --
      -- Host: old-mysql.example.com    Database: the_db
      -- ------------------------------------------------------
      -- Server version	5.1.63-rel13.4-log
       
      /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
      /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
      /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
      /*!40101 SET NAMES utf8mb4 */;
      /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
      /*!40103 SET TIME_ZONE='+00:00' */;
      /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
      /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
      /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
      /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
      

      Looking w/ `strace` I found out the problem:

      sendto(3, ".\0\0\0\3SET SESSION character_set_results = 'utf8mb4'", 50, MSG_DONTWAIT|MSG_NOSIGNAL, NULL, 0) = 50
      recvfrom(3, 0x55623eff1680, 16384, MSG_DONTWAIT, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable)
      poll([{fd=3, events=POLLIN}], 1, -1)    = 1 ([{fd=3, revents=POLLIN}])
      recvfrom(3, ")\0\0\1\377[\4#42000Unknown character set: 'utf8mb4'", 16384, MSG_DONTWAIT, NULL, NULL) = 45
      

      So because the server doesn't know `utf8mb4` the program exits w/ an error.
      It should use the charsets available on the server.

      Either:

      • fix by trying more that one charset from a list provided by the server or
      • show a textual error or
      • both.

      Attachments

        Activity

          People

            Unassigned Unassigned
            eradical Gabriel PREDA
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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