Description
OscarIdentifierProcessor.isReservedKeyword looks up the identifier in the all-uppercase RESERVED_KEYWORDS set without uppercasing it first, so a lowercase or mixed-case reserved word (e.g. select, Table) returns false, violating the SPI contract that every sibling dialect satisfies by uppercasing with Locale.ROOT.
The bug is masked only inside quoteIdentifier (which calls identifier.toUpperCase() before delegating), but any direct SPI caller (completion/metadata paths) gets the wrong answer, so lowercase reserved words would be left unquoted.
Location
chat2db-community-server/chat2db-community-plugins/chat2db-community-oscar/src/main/java/ai/chat2db/plugin/oscar/identifier/OscarIdentifierProcessor.java:28-30
@Override
public boolean isReservedKeyword(String identifier, Integer majorVersion, Integer minorVersion) {
return RESERVED_KEYWORDS.contains(identifier);
}
Sibling idiom (DM/SUNDB/XUGUDB all uppercase + null-guard):
return identifier != null && RESERVED_KEYWORDS.contains(identifier.toUpperCase(Locale.ROOT));
Impact
Reserved-keyword identifiers reached via direct isReservedKeyword callers are returned unquoted; inconsistent dialect behavior. Masked in the quoteIdentifier path.
Suggested fix
Match the sibling idiom (uppercase with Locale.ROOT + null guard) and add import java.util.Locale;:
@Override
public boolean isReservedKeyword(String identifier, Integer majorVersion, Integer minorVersion) {
return identifier != null && RESERVED_KEYWORDS.contains(identifier.toUpperCase(Locale.ROOT));
}
Related existing
None. No prior issue covers the Oscar reserved-keyword casing.
Description
OscarIdentifierProcessor.isReservedKeywordlooks up the identifier in the all-uppercaseRESERVED_KEYWORDSset without uppercasing it first, so a lowercase or mixed-case reserved word (e.g.select,Table) returnsfalse, violating the SPI contract that every sibling dialect satisfies by uppercasing withLocale.ROOT.The bug is masked only inside
quoteIdentifier(which callsidentifier.toUpperCase()before delegating), but any direct SPI caller (completion/metadata paths) gets the wrong answer, so lowercase reserved words would be left unquoted.Location
chat2db-community-server/chat2db-community-plugins/chat2db-community-oscar/src/main/java/ai/chat2db/plugin/oscar/identifier/OscarIdentifierProcessor.java:28-30Sibling idiom (DM/SUNDB/XUGUDB all uppercase + null-guard):
Impact
Reserved-keyword identifiers reached via direct
isReservedKeywordcallers are returned unquoted; inconsistent dialect behavior. Masked in thequoteIdentifierpath.Suggested fix
Match the sibling idiom (uppercase with
Locale.ROOT+ null guard) and addimport java.util.Locale;:Related existing
None. No prior issue covers the Oscar reserved-keyword casing.