aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-04-12 23:21:04 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-04-12 23:21:04 +0000
commitba1c463096b750b4aa4b692c3fe7c7cc9fbfbd45 (patch)
treec77d60272c26257e97cec5257d2383188e3e1180 /src/backend/utils/adt
parentec498cdcbb7e7b430acc7236ab19ef70f116441a (diff)
downloadpostgresql-ba1c463096b750b4aa4b692c3fe7c7cc9fbfbd45.tar.gz
postgresql-ba1c463096b750b4aa4b692c3fe7c7cc9fbfbd45.zip
Clean up a few places where Datums were being treated as pointers without
going through DatumGetPointer or some other "official" conversion macro. Not actually a bug, since Datum the same size as pointer is the only supported case at the moment, but good cleanup for the future. Gavin Sherry
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r--src/backend/utils/adt/varlena.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c
index aa56317c7ff..141fc1bc94a 100644
--- a/src/backend/utils/adt/varlena.c
+++ b/src/backend/utils/adt/varlena.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.164 2008/03/25 22:42:44 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.165 2008/04/12 23:21:04 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -754,7 +754,8 @@ text_substring(Datum str, int32 start, int32 length, bool length_not_specified)
* If we're working with an untoasted source, no need to do an extra
* copying step.
*/
- if (VARATT_IS_COMPRESSED(str) || VARATT_IS_EXTERNAL(str))
+ if (VARATT_IS_COMPRESSED(DatumGetPointer(str)) ||
+ VARATT_IS_EXTERNAL(DatumGetPointer(str)))
slice = DatumGetTextPSlice(str, slice_start, slice_size);
else
slice = (text *) DatumGetPointer(str);