oid8types() borken? - Mailing list pgsql-hackers

From Christopher Oliver
Subject oid8types() borken?
Date
Msg-id 19980917232809.A9605@fritz.traverse.net
Whole thread Raw
Responses Re: [HACKERS] oid8types() borken?  (Bruce Momjian <maillist@candle.pha.pa.us>)
List pgsql-hackers
The query generated by \df causes the backend to fail in oid8types.

The simplest illustration I found was:

    SELECT oid8types(proargtypes) FROM pg_proc;

It appears that oid8types() originally expected an array of pointers
to oid8, but now it gets the base of an array of oid8.  The following
seems to fix things for me in today's snapshot.  Any comments?

--- include/utils/builtins.h    1998/09/18 03:25:18    1.1
+++ include/utils/builtins.h    1998/09/18 03:25:47
@@ -358,7 +358,7 @@
 /* regproc.c */
 extern int32 regprocin(char *pro_name_and_oid);
 extern char *regprocout(RegProcedure proid);
-extern text *oid8types(Oid **oidArray);
+extern text *oid8types(Oid *oidArray);
 extern Oid    regproctooid(RegProcedure rp);

 /* define macro to replace mixed-case function call - tgl 97/04/27 */
--- backend/utils/adt/regproc.c    1998/09/18 02:25:19    1.1
+++ backend/utils/adt/regproc.c    1998/09/18 03:23:19
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *      $Header: /home/staff/oliver/lab/pgsql/src/backend/utils/adt/regproc.c,v 1.1 1998/09/18 02:25:19 oliver Exp
oliver$ 
+ *      $Header: /usr/local/cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.26 1998/09/01 04:32:47 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -211,7 +211,7 @@
  *        int8typeout            - converts int8 type oids to "typname" list
  */
 text *
-oid8types(Oid **oidArray)
+oid8types(Oid *oidArray)
 {
     HeapTuple    typetup;
     text       *result;
@@ -228,7 +228,7 @@
     result = (text *) palloc(NAMEDATALEN * 8 + 8 + VARHDRSZ);
     *VARDATA(result) = '\0';

-    sp = *oidArray;
+    sp = oidArray;
     for (num = 8; num != 0; num--, sp++)
     {
         if (*sp != InvalidOid)

--
Christopher Oliver                     Traverse Internet
Systems Coordinator                    223 Grandview Pkwy, Suite 108
oliver@traverse.net                    Traverse City, Michigan, 49684
  "What good is a can of worms if you never open it?"  -Bob Arning

pgsql-hackers by date:

Previous
From: "Billy G. Allie"
Date:
Subject: Re: [HACKERS] Re: [INTERFACES] Odbc parser error
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] oid8types() borken?