-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Consider the following statement:
SELECT STRINGDECODE(X'5c38'); -- StringIndexOutOfBoundsExceptionUnexpectedly, the call to STRINGDECODE results in an StringIndexOutOfBoundsException:
Caused by: java.lang.StringIndexOutOfBoundsException: begin 1, end 4, length 2
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
at java.base/java.lang.String.substring(String.java:1874)
at org.h2.util.StringUtils.javaDecode(StringUtils.java:327)
at org.h2.expression.function.StringFunction1.getValue(StringFunction1.java:137)
at org.h2.expression.function.StringFunction1.optimize(StringFunction1.java:273)
at org.h2.command.query.Select.prepare(Select.java:1170)
at org.h2.command.Parser.prepareCommand(Parser.java:951)
at org.h2.engine.SessionLocal.prepareLocal(SessionLocal.java:618)
at org.h2.engine.SessionLocal.prepareCommand(SessionLocal.java:556)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1139)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:221)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:207)
I found this based on commit 2b77de6.
Metadata
Metadata
Assignees
Labels
No labels