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

Function makeMod

src/jrd/SysFunction.cpp:1648–1679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1646
1647
1648void makeMod(DataTypeUtilBase*, const SysFunction* function, dsc* result,
1649 int argsCount, const dsc** args)
1650{
1651 fb_assert(argsCount == function->minArgCount);
1652
1653 const dsc* value1 = args[0];
1654 const dsc* value2 = args[1];
1655
1656 if (value1->isNull() || value2->isNull())
1657 {
1658 result->makeLong(0);
1659 result->setNull();
1660 return;
1661 }
1662
1663 switch (value1->dsc_dtype)
1664 {
1665 case dtype_short:
1666 case dtype_long:
1667 case dtype_int64:
1668 case dtype_int128:
1669 *result = *value1;
1670 result->dsc_scale = 0;
1671 break;
1672
1673 default:
1674 result->makeInt64(0);
1675 break;
1676 }
1677
1678 result->setNullable(value1->isNullable() || value2->isNullable());
1679}
1680
1681
1682void makeOverlay(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc* result,

Callers

nothing calls this directly

Calls 6

makeLongMethod · 0.80
makeInt64Method · 0.80
setNullableMethod · 0.80
isNullMethod · 0.45
setNullMethod · 0.45
isNullableMethod · 0.45

Tested by

no test coverage detected