-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Consider the following test case:
CREATE TABLE T0(c0 DOUBLE);
INSERT INTO T0(c0) VALUES (0);
SELECT * FROM T0 WHERE c0 % 0.1; -- General error: "java.lang.ClassCastException: class org.h2.value.ValueDecfloat cannot be cast to class org.h2.value.ValueNumeric (org.h2.value.ValueDecfloat and org.h2.value.ValueNumeric are in unnamed module of loader 'app')"; Unexpectedly, the SELECT causes a ClassCastException, which seems like an internal error to me:
Caused by: java.lang.ClassCastException: class org.h2.value.ValueDecfloat cannot be cast to class org.h2.value.ValueNumeric (org.h2.value.ValueDecfloat and org.h2.value.ValueNumeric are in unnamed module of loader 'app')
at org.h2.value.ValueBigDecimalBase.modulus(ValueBigDecimalBase.java:81)
at org.h2.expression.function.MathFunction.getValue(MathFunction.java:93)
at org.h2.expression.function.Function1_2.getValue(Function1_2.java:39)
at org.h2.expression.Expression.getBooleanValue(Expression.java:334)
at org.h2.command.query.Select.isConditionMet(Select.java:449)
at org.h2.command.query.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1824)
at org.h2.result.LazyResult.hasNext(LazyResult.java:104)
at org.h2.result.LazyResult.next(LazyResult.java:63)
at org.h2.command.query.Select.queryFlat(Select.java:722)
at org.h2.command.query.Select.queryWithoutCache(Select.java:828)
at org.h2.command.query.Query.queryWithoutCacheLazyCheck(Query.java:198)
at org.h2.command.query.Query.query(Query.java:495)
at org.h2.command.query.Query.query(Query.java:458)
at org.h2.command.CommandContainer.query(CommandContainer.java:255)
at org.h2.command.Command.executeQuery(Command.java:190)
I found this based on commit 30f0187.
Metadata
Metadata
Assignees
Labels
No labels