pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix handling of R/W expanded datums that are passed to SQL funct
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix handling of R/W expanded datums that are passed to SQL funct
@ 2022-08-10 17:37  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-10 17:37 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of R/W expanded datums that are passed to SQL functions.

fmgr_sql must make expanded-datum arguments read-only, because
it's possible that the function body will pass the argument to
more than one callee function.  If one of those functions takes
the datum's R/W property as license to scribble on it, then later
callees will see an unexpected value, leading to wrong answers.

From a performance standpoint, it'd be nice to skip this in the
common case that the argument value is passed to only one callee.
However, detecting that seems fairly hard, and certainly not
something that I care to attempt in a back-patched bug fix.

Per report from Adam Mackler.  This has been broken since we
invented expanded datums, so back-patch to all supported branches.

Discussion: https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjO...
Discussion: https://postgr.es/m/187436.1660143060@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/442dbd6698282faafc0b83363cecf818cf88a9b6

Modified Files
--------------
src/backend/executor/functions.c                | 19 +++++++++++++++++--
src/test/regress/expected/create_function_3.out | 18 +++++++++++++++++-
src/test/regress/sql/create_function_3.sql      | 13 +++++++++++++
3 files changed, 47 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix handling of R/W expanded datums that are passed to SQL funct
@ 2022-08-10 17:37  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-10 17:37 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of R/W expanded datums that are passed to SQL functions.

fmgr_sql must make expanded-datum arguments read-only, because
it's possible that the function body will pass the argument to
more than one callee function.  If one of those functions takes
the datum's R/W property as license to scribble on it, then later
callees will see an unexpected value, leading to wrong answers.

From a performance standpoint, it'd be nice to skip this in the
common case that the argument value is passed to only one callee.
However, detecting that seems fairly hard, and certainly not
something that I care to attempt in a back-patched bug fix.

Per report from Adam Mackler.  This has been broken since we
invented expanded datums, so back-patch to all supported branches.

Discussion: https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjO...
Discussion: https://postgr.es/m/187436.1660143060@sss.pgh.pa.us

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5b948b5c13366591ef0cd975df3170c4eaff4e3b

Modified Files
--------------
src/backend/executor/functions.c                | 19 +++++++++++++++++--
src/test/regress/expected/create_function_3.out | 19 ++++++++++++++++++-
src/test/regress/sql/create_function_3.sql      | 13 +++++++++++++
3 files changed, 48 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix handling of R/W expanded datums that are passed to SQL funct
@ 2022-08-10 17:37  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-10 17:37 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of R/W expanded datums that are passed to SQL functions.

fmgr_sql must make expanded-datum arguments read-only, because
it's possible that the function body will pass the argument to
more than one callee function.  If one of those functions takes
the datum's R/W property as license to scribble on it, then later
callees will see an unexpected value, leading to wrong answers.

From a performance standpoint, it'd be nice to skip this in the
common case that the argument value is passed to only one callee.
However, detecting that seems fairly hard, and certainly not
something that I care to attempt in a back-patched bug fix.

Per report from Adam Mackler.  This has been broken since we
invented expanded datums, so back-patch to all supported branches.

Discussion: https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjO...
Discussion: https://postgr.es/m/187436.1660143060@sss.pgh.pa.us

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/95bfadd4e83c17f1a31ab97eb2aba44a38c36324

Modified Files
--------------
src/backend/executor/functions.c                | 19 +++++++++++++++++--
src/test/regress/expected/create_function_3.out | 19 ++++++++++++++++++-
src/test/regress/sql/create_function_3.sql      | 13 +++++++++++++
3 files changed, 48 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix handling of R/W expanded datums that are passed to SQL funct
@ 2022-08-10 17:37  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-10 17:37 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of R/W expanded datums that are passed to SQL functions.

fmgr_sql must make expanded-datum arguments read-only, because
it's possible that the function body will pass the argument to
more than one callee function.  If one of those functions takes
the datum's R/W property as license to scribble on it, then later
callees will see an unexpected value, leading to wrong answers.

From a performance standpoint, it'd be nice to skip this in the
common case that the argument value is passed to only one callee.
However, detecting that seems fairly hard, and certainly not
something that I care to attempt in a back-patched bug fix.

Per report from Adam Mackler.  This has been broken since we
invented expanded datums, so back-patch to all supported branches.

Discussion: https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjO...
Discussion: https://postgr.es/m/187436.1660143060@sss.pgh.pa.us

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/71caf3c4da1c85a2ec7cfce914f1ccb723c8e991

Modified Files
--------------
src/backend/executor/functions.c                | 19 +++++++++++++++++--
src/test/regress/expected/create_function_3.out | 19 ++++++++++++++++++-
src/test/regress/sql/create_function_3.sql      | 13 +++++++++++++
3 files changed, 48 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix handling of R/W expanded datums that are passed to SQL funct
@ 2022-08-10 17:37  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-10 17:37 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of R/W expanded datums that are passed to SQL functions.

