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

Function GEN_descriptor

src/dsql/gen.cpp:297–411  ·  view source on GitHub ↗

GEN_descriptor @brief Generate a blr descriptor from an internal descriptor. @param dsqlScratch @param desc @param texttype **/

Source from the content-addressed store, hash-verified

295
296 **/
297void GEN_descriptor( DsqlCompilerScratch* dsqlScratch, const dsc* desc, bool texttype)
298{
299 switch (desc->dsc_dtype)
300 {
301 case dtype_text:
302 if (texttype || desc->dsc_ttype() == ttype_binary || desc->dsc_ttype() == ttype_none)
303 {
304 dsqlScratch->appendUChar(blr_text2);
305 dsqlScratch->appendUShort(desc->dsc_ttype());
306 }
307 else
308 {
309 dsqlScratch->appendUChar(blr_text2); // automatic transliteration
310 dsqlScratch->appendUShort(ttype_dynamic);
311 }
312
313 dsqlScratch->appendUShort(desc->dsc_length);
314 break;
315
316 case dtype_varying:
317 if (texttype || desc->dsc_ttype() == ttype_binary || desc->dsc_ttype() == ttype_none)
318 {
319 dsqlScratch->appendUChar(blr_varying2);
320 dsqlScratch->appendUShort(desc->dsc_ttype());
321 }
322 else
323 {
324 dsqlScratch->appendUChar(blr_varying2); // automatic transliteration
325 dsqlScratch->appendUShort(ttype_dynamic);
326 }
327 dsqlScratch->appendUShort(desc->dsc_length - sizeof(USHORT));
328 break;
329
330 case dtype_short:
331 dsqlScratch->appendUChar(blr_short);
332 dsqlScratch->appendUChar(desc->dsc_scale);
333 break;
334
335 case dtype_long:
336 dsqlScratch->appendUChar(blr_long);
337 dsqlScratch->appendUChar(desc->dsc_scale);
338 break;
339
340 case dtype_quad:
341 dsqlScratch->appendUChar(blr_quad);
342 dsqlScratch->appendUChar(desc->dsc_scale);
343 break;
344
345 case dtype_int64:
346 dsqlScratch->appendUChar(blr_int64);
347 dsqlScratch->appendUChar(desc->dsc_scale);
348 break;
349
350 case dtype_real:
351 dsqlScratch->appendUChar(blr_float);
352 break;
353
354 case dtype_double:

Callers 6

genBlrMethod · 0.85
genNegZeroMethod · 0.85
genConstantMethod · 0.85
GEN_hidden_variablesFunction · 0.85
GEN_portFunction · 0.85

Calls 7

ERRD_postFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
dsc_ttypeMethod · 0.80
appendUCharMethod · 0.80
appendUShortMethod · 0.80
getTextTypeMethod · 0.80

Tested by

no test coverage detected