From 92346f618f9311dd2c54b5717f5681c00e3c63f9 Mon Sep 17 00:00:00 2001 From: wangpingyun <2418191738@qq.com> Date: Mon, 25 Nov 2024 09:51:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=AE=E7=82=B9=E6=95=B0=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=80=BCGUC=E6=B7=BB=E5=8A=A0A=E5=BA=93=E9=9A=94=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/utils/adt/float.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/backend/utils/adt/float.cpp b/src/common/backend/utils/adt/float.cpp index 814d6ced8..e1e60590e 100644 --- a/src/common/backend/utils/adt/float.cpp +++ b/src/common/backend/utils/adt/float.cpp @@ -397,7 +397,7 @@ Datum float4out(PG_FUNCTION_ARGS) errno_t rc = EOK; if (isnan(num)) { - if (u_sess->attr.attr_sql.enable_binary_special_a_format) { + if (DB_IS_CMPT(A_FORMAT) && u_sess->attr.attr_sql.enable_binary_special_a_format && !is_req_from_jdbc()) { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "Nan"); } else { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "NaN"); @@ -408,7 +408,7 @@ Datum float4out(PG_FUNCTION_ARGS) switch (is_infinite(num)) { case 1: - if (u_sess->attr.attr_sql.enable_binary_special_a_format) { + if (DB_IS_CMPT(A_FORMAT) && u_sess->attr.attr_sql.enable_binary_special_a_format && !is_req_from_jdbc()) { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "Inf"); } else { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "Infinity"); @@ -416,7 +416,7 @@ Datum float4out(PG_FUNCTION_ARGS) securec_check_ss(rc, "\0", "\0"); break; case -1: - if (u_sess->attr.attr_sql.enable_binary_special_a_format) { + if (DB_IS_CMPT(A_FORMAT) && u_sess->attr.attr_sql.enable_binary_special_a_format && !is_req_from_jdbc()) { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "-Inf"); } else { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "-Infinity"); @@ -639,7 +639,7 @@ Datum float8out(PG_FUNCTION_ARGS) errno_t rc = EOK; if (isnan(num)) { - if (u_sess->attr.attr_sql.enable_binary_special_a_format && !is_req_from_jdbc()) { + if (DB_IS_CMPT(A_FORMAT) && u_sess->attr.attr_sql.enable_binary_special_a_format && !is_req_from_jdbc()) { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "Nan"); } else { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "NaN"); @@ -649,7 +649,7 @@ Datum float8out(PG_FUNCTION_ARGS) } switch (is_infinite(num)) { case 1: - if (u_sess->attr.attr_sql.enable_binary_special_a_format && !is_req_from_jdbc()) { + if (DB_IS_CMPT(A_FORMAT) && u_sess->attr.attr_sql.enable_binary_special_a_format && !is_req_from_jdbc()) { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "Inf"); } else { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "Infinity"); @@ -657,7 +657,7 @@ Datum float8out(PG_FUNCTION_ARGS) securec_check(rc, "\0", "\0"); break; case -1: - if (u_sess->attr.attr_sql.enable_binary_special_a_format && !is_req_from_jdbc()) { + if (DB_IS_CMPT(A_FORMAT) && u_sess->attr.attr_sql.enable_binary_special_a_format && !is_req_from_jdbc()) { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "-Inf"); } else { rc = strcpy_s(ascii, MAXDOUBLEWIDTH + 1, "-Infinity");