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

Function par_computed

src/gpre/sql.cpp:5680–5717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5678//
5679
5680static void par_computed( gpre_req* request, gpre_fld* field)
5681{
5682 MSC_match(KW_BY);
5683
5684 // If field size has been specified, save it. Then NULL it
5685 // till the new size is calculated from the specified expression.
5686 // This will catch self references.
5687 //
5688 // The user specified values will be restored to override calculated
5689 // values.
5690 //
5691 // Don't move this initialization below.
5692 const gpre_fld save_fld = *field;
5693
5694 CMPF cmp = (CMPF) MSC_alloc(CMPF_LEN);
5695 cmp->cmpf_text = CPR_start_text();
5696 cmp->cmpf_boolean = SQE_value(request, false, NULL, NULL);
5697 CPR_end_text(cmp->cmpf_text);
5698
5699 field->fld_computed = cmp;
5700 field->fld_flags |= FLD_computed;
5701
5702 CME_get_dtype(field->fld_computed->cmpf_boolean, field);
5703
5704 // If there was user specified data type/size, restore it
5705
5706 if (save_fld.fld_dtype)
5707 {
5708 field->fld_dtype = save_fld.fld_dtype;
5709 field->fld_length = save_fld.fld_length;
5710 field->fld_scale = save_fld.fld_scale;
5711 field->fld_sub_type = save_fld.fld_sub_type;
5712 field->fld_ttype = save_fld.fld_ttype;
5713 field->fld_charset_id = save_fld.fld_charset_id;
5714 field->fld_collate_id = save_fld.fld_collate_id;
5715 field->fld_char_length = save_fld.fld_char_length;
5716 }
5717}
5718
5719
5720//____________________________________________________________

Callers 1

par_fieldFunction · 0.85

Calls 6

MSC_matchFunction · 0.85
MSC_allocFunction · 0.85
CPR_start_textFunction · 0.85
SQE_valueFunction · 0.85
CPR_end_textFunction · 0.85
CME_get_dtypeFunction · 0.85

Tested by

no test coverage detected