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

Refactor the ADMIN_KILL section of mysqladmin.cc

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      This issue is pending verification and triage.

      The current code scans a number from the input string (using strtoull) only to convert it back to a string at another buffer (using ullstr). It locates the , delimiter after processing the current number.
      Using a converter pair to substring a number is (obviously) wasteful computations. It could instead locate the delimiter first and then copy the substring.

      That said, at least this strategy sanitizes the input a bit, but the behavior of its current implementation, strtoull(pos, NULL, 0), is questionable:

      • It recognizes 0x/0 as hexadecimal/octal prefixes.
      • It ignores non-numeric suffixes; e.g., truncates 1337code as 1337.
      • It converts "completely" invalid input (such as `hello`) to 0.

      Question: What should mariadb-admin kill consider invalid input as, and what should it do about them?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ParadoxV5 Jimmy Hú
              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.