From f5e0d3b71343d081ce12857366f444ea32e64f18 Mon Sep 17 00:00:00 2001 From: i121426365 Date: Sat, 25 Jul 2020 11:44:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dxml=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=ADtimestamp=E6=8A=A5=E9=94=99=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/utils/adt/xml.cpp | 12 ++++++------ src/test/regress/expected/single_node_xml.out | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/backend/utils/adt/xml.cpp b/src/common/backend/utils/adt/xml.cpp index c398840a9d..ed5dfcd135 100755 --- a/src/common/backend/utils/adt/xml.cpp +++ b/src/common/backend/utils/adt/xml.cpp @@ -1862,12 +1862,12 @@ char* map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings) if (TIMESTAMP_NOT_FINITE(time_stamp)) { ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), - errmsg("time_stamp out of range"), - errdetail("XML does not support infinite time_stamp values."))); + errmsg("timestamp out of range"), + errdetail("XML does not support infinite timestamp values."))); } else if (timestamp2tm(time_stamp, NULL, &tm, &fsec, NULL, NULL) == 0) { EncodeDateTime(&tm, fsec, false, 0, NULL, USE_XSD_DATES, buf); } else { - ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), errmsg("time_stamp out of range"))); + ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), errmsg("timestamp out of range"))); } return pstrdup(buf); } @@ -1885,12 +1885,12 @@ char* map_sql_value_to_xml_value(Datum value, Oid type, bool xml_escape_strings) if (TIMESTAMP_NOT_FINITE(time_stamp)) { ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), - errmsg("time_stamp out of range"), - errdetail("XML does not support infinite time_stamp values."))); + errmsg("timestamp out of range"), + errdetail("XML does not support infinite timestamp values."))); } else if (timestamp2tm(time_stamp, &tz, &tm, &fsec, &tzn, NULL) == 0) { EncodeDateTime(&tm, fsec, true, tz, tzn, USE_XSD_DATES, buf); } else { - ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), errmsg("time_stamp out of range"))); + ereport(ERROR, (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), errmsg("timestamp out of range"))); } return pstrdup(buf); } diff --git a/src/test/regress/expected/single_node_xml.out b/src/test/regress/expected/single_node_xml.out index 31cb6296d0..d3d3f7c8d4 100644 --- a/src/test/regress/expected/single_node_xml.out +++ b/src/test/regress/expected/single_node_xml.out @@ -178,7 +178,7 @@ SELECT xmlelement(name foo, xmlattributes('2009-04-09 00:24:37'::timestamp as ba (1 row) SELECT xmlelement(name foo, xmlattributes('infinity'::timestamp as bar)); -ERROR: time_stamp out of range +ERROR: timestamp out of range SELECT xmlelement(name foo, xmlattributes('<>&"''' as funny, xml 'br' as funnier)); xmlelement ------------------------------------------------------------ -- Gitee