Re: [HACKERS] oid8types() borken?

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: oliver(at)fritz(dot)traverse(dot)net (Christopher Oliver)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] oid8types() borken?
Date: 1998-09-18 04:47:50
Message-ID: 199809180447.AAA22435@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fixed. The actual fix is to change:

oid8types(Oid **oidArray)

to:

oid8types(Oid (*oidArray)[])

Can someone explain what this is? This is the old 6.3 code, and forgot
to reverse back this part when I realized my change to **oidArray did
not work.

> 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(at)traverse(dot)net Traverse City, Michigan, 49684
> "What good is a can of worms if you never open it?" -Bob Arning
>
>

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
http://www.op.net/~candle | (610) 353-9879(w)
+ If your life is a hard drive, | (610) 853-3000(h)
+ Christ can be your backup. |

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Davies 1998-09-18 05:07:28 PostgreSQL syntax question
Previous Message Christopher Oliver 1998-09-18 03:28:09 oid8types() borken?