From 91ff86f7754f771d37a55bfb20a5b88a98a78671 Mon Sep 17 00:00:00 2001 From: wangpingyun <2418191738@qq.com> Date: Thu, 21 Nov 2024 10:36:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=B5=AE=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E5=80=BC=E6=98=BE=E7=A4=BA=E6=8E=A7=E5=88=B6?= =?UTF-8?q?GUC=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contrib/gms_compress/expected/gms_compress.out | 6 +++--- contrib/gms_compress/sql/gms_compress.sql | 2 +- src/bin/gs_guc/cluster_guc.conf | 2 +- src/common/backend/utils/adt/float.cpp | 12 ++++++------ src/common/backend/utils/misc/guc/guc_sql.cpp | 4 ++-- src/include/knl/knl_guc/knl_session_attr_sql.h | 2 +- src/test/regress/expected/test_binary_suffix.out | 2 +- src/test/regress/sql/test_binary_suffix.sql | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/contrib/gms_compress/expected/gms_compress.out b/contrib/gms_compress/expected/gms_compress.out index 670f06f41..464e708ca 100644 --- a/contrib/gms_compress/expected/gms_compress.out +++ b/contrib/gms_compress/expected/gms_compress.out @@ -940,13 +940,13 @@ BEGIN v_handle := GMS_COMPRESS.LZ_UNCOMPRESS_OPEN(content); v_bool := GMS_COMPRESS.ISOPEN(v_handle); RAISE NOTICE 'v_bool=%', v_bool; - GMS_COMPRESS.LZ_UNCOMPRESS_CLOSE(v_handle,content); + GMS_COMPRESS.LZ_UNCOMPRESS_CLOSE(v_handle); v_bool := GMS_COMPRESS.ISOPEN(v_handle); RAISE NOTICE 'v_bool=%', v_bool; END; / -ERROR: when invoking function gms_compress.lz_uncompress_close, expected ")", maybe input something superfluous. -CONTEXT: compilation of PL/pgSQL function "inline_code_block" near line 10 +NOTICE: v_bool=t +NOTICE: v_bool=f -- abnormal scenario DECLARE v_bool boolean; diff --git a/contrib/gms_compress/sql/gms_compress.sql b/contrib/gms_compress/sql/gms_compress.sql index e0bda31a7..cf53f9164 100644 --- a/contrib/gms_compress/sql/gms_compress.sql +++ b/contrib/gms_compress/sql/gms_compress.sql @@ -685,7 +685,7 @@ BEGIN v_handle := GMS_COMPRESS.LZ_UNCOMPRESS_OPEN(content); v_bool := GMS_COMPRESS.ISOPEN(v_handle); RAISE NOTICE 'v_bool=%', v_bool; - GMS_COMPRESS.LZ_UNCOMPRESS_CLOSE(v_handle,content); + GMS_COMPRESS.LZ_UNCOMPRESS_CLOSE(v_handle); v_bool := GMS_COMPRESS.ISOPEN(v_handle); RAISE NOTICE 'v_bool=%', v_bool; END; diff --git a/src/bin/gs_guc/cluster_guc.conf b/src/bin/gs_guc/cluster_guc.conf index 39ac3ba83..678d39250 100755 --- a/src/bin/gs_guc/cluster_guc.conf +++ b/src/bin/gs_guc/cluster_guc.conf @@ -365,7 +365,7 @@ wdr_snapshot_retention_days|int|1,8|NULL|NULL| wdr_snapshot_query_timeout|int|100,2147483647|s|NULL| enable_wdr_snapshot|bool|0,0|NULL|NULL| enable_set_variable_b_format|bool|0,0|NULL|NULL| -enable_binary_special_o_format|bool|0,0|NULL|NULL| +enable_binary_special_a_format|bool|0,0|NULL|NULL| enable_asp|bool|0,0|NULL|NULL| enable_startwith_debug|bool|0,0|NULL|NULL| enable_stmt_track|bool|0,0|NULL|NULL| diff --git a/src/common/backend/utils/adt/float.cpp b/src/common/backend/utils/adt/float.cpp index 9959d7601..814d6ced8 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_o_format) { + if (u_sess->attr.attr_sql.enable_binary_special_a_format) { 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_o_format) { + if (u_sess->attr.attr_sql.enable_binary_special_a_format) { 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_o_format) { + if (u_sess->attr.attr_sql.enable_binary_special_a_format) { 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_o_format && !is_req_from_jdbc()) { + if (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_o_format && !is_req_from_jdbc()) { + if (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_o_format && !is_req_from_jdbc()) { + if (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"); diff --git a/src/common/backend/utils/misc/guc/guc_sql.cpp b/src/common/backend/utils/misc/guc/guc_sql.cpp index 7b03ef4df..f59644deb 100755 --- a/src/common/backend/utils/misc/guc/guc_sql.cpp +++ b/src/common/backend/utils/misc/guc/guc_sql.cpp @@ -665,13 +665,13 @@ static void InitSqlConfigureNamesBool() NULL, NULL, NULL}, - {{"enable_binary_special_o_format", + {{"enable_binary_special_a_format", PGC_USERSET, NODE_ALL, QUERY_TUNING_COST, gettext_noop("Allows the user to specify the value of a double-precision floating-point parameter."), NULL}, - &u_sess->attr.attr_sql.enable_binary_special_o_format, + &u_sess->attr.attr_sql.enable_binary_special_a_format, false, NULL, NULL, diff --git a/src/include/knl/knl_guc/knl_session_attr_sql.h b/src/include/knl/knl_guc/knl_session_attr_sql.h index ee06242da..182fa7cf3 100644 --- a/src/include/knl/knl_guc/knl_session_attr_sql.h +++ b/src/include/knl/knl_guc/knl_session_attr_sql.h @@ -130,7 +130,7 @@ typedef struct knl_session_attr_sql { bool enable_light_proxy; bool enable_pbe_optimization; bool enable_cluster_resize; - bool enable_binary_special_o_format; + bool enable_binary_special_a_format; bool lo_compat_privileges; bool quote_all_identifiers; bool enforce_a_behavior; diff --git a/src/test/regress/expected/test_binary_suffix.out b/src/test/regress/expected/test_binary_suffix.out index c222e3eec..efb381ac1 100644 --- a/src/test/regress/expected/test_binary_suffix.out +++ b/src/test/regress/expected/test_binary_suffix.out @@ -451,7 +451,7 @@ SELECT CONCAT('The value is ', TO_CHAR(-BINARY_DOUBLE_NAN)) AS result; The value is NaN (1 row) -set enable_binary_special_o_format to on; +set enable_binary_special_a_format to on; SELECT CONCAT('The value is ', TO_CHAR(BINARY_DOUBLE_INFINITY)) AS result; result ------------------ diff --git a/src/test/regress/sql/test_binary_suffix.sql b/src/test/regress/sql/test_binary_suffix.sql index f09853aef..c16fdb4f1 100644 --- a/src/test/regress/sql/test_binary_suffix.sql +++ b/src/test/regress/sql/test_binary_suffix.sql @@ -161,7 +161,7 @@ set float_suffix_acceptance to on; SELECT CONCAT('The value is ', TO_CHAR(BINARY_DOUBLE_INFINITY)) AS result; SELECT CONCAT('The value is ', TO_CHAR(-BINARY_DOUBLE_INFINITY)) AS result; SELECT CONCAT('The value is ', TO_CHAR(-BINARY_DOUBLE_NAN)) AS result; -set enable_binary_special_o_format to on; +set enable_binary_special_a_format to on; SELECT CONCAT('The value is ', TO_CHAR(BINARY_DOUBLE_INFINITY)) AS result; SELECT CONCAT('The value is ', TO_CHAR(-BINARY_DOUBLE_INFINITY)) AS result; SELECT CONCAT('The value is ', TO_CHAR(-BINARY_DOUBLE_NAN)) AS result;