From 73874a06f02691b32c07318e543d83e7947efa51 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 31 Oct 2000 10:22:13 +0000 Subject: Change the parser to convert SQL "position" and "substring" syntax to position() and substring() functions, so that it works transparently for bit types as well. Alias the text functions appropriately. Add position() for bit types. Add new constant node T_BitString that represents literals of the form B'1001 and pass those to zpbit type. --- src/backend/parser/parse_node.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/backend/parser/parse_node.c') diff --git a/src/backend/parser/parse_node.c b/src/backend/parser/parse_node.c index 2ff4d9c990b..d23c5c1e7c7 100644 --- a/src/backend/parser/parse_node.c +++ b/src/backend/parser/parse_node.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.47 2000/09/29 18:21:36 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.48 2000/10/31 10:22:11 petere Exp $ * *------------------------------------------------------------------------- */ @@ -31,6 +31,7 @@ #include "parser/parse_target.h" #include "parser/parse_type.h" #include "utils/builtins.h" +#include "utils/varbit.h" #include "utils/lsyscache.h" #include "utils/syscache.h" @@ -473,6 +474,16 @@ make_const(Value *value) typebyval = false; break; + case T_BitString: + val = DirectFunctionCall3(zpbit_in, + CStringGetDatum(strVal(value)), + ObjectIdGetDatum(InvalidOid), + Int32GetDatum(-1)); + typeid = ZPBITOID; + typelen = -1; + typebyval = false; + break; + default: elog(NOTICE, "make_const: unknown type %d", nodeTag(value)); /* FALLTHROUGH */ -- cgit v1.2.3