Commit fe2bfa63 authored by Tom Lane's avatar Tom Lane

This makes dblink pass its installcheck test on platforms where

snprintf(data, len, %s, NULL) crash.

The code was trying to find a connection by name when it already had an
unnamed connection and did not have a name to search with.

Kris Jurka
parent 5a5f34e0
...@@ -310,11 +310,11 @@ dblink_open(PG_FUNCTION_ARGS) ...@@ -310,11 +310,11 @@ dblink_open(PG_FUNCTION_ARGS)
conname = GET_STR(PG_GETARG_TEXT_P(0)); conname = GET_STR(PG_GETARG_TEXT_P(0));
curname = GET_STR(PG_GETARG_TEXT_P(1)); curname = GET_STR(PG_GETARG_TEXT_P(1));
sql = GET_STR(PG_GETARG_TEXT_P(2)); sql = GET_STR(PG_GETARG_TEXT_P(2));
}
rcon = getConnectionByName(conname); rcon = getConnectionByName(conname);
if (rcon) if (rcon)
conn = rcon->con; conn = rcon->con;
} }
}
else if (PG_NARGS() == 4) else if (PG_NARGS() == 4)
{ {
/* text,text,text,bool */ /* text,text,text,bool */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment