summaryrefslogtreecommitdiff
path: root/contrib/dblink
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-10-19 19:53:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-10-19 19:53:03 +0000
commit2315df21f824732dbae061a79f7105caf864c50e (patch)
treefc81e8034eea86d8acab77416f2eaf5dfbecdefb /contrib/dblink
parent681892208fe41459acf89ade0d91a78e55f1089a (diff)
downloadpostgresql-2315df21f824732dbae061a79f7105caf864c50e.tar.gz
Fix a couple of places that were assuming debug_query_string couldn't
be NULL ... seems an unsafe assumption.
Diffstat (limited to 'contrib/dblink')
-rw-r--r--contrib/dblink/dblink.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c
index 08fb6328fb..79e78fd86e 100644
--- a/contrib/dblink/dblink.c
+++ b/contrib/dblink/dblink.c
@@ -8,7 +8,7 @@
* Darko Prenosil <Darko.Prenosil@finteh.hr>
* Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
*
- * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.59 2006/10/04 00:29:44 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.60 2006/10/19 19:53:03 tgl Exp $
* Copyright (c) 2001-2006, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
@@ -1640,7 +1640,10 @@ PG_FUNCTION_INFO_V1(dblink_current_query);
Datum
dblink_current_query(PG_FUNCTION_ARGS)
{
- PG_RETURN_TEXT_P(GET_TEXT(debug_query_string));
+ if (debug_query_string)
+ PG_RETURN_TEXT_P(GET_TEXT(debug_query_string));
+ else
+ PG_RETURN_NULL();
}