[jOOQ/jOOQ#14738] Add parser support for Snowflake's EQUAL_NULL function
This commit is contained in:
parent
e3e7670562
commit
b959830be9
@ -6513,7 +6513,9 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
if (parseKeywordIf("EXISTS"))
|
||||
if (parseFunctionNameIf("EQUAL_NULL"))
|
||||
return parseEqualNull();
|
||||
else if (parseKeywordIf("EXISTS"))
|
||||
return exists(parseParenthesised(c -> parseWithOrSelect()));
|
||||
|
||||
break;
|
||||
@ -6613,16 +6615,13 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
|
||||
break;
|
||||
}
|
||||
|
||||
FieldOrRow left;
|
||||
boolean notOp = false;
|
||||
FieldOrRow left = parseConcat();
|
||||
int p = position();
|
||||
boolean not = parseKeywordIf("NOT");
|
||||
boolean isField = left instanceof Field;
|
||||
Comparator comp;
|
||||
TSQLOuterJoinComparator outer;
|
||||
boolean not;
|
||||
boolean notOp = false;
|
||||
|
||||
left = parseConcat();
|
||||
int p = position();
|
||||
not = parseKeywordIf("NOT");
|
||||
boolean isField = left instanceof Field;
|
||||
|
||||
|
||||
if (!not && !ignoreProEdition() && ((outer = parseTSQLOuterJoinComparatorIf()) != null) && requireProEdition()) {
|
||||
@ -6863,6 +6862,22 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
|
||||
}
|
||||
}
|
||||
|
||||
private final Condition parseEqualNull() {
|
||||
Condition result;
|
||||
|
||||
parse('(');
|
||||
FieldOrRow left = parseConcat();
|
||||
parse(',');
|
||||
|
||||
if (left instanceof Field f)
|
||||
result = f.isNotDistinctFrom((Field) toField(parseConcat()));
|
||||
else
|
||||
result = new RowIsDistinctFrom((Row) left, parseRow(((Row) left).size(), true), true);
|
||||
|
||||
parse(')');
|
||||
return result;
|
||||
}
|
||||
|
||||
private final Condition parsePredicateXMLExistsIf() {
|
||||
if (parseKeywordIf("XMLEXISTS")) {
|
||||
parse('(');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user