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

Improve error log messages with descriptive text already present in the code

    XMLWordPrintable

Details

    Description

      It would be great if we could improve the quality of some or all error messages.

      For example:

      CREATE TABLE t (i INT KEY);
      ALTER TABLE t DISCARD TABLESPACE;
      SELECT * FROM t;
      

      Will lead to (in the CLI):

      10.9.0 b5852ffbeebc3000982988383daeefb0549e058a (Debug)

      10.9.0-dbg>SELECT * FROM t;
      ERROR 1814 (HY000): Tablespace has been discarded for table `t`
      

      Which is sufficiently clear to understand what is happening, or at least to get a good hint in the case where the SELECT happens much later than the DISCARD TABLESPACE.

      However, the error log is much more cryptic:

      10.9.0 b5852ffbeebc3000982988383daeefb0549e058a (Debug)

      2022-02-26  8:11:50 0 [Note] /test/MD140222-mariadb-10.9.0-linux-x86_64-dbg/bin/mysqld: ready for connections.
      Version: '10.9.0-MariaDB-debug'  socket: '/test/MD140222-mariadb-10.9.0-linux-x86_64-dbg/socket.sock'  port: 27815  MariaDB Server
      2022-02-26  8:12:08 6 [ERROR] Got error 194 when reading table './test/t'
      

      Sysadmins would have to use the bin/perror tool (if they know it exists), or search online, to find out what is happening. We can save them from having to take this extra and unnecessary step by automating (and improving) the error to message step:

      Proposed Output

      2022-02-26  8:12:08 6 [ERROR] Got error 194 when reading table './test/t' (Tablespace is missing for a table)
      

      It would seem that this is low hanging fruit and a feature easy to implement.

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              9 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.