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

Method makeOffsets

src/common/MsgMetadata.cpp:347–377  ·  view source on GitHub ↗

returns ~0 on success or index of not finished item

Source from the content-addressed store, hash-verified

345
346// returns ~0 on success or index of not finished item
347unsigned MsgMetadata::makeOffsets()
348{
349 length = alignedLength = 0;
350 alignment = type_alignments[dtype_short]; // NULL indicator
351
352 for (unsigned n = 0; n < items.getCount(); ++n)
353 {
354 Item* param = &items[n];
355 if (!param->finished)
356 {
357 length = alignment = 0;
358 return n;
359 }
360
361 unsigned dtype;
362 length = fb_utils::sqlTypeToDsc(length, param->type, param->length,
363 &dtype, NULL /*length*/, &param->offset, &param->nullInd);
364
365 if (dtype >= DTYPE_TYPE_MAX)
366 {
367 length = alignment = 0;
368 return n;
369 }
370
371 alignment = MAX(alignment, type_alignments[dtype]);
372 }
373
374 alignedLength = FB_ALIGN(length, alignment);
375
376 return ~0u;
377}
378
379
380IMetadataBuilder* MsgMetadata::getBuilder(CheckStatusWrapper* status)

Callers 4

createMetadataMethod · 0.80
parseDsqlMessageMethod · 0.80
getMetadataMethod · 0.80
parseMethod · 0.80

Calls 3

sqlTypeToDscFunction · 0.85
FB_ALIGNFunction · 0.85
getCountMethod · 0.45

Tested by

no test coverage detected