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

Remove unnecessary delimiter from query for mariadb-client shortcut command

    XMLWordPrintable

Details

    • Bug
    • Status: In Review (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3
    • 11.0
    • Scripts & Clients
    • None

    Description

      When comparing the string query when processing command name and it's shortcut form, one can obtain the delimiter at the end of the string. This is not needed and we can remove it in order to expect the same format of query/string to be processed by `com_*()` functions and this is now not the case.
      -Example

      • Shortcut with delimiter

        MariaDB [(none)]> \h;
         
        Breakpoint 1, com_help (buffer=0x5555555b476b <find_command(char)+297>, line=0x7fffffffd990 "\220\332\377\377\377\177") at /home/anel/GitHub/mariadb/server/src/10.3/client/mysql.cc:3145
        3145	{
        (gdb) p line
        +p line
        $2 = 0x555555a3dfc0 "\\h;"
        

      • Shortcut without delimiter

        MariaDB [(none)]> \h
         
        Breakpoint 1, com_help (buffer=0x5555555b476b <find_command(char)+297>, line=0x7fffffffd990 "\220\332\377\377\377\177") at /home/anel/GitHub/mariadb/server/src/10.3/client/mysql.cc:3145
        3145	{
        (gdb) n
        +n
        3147	  char * help_arg= strchr(line,' '), buff[32], *end;
        (gdb) p line
        +p line
        $3 = 0x555555a3e5b0 "\\h"
        

      • Verbose command

        MariaDB [(none)]> help;
         
        Breakpoint 1, com_help (buffer=0x5555559f8b98, line=0x555555a3dfc4 ";") at /home/anel/GitHub/mariadb/server/src/10.3/client/mysql.cc:3145
        3145	{
        (gdb) n
        +n
        3147	  char * help_arg= strchr(line,' '), buff[32], *end;
        (gdb) p line
        +p line
        $5 = 0x5555559f8b98 "help"
        

      Why is this needed?
      MDEV-12192 is parsing the key/value for alias handling, so we need to have deterministic behavior for verbose command alias as well as abbreviation \a.

      Attachments

        Issue Links

          Activity

            People

              cvicentiu Vicențiu Ciorbaru
              anel Anel Husakovic
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.