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

Method make

src/dsql/AggNodes.cpp:511–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511void AvgAggNode::make(DsqlCompilerScratch* dsqlScratch, dsc* desc)
512{
513 DsqlDescMaker::fromNode(dsqlScratch, desc, arg, true);
514
515 if (desc->isNull())
516 return;
517
518 if (DTYPE_IS_DECFLOAT(desc->dsc_dtype))
519 return;
520
521 if (dialect1)
522 {
523 if (!DTYPE_IS_NUMERIC(desc->dsc_dtype) && !DTYPE_IS_TEXT(desc->dsc_dtype))
524 {
525 ERRD_post(Arg::Gds(isc_expression_eval_err) <<
526 Arg::Gds(isc_dsql_agg_wrongarg) << Arg::Str("AVG"));
527 }
528 else if (DTYPE_IS_TEXT(desc->dsc_dtype))
529 {
530 desc->dsc_dtype = dtype_double;
531 desc->dsc_length = sizeof(double);
532 }
533 }
534 else
535 {
536 if (!DTYPE_IS_NUMERIC(desc->dsc_dtype))
537 {
538 ERRD_post(Arg::Gds(isc_expression_eval_err) <<
539 Arg::Gds(isc_dsql_agg2_wrongarg) << Arg::Str("AVG"));
540 }
541 else if (desc->dsc_dtype == dtype_int128)
542 {
543 desc->dsc_dtype = dtype_int128;
544 desc->dsc_length = sizeof(Int128);
545 }
546 else if (DTYPE_IS_EXACT(desc->dsc_dtype))
547 {
548 desc->dsc_dtype = dtype_int64;
549 desc->dsc_length = sizeof(SINT64);
550 }
551 else
552 {
553 desc->dsc_dtype = dtype_double;
554 desc->dsc_length = sizeof(double);
555 }
556 }
557}
558
559void AvgAggNode::getDesc(thread_db* tdbb, CompilerScratch* csb, dsc* desc)
560{

Callers 1

dsqlCopyMethod · 0.45

Calls 15

DTYPE_IS_DECFLOATFunction · 0.85
DTYPE_IS_NUMERICFunction · 0.85
DTYPE_IS_TEXTFunction · 0.85
ERRD_postFunction · 0.85
GdsClass · 0.85
StrClass · 0.85
DTYPE_IS_EXACTFunction · 0.85
makeBlobMethod · 0.80
getBlobSubTypeMethod · 0.80
getTextTypeMethod · 0.80
setNullableMethod · 0.80
makeLongMethod · 0.80

Tested by

no test coverage detected