[raster] ST_MapAlgebra checks callbacks parameters but not strictness
|Reported by:||strk||Owned by:||Bborie Park|
I've spent all morning wondering why ST_MapAlgebra was not calling my callback function, to finally find the culprit was the function being defined as being "strict": https://github.com/postgis/postgis/blob/svn-trunk/raster/rt_pg/rtpg_mapalgebra.c#L476-L478
I guess the null being passed is the userarg, which I'm not requesting. That argument, in the callback, is marked as being "variadic".
I don't know if it would be safe to call a strict function with a null value as a variadic argument (I'd guess so) but the point of this ticket is that silently skipping the callback invocation is not a nice thing to do, as the user is left wondering why the callback is not being invoked.
What we could do is raise an EXCEPTION if any NULL is to be passed to a STRICT function. For a start, that'd give the user an hint.
If there are any other possible NULL values that could get passed, and would depend on the input raster/band/values rather than on the call to ST_MapAlgebra then the message could become a WARNING instead, but, does such case exist ?
Change History (9)
comment:8 by , 9 years ago
|Milestone:||→ PostGIS 2.1.4|
|Status:||assigned → closed|
|Version:||trunk → 2.1.x|