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

Function makeDateDiff

src/jrd/SysFunction.cpp:1398–1419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1396
1397
1398void makeDateDiff(DataTypeUtilBase* dataTypeUtil, const SysFunction*, dsc* result, int argsCount, const dsc** args)
1399{
1400 if (dataTypeUtil->getDialect() == 1)
1401 result->makeDouble();
1402 else
1403 {
1404 if (argsCount >= 1 &&
1405 args[0]->dsc_address && // constant
1406 CVT_get_long(args[0], 0, JRD_get_thread_data()->getAttachment()->att_dec_status, ERR_post) == blr_extract_millisecond)
1407 {
1408 result->makeInt64(ISC_TIME_SECONDS_PRECISION_SCALE + 3);
1409 }
1410 else
1411 result->makeInt64(0);
1412 }
1413
1414 bool isNullable;
1415 if (initResult(result, argsCount, args, &isNullable))
1416 return;
1417
1418 result->setNullable(isNullable);
1419}
1420
1421
1422void makeFirstLastDayResult(DataTypeUtilBase*, const SysFunction*, dsc* result,

Callers

nothing calls this directly

Calls 8

CVT_get_longFunction · 0.85
JRD_get_thread_dataFunction · 0.85
initResultFunction · 0.85
makeDoubleMethod · 0.80
makeInt64Method · 0.80
setNullableMethod · 0.80
getDialectMethod · 0.45
getAttachmentMethod · 0.45

Tested by

no test coverage detected