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

Enum options treat empty string as 0

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.11, 12.1(EOL)
    • 10.11, 11.4, 11.8
    • Server
    • None
    • Can result in unexpected behaviour

    Description

      Take rpl_semi_sync_master_wait_point for example.
      It is a Sys_var_enum with CMD_LINE(REQUIRED_ARG) and defaults to AFTER_COMMIT.

      This quick test:

      --source include/not_embedded.inc
      SELECT @@GLOBAL.rpl_semi_sync_master_wait_point;
      

      Results:

      • AFTER_COMMIT with an empty .opt file
      • argument parsing problem with --rpl-semi-sync-master-wait-point
      • AFTER_SYNC with --rpl-semi-sync-master-wait-point= (note the dangling = with no text)
        • expected: invalid argument error
      • invalid argument error with --rpl-semi-sync-master-wait-point=asdf
      • AFTER_SYNC with --rpl-semi-sync-master-wait-point=0 as that is the 1st choice

      Analysis: mysys/my_getopt.c § case GET_ENUM rejects extraneous text (e.g., =asdf) after the number (e.g., =0), but does not look for the existence of the number itself (=).

      Attachments

        Activity

          People

            ParadoxV5 Jimmy Hú
            ParadoxV5 Jimmy Hú
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.