◐ Shell
reader mode source ↗
Skip to content

use Locale.ROOT for case-insensitive keyword normalisation#2437

Open
dxbjavid wants to merge 1 commit into
JSQLParser:masterfrom
dxbjavid:locale-root-keyword-folding
Open

use Locale.ROOT for case-insensitive keyword normalisation#2437
dxbjavid wants to merge 1 commit into
JSQLParser:masterfrom
dxbjavid:locale-root-keyword-folding

Conversation

@dxbjavid

Copy link
Copy Markdown

several parser helpers fold SQL keywords and identifiers to upper case with the no-argument toUpperCase(), which uses the JVM default locale. under a Turkish or Azeri locale a keyword containing the letter i (union, intersect, minus, time, timestamp, like and friends) folds to a dotted İ instead of ASCII I, so the following Enum.valueOf lookup throws IllegalArgumentException and a valid statement fails to parse, while deparsing emits the wrong casing. switching the conversions to Locale.ROOT keeps case folding of SQL text independent of the runtime locale.

Signed-off-by: dxbjavid <dxbjavid@gmail.com>
@manticore-projects

Copy link
Copy Markdown
Contributor

Looks good but I need to fix the build script first :-(

@dxbjavid

Copy link
Copy Markdown
Author

no rush at all. happy to rebase onto master once the build script is sorted, just give me a shout if you need anything changed on my side.

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.

2 participants