Re: pgsql: dblink: Replace some macros by staticfunctions
| От | Peter Eisentraut |
|---|---|
| Тема | Re: pgsql: dblink: Replace some macros by staticfunctions |
| Дата | |
| Msg-id | d86645b3-44cb-4155-719c-66bcdeba3fe0@2ndquadrant.com обсуждение исходный текст |
| Ответ на | Re: [COMMITTERS] pgsql: dblink: Replace some macros by static functions (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-committers |
On 3/13/17 15:58, Tom Lane wrote: > In the same vein, I think this bit in dblink_open is pretty poor coding > practice: > > if (!rconn || !rconn->conn) > dblink_conn_not_avail(conname); > else > conn = rconn->conn; > > as it expects both the compiler and the reader to understand that > we will not proceed without "conn" getting a value. I see that > that was band-aided around by initializing conn to NULL, but that's a > crummy way of suppressing uninitialized-variable warnings, because it > will mask even actual errors. Far better would be to remove the dummy > initialization and write > > if (!rconn || !rconn->conn) > dblink_conn_not_avail(conname); > conn = rconn->conn; fixed -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-committers по дате отправления: