From 2315df21f824732dbae061a79f7105caf864c50e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 19 Oct 2006 19:53:03 +0000 Subject: Fix a couple of places that were assuming debug_query_string couldn't be NULL ... seems an unsafe assumption. --- contrib/dblink/dblink.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'contrib') 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 * Shridhar Daithankar * - * $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(); } -- cgit v1.2.1