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

Method fillParams

src/jrd/trace/TraceObjects.cpp:277–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275/// TraceSQLStatementImpl::DSQLParamsImpl
276
277void TraceSQLStatementImpl::DSQLParamsImpl::fillParams()
278{
279 if (m_descs.getCount() || !m_params || m_params->getCount() == 0)
280 return;
281
282 if (!m_stmt->getDsqlStatement()->isDml())
283 {
284 fb_assert(false);
285 return;
286 }
287
288 const auto dmlRequest = (DsqlDmlRequest*) m_stmt;
289
290 USHORT first_index = 0;
291 for (FB_SIZE_T i = 0 ; i < m_params->getCount(); ++i)
292 {
293 const dsql_par* parameter = (*m_params)[i];
294
295 if (parameter->par_index)
296 {
297 // Use descriptor for nulls signaling
298 USHORT null_flag = 0;
299 if (parameter->par_null)
300 {
301 const UCHAR* msgBuffer =
302 dmlRequest->req_msg_buffers[parameter->par_null->par_message->msg_buffer_number];
303
304 if (*(SSHORT*) (msgBuffer + (IPTR) parameter->par_null->par_desc.dsc_address))
305 null_flag = DSC_null;
306 }
307
308 dsc* desc = NULL;
309
310 const FB_SIZE_T idx = parameter->par_index - 1;
311 if (idx >= m_descs.getCount())
312 m_descs.getBuffer(idx + 1);
313
314 desc = &m_descs[idx];
315
316 *desc = parameter->par_desc;
317 desc->dsc_flags |= null_flag;
318
319 UCHAR* msgBuffer = dmlRequest->req_msg_buffers[parameter->par_message->msg_buffer_number];
320 desc->dsc_address = msgBuffer + (IPTR) desc->dsc_address;
321 }
322 }
323}
324
325
326FB_SIZE_T TraceSQLStatementImpl::DSQLParamsImpl::getCount()

Callers

nothing calls this directly

Calls 12

JRD_get_thread_dataFunction · 0.85
EVL_exprFunction · 0.85
MOV_get_longFunction · 0.85
getCountMethod · 0.45
isDmlMethod · 0.45
getDsqlStatementMethod · 0.45
getBufferMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45
setNullMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected