============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name               :       Marc Lehmann
Your email address      :       [EMAIL PROTECTED]


System Configuration
---------------------
  Architecture (example: Intel Pentium)         : 

  Operating System (example: Linux 2.0.26 ELF)  :

  PostgreSQL version (example: PostgreSQL-6.5.1):   PostgreSQL-7.0beta3

  Compiler used (example:  gcc 2.8.0)           :


Please enter a FULL description of your problem:
------------------------------------------------

the perl interface does not compile with newer perl versions (5.006 and
probably 5.005 without options).

Please describe a way to repeat the problem.   Please try to provide a

(sorry, just found out that plperl also won't compile, so I have "re-added"
another, a second diff against plperl ;)

concise reproducible example, if at all possible: 
----------------------------------------------------------------------

"make"




If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

A diff against Pg.xs is attached, however, it will not compile with older
perl versions (it is the prefered long-term solution).

So, for the forseeable future, it might be a better to create the Makefile
using

   perl Makefile.PL POLLUTE=1

which will enable some kind of compatibility mode.

A preferable but better solution would be to use the Devel::PPPort module
(on CPAN) to get rid of versiondependonitis (in which case you will need
to apply both diffs and additionally include ppport.h, preferably after
renaming it to something else.

===PATCH 1===================================================================

diff -r -u perl5o/Pg.c perl5/Pg.c
--- perl5o/Pg.c Sat Mar 25 13:09:05 2000
+++ perl5/Pg.c  Sat Mar 25 13:10:38 2000
@@ -1407,7 +1407,7 @@
                ps.caption   = caption;
                Newz(0, ps.fieldName, items + 1 - 11, char*);
                for (i = 11; i < items; i++) {
-                       ps.fieldName[i - 11] = (char *)SvPV(ST(i), na);
+                       ps.fieldName[i - 11] = (char *)SvPV_nolen(ST(i));
                }
                PQprint(fout, res, &ps);
                Safefree(ps.fieldName);
@@ -3182,7 +3182,7 @@
                                EXTEND(sp, cols);
                                while (col < cols) {
                                        if (PQgetisnull(res->result, res->row, col)) {
-                                               PUSHs(&sv_undef);
+                                               PUSHs(&PL_sv_undef);
                                        } else {
                                                char *val = PQgetvalue(res->result, 
res->row, col);
                                                PUSHs(sv_2mortal((SV*)newSVpv(val, 
0)));
@@ -3238,7 +3238,7 @@
                ps.caption   = caption;
                Newz(0, ps.fieldName, items + 1 - 11, char*);
                for (i = 11; i < items; i++) {
-                       ps.fieldName[i - 11] = (char *)SvPV(ST(i), na);
+                       ps.fieldName[i - 11] = (char *)SvPV_nolen(ST(i));
                }
                PQprint(fout, res->result, &ps);
                Safefree(ps.fieldName);
diff -r -u perl5o/Pg.xs perl5/Pg.xs
--- perl5o/Pg.xs        Sat Mar 11 04:08:37 2000
+++ perl5/Pg.xs Sat Mar 25 13:10:36 2000
@@ -581,7 +581,7 @@
                ps.caption   = caption;
                Newz(0, ps.fieldName, items + 1 - 11, char*);
                for (i = 11; i < items; i++) {
-                       ps.fieldName[i - 11] = (char *)SvPV(ST(i), na);
+                       ps.fieldName[i - 11] = (char *)SvPV_nolen(ST(i));
                }
                PQprint(fout, res, &ps);
                Safefree(ps.fieldName);
@@ -1252,7 +1252,7 @@
                                EXTEND(sp, cols);
                                while (col < cols) {
                                        if (PQgetisnull(res->result, res->row, col)) {
-                                               PUSHs(&sv_undef);
+                                               PUSHs(&PL_sv_undef);
                                        } else {
                                                char *val = PQgetvalue(res->result, 
res->row, col);
                                                PUSHs(sv_2mortal((SV*)newSVpv(val, 
0)));
@@ -1292,7 +1292,7 @@
                ps.caption   = caption;
                Newz(0, ps.fieldName, items + 1 - 11, char*);
                for (i = 11; i < items; i++) {
-                       ps.fieldName[i - 11] = (char *)SvPV(ST(i), na);
+                       ps.fieldName[i - 11] = (char *)SvPV_nolen(ST(i));
                }
                PQprint(fout, res->result, &ps);
                Safefree(ps.fieldName);

===PATCH 2===================================================================

diff -u -r plperlo/plperl.c plperl/plperl.c
--- plperlo/plperl.c    Sat Mar 25 13:17:31 2000
+++ plperl/plperl.c     Sat Mar 25 13:18:32 2000
@@ -309,12 +309,12 @@
        perl_eval_sv(s, G_SCALAR | G_EVAL | G_KEEPERR);
        SPAGAIN;
 
-       if (SvTRUE(GvSV(errgv))) {
+       if (SvTRUE(GvSV(PL_errgv))) {
                POPs;
                PUTBACK;
                FREETMPS;
                LEAVE;
-               elog(ERROR, "creation of function failed : %s", SvPV(GvSV(errgv), na));
+               elog(ERROR, "creation of function failed : %s", 
+SvPV_nolen(GvSV(PL_errgv)));
        }
 
        /*
@@ -413,12 +413,12 @@
                elog(ERROR, "plperl : didn't get a return item from function");
        }
 
-       if (SvTRUE(GvSV(errgv))) {
+       if (SvTRUE(GvSV(PL_errgv))) {
                POPs;
                PUTBACK ;
                FREETMPS ;
                LEAVE;
-               elog(ERROR, "plperl : error from function : %s", SvPV(GvSV(errgv), 
na));
+               elog(ERROR, "plperl : error from function : %s", 
+SvPV_nolen(GvSV(PL_errgv)));
        }
 
        retval = newSVsv(POPs);
@@ -632,7 +632,7 @@
                elog(ERROR, "plperl: SPI_finish() failed");
 
        retval = (Datum) (*fmgr_faddr(&prodesc->result_in_func))
-                       (SvPV(perlret, na),
+                       (SvPV_nolen(perlret),
                         prodesc->result_in_elem,
                    prodesc->result_in_len);
 
@@ -2168,6 +2168,6 @@
                }
        }
        sv_catpv(output, "}");
-       output = perl_eval_pv(SvPV(output, na), TRUE);
+       output = perl_eval_pv(SvPV_nolen(output), TRUE);
        return output;
 }

=============================================================================

-- 
      -----==-                                             |
      ----==-- _                                           |
      ---==---(_)__  __ ____  __       Marc Lehmann      +--
      --==---/ / _ \/ // /\ \/ /       [EMAIL PROTECTED] |e|
      -=====/_/_//_/\_,_/ /_/\_\       XX11-RIPE         --+
    The choice of a GNU generation                       |
                                                         |

Reply via email to