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

LP:423035 - error in parsing enum value for plugin variable in mysqld command-line option

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      This should fail:

      mysqld --plugin-load=EXAMPLE=ha_example.so --plugin-example-enum-var=noexist

      But it does not in current MariaDB 5.1, due to an incorrect cast/unsigned comparison. Instead it sets the variable to some value (0 I think).

      Fix:

      === modified file 'mysys/my_getopt.c'
      — mysys/my_getopt.c 2009-05-20 15:34:34 +0000
      +++ mysys/my_getopt.c 2009-09-02 08:13:14 +0000
      @@ -603,6 +603,7 @@ static int setval(const struct my_option
      my_bool set_maximum_value)
      {
      int err= 0;
      + int pos;

      if (value && argument)
      {
      @@ -647,7 +648,9 @@ static int setval(const struct my_option
      return EXIT_OUT_OF_MEMORY;
      break;
      case GET_ENUM:

      • if (((*(ulong *)result_pos)= find_type(argument, opts->typelib, 2) - 1) < 0)
        + pos= find_type(argument, opts->typelib, 2) - 1;
        + (*(ulong *)result_pos)= pos;
        + if (pos < 0)
        return EXIT_ARGUMENT_INVALID;
        break;
        case GET_SET:

      Bug was introduced with this patch:

      ------------------------------------------------------------
      revno: 2703
      revision-id: <email address hidden>
      parent: <email address hidden>
      committer: <email address hidden>
      branch nick: work-5.1-ourdelta
      timestamp: Wed 2009-05-20 17:34:34 +0200
      message:
      Fix accessing ulong enum option as uint, failing on 64-bit big-endian.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 423035

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 423035

              People

              • Assignee:
                knielsen Kristian Nielsen
                Reporter:
                knielsen Kristian Nielsen
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: