6
6
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
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 $
10
10
*
11
11
*-------------------------------------------------------------------------
12
12
*/
20
20
21
21
#include "access/heapam.h"
22
22
#include "catalog/catname.h"
23
+ #include "catalog/indexing.h"
23
24
#include "catalog/pg_database.h"
24
- #include "catalog/pg_shadow.h"
25
25
#include "catalog/pg_group.h"
26
- #include "catalog/indexing.h"
26
+ #include "catalog/pg_shadow.h"
27
+ #include "catalog/pg_type.h"
27
28
#include "commands/user.h"
28
29
#include "libpq/crypt.h"
29
30
#include "miscadmin.h"
@@ -1398,6 +1399,7 @@ IdListToArray(List *members)
1398
1399
newarray = palloc (ARR_OVERHEAD (1 ) + nmembers * sizeof (int32 ));
1399
1400
newarray -> size = ARR_OVERHEAD (1 ) + nmembers * sizeof (int32 );
1400
1401
newarray -> flags = 0 ;
1402
+ newarray -> elemtype = INT4OID ;
1401
1403
ARR_NDIM (newarray ) = 1 ; /* one dimensional array */
1402
1404
ARR_LBOUND (newarray )[0 ] = 1 ; /* axis starts at one */
1403
1405
ARR_DIMS (newarray )[0 ] = nmembers ; /* axis is this long */
@@ -1424,14 +1426,15 @@ IdArrayToList(IdList *oldarray)
1424
1426
return NIL ;
1425
1427
1426
1428
Assert (ARR_NDIM (oldarray ) == 1 );
1429
+ Assert (ARR_ELEMTYPE (oldarray ) == INT4OID );
1427
1430
1428
1431
hibound = ARR_DIMS (oldarray )[0 ];
1429
1432
1430
1433
for (i = 0 ; i < hibound ; i ++ )
1431
1434
{
1432
1435
int32 sysid ;
1433
1436
1434
- sysid = ((int * ) ARR_DATA_PTR (oldarray ))[i ];
1437
+ sysid = ((int32 * ) ARR_DATA_PTR (oldarray ))[i ];
1435
1438
/* filter out any duplicates --- probably a waste of time */
1436
1439
if (!intMember (sysid , newlist ))
1437
1440
newlist = lappendi (newlist , sysid );
0 commit comments