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

Function makeHash

src/jrd/SysFunction.cpp:1466–1493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1464
1465
1466void makeHash(DataTypeUtilBase* dataTypeUtil, const SysFunction* function, dsc* result,
1467 int argsCount, const dsc** args)
1468{
1469 fb_assert(argsCount >= function->minArgCount);
1470
1471 if (argsCount == 1)
1472 makeInt64Result(dataTypeUtil, function, result, argsCount, args);
1473 else if (argsCount >= 2)
1474 {
1475 bool cryptHash;
1476 const HashAlgorithmDescriptor* d = getHashAlgorithmDesc(JRD_get_thread_data(), function, args[1], &cryptHash);
1477
1478 if (cryptHash)
1479 result->makeVarying(d->length, ttype_binary);
1480 else
1481 {
1482 switch(d->length)
1483 {
1484 case 4:
1485 result->makeLong(0);
1486 break;
1487 default:
1488 fb_assert(false);
1489 }
1490 }
1491 result->setNullable(args[0]->isNullable());
1492 }
1493}
1494
1495
1496unsigned decodeLen(unsigned len)

Callers

nothing calls this directly

Calls 7

makeInt64ResultFunction · 0.85
getHashAlgorithmDescFunction · 0.85
JRD_get_thread_dataFunction · 0.85
makeVaryingMethod · 0.80
makeLongMethod · 0.80
setNullableMethod · 0.80
isNullableMethod · 0.45

Tested by

no test coverage detected