Kohei KaiGai <kai...@heterodb.com> writes: > Ok, the attached v4 sends the raw header as-is, then cube_recv > validates the header. > If num-of-dimension is larger than CUBE_MAX_DIM, it is obviously > unused bits (8-30) > are used or out of the range.
Works for me. I noted one additional bug: you have to condition whether to dump the upper coordinates just on the IS_POINT flag, because that is all that cube_recv will see. The cube_is_point_internal() hack can be used in some other places, but not here. Also, as a matter of style, I didn't like that cube_send was using the LL_COORD/UR_COORD abstraction but cube_recv wasn't. In the worst case (if someone tried to change that abstraction) this could turn into an actual bug, with cube_recv storing the coordinates in the wrong order. Could have gone either way on which one to change to look like the other, but I chose to simplify cube_send to look like cube_recv. This essentially means that we're locking the binary representation to use the physical storage order of the coordinates even if someone gets fancy about their meaning. Pushed with those fixes. regards, tom lane