Re: subplan resets wrong hashtable

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: subplan resets wrong hashtable
Дата
Msg-id 20200210045308.GD1412@telsasoft.com
обсуждение исходный текст
Ответ на Re: subplan resets wrong hashtable  (Andres Freund <andres@anarazel.de>)
Ответы Re: subplan resets wrong hashtable  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, Feb 09, 2020 at 08:01:26PM -0800, Andres Freund wrote:
> Ugh, that indeed looks wrong. Did you check whether it can actively
> cause wrong query results? If so, did you do theoretically, or got to a
> query returning wrong results?

Actually .. I can "theoretically" prove that there's no wrong results from that
patch...since in that file it has no effect, the tested variables being zeroed
few lines earlier:

 @@ -499,51 +499,60 @@ buildSubPlanHash(SubPlanState *node, ExprContext *econtext)
*        node->hashtable = NULL;
*        node->hashnulls = NULL;
         node->havehashrows = false;
         node->havenullrows = false;
  
         nbuckets = (long) Min(planstate->plan->plan_rows, (double) LONG_MAX);
         if (nbuckets < 1)
                 nbuckets = 1;
  
 -       node->hashtable = BuildTupleHashTable(node->parent,
 -                                                                                 node->descRight,
 -                                                                                 ncols,
 -                                                                                 node->keyColIdx,
 -                                                                                 node->tab_eq_funcoids,
 -                                                                                 node->tab_hash_funcs,
 -                                                                                 nbuckets,
 -                                                                                 0,
 -                                                                                 node->hashtablecxt,
 -                                                                                 node->hashtempcxt,
 -                                                                                 false);
*+       if (node->hashtable)
 +               ResetTupleHashTable(node->hashtable);
 +       else
 +               node->hashtable = BuildTupleHashTableExt(node->parent,
 
 ...
*+               if (node->hashnulls)
 +                       ResetTupleHashTable(node->hashtable);
 +               else
 +                       node->hashnulls = BuildTupleHashTableExt(node->parent,
 +
node->descRight,





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: Identifying user-created objects
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Is custom MemoryContext prohibited?