|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.142 2006/07/2600:34:48 momjian Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.143 2006/07/2619:31:51 tgl Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
@@ -780,7 +780,8 @@ coerce_record_to_complex(ParseState *pstate, Node *node, |
780 | 780 | return (Node*)rowexpr; |
781 | 781 | } |
782 | 782 |
|
783 | | -/* coerce_to_boolean() |
| 783 | +/* |
| 784 | + * coerce_to_boolean() |
784 | 785 | *Coerce an argument of a construct that requires boolean input |
785 | 786 | *(AND, OR, NOT, etc). Also check that input is not a set. |
786 | 787 | * |
@@ -819,8 +820,9 @@ coerce_to_boolean(ParseState *pstate, Node *node, |
819 | 820 | returnnode; |
820 | 821 | } |
821 | 822 |
|
822 | | -/* coerce_to_integer() |
823 | | - *Coerce an argument of a construct that requires integer input |
| 823 | +/* |
| 824 | + * coerce_to_integer() |
| 825 | + *Coerce an argument of a construct that requires integer input. |
824 | 826 | *Also check that input is not a set. |
825 | 827 | * |
826 | 828 | * Returns the possibly-transformed node tree. |
@@ -857,45 +859,47 @@ coerce_to_integer(ParseState *pstate, Node *node, |
857 | 859 |
|
858 | 860 | returnnode; |
859 | 861 | } |
860 | | - |
861 | | -/* coerce_to_integer64() |
862 | | - * Coerce an argument of a construct that requires integer input |
863 | | - * (LIMIT, OFFSET). Also check that input is not a set. |
| 862 | + |
| 863 | +/* |
| 864 | + * coerce_to_bigint() |
| 865 | + *Coerce an argument of a construct that requires int8 input. |
| 866 | + *Also check that input is not a set. |
864 | 867 | * |
865 | 868 | * Returns the possibly-transformed node tree. |
866 | 869 | * |
867 | 870 | * As with coerce_type, pstate may be NULL if no special unknown-Param |
868 | 871 | * processing is wanted. |
869 | 872 | */ |
870 | 873 | Node* |
871 | | -coerce_to_integer64(ParseState*pstate,Node*node, |
872 | | -constchar*constructName) |
| 874 | +coerce_to_bigint(ParseState*pstate,Node*node, |
| 875 | +constchar*constructName) |
873 | 876 | { |
874 | | -OidinputTypeId=exprType(node); |
| 877 | +OidinputTypeId=exprType(node); |
875 | 878 |
|
876 | 879 | if (inputTypeId!=INT8OID) |
877 | 880 | { |
878 | 881 | node=coerce_to_target_type(pstate,node,inputTypeId, |
879 | | -INT8OID,-1,COERCION_ASSIGNMENT, |
| 882 | +INT8OID,-1, |
| 883 | +COERCION_ASSIGNMENT, |
880 | 884 | COERCE_IMPLICIT_CAST); |
881 | 885 | if (node==NULL) |
882 | | -ereport(ERROR, |
883 | | -(errcode(ERRCODE_DATATYPE_MISMATCH), |
884 | | -/* translator: first %s is name of a SQL construct, eg LIMIT */ |
885 | | -errmsg("argument of %s must be typeinteger, not type %s", |
886 | | -constructName,format_type_be(inputTypeId)))); |
| 886 | +ereport(ERROR, |
| 887 | +(errcode(ERRCODE_DATATYPE_MISMATCH), |
| 888 | +/* translator: first %s is name of a SQL construct, eg LIMIT */ |
| 889 | +errmsg("argument of %s must be typebigint, not type %s", |
| 890 | +constructName,format_type_be(inputTypeId)))); |
887 | 891 | } |
888 | 892 |
|
889 | 893 | if (expression_returns_set(node)) |
890 | 894 | ereport(ERROR, |
891 | | -(errcode(ERRCODE_DATATYPE_MISMATCH), |
892 | | -/* translator: %s is name of a SQL construct, eg LIMIT */ |
893 | | -errmsg("argument of %s must not return a set", |
894 | | -constructName))); |
| 895 | +(errcode(ERRCODE_DATATYPE_MISMATCH), |
| 896 | +/* translator: %s is name of a SQL construct, eg LIMIT */ |
| 897 | +errmsg("argument of %s must not return a set", |
| 898 | +constructName))); |
895 | 899 |
|
896 | 900 | returnnode; |
897 | 901 | } |
898 | | -
|
| 902 | + |
899 | 903 |
|
900 | 904 | /* select_common_type() |
901 | 905 | *Determine the common supertype of a list of input expression types. |
|