Re: [PATCHES] dblink crash fix

2004-10-28 Thread Tom Lane
Kris Jurka [EMAIL PROTECTED] writes:
 This makes dblink pass its installcheck test on platforms where 
 snprintf(data, len, %s, NULL) crash.

Good catch!  Applied.

regards, tom lane

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


[PATCHES] dblink crash fix

2004-10-27 Thread Kris Jurka

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 JurkaIndex: contrib/dblink/dblink.c
===
RCS file: /projects/cvsroot/pgsql/contrib/dblink/dblink.c,v
retrieving revision 1.36
diff -c -r1.36 dblink.c
*** contrib/dblink/dblink.c 25 Oct 2004 00:46:39 -  1.36
--- contrib/dblink/dblink.c 28 Oct 2004 00:07:01 -
***
*** 310,319 
conname = GET_STR(PG_GETARG_TEXT_P(0));
curname = GET_STR(PG_GETARG_TEXT_P(1));
sql = GET_STR(PG_GETARG_TEXT_P(2));
}
-   rcon = getConnectionByName(conname);
-   if (rcon)
-   conn = rcon-con;
}
else if (PG_NARGS() == 4)
{
--- 310,319 
conname = GET_STR(PG_GETARG_TEXT_P(0));
curname = GET_STR(PG_GETARG_TEXT_P(1));
sql = GET_STR(PG_GETARG_TEXT_P(2));
+   rcon = getConnectionByName(conname);
+   if (rcon)
+   conn = rcon-con;
}
}
else if (PG_NARGS() == 4)
{

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]