]> granicus.if.org Git - postgresql/commit
Use mul_size when multiplying by the number of parallel workers.
authorRobert Haas <rhaas@postgresql.org>
Fri, 6 May 2016 18:23:47 +0000 (14:23 -0400)
committerRobert Haas <rhaas@postgresql.org>
Fri, 6 May 2016 18:32:58 +0000 (14:32 -0400)
commit06bd458cb812623c3f1fdd55216c4c08b06a8447
tree49d6d64be5e945fd65df41bf5222d31b193a13d2
parenta89505fd21da337b81172871d8f65d9a4fa22a8b
Use mul_size when multiplying by the number of parallel workers.

That way, if the result overflows size_t, you'll get an error instead
of undefined behavior, which seems like a plus.  This also has the
effect of casting the number of workers from int to Size, which is
better because it's harder to overflow int than size_t.

Dilip Kumar reported this issue and provided a patch upon which this
patch is based, but his version did use mul_size.
src/backend/access/transam/parallel.c
src/backend/executor/execParallel.c