src/bin/psql/command.c
static void
discard_query_text(PsqlScanState scan_state, ConditionalStack cstack,
				   PQExpBuffer query_buf)
{
	if (query_buf)
	{
		int			new_len = conditional_stack_get_query_len(cstack);

		Assert(new_len >= 0 && new_len <= query_buf->len);
		query_buf->len = new_len;
		query_buf->data[new_len] = '\0';
	}
	psql_scan_set_paren_depth(scan_state,
							  conditional_stack_get_paren_depth(cstack));
}
/*
 * Discard any query text absorbed during an inactive conditional branch.
 *
 * We must discard data that was appended to query_buf during an inactive
 * \if branch.  We don't have to do anything there if there's no query_buf.
 *
 * Also, reset the lexer state to the same paren depth there was before.
 * (The rest of its state doesn't need attention, since we could not be
 * inside a comment or literal or partial token.)
 */
Discard any query text absorbed during an inactive conditional branch.
We must discard data that was appended to query_buf during an inactive
\if branch.  We don't have to do anything there if there's no query_buf.

Also, reset the lexer state to the same paren depth there was before.
(The rest of its state doesn't need attention, since we could not be
inside a comment or literal or partial token.)
Discard any query text absorbed during an inactive conditional branch . We must discard data that was appended to query_buf during an inactive \ if branch . We don ' t have to do anything there if there ' s no query_buf . Also reset the lexer state to the same paren depth there was before . ( The rest of its state doesn ' t need attention since we could not be inside a comment or literal or partial token . )
static void
discard_query_text(PsqlScanState scan_state, ConditionalStack cstack,
				   PQExpBuffer query_buf)
{
	if (query_buf)
	{
		int			new_len = conditional_stack_get_query_len(cstack);
		Assert(new_len >= 0 && new_len <= query_buf->len);
		query_buf->len = new_len;
		query_buf->data[new_len] = '\0';
	}
	psql_scan_set_paren_depth(scan_state,
							  conditional_stack_get_paren_depth(cstack));
}
static void discard_query_text ( PsqlScanState scan_state , ConditionalStack cstack , PQExpBuffer query_buf ) { if ( query_buf ) { int new_len = conditional_stack_get_query_len ( cstack ) ; Assert ( new_len >= 0 && new_len <= query_buf -> len ) ; query_buf -> len = new_len ; query_buf -> data [ new_len ] = ' \0 ' ; } psql_scan_set_paren_depth ( scan_state , conditional_stack_get_paren_depth ( cstack ) ) ; }
Discard any query text absorbed during an inactive conditional branch.
Discard any query text absorbed during an inactive conditional branch .