Branch: Tag:

2018-05-23

2018-05-23 09:43:50 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Fix regression error in adaptive buffer refill.

sizeof(Thread.Queue()) is not equal to Thread.Queue()->size().
Fixes the calculation for adaptive buffer refills.
Without this fix, it *will* result in hung queries, but only
if the number of rows returned exceeds 1024.

1453:    }       private void replenishrows() { -  if (_fetchlimit && sizeof(datarows) <= _fetchlimit >> 1) { +  if (_fetchlimit && datarows->size() <= _fetchlimit >> 1) {    Thread.MutexKey lock = closemux->lock();    if (_fetchlimit) {    _fetchlimit = pgsqlsess._fetchlimit;