fmgr_sql must make expanded-datum arguments read-only, because
it's possible that the function body will pass the argument to
more than one callee function.  If one of those functions takes
the datum's R/W property as license to scribble on it, then later
callees will see an unexpected value, leading to wrong answers.

From a performance standpoint, it'd be nice to skip this in the
common case that the argument value is passed to only one callee.
However, detecting that seems fairly hard, and certainly not
something that I care to attempt in a back-patched bug fix.

Per report from Adam Mackler.  This has been broken since we
invented expanded datums, so back-patch to all supported branches.

Discussion: https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjO...
Discussion: https://postgr.es/m/187436.1660143060@sss.pgh.pa.us

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ad3e07c156544f31d02e55e95ba7954ea87a2ee8

Modified Files
--------------
src/backend/executor/functions.c                  | 19 +++++++++++++++++--
src/test/regress/expected/create_function_sql.out | 19 ++++++++++++++++++-
src/test/regress/sql/create_function_sql.sql      | 13 +++++++++++++
3 files changed, 48 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix handling of R/W expanded datums that are passed to SQL funct
@ 2022-08-10 17:37  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-10 17:37 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of R/W expanded datums that are passed to SQL functions.

fmgr_sql must make expanded-datum arguments read-only, because
it's possible that the function body will pass the argument to
more than one callee function.  If one of those functions takes
the datum's R/W property as license to scribble on it, then later
callees will see an unexpected value, leading to wrong answers.

From a performance standpoint, it'd be nice to skip this in the
common case that the argument value is passed to only one callee.
However, detecting that seems fairly hard, and certainly not
something that I care to attempt in a back-patched bug fix.

Per report from Adam Mackler.  This has been broken since we
invented expanded datums, so back-patch to all supported branches.

Discussion: https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjO...
Discussion: https://postgr.es/m/187436.1660143060@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/309857f9c1825d0591579579bdde2a8c8bd3e491

Modified Files
--------------
src/backend/executor/functions.c                  | 19 +++++++++++++++++--
src/test/regress/expected/create_function_sql.out | 19 ++++++++++++++++++-
src/test/regress/sql/create_function_sql.sql      | 13 +++++++++++++
3 files changed, 48 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix handling of R/W expanded datums that are passed to SQL funct
@ 2022-08-10 17:37  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2022-08-10 17:37 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of R/W expanded datums that are passed to SQL functions.

fmgr_sql must make expanded-datum arguments read-only, because
it's possible that the function body will pass the argument to
more than one callee function.  If one of those functions takes
the datum's R/W property as license to scribble on it, then later
callees will see an unexpected value, leading to wrong answers.

From a performance standpoint, it'd be nice to skip this in the
common case that the argument value is passed to only one callee.
However, detecting that seems fairly hard, and certainly not
something that I care to attempt in a back-patched bug fix.

Per report from Adam Mackler.  This has been broken since we
invented expanded datums, so back-patch to all supported branches.

Discussion: https://postgr.es/m/WScDU5qfoZ7PB2gXwNqwGGgDPmWzz08VdydcPFLhOwUKZcdWbblbo-0Lku-qhuEiZoXJ82jpiQU4hOjO...
Discussion: https://postgr.es/m/187436.1660143060@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1446612c5b25d74739dc1e3337edfba8fec9516d

Modified Files
--------------
src/backend/executor/functions.c                | 19 +++++++++++++++++--
src/test/regress/expected/create_function_3.out | 21 +++++++++++++++++++--
src/test/regress/sql/create_function_3.sql      | 14 +++++++++++++-
3 files changed, 49 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2022-08-10 17:37 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 17:37 pgsql: Fix handling of R/W expanded datums that are passed to SQL funct Tom Lane <tgl@sss.pgh.pa.us>
2022-08-10 17:37 pgsql: Fix handling of R/W expanded datums that are passed to SQL funct Tom Lane <tgl@sss.pgh.pa.us>
2022-08-10 17:37 pgsql: Fix handling of R/W expanded datums that are passed to SQL funct Tom Lane <tgl@sss.pgh.pa.us>
2022-08-10 17:37 pgsql: Fix handling of R/W expanded datums that are passed to SQL funct Tom Lane <tgl@sss.pgh.pa.us>
2022-08-10 17:37 pgsql: Fix handling of R/W expanded datums that are passed to SQL funct Tom Lane <tgl@sss.pgh.pa.us>
2022-08-10 17:37 pgsql: Fix handling of R/W expanded datums that are passed to SQL funct Tom Lane <tgl@sss.pgh.pa.us>
2022-08-10 17:37 pgsql: Fix handling of R/W expanded datums that are passed to SQL funct Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox