| 3855 | // |
| 3856 | |
| 3857 | static void set_ref( gpre_nod* expr, gpre_fld* field_ref) |
| 3858 | { |
| 3859 | assert_IS_NOD(expr); |
| 3860 | |
| 3861 | ref* re = (ref*) expr->nod_arg[0]; |
| 3862 | switch (expr->nod_type) |
| 3863 | { |
| 3864 | case nod_value: |
| 3865 | re->ref_field = field_ref; |
| 3866 | break; |
| 3867 | |
| 3868 | case nod_agg_count: |
| 3869 | case nod_agg_max: |
| 3870 | case nod_agg_min: |
| 3871 | case nod_agg_total: |
| 3872 | case nod_agg_average: |
| 3873 | case nod_plus: |
| 3874 | case nod_minus: |
| 3875 | case nod_times: |
| 3876 | case nod_divide: |
| 3877 | case nod_negate: |
| 3878 | case nod_upcase: |
| 3879 | case nod_lowcase: |
| 3880 | case nod_concatenate: |
| 3881 | case nod_cast: |
| 3882 | { |
| 3883 | gpre_nod** ptr = expr->nod_arg; |
| 3884 | for (const gpre_nod* const* const end = ptr + expr->nod_count; ptr < end; ptr++) |
| 3885 | { |
| 3886 | set_ref(*ptr, field_ref); |
| 3887 | } |
| 3888 | break; |
| 3889 | } |
| 3890 | // Begin date/time/timestamp support |
| 3891 | case nod_extract: |
| 3892 | set_ref(expr->nod_arg[1], field_ref); |
| 3893 | break; |
| 3894 | // End date/time/timestamp support |
| 3895 | } |
| 3896 | } |
| 3897 | |
| 3898 | |
| 3899 | //____________________________________________________________ |