!6708 浮点数特殊值控制添加A库隔离

Merge pull request !6708 from 王平云/fix1
This commit is contained in:
opengauss_bot
2024-11-26 03:58:04 +00:00
committed by Gitee

View File

@ -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");