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

Function evlOverlay

src/jrd/SysFunction.cpp:5662–5843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5660
5661
5662dsc* evlOverlay(thread_db* tdbb, const SysFunction* function, const NestValueArray& args,
5663 impure_value* impure)
5664{
5665 fb_assert(args.getCount() >= 3);
5666
5667 Request* request = tdbb->getRequest();
5668
5669 const dsc* value = EVL_expr(tdbb, request, args[0]);
5670 if (request->req_flags & req_null) // return NULL if value is NULL
5671 return NULL;
5672
5673 const dsc* placing = EVL_expr(tdbb, request, args[1]);
5674 if (request->req_flags & req_null) // return NULL if placing is NULL
5675 return NULL;
5676
5677 const dsc* fromDsc = EVL_expr(tdbb, request, args[2]);
5678 if (request->req_flags & req_null) // return NULL if fromDsc is NULL
5679 return NULL;
5680
5681 const dsc* lengthDsc = NULL;
5682 ULONG length = 0;
5683
5684 if (args.getCount() >= 4)
5685 {
5686 lengthDsc = EVL_expr(tdbb, request, args[3]);
5687 if (request->req_flags & req_null) // return NULL if lengthDsc is NULL
5688 return NULL;
5689
5690 const SLONG auxlen = MOV_get_long(tdbb, lengthDsc, 0);
5691
5692 if (auxlen < 0)
5693 {
5694 status_exception::raise(Arg::Gds(isc_expression_eval_err) <<
5695 Arg::Gds(isc_sysf_argnmustbe_nonneg) <<
5696 Arg::Num(4) <<
5697 Arg::Str(function->name));
5698 }
5699
5700 length = auxlen;
5701 }
5702
5703 SLONG from = MOV_get_long(tdbb, fromDsc, 0);
5704
5705 if (from <= 0)
5706 {
5707 status_exception::raise(Arg::Gds(isc_expression_eval_err) <<
5708 Arg::Gds(isc_sysf_argnmustbe_positive) <<
5709 Arg::Num(3) <<
5710 Arg::Str(function->name));
5711 }
5712
5713 const USHORT resultTextType = DataTypeUtil::getResultTextType(value, placing);
5714 CharSet* cs = INTL_charset_lookup(tdbb, resultTextType);
5715
5716 MoveBuffer temp1;
5717 UCHAR* str1;
5718 ULONG len1;
5719

Callers

nothing calls this directly

Calls 15

EVL_exprFunction · 0.85
MOV_get_longFunction · 0.85
raiseFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
StrClass · 0.85
INTL_charset_lookupFunction · 0.85
BLB_gen_bpb_from_descsFunction · 0.85
MOV_make_string2Function · 0.85
EVL_make_valueFunction · 0.85
createFunction · 0.85
isBlobMethod · 0.80

Tested by

no test coverage detected