Skip to content

Mask DistSQL grammar still reserves the removed ADDRESS_RANDOM_REPLACE algorithm keyword #39360

Description

@thswlsqls

Bug Report

Which version of ShardingSphere did you use?

master @ 99a0b47

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

Both

Expected behavior

address_random_replace is usable as a mask rule name, column name or database name.

Actual behavior

The statements below fail with mismatched input 'address_random_replace' expecting {IF, IDENTIFIER_} or expecting IDENTIFIER_.

Reason analyze (If you can)

features/mask/distsql/parser/src/main/antlr4/imports/mask/Keyword.g4:138 defines the unreferenced ADDRESS_RANDOM_REPLACE lexer token: buildInMaskAlgorithmType omits it and no matching MaskAlgorithm exists. It precedes IDENTIFIER_ and shadows it.

It is the leftover of #24847 ("the keyword list now needs to be updated"): #24848 dropped only the BaseRule.g4 alternative, and #28071 removed five sibling keywords from both files but missed this one. #39012 removed unused DistSQL keyword tokens for the same reason.

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

CREATE MASK RULE address_random_replace (COLUMNS((NAME=phone, TYPE(NAME=MD5))));
SHOW MASK RULES FROM address_random_replace;
DROP MASK RULE address_random_replace;

Example codes for reproduce this issue (such as a github link).

N/A

Could a committer confirm there is no plan to reintroduce this algorithm? If there is, the keyword should instead gain a buildInMaskAlgorithmType alternative.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions