Tom Lane 55d9cd46f6 Avoid misbehavior when hash_table_bytes < bucket_size.
It's possible to reach this case when work_mem is very small and tupsize
is (relatively) very large.  In that case ExecChooseHashTableSize would
get an assertion failure, or with asserts off it'd compute nbuckets = 0,
which'd likely cause misbehavior later (I've not checked).  To fix,
clamp the number of buckets to be at least 1.

This is due to faulty conversion of old my_log2() coding in 28d936031.
Back-patch to v13, as that was.

Zhang Mingli

Discussion: https://postgr.es/m/beb64ca0-91e2-44ac-bf4a-7ea36275ec02@Spark
2022-08-13 17:00:32 -04:00
..
2022-07-11 16:43:29 +12:00
2022-08-14 08:46:53 +12:00
2022-08-14 08:46:53 +12:00
2022-07-12 16:30:36 -04:00
2022-08-14 08:46:53 +12:00
2018-03-30 17:33:04 -07:00