@@ -1406,12 +1406,14 @@ static void successful_completion(CheckStatusWrapper* s, ISC_STATUS acceptCode =
14061406
14071407// Stuff exception transliterated to the client charset.
14081408static ISC_STATUS transliterateException (thread_db* tdbb, const Exception& ex, FbStatusVector* vector,
1409- const char * func) noexcept
1409+ const char * func, std::function< bool ( const FbStatusVector* vector)> avoidTrace = {} ) noexcept
14101410{
14111411 ex.stuffException (vector);
14121412
14131413 Jrd::Attachment* attachment = tdbb->getAttachment ();
1414- if (func && attachment && attachment->att_trace_manager ->needs (ITraceFactory::TRACE_EVENT_ERROR))
1414+
1415+ if ((!avoidTrace || !avoidTrace (vector)) && func &&
1416+ attachment && attachment->att_trace_manager ->needs (ITraceFactory::TRACE_EVENT_ERROR))
14151417 {
14161418 TraceConnectionImpl conn (attachment);
14171419 TraceStatusVectorImpl traceStatus (vector, TraceStatusVectorImpl::TS_ERRORS);
@@ -5683,7 +5685,13 @@ JStatement* JAttachment::prepare(CheckStatusWrapper* user_status, ITransaction*
56835685 }
56845686 catch (const Exception& ex)
56855687 {
5686- transliterateException (tdbb, ex, user_status, " JStatement::prepare" );
5688+ transliterateException (tdbb, ex, user_status, " JStatement::prepare" ,
5689+ [&](const FbStatusVector* vector)
5690+ {
5691+ return (flags & IStatement::PREPARE_REQUIRE_SEMICOLON) &&
5692+ fb_utils::containsErrorCode (vector->getErrors (), isc_command_end_err2);
5693+ });
5694+
56875695 if (statement)
56885696 {
56895697 try
0 commit comments