MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / query

Method query

src/jrd/jrd.cpp:4370–4429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4368
4369
4370void JService::query(CheckStatusWrapper* user_status,
4371 unsigned int sendLength, const unsigned char* sendItems,
4372 unsigned int receiveLength, const unsigned char* receiveItems,
4373 unsigned int bufferLength, unsigned char* buffer)
4374{
4375/**************************************
4376 *
4377 * g d s _ $ s e r v i c e _ q u e r y
4378 *
4379 **************************************
4380 *
4381 * Functional description
4382 * Provide information on service object.
4383 *
4384 * NOTE: The parameter RESERVED must not be used
4385 * for any purpose as there are networking issues
4386 * involved (as with any handle that goes over the
4387 * network). This parameter will be implemented at
4388 * a later date.
4389 *
4390 **************************************/
4391 try
4392 {
4393 ThreadContextHolder tdbb(user_status);
4394
4395 validateHandle(svc);
4396
4397 if (svc->getVersion() == isc_spb_version1)
4398 {
4399 svc->query(sendLength, sendItems, receiveLength,
4400 receiveItems, bufferLength, buffer);
4401 }
4402 else
4403 {
4404 // For SVC_query2, we are going to completly dismantle user_status (since at this point it is
4405 // meaningless anyway). The status vector returned by this function can hold information about
4406 // the call to query the service manager and/or a service thread that may have been running.
4407
4408 svc->query2(tdbb, sendLength, sendItems, receiveLength,
4409 receiveItems, bufferLength, buffer);
4410
4411 // If there is a status vector from a service thread, copy it into the thread status
4412 Service::StatusAccessor status = svc->getStatusAccessor();
4413 if (status->getState())
4414 {
4415 fb_utils::copyStatus(user_status, status);
4416 // Empty out the service status vector
4417 status.init();
4418 return;
4419 }
4420 }
4421 }
4422 catch (const Exception& ex)
4423 {
4424 ex.stuffException(user_status);
4425 return;
4426 }
4427

Callers 3

svc_api_gbakFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 9

validateHandleFunction · 0.85
copyStatusFunction · 0.85
successful_completionFunction · 0.85
query2Method · 0.80
getVersionMethod · 0.45
getStatusAccessorMethod · 0.45
getStateMethod · 0.45
initMethod · 0.45
stuffExceptionMethod · 0.45

Tested by

no test coverage detected