| 804 | */ |
| 805 | PG_FUNCTION_INFO_V1(array_square); |
| 806 | Datum |
| 807 | array_square(PG_FUNCTION_ARGS){ |
| 808 | if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); } |
| 809 | |
| 810 | ArrayType *x = PG_GETARG_ARRAYTYPE_P(0); |
| 811 | ArrayType *v1 = array_to_float8_array(x); |
| 812 | Datum v2 = 0; |
| 813 | |
| 814 | ArrayType *res = General_Array_to_Array(v1, v2, element_square); |
| 815 | |
| 816 | if (v1 != x) { pfree(v1); } |
| 817 | PG_FREE_IF_COPY(x, 0); |
| 818 | |
| 819 | PG_RETURN_ARRAYTYPE_P(res); |
| 820 | } |
| 821 | |
| 822 | /* |
| 823 | * This function sets all elements to be the specified value. |
nothing calls this directly
no test coverage detected