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

Method fixLength

src/jrd/DataTypeUtil.cpp:237–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235
236
237ULONG DataTypeUtilBase::fixLength(const dsc* desc, ULONG length)
238{
239 const UCHAR bpc = maxBytesPerChar(desc->getCharSet());
240
241 USHORT overhead = 0;
242 if (desc->dsc_dtype == dtype_varying)
243 overhead = sizeof(USHORT);
244 else if (desc->dsc_dtype == dtype_cstring)
245 overhead = sizeof(UCHAR);
246
247 return MIN(((MAX_STR_SIZE - overhead) / bpc) * bpc, length);
248}
249
250
251void DataTypeUtilBase::makeConcatenate(dsc* result, const dsc* value1, const dsc* value2)

Callers 4

GEN_portFunction · 0.80
makeLeftRightFunction · 0.80
makePadFunction · 0.80
makeReplaceFunction · 0.80

Calls 1

getCharSetMethod · 0.45

Tested by

no test coverage detected