[jOOQ/jOOQ#16368] Parser always parses NULL literal of type BOOLEAN
This commit is contained in:
parent
eaf1a766b5
commit
c65e1e1cd0
@ -11860,7 +11860,7 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
|
||||
return null;
|
||||
}
|
||||
|
||||
private final Field<Boolean> parseBooleanValueExpressionIf() {
|
||||
private final Field<?> parseBooleanValueExpressionIf() {
|
||||
TruthValue truth = parseTruthValueIf();
|
||||
|
||||
if (truth != null) {
|
||||
@ -11869,8 +11869,10 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
|
||||
return inline(true);
|
||||
case T_FALSE:
|
||||
return inline(false);
|
||||
|
||||
// [#16368] We cannot decide the data type at this point
|
||||
case T_NULL:
|
||||
return inline((Boolean) null);
|
||||
return inline(null, OTHER);
|
||||
default:
|
||||
throw exception("Truth value not supported: " + truth);
|
||||
}
|
||||
|
||||
@ -2692,24 +2692,6 @@ package org.jooq.impl;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -3979,6 +3979,28 @@ final class Tools {
|
||||
|| field instanceof ConvertedVal && ((ConvertedVal<?>) field).delegate instanceof Val;
|
||||
}
|
||||
|
||||
static final boolean isVal(QueryPart p, Predicate<? super Val<?>> predicate) {
|
||||
if (p instanceof Val<?> v) {
|
||||
return predicate.test(v);
|
||||
}
|
||||
else if (p instanceof ConvertedVal<?> v) {
|
||||
return isVal(v.delegate, predicate);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
static final <T> boolean isVal0(Field<T> p, Predicate<? super Val<T>> predicate) {
|
||||
if (p instanceof Val<T> v) {
|
||||
return predicate.test(v);
|
||||
}
|
||||
else if (p instanceof ConvertedVal<T> v) {
|
||||
return isVal0((Field<T>) v.delegate, predicate);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
static final boolean isWindow(QueryPart part) {
|
||||
return part instanceof AbstractWindowFunction && ((AbstractWindowFunction<?>) part).isWindow();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user