mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 03:23:03 +01:00
Fixed CORE-5244: Wrong error message when trying to execute SELECT statement using isc_dsql_execute_immediate
This commit is contained in:
parent
88cad913d0
commit
641a2b913d
@ -211,13 +211,19 @@ InternalMessageBuffer::InternalMessageBuffer(unsigned aBlrLength, const unsigned
|
||||
unsigned aBufferLength, unsigned char* aBuffer)
|
||||
{
|
||||
buffer = aBuffer;
|
||||
metadata = FB_NEW MetadataFromBlr(aBlrLength, aBlr, aBufferLength);
|
||||
metadata->addRef();
|
||||
if (aBlr)
|
||||
{
|
||||
metadata = FB_NEW MetadataFromBlr(aBlrLength, aBlr, aBufferLength);
|
||||
metadata->addRef();
|
||||
}
|
||||
else
|
||||
metadata = NULL;
|
||||
}
|
||||
|
||||
InternalMessageBuffer::~InternalMessageBuffer()
|
||||
{
|
||||
metadata->release();
|
||||
if (metadata)
|
||||
metadata->release();
|
||||
}
|
||||
|
||||
} // namespace Firebird
|
||||
|
@ -546,8 +546,13 @@ void DSQL_execute_immediate(thread_db* tdbb, Jrd::Attachment* attachment, jrd_tr
|
||||
|
||||
Jrd::ContextPoolHolder context(tdbb, &request->getPool());
|
||||
|
||||
// A select with a non zero output length is a singleton select
|
||||
const bool singleton = reqTypeWithCursor(statement->getType()) && out_msg;
|
||||
// A select having cursor is a singleton select when executed immediate
|
||||
const bool singleton = reqTypeWithCursor(statement->getType());
|
||||
if (singleton && !(out_msg && out_meta))
|
||||
{
|
||||
ERRD_post(Arg::Gds(isc_dsql_sqlda_err) <<
|
||||
Arg::Gds(isc_dsql_no_output_sqlda));
|
||||
}
|
||||
|
||||
request->req_transaction = *tra_handle;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user