mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
New pg_attribute.atttypmod for type-specific information like
varchar length. Cleans up code so attlen is always length. Removed varchar() hack added earlier. Will fix bug in selecting varchar() fields, and varchar() can be variable length.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.6 1998/01/05 03:32:27 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.7 1998/01/16 23:20:18 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -30,7 +30,7 @@
|
||||
#include "parser/parse_target.h"
|
||||
#include "utils/builtins.h"
|
||||
|
||||
static Node *parser_typecast(Value *expr, TypeName *typename, int typlen);
|
||||
static Node *parser_typecast(Value *expr, TypeName *typename, int atttypmod);
|
||||
|
||||
/*
|
||||
* transformExpr -
|
||||
@ -403,7 +403,7 @@ handleNestedDots(ParseState *pstate, Attr *attr, int *curr_resno, int precedence
|
||||
}
|
||||
|
||||
static Node *
|
||||
parser_typecast(Value *expr, TypeName *typename, int typlen)
|
||||
parser_typecast(Value *expr, TypeName *typename, int atttypmod)
|
||||
{
|
||||
/* check for passing non-ints */
|
||||
Const *adt;
|
||||
@ -492,7 +492,7 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
|
||||
}
|
||||
#endif
|
||||
|
||||
cp = stringTypeString(tp, const_string, typlen);
|
||||
cp = stringTypeString(tp, const_string, atttypmod);
|
||||
|
||||
if (!typeByVal(tp))
|
||||
{
|
||||
@ -540,7 +540,7 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
|
||||
}
|
||||
|
||||
Node *
|
||||
parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
|
||||
parser_typecast2(Node *expr, Oid exprType, Type tp, int atttypmod)
|
||||
{
|
||||
/* check for passing non-ints */
|
||||
Const *adt;
|
||||
@ -627,8 +627,7 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
|
||||
return ((Node *) adt);
|
||||
}
|
||||
|
||||
cp = stringTypeString(tp, const_string, typlen);
|
||||
|
||||
cp = stringTypeString(tp, const_string, atttypmod);
|
||||
|
||||
if (!typeByVal(tp))
|
||||
{
|
||||
|
Reference in New Issue
Block a user