Skip to content

Conversation

Ev3nt
Copy link
Contributor

@Ev3nt Ev3nt commented Oct 14, 2025

This code is more secure than the stub in https://github.com/FirebirdSQL/firebird/blob/master/src/dsql/DsqlRequests.cpp#L383

// Fetch from already finished request should not produce error
if (!(request->req_flags & req_active))
{
	if (req_timer)
		req_timer->stop();

	trace.fetch(true, ITracePlugin::RESULT_SUCCESS);
	return false;
}

It can be used as a second level of cursor status checking.

@dyemanov
Copy link
Member

A few notes:

  • The original goal is to avoid fetching beyond EOF in cursors, which is currently still possible in the remote protocol prefetch logic. This causes isc_req_sync errors being reported in the trace. It can be additionally fixed inside the protocol code, but this patch is more robust from the possible regressions POV.
  • While this protection it's not strictly required in master (due to the aforementioned check added by Dimitry Sibiryakov recently), it's IMHO better understandable.
  • It unifies EOF handling between uni-directional and scrollable cursors.
  • It can be easily cherry-picked into the prior versions, if desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants