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

Parser shouldn't fail with NumberFormatException #16336

Closed
lukaseder opened this issue Feb 26, 2024 · 1 comment
Closed

Parser shouldn't fail with NumberFormatException #16336

lukaseder opened this issue Feb 26, 2024 · 1 comment

Comments

@lukaseder
Copy link
Member

As shown here: #16330, it is possible for the parser to fail with a NumberFormatException (or something similar) when it would be expected to get a ParserException:

java.lang.NumberFormatException: For input string: "0.0000000000000000e"
	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
	at java.base/java.lang.Double.parseDouble(Double.java:651)
	at org.jooq.impl.DefaultParseContext.parseUnsignedNumericLiteralIf(ParserImpl.java:13737)
	at org.jooq.impl.DefaultParseContext.parseFieldUnsignedNumericLiteralIf(ParserImpl.java:13716)
	at org.jooq.impl.DefaultParseContext.parseTerm(ParserImpl.java:9493)
	at org.jooq.impl.DefaultParseContext.parseUnaryOps(ParserImpl.java:8364)
	at org.jooq.impl.DefaultParseContext.parseExp(ParserImpl.java:8338)
	at org.jooq.impl.DefaultParseContext.parseFactor(ParserImpl.java:8315)
	at org.jooq.impl.DefaultParseContext.parseSum(ParserImpl.java:8256)
	at org.jooq.impl.DefaultParseContext.parseNumericOp(ParserImpl.java:8205)
	at org.jooq.impl.DefaultParseContext.parseCollated(ParserImpl.java:8054)
	at org.jooq.impl.DefaultParseContext.parseConcat(ParserImpl.java:8037)
	at org.jooq.impl.DefaultParseContext.parsePredicate(ParserImpl.java:6747)
	at org.jooq.impl.DefaultParseContext.parseNot(ParserImpl.java:6578)
	at org.jooq.impl.DefaultParseContext.parseAnd(ParserImpl.java:6568)
	at org.jooq.impl.DefaultParseContext.parseXor(ParserImpl.java:6559)
	at org.jooq.impl.DefaultParseContext.parseOr(ParserImpl.java:6550)
	at org.jooq.impl.DefaultParseContext.parseFieldOrRow(ParserImpl.java:7948)
	at org.jooq.impl.DefaultParseContext.parseTerm(ParserImpl.java:9552)
	at org.jooq.impl.DefaultParseContext.parseUnaryOps(ParserImpl.java:8364)
	at org.jooq.impl.DefaultParseContext.parseExp(ParserImpl.java:8338)
	at org.jooq.impl.DefaultParseContext.parseFactor(ParserImpl.java:8315)
	at org.jooq.impl.DefaultParseContext.parseSum(ParserImpl.java:8256)
	at org.jooq.impl.DefaultParseContext.parseNumericOp(ParserImpl.java:8205)
	at org.jooq.impl.DefaultParseContext.parseCollated(ParserImpl.java:8054)
	at org.jooq.impl.DefaultParseContext.parseConcat(ParserImpl.java:8037)
	at org.jooq.impl.DefaultParseContext.parsePredicate(ParserImpl.java:6747)
	at org.jooq.impl.DefaultParseContext.parseNot(ParserImpl.java:6578)
	at org.jooq.impl.DefaultParseContext.parseAnd(ParserImpl.java:6568)
	at org.jooq.impl.DefaultParseContext.parseXor(ParserImpl.java:6559)
	at org.jooq.impl.DefaultParseContext.parseOr(ParserImpl.java:6550)
	at org.jooq.impl.DefaultParseContext.parseFieldOrRow(ParserImpl.java:7948)
	at org.jooq.impl.DefaultParseContext.parseTerm(ParserImpl.java:9552)
	at org.jooq.impl.DefaultParseContext.parseUnaryOps(ParserImpl.java:8364)
	at org.jooq.impl.DefaultParseContext.parseExp(ParserImpl.java:8338)
	at org.jooq.impl.DefaultParseContext.parseFactor(ParserImpl.java:8315)
	at org.jooq.impl.DefaultParseContext.parseSum(ParserImpl.java:8256)
	at org.jooq.impl.DefaultParseContext.parseNumericOp(ParserImpl.java:8205)
	at org.jooq.impl.DefaultParseContext.parseCollated(ParserImpl.java:8054)
	at org.jooq.impl.DefaultParseContext.parseConcat(ParserImpl.java:8037)
	at org.jooq.impl.DefaultParseContext.parsePredicate(ParserImpl.java:6747)
	at org.jooq.impl.DefaultParseContext.parseNot(ParserImpl.java:6578)
	at org.jooq.impl.DefaultParseContext.parseAnd(ParserImpl.java:6568)
	at org.jooq.impl.DefaultParseContext.parseXor(ParserImpl.java:6559)
	at org.jooq.impl.DefaultParseContext.parseOr(ParserImpl.java:6550)
	at org.jooq.impl.DefaultParseContext.parseField(ParserImpl.java:7953)
	at org.jooq.impl.DefaultParseContext.lambda$parseField0$8(ParserImpl.java:1009)
	at org.jooq.impl.DefaultParseContext.wrap(ParserImpl.java:15244)
	at org.jooq.impl.DefaultParseContext.parseField0(ParserImpl.java:1009)
	at org.jooq.impl.ParserImpl.parseField(ParserImpl.java:848)
	at org.jooq.impl.ParserImpl.parseField(ParserImpl.java:843)
	at org.jooq.impl.MetaImpl$MetaTable.initColumns(MetaImpl.java:1399)
	at org.jooq.impl.MetaImpl$MetaTable.<init>(MetaImpl.java:941)
	at org.jooq.impl.MetaImpl$MetaSchema.lambda$getTables$2(MetaImpl.java:508)
	at org.jooq.impl.Tools.map(Tools.java:2520)
	at org.jooq.impl.MetaImpl$MetaSchema.getTables(MetaImpl.java:477)
	at org.jooq.impl.MetaImpl.lambda$getTables0$3(MetaImpl.java:309)
	at org.jooq.impl.Tools.flatMap(Tools.java:2535)
	at org.jooq.impl.MetaImpl.getTables0(MetaImpl.java:309)
	at org.jooq.impl.AbstractMeta.lambda$initTables$4(AbstractMeta.java:186)
	at org.jooq.impl.AbstractMeta.get(AbstractMeta.java:409)
	at org.jooq.impl.AbstractMeta.initTables(AbstractMeta.java:186)
	at org.jooq.impl.AbstractMeta.getTables(AbstractMeta.java:172)
	at org.jooq.impl.AbstractMeta.getTables(AbstractMeta.java:167)

The relevant MetaImpl logic doesn't expect the NFE either, which is why it fails for an otherwise cosmetic problem.

@lukaseder lukaseder added this to the Version 3.20.0 milestone Feb 26, 2024
@lukaseder lukaseder added this to To do in 3.20 Other improvements via automation Feb 26, 2024
lukaseder added a commit that referenced this issue Feb 27, 2024
This includes:

- [#16347] Parser fails with StringIndexOutOfBoundsException when encountering invalid PostgreSQL unicode literal
lukaseder added a commit that referenced this issue Feb 27, 2024
This includes:

- [#16347] Parser fails with StringIndexOutOfBoundsException when encountering invalid PostgreSQL unicode literal
lukaseder added a commit that referenced this issue Feb 27, 2024
This includes:

- [#16347] Parser fails with StringIndexOutOfBoundsException when encountering invalid PostgreSQL unicode literal
lukaseder added a commit that referenced this issue Feb 27, 2024
This includes:

- [#16347] Parser fails with StringIndexOutOfBoundsException when encountering invalid PostgreSQL unicode literal
3.20 Other improvements automation moved this from To do to Done Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant