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

Function PAR_desc

src/jrd/par.cpp:403–575  ·  view source on GitHub ↗

Parse a BLR descriptor. Return the alignment requirements of the datatype.

Source from the content-addressed store, hash-verified

401
402// Parse a BLR descriptor. Return the alignment requirements of the datatype.
403USHORT PAR_desc(thread_db* tdbb, CompilerScratch* csb, dsc* desc, ItemInfo* itemInfo)
404{
405 if (itemInfo)
406 {
407 itemInfo->nullable = true;
408 itemInfo->explicitCollation = false;
409 itemInfo->fullDomain = false;
410 }
411
412 desc->clear();
413
414 const USHORT dtype = csb->csb_blr_reader.getByte();
415
416 switch (dtype)
417 {
418 case blr_not_nullable:
419 PAR_desc(tdbb, csb, desc, itemInfo);
420 if (itemInfo)
421 itemInfo->nullable = false;
422 break;
423
424 case blr_domain_name:
425 case blr_domain_name2:
426 {
427 const bool fullDomain = (csb->csb_blr_reader.getByte() == blr_domain_full);
428 MetaName* name = FB_NEW_POOL(csb->csb_pool) MetaName(csb->csb_pool);
429 csb->csb_blr_reader.getMetaName(*name);
430
431 MetaNamePair namePair(*name, "");
432
433 FieldInfo fieldInfo;
434 bool exist = csb->csb_map_field_info.get(namePair, fieldInfo);
435 MET_get_domain(tdbb, csb->csb_pool, *name, desc, (exist ? NULL : &fieldInfo));
436
437 if (!exist)
438 csb->csb_map_field_info.put(namePair, fieldInfo);
439
440 if (itemInfo)
441 {
442 itemInfo->field = namePair;
443
444 if (fullDomain)
445 {
446 itemInfo->nullable = fieldInfo.nullable;
447 itemInfo->fullDomain = true;
448 }
449 else
450 itemInfo->nullable = true;
451 }
452
453 if (dtype == blr_domain_name2)
454 {
455 const USHORT ttype = csb->csb_blr_reader.getWord();
456
457 switch (desc->dsc_dtype)
458 {
459 case dtype_cstring:
460 case dtype_text:

Callers 4

parseMethod · 0.85
parseMethod · 0.85
setupDescMethod · 0.85
parseMessagesMethod · 0.85

Calls 15

GdsClass · 0.85
PAR_datatypeFunction · 0.85
INTL_TEXT_TYPEFunction · 0.85
setTextTypeMethod · 0.80
addDependencyMethod · 0.80
seekBackwardMethod · 0.80
getTextTypeMethod · 0.80
MetaNameClass · 0.70
PAR_errorFunction · 0.70
clearMethod · 0.45
getByteMethod · 0.45

Tested by

no test coverage detected