OSDN Git Service

Clean up handling of explicit NULL constants. Cases like
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 24 Dec 1999 06:43:34 +0000 (06:43 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 24 Dec 1999 06:43:34 +0000 (06:43 +0000)
commit350cb386af0d5caf5ae32781e80b8622fb5e4fe1
tree9bb76439a628b4db461dc4e1fb8f95753e06c009
parentbd5ea42a8d2f6cf484f9b10d8c13894fe88ee7e8
Clean up handling of explicit NULL constants.  Cases like
SELECT null::text;
SELECT int4fac(null);
work as expected now.  In some cases a NULL must be surrounded by
parentheses:
SELECT 2 + null;                 fails
SELECT 2 + (null);               OK
This is a grammatical ambiguity that seems difficult to avoid.  Other
than that, NULLs seem to behave about like you'd expect.  The internal
implementation is that NULL constants are typed as UNKNOWN (like
untyped string constants) until the parser can deduce the right type.
src/backend/nodes/equalfuncs.c
src/backend/parser/parse_expr.c
src/backend/parser/parse_node.c
src/backend/utils/adt/ruleutils.c