Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] JSQLParser Version 5.0 : Failure to parse CHARACTER SET #2091

Open
micheltuu opened this issue Oct 18, 2024 · 0 comments
Open

[BUG] JSQLParser Version 5.0 : Failure to parse CHARACTER SET #2091

micheltuu opened this issue Oct 18, 2024 · 0 comments
Labels
DDL DDL statement related MySQL MySQL specific issue Sponsor needed

Comments

@micheltuu
Copy link

micheltuu commented Oct 18, 2024

Failing SQL Feature:

Starting with JSQLParser 5.0, CHARACTER SET is not properly parsed and result in an error

SQL Example:

E.g. this query

ALTER TABLE `jobs`.`runs` MODIFY COLUMN quartzId varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN triggerInfo text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
MODIFY COLUMN lifeCycleState varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
MODIFY COLUMN userVisibleState varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
MODIFY COLUMN sparkConf text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
MODIFY COLUMN clusterId varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN sparkVersion varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN runOutputPathName varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN nodeTypeId varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN actionIds varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
MODIFY COLUMN miscMessage varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
MODIFY COLUMN thinStats longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

results in

net.sf.jsqlparser.JSQLParserException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "SET" "SET"
    at line 2, column 42.

while it works fine with JSQLParser 4.9

Software Information:

JSqlParser version 5.0
Mysql 8

@manticore-projects manticore-projects added MySQL MySQL specific issue DDL DDL statement related Sponsor needed labels Oct 24, 2024
@JSQLParser JSQLParser deleted a comment Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DDL DDL statement related MySQL MySQL specific issue Sponsor needed
Projects
None yet
Development

No branches or pull requests

3 participants
@manticore-projects @micheltuu and others