summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pg_lsn.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2022-08-28 10:47:10 +0200
committerPeter Eisentraut <peter@eisentraut.org>2022-09-05 13:30:44 +0200
commit6bcda4a72123c3aa29fa3f03d952095675ad4468 (patch)
treeccd9c5998367bb93509fce2a5c8c6bd49563f168 /src/backend/utils/adt/pg_lsn.c
parent6dc0738812c3fdbd733d917267a0543ab5fdf997 (diff)
downloadpostgresql-6bcda4a72123c3aa29fa3f03d952095675ad4468.tar.gz
Fix incorrect uses of Datum conversion macros
Since these macros just cast whatever you give them to the designated output type, and many normal uses also cast the output type further, a number of incorrect uses go undiscovered. The fixes in this patch have been discovered by changing these macros to inline functions, which is the subject of a future patch. Reviewed-by: Aleksander Alekseev <aleksander@timescale.com> Discussion: https://www.postgresql.org/message-id/flat/8528fb7e-0aa2-6b54-85fb-0c0886dbd6ed%40enterprisedb.com
Diffstat (limited to 'src/backend/utils/adt/pg_lsn.c')
-rw-r--r--src/backend/utils/adt/pg_lsn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/pg_lsn.c b/src/backend/utils/adt/pg_lsn.c
index 45408787da..15266f36f5 100644
--- a/src/backend/utils/adt/pg_lsn.c
+++ b/src/backend/utils/adt/pg_lsn.c
@@ -271,7 +271,7 @@ pg_lsn_pli(PG_FUNCTION_ARGS)
/* Add two numerics */
res = DirectFunctionCall2(numeric_add,
- NumericGetDatum(num),
+ num,
NumericGetDatum(nbytes));
/* Convert to pg_lsn */
@@ -305,7 +305,7 @@ pg_lsn_mii(PG_FUNCTION_ARGS)
/* Subtract two numerics */
res = DirectFunctionCall2(numeric_sub,
- NumericGetDatum(num),
+ num,
NumericGetDatum(nbytes));
/* Convert to pg_lsn */