66 * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
77 * Portions Copyright (c) 1994, Regents of the University of California
88 *
9- * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.108 2002/08/25 17:20:01 tgl Exp $
9+ * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.109 2002/08/30 01:01:02 tgl Exp $
1010 *
1111 *-------------------------------------------------------------------------
1212 */
2020
2121#include "access/heapam.h"
2222#include "catalog/catname.h"
23+ #include "catalog/indexing.h"
2324#include "catalog/pg_database.h"
24- #include "catalog/pg_shadow.h"
2525#include "catalog/pg_group.h"
26- #include "catalog/indexing.h"
26+ #include "catalog/pg_shadow.h"
27+ #include "catalog/pg_type.h"
2728#include "commands/user.h"
2829#include "libpq/crypt.h"
2930#include "miscadmin.h"
@@ -1398,6 +1399,7 @@ IdListToArray(List *members)
13981399 newarray = palloc (ARR_OVERHEAD (1 ) + nmembers * sizeof (int32 ));
13991400 newarray -> size = ARR_OVERHEAD (1 ) + nmembers * sizeof (int32 );
14001401 newarray -> flags = 0 ;
1402+ newarray -> elemtype = INT4OID ;
14011403 ARR_NDIM (newarray ) = 1 ; /* one dimensional array */
14021404 ARR_LBOUND (newarray )[0 ] = 1 ; /* axis starts at one */
14031405 ARR_DIMS (newarray )[0 ] = nmembers ; /* axis is this long */
@@ -1424,14 +1426,15 @@ IdArrayToList(IdList *oldarray)
14241426 return NIL ;
14251427
14261428 Assert (ARR_NDIM (oldarray ) == 1 );
1429+ Assert (ARR_ELEMTYPE (oldarray ) == INT4OID );
14271430
14281431 hibound = ARR_DIMS (oldarray )[0 ];
14291432
14301433 for (i = 0 ; i < hibound ; i ++ )
14311434 {
14321435 int32 sysid ;
14331436
1434- sysid = ((int * ) ARR_DATA_PTR (oldarray ))[i ];
1437+ sysid = ((int32 * ) ARR_DATA_PTR (oldarray ))[i ];
14351438 /* filter out any duplicates --- probably a waste of time */
14361439 if (!intMember (sysid , newlist ))
14371440 newlist = lappendi (newlist , sysid );
0 commit comments