Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
20f6d742
Commit
20f6d742
authored
Mar 01, 2017
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collect duplicate copies of oid_cmp()
parent
788af6f8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
51 deletions
+17
-51
src/backend/catalog/pg_enum.c
src/backend/catalog/pg_enum.c
+0
-15
src/backend/catalog/pg_inherits.c
src/backend/catalog/pg_inherits.c
+1
-17
src/backend/utils/adt/acl.c
src/backend/utils/adt/acl.c
+1
-19
src/backend/utils/adt/oid.c
src/backend/utils/adt/oid.c
+14
-0
src/include/utils/builtins.h
src/include/utils/builtins.h
+1
-0
No files found.
src/backend/catalog/pg_enum.c
View file @
20f6d742
...
...
@@ -36,7 +36,6 @@
Oid
binary_upgrade_next_pg_enum_oid
=
InvalidOid
;
static
void
RenumberEnumType
(
Relation
pg_enum
,
HeapTuple
*
existing
,
int
nelems
);
static
int
oid_cmp
(
const
void
*
p1
,
const
void
*
p2
);
static
int
sort_order_cmp
(
const
void
*
p1
,
const
void
*
p2
);
...
...
@@ -605,20 +604,6 @@ RenumberEnumType(Relation pg_enum, HeapTuple *existing, int nelems)
}
/* qsort comparison function for oids */
static
int
oid_cmp
(
const
void
*
p1
,
const
void
*
p2
)
{
Oid
v1
=
*
((
const
Oid
*
)
p1
);
Oid
v2
=
*
((
const
Oid
*
)
p2
);
if
(
v1
<
v2
)
return
-
1
;
if
(
v1
>
v2
)
return
1
;
return
0
;
}
/* qsort comparison function for tuples by sort order */
static
int
sort_order_cmp
(
const
void
*
p1
,
const
void
*
p2
)
...
...
src/backend/catalog/pg_inherits.c
View file @
20f6d742
...
...
@@ -27,12 +27,11 @@
#include "catalog/pg_inherits_fn.h"
#include "parser/parse_type.h"
#include "storage/lmgr.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/syscache.h"
#include "utils/tqual.h"
static
int
oid_cmp
(
const
void
*
p1
,
const
void
*
p2
);
/*
* find_inheritance_children
...
...
@@ -357,18 +356,3 @@ typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId)
return
result
;
}
/* qsort comparison function */
static
int
oid_cmp
(
const
void
*
p1
,
const
void
*
p2
)
{
Oid
v1
=
*
((
const
Oid
*
)
p1
);
Oid
v2
=
*
((
const
Oid
*
)
p2
);
if
(
v1
<
v2
)
return
-
1
;
if
(
v1
>
v2
)
return
1
;
return
0
;
}
src/backend/utils/adt/acl.c
View file @
20f6d742
...
...
@@ -88,7 +88,6 @@ static void check_circularity(const Acl *old_acl, const AclItem *mod_aip,
Oid
ownerId
);
static
Acl
*
recursive_revoke
(
Acl
*
acl
,
Oid
grantee
,
AclMode
revoke_privs
,
Oid
ownerId
,
DropBehavior
behavior
);
static
int
oidComparator
(
const
void
*
arg1
,
const
void
*
arg2
);
static
AclMode
convert_priv_string
(
text
*
priv_type_text
);
static
AclMode
convert_any_priv_string
(
text
*
priv_type_text
,
...
...
@@ -1490,7 +1489,7 @@ aclmembers(const Acl *acl, Oid **roleids)
}
/* Sort the array */
qsort
(
list
,
j
,
sizeof
(
Oid
),
oid
Comparator
);
qsort
(
list
,
j
,
sizeof
(
Oid
),
oid
_cmp
);
/* Remove duplicates from the array */
k
=
0
;
...
...
@@ -1509,23 +1508,6 @@ aclmembers(const Acl *acl, Oid **roleids)
return
k
+
1
;
}
/*
* oidComparator
* qsort comparison function for Oids
*/
static
int
oidComparator
(
const
void
*
arg1
,
const
void
*
arg2
)
{
Oid
oid1
=
*
(
const
Oid
*
)
arg1
;
Oid
oid2
=
*
(
const
Oid
*
)
arg2
;
if
(
oid1
>
oid2
)
return
1
;
if
(
oid1
<
oid2
)
return
-
1
;
return
0
;
}
/*
* aclinsert (exported function)
...
...
src/backend/utils/adt/oid.c
View file @
20f6d742
...
...
@@ -331,6 +331,20 @@ oidparse(Node *node)
return
InvalidOid
;
/* keep compiler quiet */
}
/* qsort comparison function for Oids */
int
oid_cmp
(
const
void
*
p1
,
const
void
*
p2
)
{
Oid
v1
=
*
((
const
Oid
*
)
p1
);
Oid
v2
=
*
((
const
Oid
*
)
p2
);
if
(
v1
<
v2
)
return
-
1
;
if
(
v1
>
v2
)
return
1
;
return
0
;
}
/*****************************************************************************
* PUBLIC ROUTINES *
...
...
src/include/utils/builtins.h
View file @
20f6d742
...
...
@@ -67,6 +67,7 @@ extern int float8_cmp_internal(float8 a, float8 b);
/* oid.c */
extern
oidvector
*
buildoidvector
(
const
Oid
*
oids
,
int
n
);
extern
Oid
oidparse
(
Node
*
node
);
extern
int
oid_cmp
(
const
void
*
p1
,
const
void
*
p2
);
/* regexp.c */
extern
char
*
regexp_fixed_prefix
(
text
*
text_re
,
bool
case_insensitive
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment