confusing comment in tqual.c

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема confusing comment in tqual.c
Дата
Msg-id 871wqdqglm.fsf@enterprisedb.com
обсуждение исходный текст
Ответы Re: confusing comment in tqual.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

I'm reading the code in tqual.c and find that this comment doesn't seem to
match the code. CommandId always seems to be compared with >= or <= rather
than equality as the comment says.

I'm not even sure I have these operators right as the expression as written
here is in a few places the converse case that the code actually tests. It's
also pretty confusing.

I'm not so much submitting this patch to try to correct it as to verify my
understanding of the code.


*** tqual.c    14 Sep 2006 13:54:45 +0100    1.96
--- tqual.c    15 Sep 2006 15:50:41 +0100    
***************
*** 254,269 ****  * The satisfaction of "now" requires the following:  *  * ((Xmin == my-transaction &&
changedby the current transaction
 
!  *     Cmin != my-command &&                    but not by this command, and  *        (Xmax is null ||
        the row has not been deleted, or  *            (Xmax == my-transaction &&            it was deleted by the
currenttransaction
 
!  *             Cmax != my-command)))                but not by this command,  * ||
   or  *  *    (Xmin is committed &&                    the row was modified by a committed transaction, and  *
(Xmaxis null ||                    the row has not been deleted, or  *            (Xmax == my-transaction &&
therow is being deleted by this command, or
 
!  *             Cmax == my-command) ||  *            (Xmax is not committed &&            the row was deleted by
anothertransaction  *             Xmax != my-transaction))))            that has not been committed  *
 
--- 254,269 ----  * The satisfaction of "now" requires the following:  *  * ((Xmin == my-transaction &&
changedby the current transaction
 
!  *     Cmin < my-command &&                    by an earlier command than this scan, and  *        (Xmax is null ||
                    the row has not been deleted, or  *            (Xmax == my-transaction &&            it was deleted
bythe current transaction
 
!  *             Cmax >= my-command)))                but not by a command before this scan  * ||
                or  *  *    (Xmin is committed &&                    the row was modified by a committed transaction,
and *        (Xmax is null ||                    the row has not been deleted, or  *            (Xmax == my-transaction
&&           the row is being deleted by an earlier command
 
!  *             Cmax >= my-command) ||  *            (Xmax is not committed &&            the row was deleted by
anothertransaction  *             Xmax != my-transaction))))            that has not been committed  *
 


--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com


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

Предыдущее
От: "Ricardo Malafaia"
Дата:
Сообщение: Re: polite request about syntax
Следующее
От: "D'Arcy J.M. Cain"
Дата:
Сообщение: Re: New version of money type