* overflow.)
*
*
- * Portions Copyright (c) 2003-2015, PgPool Global Development Group
+ * Portions Copyright (c) 2003-2018, PgPool Global Development Group
* Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
{
case 'a': /* application name */
{
- StartupPacket *sp = session? MASTER_CONNECTION(session->backend)->sp : NULL ;
+
+ /*
+ * Do not use MASTER_CONNECTION macro here since it calls
+ * pool_virtual_master_db_node_id() which eventually calls
+ * ereport() if operated in DEBUG mode.
+ */
+ StartupPacket *sp = session? (session->backend->slots[REAL_MASTER_NODE_ID])->sp : NULL ;
const char *appname = sp? sp->application_name : "[No Connection]";
if (appname == NULL || *appname == '\0')
appname = "[unknown]";