Thread: Updated win32 readdir patch

Updated win32 readdir patch

From
"Magnus Hagander"
Date:
Hello!

Here is an updated version of the win32 readdir patch.

1) Now puts in exactly the same change as the current-cvs mingw code
does. (see
http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/mingwex/dirent.c?r1=
1.3&r2=1.4, second part of the patch).

2) Updates both xlog.c and slru.c in backend/access/transam/

3) Also updates pg_resetxlog, which also uses readdir() and checks the
errno value after the loop.

Claudio - if this is not applied, please updated the win32 status page
to point to this patch instead of the previous incomplete one.

//Magnus
 <<win32_readdir.patch>>

Attachment

Re: Updated win32 readdir patch

From
Neil Conway
Date:
"Magnus Hagander" <mha@sollentuna.net> writes:
> Here is an updated version of the win32 readdir patch.

Do we actually need to apply this to the main CVS tree, or can we just
wait for a mingw release that includes the fix?

-Neil


Re: Updated win32 readdir patch

From
Tom Lane
Date:
"Magnus Hagander" <mha@sollentuna.net> writes:
> Here is an updated version of the win32 readdir patch.

> 1) Now puts in exactly the same change as the current-cvs mingw code
> does. (see
> http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/mingwex/dirent.c?r1=3D
> 1.3&r2=3D1.4, second part of the patch).

I don't really agree with cluttering our code with temporary workarounds
for a mingw bug.

            regards, tom lane

Re: Updated win32 readdir patch

From
"Magnus Hagander"
Date:
>> Here is an updated version of the win32 readdir patch.
>
>> 1) Now puts in exactly the same change as the current-cvs mingw code
>> does. (see
>>
>>http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/mingwex/dir
ent.c?r1=3D
>> 1.3&r2=3D1.4, second part of the patch).

> I don't really agree with cluttering our code with temporary
workarounds
>for a mingw bug.

Fine by me, as long as we still keep it on the win32 page. It *is*
required to build on win32 (or rather - not to build, but if you build
without it, you will get a runtime failure).

AFAIK we have no idea when the new mingw will actually be out, but if
it's out before the postgresql version with win32, then we're fine
without it. If not, we can discuss at that time if we want it
temporarily applied or keep it as a temporary patch (since it might at
that point make a big difference for people downloading the distro and
thinking it would work out of the box).


//Magnus

Re: [pgsql-hackers-win32] Updated win32 readdir patch

From
Bruce Momjian
Date:
Magnus Hagander wrote:
> >> Here is an updated version of the win32 readdir patch.
> >
> >> 1) Now puts in exactly the same change as the current-cvs mingw code
> >> does. (see
> >>
> >>http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/mingwex/dir
> ent.c?r1=3D
> >> 1.3&r2=3D1.4, second part of the patch).
>
> > I don't really agree with cluttering our code with temporary
> workarounds
> >for a mingw bug.
>
> Fine by me, as long as we still keep it on the win32 page. It *is*
> required to build on win32 (or rather - not to build, but if you build
> without it, you will get a runtime failure).
>
> AFAIK we have no idea when the new mingw will actually be out, but if
> it's out before the postgresql version with win32, then we're fine
> without it. If not, we can discuss at that time if we want it
> temporarily applied or keep it as a temporary patch (since it might at
> that point make a big difference for people downloading the distro and
> thinking it would work out of the box).

I suggest we apply the patch, and add a TODO to remove it once we get an
MinGW update that fixes it.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Updated win32 readdir patch

From
Bruce Momjian
Date:
Neil Conway wrote:
> "Magnus Hagander" <mha@sollentuna.net> writes:
> > Here is an updated version of the win32 readdir patch.
>
> Do we actually need to apply this to the main CVS tree, or can we just
> wait for a mingw release that includes the fix?

We might be able to wait, but the current MinGW has other bugs so we
can't use it.  I think we can include it in CVS and add a TODO to remove
it when MinGW is upgraded.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: Updated win32 readdir patch

From
Bruce Momjian
Date:
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Magnus Hagander wrote:
> Hello!
>
> Here is an updated version of the win32 readdir patch.
>
> 1) Now puts in exactly the same change as the current-cvs mingw code
> does. (see
> http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/mingwex/dirent.c?r1=
> 1.3&r2=1.4, second part of the patch).
>
> 2) Updates both xlog.c and slru.c in backend/access/transam/
>
> 3) Also updates pg_resetxlog, which also uses readdir() and checks the
> errno value after the loop.
>
> Claudio - if this is not applied, please updated the win32 status page
> to point to this patch instead of the previous incomplete one.
>
> //Magnus
>  <<win32_readdir.patch>>

Content-Description: win32_readdir.patch

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: [pgsql-hackers-win32] Updated win32 readdir patch

From
Bruce Momjian
Date:
Patch applied.  Thanks.

Also, I updated the Win32 patch to mention removing the patch when
runtime/mingwex/dirent.c rev 1.4 is released.

---------------------------------------------------------------------------


Magnus Hagander wrote:
> Hello!
>
> Here is an updated version of the win32 readdir patch.
>
> 1) Now puts in exactly the same change as the current-cvs mingw code
> does. (see
> http://cvs.sourceforge.net/viewcvs.py/mingw/runtime/mingwex/dirent.c?r1=
> 1.3&r2=1.4, second part of the patch).
>
> 2) Updates both xlog.c and slru.c in backend/access/transam/
>
> 3) Also updates pg_resetxlog, which also uses readdir() and checks the
> errno value after the loop.
>
> Claudio - if this is not applied, please updated the win32 status page
> to point to this patch instead of the previous incomplete one.
>
> //Magnus
>  <<win32_readdir.patch>>

Content-Description: win32_readdir.patch

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073