diff options
| author | Tom Lane | 2015-02-23 17:46:46 +0000 |
|---|---|---|
| committer | Tom Lane | 2015-02-23 17:46:50 +0000 |
| commit | 56be925e4b8f5b1c0e6716ca5cbe0360d1229f50 (patch) | |
| tree | 1b00fd91c5044e62ee515a2e90862a8855d727a2 /src/include | |
| parent | 296f3a6053844089bc533630fffafaba8f016384 (diff) | |
Further tweaking of raw grammar output to distinguish different inputs.
Use a different A_Expr_Kind for LIKE/ILIKE/SIMILAR TO constructs, so that
they can be distinguished from direct invocation of the underlying
operators. Also, postpone selection of the operator name when transforming
"x IN (select)" to "x = ANY (select)", so that those syntaxes can be told
apart at parse analysis time.
I had originally thought I'd also have to do something special for the
syntaxes IS NOT DISTINCT FROM, IS NOT DOCUMENT, and x NOT IN (SELECT...),
which the grammar translates as though they were NOT (construct).
On reflection though, we can distinguish those cases reliably by noting
whether the parse location shown for the NOT is the same as for its child
node. This only requires tweaking the parse locations for NOT IN, which
I've done here.
These changes should have no effect outside the parser; they're just in
support of being able to give accurate warnings for planned operator
precedence changes.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/nodes/parsenodes.h | 3 | ||||
| -rw-r--r-- | src/include/nodes/primnodes.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index d7b6148cd5..ac133023b4 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -233,6 +233,9 @@ typedef enum A_Expr_Kind AEXPR_NULLIF, /* NULLIF - name must be "=" */ AEXPR_OF, /* IS [NOT] OF - name must be "=" or "<>" */ AEXPR_IN, /* [NOT] IN - name must be "=" or "<>" */ + AEXPR_LIKE, /* [NOT] LIKE - name must be "~~" or "!~~" */ + AEXPR_ILIKE, /* [NOT] ILIKE - name must be "~~*" or "!~~*" */ + AEXPR_SIMILAR, /* [NOT] SIMILAR - name must be "~" or "!~" */ AEXPR_BETWEEN, /* name must be "BETWEEN" */ AEXPR_NOT_BETWEEN, /* name must be "NOT BETWEEN" */ AEXPR_BETWEEN_SYM, /* name must be "BETWEEN SYMMETRIC" */ diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index b004da6dc4..dbc5a35cc8 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -994,7 +994,6 @@ typedef struct MinMaxExpr * Note: result type/typmod/collation are not stored, but can be deduced * from the XmlExprOp. The type/typmod fields are just used for display * purposes, and are NOT necessarily the true result type of the node. - * (We also use type == InvalidOid to mark a not-yet-parse-analyzed XmlExpr.) */ typedef enum XmlExprOp { |
