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

Misleading error messages about event scheduler when using --skip-grant-tables

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
    • 11.1.1
    • Events
    • None

    Description

      If I start the server with --skip-grant-tables, then CREATE EVENT doesn't work:

      The error message is extremely misleading: "Cannot proceed, because event scheduler is disabled", even if (as in this case) I've explicitly set EVENT_SCHEDULER=ON.

      $ ./mariadbd --version
      ./mariadbd  Ver 10.6.10-MariaDB for Linux on x86_64
       
      $ ./mariadbd --no-defaults --socket=$PATH --skip-grant-tables --skip-networking --datadir=$DATADIR --event-scheduler=ON &
      ...
       
      $ ./mariadb --no-defaults --socket=$PATH \
         -e 'select @@global.event_scheduler; create event if not exists mysql.test on schedule at current_timestamp + interval 1 minute do select 1;'
      +--------------------------+
      | @@global.event_scheduler |
      +--------------------------+
      | ON                       |
      +--------------------------+
      ERROR 1577 (HY000) at line 1: Cannot proceed, because event scheduler is disabled
      

      This misleading message is a consequence of the fix for MDEV-19262, which changed the previous error message, even though it was more accurate in this case:

      From https://github.com/mariadb/server/commit/6c9a6bad4fe90c8bfcfe6dbf46835a39edc95c6f by wlad:

      --- a/sql/share/errmsg-utf8.txt
      +++ b/sql/share/errmsg-utf8.txt
      @@ -5974,2 +5974,2 @@
       ER_EVENTS_DB_ERROR
      -        eng "Cannot proceed because system tables used by Event Scheduler were found damaged at server start"
      +        eng "Cannot proceed, because event scheduler is disabled"
      

      Ideas:

      1. There should be ≥2 error messages that actually distinguish the distinct cases:
        • Cannot proceed, because event scheduler is disabled (should only be used when EVENT_SCHEDULER=DISABLED, obviously)
        • Cannot proceed, because grant tables are disabled ((this case)
        • Anything else?
      2. Is there any reason the event scheduler can't/shouldn't work with grant tables disabled?

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              dlenski Daniel Lenski
              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.