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

Function makeLeftRight

src/jrd/SysFunction.cpp:1619–1645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1617
1618
1619void makeLeftRight(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc* result,
1620 int argsCount, const dsc** args)
1621{
1622 fb_assert(argsCount == function->minArgCount);
1623
1624 const dsc* value = args[0];
1625 const dsc* length = args[1];
1626
1627 if (value->isNull() || length->isNull())
1628 {
1629 result->makeNullString();
1630 return;
1631 }
1632
1633 if (value->isBlob())
1634 result->makeBlob(value->getBlobSubType(), value->getTextType());
1635 else
1636 {
1637 result->clear();
1638 result->dsc_dtype = dtype_varying;
1639 result->setTextType(value->getTextType());
1640 result->setNullable(value->isNullable() || length->isNullable());
1641
1642 result->dsc_length = dataTypeUtil->fixLength(result,
1643 dataTypeUtil->convertLength(value, result)) + static_cast<USHORT>(sizeof(USHORT));
1644 }
1645}
1646
1647
1648void makeMod(DataTypeUtilBase*, const SysFunction* function, dsc* result,

Callers

nothing calls this directly

Calls 12

makeNullStringMethod · 0.80
isBlobMethod · 0.80
makeBlobMethod · 0.80
getBlobSubTypeMethod · 0.80
getTextTypeMethod · 0.80
setTextTypeMethod · 0.80
setNullableMethod · 0.80
fixLengthMethod · 0.80
isNullMethod · 0.45
clearMethod · 0.45
isNullableMethod · 0.45
convertLengthMethod · 0.45

Tested by

no test coverage detected