Skip to content

Commit 3f188ec

Browse files
committed
Fix #8409 - Error message "SQL -104 / Unexpected end of command" appears in a trace log when 'SET AUTOTERM ON;' is used.
1 parent 47fb637 commit 3f188ec

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

doc/README.isql_enhancements.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ It is set to OFF by default. The name WIRE_STATS could be shortened up to WIRE.
337337
The statistics counters shown in two groups: 'logical' and 'physical':
338338
- logical counters show numbers of packets in terms of Firebird wire protocol
339339
and number of bytes send before compression and received after decompression;
340-
- physical counters show number of physical packets and bytes send and
341-
received over the wire, number of bytes could be affected by wire compression,
340+
- physical counters show number of physical packets and bytes send and
341+
received over the wire, number of bytes could be affected by wire compression,
342342
if present. Also, number of network roundtrips is shown: it is number of
343343
changes of IO direction from 'send' to 'receive'.
344344

@@ -489,7 +489,9 @@ If engine prepares the statement correctly, it's run and ISQL is put in new stat
489489
mode.
490490

491491
If engine returns error isc_command_end_err2, then ISQL is put in statement
492-
continuation mode and asks for another line, repeating the process.
492+
continuation mode and asks for another line, repeating the process. When this error
493+
happens together with IStatement::PREPARE_REQUIRE_SEMICOLON, trace does not log the
494+
error.
493495

494496
If engine returns a different error, the error is shown and ISQL is put in new statement
495497
mode.

src/dsql/dsql.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,17 @@ static DsqlRequest* prepareRequest(thread_db* tdbb, dsql_dbb* database, jrd_tra*
480480

481481
return dsqlRequest;
482482
}
483-
catch (const Exception&)
483+
catch (const Exception& ex)
484484
{
485-
trace.prepare(ITracePlugin::RESULT_FAILED);
485+
StaticStatusVector st;
486+
ex.stuffException(st);
487+
488+
if (!((prepareFlags & IStatement::PREPARE_REQUIRE_SEMICOLON) &&
489+
fb_utils::containsErrorCode(st.begin(), isc_command_end_err2)))
490+
{
491+
trace.prepare(ITracePlugin::RESULT_FAILED);
492+
}
493+
486494
throw;
487495
}
488496
}

0 commit comments

Comments
 (0)