diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-17 00:11:05 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-17 00:11:05 +0000 |
commit | 0f4ff460c479e9c9bff90e8208f0a5272b9925df (patch) | |
tree | f22187ef35d7284cbc42f9255c369378d16ffe07 /src/backend/optimizer/path/indxpath.c | |
parent | 51d7741db13332523708cd7ac75a8ca60c9d16a9 (diff) |
Fix up the remaining places where the expression node structure would lose
available information about the typmod of an expression; namely, Const,
ArrayRef, ArrayExpr, and EXPR and ARRAY SubLinks. In the ArrayExpr and
SubLink cases it wasn't really the data structure's fault, but exprTypmod()
being lazy. This seems like a good idea in view of the expected increase in
typmod usage from Teodor's work to allow user-defined types to have typmods.
In particular this responds to the concerns we had about eliminating the
special-purpose hack that exprTypmod() used to have for BPCHAR Consts.
We can now tell whether or not such a Const has been cast to a specific
length, and report or display properly if so.
initdb forced due to changes in stored rules.
Diffstat (limited to 'src/backend/optimizer/path/indxpath.c')
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index 0146cacf4e5..04e029beb28 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.216 2007/01/20 20:45:39 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.217 2007/03/17 00:11:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2628,7 +2628,7 @@ network_prefix_quals(Node *leftop, Oid expr_op, Oid opfamily, Datum rightop) expr = make_opclause(opr1oid, BOOLOID, false, (Expr *) leftop, - (Expr *) makeConst(datatype, -1, opr1right, + (Expr *) makeConst(datatype, -1, -1, opr1right, false, false)); result = list_make1(make_restrictinfo(expr, true, false, false, NULL)); @@ -2643,7 +2643,7 @@ network_prefix_quals(Node *leftop, Oid expr_op, Oid opfamily, Datum rightop) expr = make_opclause(opr2oid, BOOLOID, false, (Expr *) leftop, - (Expr *) makeConst(datatype, -1, opr2right, + (Expr *) makeConst(datatype, -1, -1, opr2right, false, false)); result = lappend(result, make_restrictinfo(expr, true, false, false, NULL)); @@ -2683,6 +2683,7 @@ string_to_const(const char *str, Oid datatype) { Datum conval = string_to_datum(str, datatype); - return makeConst(datatype, ((datatype == NAMEOID) ? NAMEDATALEN : -1), + return makeConst(datatype, -1, + ((datatype == NAMEOID) ? NAMEDATALEN : -1), conval, false, false); } |