Skip to content

bug(oceanbase-oracle): COMMENT DDL doubles backslashes (regression vs base Oracle) #2428

Description

@Aias00

Description

OceanbaseOracleMetaData.tableDDL builds COMMENT ON ... IS using EasyStringUtils.escapeAndQuoteString(comment), which doubles both ' and \. The base OracleMetaData correctly uses OracleIdentifierProcessor.quoteStringLiteral (only doubles '), and OceanBase Oracle mode treats \ as a literal character (OceanbaseOracleIdentifierProcessor extends OracleIdentifierProcessor without overriding escape). So a comment containing \ (Windows paths, regex) is regenerated as \\ and persisted corrupted when the DDL is re-applied.

Location

chat2db-community-plugins/chat2db-community-oceanbase-oracle/.../OceanbaseOracleMetaData.java:52,64 (tableComment, columnComment). Base OracleMetaData uses quoteStringLiteral; OracleIdentifierProcessor.quoteStringLiteral only doubles '.

Impact

Comments containing backslashes are persisted as doubled-backslash when the regenerated DDL is executed.

Suggested fix

Use OceanbaseOracleIdentifierProcessor.INSTANCE.quoteStringLiteral(comment) (dialect-correct, only escapes '), mirroring the base OracleMetaData.

Related existing

None.

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions