Skip to content

fix: make :param and :params commands case insensitive - #262

Open
Bewear777 wants to merge 1 commit into
vesoft-inc:masterfrom
Bewear777:fix/param-command-case-insensitive
Open

Bewear777 wants to merge 1 commit into
vesoft-inc:masterfrom
Bewear777:fix/param-command-case-insensitive

Conversation

@Bewear777

Copy link
Copy Markdown

What type of PR is this?

  • bug
  • feature
  • enhancement
  • documentation

What problem(s) does this PR solve?

Issue(s) number:

Fixes #261

Description:

The :param and :params commands are not fully case insensitive.

Although isConsoleCmd() converts the local command name to lowercase when dispatching commands, the regular expressions in defineParams() and ListParams() only match lowercase command names.

As a result, commands such as :PARAM p1=>123 and :PARAMS are rejected with Wrong local command format.

How do you solve it?

  • Add the case-insensitive flag (?i) to the regular expression in defineParams().
  • Add the case-insensitive flag (?i) to the regular expression in ListParams().

This allows uppercase and mixed-case parameter commands to work correctly without changing the existing parameter handling logic.

Special notes for your reviewer, ex. impact of this fix, design document, etc:

  • Minimal change limited to two regular expressions in main.go.
  • Existing lowercase command behavior remains unchanged.
  • Uppercase and mixed-case commands are now supported.
  • Parameter names and values are not affected.
  • No public API changes.
  • No backward compatibility impact.
  • The regular expression behavior was verified with a Go check. The full project test suite has not been run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console :PARAM and :PARAMS commands are case-sensitive

1 participant