Обсуждение: OIDS > INT_MAX displayed wrapped around

Поиск
Список
Период
Сортировка

OIDS > INT_MAX displayed wrapped around

От
Kris Jurka
Дата:
The display for tables that have oids higher than INT_MAX is correct in
one dialog, but wrapped around in another.  The popup properties is wrong
while the properties displayed in the core view is right.  It's difficult
to describe exactly in words, so here's a screenshot.

http://ejurka.com/pgsql/pgadmin/highoids.png


Kris Jurka

Re: OIDS > INT_MAX displayed wrapped around

От
Guillaume Lelarge
Дата:
Hi Kris,

Kris Jurka a écrit :
>
> The display for tables that have oids higher than INT_MAX is correct in
> one dialog, but wrapped around in another.  The popup properties is
> wrong while the properties displayed in the core view is right.  It's
> difficult to describe exactly in words, so here's a screenshot.
>
> http://ejurka.com/pgsql/pgadmin/highoids.png
>

Thanks for the report and the screenshot. We use long instead of
unsigned long in dlgProperties.cpp. So it should be pretty easy to fix
but I need some time to build a test case.

Thanks.


--
Guillaume.
<!-- http://abs.traduc.org/
     http://lfs.traduc.org/
     http://docs.postgresqlfr.org/ -->

Re: OIDS > INT_MAX displayed wrapped around

От
Guillaume Lelarge
Дата:
Guillaume Lelarge a écrit :
> Hi Kris,
>
> Kris Jurka a écrit :
>> The display for tables that have oids higher than INT_MAX is correct in
>> one dialog, but wrapped around in another.  The popup properties is
>> wrong while the properties displayed in the core view is right.  It's
>> difficult to describe exactly in words, so here's a screenshot.
>>
>> http://ejurka.com/pgsql/pgadmin/highoids.png
>>
>
> Thanks for the report and the screenshot. We use long instead of
> unsigned long in dlgProperties.cpp. So it should be pretty easy to fix
> but I need some time to build a test case.
>

I don't know how I can build such a test case. My generate_series to
build a billion inserts just failed with a "write failed" message...
Here is the patch. It compiles and works on my laptop but I don't know
if it really fixes the issue. If someone with a big enough database can
apply the patch and compile pgAdmin with it, I would be really happy to
know about the result.

Thanks.


--
Guillaume.
<!-- http://abs.traduc.org/
     http://lfs.traduc.org/
     http://docs.postgresqlfr.org/ -->
Index: pgadmin/dlg/dlgProperty.cpp
===================================================================
--- pgadmin/dlg/dlgProperty.cpp    (révision 6515)
+++ pgadmin/dlg/dlgProperty.cpp    (copie de travail)
@@ -264,7 +264,7 @@
         if (txtName)
             txtName->SetValue(GetObject()->GetName());
         if (txtOid)
-            txtOid->SetValue(NumToStr((long)GetObject()->GetOid()));
+            txtOid->SetValue(NumToStr((unsigned long)GetObject()->GetOid()));
         if (cbOwner)
             cbOwner->SetValue(GetObject()->GetOwner());
         if (txtComment)

Re: OIDS > INT_MAX displayed wrapped around

От
Dave Page
Дата:
Guillaume Lelarge wrote:
> I don't know how I can build such a test case. My generate_series to
> build a billion inserts just failed with a "write failed" message...
> Here is the patch. It compiles and works on my laptop but I don't know
> if it really fixes the issue. If someone with a big enough database can
> apply the patch and compile pgAdmin with it, I would be really happy to
> know about the result.

The patch seems fine to me - and I can't see that it can break anything.

Please go ahead and apply.

Regards, Dave.

Re: OIDS > INT_MAX displayed wrapped around

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> Guillaume Lelarge wrote:
>> I don't know how I can build such a test case. My generate_series to
>> build a billion inserts just failed with a "write failed" message...
>> Here is the patch. It compiles and works on my laptop but I don't know
>> if it really fixes the issue. If someone with a big enough database can
>> apply the patch and compile pgAdmin with it, I would be really happy to
>> know about the result.
>
> The patch seems fine to me - and I can't see that it can break anything.
>
> Please go ahead and apply.
>

Done.

Kris, it would be great if you can tell us if your issue is fixed when
beta 3 will be available. Thanks.

Regards.


--
Guillaume.
<!-- http://abs.traduc.org/
     http://lfs.traduc.org/
     http://docs.postgresqlfr.org/ -->

Re: OIDS > INT_MAX displayed wrapped around

От
Kris Jurka
Дата:

On Tue, 31 Jul 2007, Guillaume Lelarge wrote:

> I don't know how I can build such a test case. My generate_series to
> build a billion inserts just failed with a "write failed" message...
> Here is the patch. It compiles and works on my laptop but I don't know
> if it really fixes the issue. If someone with a big enough database can
> apply the patch and compile pgAdmin with it, I would be really happy to
> know about the result.
>

I actually have a tiny database that I was testing the JDBC driver's large
oid handling with and happened across this problem.  You can use
pg_resetxlog's -o option to set the next oid to any value of your
choosing.  Or you can wait for beta three and I'll test again.

Kris Jurka