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

Function evlUuidToChar

src/jrd/SysFunction.cpp:6792–6834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6790
6791
6792dsc* evlUuidToChar(thread_db* tdbb, const SysFunction* function, const NestValueArray& args,
6793 impure_value* impure)
6794{
6795 fb_assert(args.getCount() == 1);
6796
6797 Request* request = tdbb->getRequest();
6798
6799 const dsc* value = EVL_expr(tdbb, request, args[0]);
6800 if (request->req_flags & req_null) // return NULL if value is NULL
6801 return NULL;
6802
6803 if (!value->isText())
6804 {
6805 status_exception::raise(Arg::Gds(isc_expression_eval_err) <<
6806 Arg::Gds(isc_sysf_binuuid_mustbe_str) <<
6807 Arg::Str(function->name));
6808 }
6809
6810 UCHAR* data;
6811 const USHORT len = MOV_get_string(tdbb, value, &data, NULL, 0);
6812
6813 if (len != sizeof(Guid))
6814 {
6815 status_exception::raise(Arg::Gds(isc_expression_eval_err) <<
6816 Arg::Gds(isc_sysf_binuuid_wrongsize) <<
6817 Arg::Num(sizeof(Guid)) <<
6818 Arg::Str(function->name));
6819 }
6820
6821 UCHAR buffer[GUID_BUFF_SIZE];
6822 sprintf(reinterpret_cast<char*>(buffer),
6823 BYTE_GUID_FORMAT,
6824 data[0], data[1], data[2], data[3], data[4],
6825 data[5], data[6], data[7], data[8], data[9],
6826 data[10], data[11], data[12], data[13], data[14],
6827 data[15]);
6828
6829 dsc result;
6830 result.makeText(GUID_BODY_SIZE, ttype_ascii, buffer);
6831 EVL_make_value(tdbb, &result, impure);
6832
6833 return &impure->vlu_desc;
6834}
6835
6836dsc* evlRoleInUse(thread_db* tdbb, const SysFunction*, const NestValueArray& args,
6837 impure_value* impure)

Callers

nothing calls this directly

Calls 11

EVL_exprFunction · 0.85
raiseFunction · 0.85
GdsClass · 0.85
StrClass · 0.85
MOV_get_stringFunction · 0.85
NumClass · 0.85
EVL_make_valueFunction · 0.85
isTextMethod · 0.80
makeTextMethod · 0.80
getCountMethod · 0.45
getRequestMethod · 0.45

Tested by

no test coverage detected