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

Function makeCeilFloor

src/jrd/SysFunction.cpp:1340–1380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1338
1339
1340void makeCeilFloor(DataTypeUtilBase*, const SysFunction* function, dsc* result,
1341 int argsCount, const dsc** args)
1342{
1343 fb_assert(argsCount == function->minArgCount);
1344
1345 const dsc* value = args[0];
1346
1347 if (value->isNull())
1348 {
1349 result->makeLong(0);
1350 result->setNull();
1351 return;
1352 }
1353
1354 switch (value->dsc_dtype)
1355 {
1356 case dtype_short:
1357 result->makeLong(0);
1358 break;
1359
1360 case dtype_long:
1361 case dtype_int64:
1362 result->makeInt64(0);
1363 break;
1364
1365 case dtype_int128:
1366 result->makeInt128(0);
1367 break;
1368
1369 case dtype_dec128:
1370 case dtype_dec64:
1371 result->makeDecimal128(0);
1372 break;
1373
1374 default:
1375 result->makeDouble();
1376 break;
1377 }
1378
1379 result->setNullable(value->isNullable());
1380}
1381
1382
1383void makeDateAdd(DataTypeUtilBase*, const SysFunction*, dsc* result, int argsCount, const dsc** args)

Callers

nothing calls this directly

Calls 9

makeLongMethod · 0.80
makeInt64Method · 0.80
makeInt128Method · 0.80
makeDecimal128Method · 0.80
makeDoubleMethod · 0.80
setNullableMethod · 0.80
isNullMethod · 0.45
setNullMethod · 0.45
isNullableMethod · 0.45

Tested by

no test coverage detected