diff options
author | Robert Haas <rhaas@postgresql.org> | 2017-01-24 08:57:10 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2017-01-24 08:57:10 -0500 |
commit | 289992c462b504ffa289202ce8fc34a56b4048c3 (patch) | |
tree | e7cd0398b763e55f48b76149521eeda3c755fa9b /src/backend/utils/adt/datum.c | |
parent | b1ecb9b3fcfb76edb3461ce561d049c8fb9e710d (diff) | |
download | postgresql-289992c462b504ffa289202ce8fc34a56b4048c3.tar.gz postgresql-289992c462b504ffa289202ce8fc34a56b4048c3.zip |
Don't invoke arbitrary code inside a possibly-aborted transaction.
The code here previously tried to call the partitioning operator, but
really the right thing to do (and the safe thing to do) is use
datumIsEqual().
Amit Langote, but I expanded the comment and fixed a compiler warning.
Diffstat (limited to 'src/backend/utils/adt/datum.c')
-rw-r--r-- | src/backend/utils/adt/datum.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/utils/adt/datum.c b/src/backend/utils/adt/datum.c index 535e4277ccb..071a7d4db16 100644 --- a/src/backend/utils/adt/datum.c +++ b/src/backend/utils/adt/datum.c @@ -209,6 +209,10 @@ datumTransfer(Datum value, bool typByVal, int typLen) * of say the representation of zero in one's complement arithmetic). * Also, it will probably not give the answer you want if either * datum has been "toasted". + * + * Do not try to make this any smarter than it currently is with respect + * to "toasted" datums, because some of the callers could be working in the + * context of an aborted transaction. *------------------------------------------------------------------------- */ bool |