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

Function evlNormDec

src/jrd/SysFunction.cpp:5390–5420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5388
5389
5390dsc* evlNormDec(thread_db* tdbb, const SysFunction* function, const NestValueArray& args,
5391 impure_value* impure)
5392{
5393 fb_assert(args.getCount() == 1);
5394
5395 Request* request = tdbb->getRequest();
5396
5397 const dsc* value;
5398 value = EVL_expr(tdbb, request, args[0]);
5399 if (request->req_flags & req_null) // return NULL if value is NULL
5400 return NULL;
5401
5402 DecimalStatus decSt = tdbb->getAttachment()->att_dec_status;
5403
5404 if (value->dsc_dtype == dtype_dec64)
5405 {
5406 Decimal64 v = MOV_get_dec64(tdbb, value);
5407
5408 impure->vlu_misc.vlu_dec64 = v.normalize(decSt);
5409 impure->vlu_desc.makeDecimal64(&impure->vlu_misc.vlu_dec64);
5410 }
5411 else
5412 {
5413 Decimal128 v = MOV_get_dec128(tdbb, value);
5414
5415 impure->vlu_misc.vlu_dec128 = v.normalize(decSt);
5416 impure->vlu_desc.makeDecimal128(&impure->vlu_misc.vlu_dec128);
5417 }
5418
5419 return &impure->vlu_desc;
5420}
5421
5422
5423dsc* evlMakeDbkey(Jrd::thread_db* tdbb, const SysFunction* function, const NestValueArray& args, Jrd::impure_value* impure)

Callers

nothing calls this directly

Calls 9

EVL_exprFunction · 0.85
MOV_get_dec64Function · 0.85
MOV_get_dec128Function · 0.85
makeDecimal64Method · 0.80
makeDecimal128Method · 0.80
getCountMethod · 0.45
getRequestMethod · 0.45
getAttachmentMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected