Re: BUG #17514: Application with embedded SQL crashes when executing EXEC SQL PREPARE

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: okano.naoki@jp.fujitsu.com
Cc: pgsql-bugs@lists.postgresql.org
Date: 2022-06-09T17:01:36Z
Lists: pgsql-bugs

Attachments

PG Bug reporting form <noreply@postgresql.org> writes:
> Application with embedded SQL crashes with segmentation fault if I execute
> EXEC SQL PREPARE
> command before executing EXEC SQL CONNECT command (*1).
> I know that it is the correct operation to execute EXEC SQL CONNECT command
> first 
> and then execute EXEC SQL PREPARE command.
> But I expect this wrong operation to result in an error, not a crash.

We could do something like the attached, perhaps.  Having said that,
an application that includes no error checks is pretty unlikely to
fail gracefully :-(.

			regards, tom lane

Commits

  1. Avoid ecpglib core dump with out-of-order operations.