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

Function makeDecodeHex

src/jrd/SysFunction.cpp:1556–1572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1554
1555
1556void makeDecodeHex(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc* result, int argsCount, const dsc** args)
1557{
1558 fb_assert(argsCount == 1);
1559 if (args[0]->isBlob())
1560 result->makeBlob(isc_blob_untyped, ttype_binary);
1561 else if (args[0]->isText())
1562 {
1563 unsigned len = characterLen(dataTypeUtil, args[0]);
1564 if (len % 2 || !len)
1565 status_exception::raise(Arg::Gds(isc_odd_hex_len) << Arg::Num(len));
1566 result->makeVarying(len / 2, ttype_binary);
1567 }
1568 else
1569 status_exception::raise(Arg::Gds(isc_tom_strblob));
1570
1571 result->setNullable(args[0]->isNullable());
1572}
1573
1574
1575void makeEncodeHex(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc* result, int argsCount, const dsc** args)

Callers

nothing calls this directly

Calls 10

characterLenFunction · 0.85
raiseFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
isBlobMethod · 0.80
makeBlobMethod · 0.80
isTextMethod · 0.80
makeVaryingMethod · 0.80
setNullableMethod · 0.80
isNullableMethod · 0.45

Tested by

no test coverage detected