BUG #4743: potential bug between int and uint

Поиск
Список
Период
Сортировка
От MATSUDA, Daiki
Тема BUG #4743: potential bug between int and uint
Дата
Msg-id 200903310557.n2V5vSNh030035@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #4743: potential bug between int and uint
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      4743
Logged by:          MATSUDA, Daiki
Email address:      d.matuda@gmail.com
PostgreSQL version: 8.3.6
Operating system:   Linux
Description:        potential bug between int and uint
Details:

diff -uNrp ./src/backend/storage/ipc/procarray.c.bk
./src/backend/storage/ipc/procarray.c
--- ./src/backend/storage/ipc/procarray.c.bk    2009-03-05
10:23:03.000000000 +0900
+++ ./src/backend/storage/ipc/procarray.c       2009-03-05
10:25:20.000000000 +0900
@@ -662,8 +662,8 @@ GetSnapshotData(Snapshot snapshot, bool
        TransactionId xmax;
        TransactionId globalxmin;
        int                     index;
-       int                     count = 0;
-       int                     subcount = 0;
+       uint32          count = 0;
+       int32           subcount = 0;

        Assert(snapshot != NULL);

because uint32 xcnt and int32 subxcnt in Snapshot structure, same as struct
SnapshotData, is declared. and
    snapshot->xcnt = count;
    snapshot->subxcnt = subcount;
are written in GetSnapshotData() in procarray.c. It is a potential bug.

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

Предыдущее
От: "Slava Moudry"
Дата:
Сообщение: BUG #4742: wrong resultset instead of syntax error
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #4742: wrong resultset instead of syntax error