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

Timeout configuration option should accept long not int #1758

Closed
zaza opened this issue Apr 4, 2023 · 0 comments
Closed

Timeout configuration option should accept long not int #1758

zaza opened this issue Apr 4, 2023 · 0 comments

Comments

@zaza
Copy link
Contributor

zaza commented Apr 4, 2023

When waiting for a parser to complete its job in CCJSqlParser.parseStatement(CCJSqlParser) we call Future.get(long, TimeUnit) which clearly expects a long value to be passed, however the project does this:

statement = future.get( parser.getConfiguration().getAsInteger(Feature.timeOut), TimeUnit.MILLISECONDS);
Note the getAsInteger method.

Furthermore when using a custom value for the timeout setting it would be more convenient to just do:
CCJSqlParserUtil.parse(sql, parser -> parser.withTimeOut(TimeUnit.SECONDS.toMillis(30)))
instead of current:
CCJSqlParserUtil.parse(sql, parser -> parser.withTimeOut(Long.valueOf(TimeUnit.SECONDS.toMillis(30)).intValue()))

zaza added a commit to zaza/JSqlParser that referenced this issue Apr 4, 2023
zaza added a commit to zaza/JSqlParser that referenced this issue Apr 4, 2023
@wumpz wumpz closed this as completed in 3314edf Apr 27, 2023
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

No branches or pull requests

1 participant