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
0ef5910d
Commit
0ef5910d
authored
Dec 24, 2009
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename EnumValuesCreate() single-letter variable names to useful
variable names.
parent
c44327af
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
src/backend/catalog/pg_enum.c
src/backend/catalog/pg_enum.c
+11
-11
No files found.
src/backend/catalog/pg_enum.c
View file @
0ef5910d
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_enum.c,v 1.1
0 2009/12/19 00:47:57
momjian Exp $
* $PostgreSQL: pgsql/src/backend/catalog/pg_enum.c,v 1.1
1 2009/12/24 22:17:58
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -39,14 +39,14 @@ EnumValuesCreate(Oid enumTypeOid, List *vals)
TupleDesc
tupDesc
;
NameData
enumlabel
;
Oid
*
oids
;
int
i
,
n
;
int
elemno
,
n
um_elems
;
Datum
values
[
Natts_pg_enum
];
bool
nulls
[
Natts_pg_enum
];
ListCell
*
lc
;
HeapTuple
tup
;
n
=
list_length
(
vals
);
n
um_elems
=
list_length
(
vals
);
/*
* XXX we do not bother to check the list of values for duplicates --- if
...
...
@@ -64,23 +64,23 @@ EnumValuesCreate(Oid enumTypeOid, List *vals)
* counter wraps all the way around before we finish. Which seems
* unlikely.
*/
oids
=
(
Oid
*
)
palloc
(
n
*
sizeof
(
Oid
));
for
(
i
=
0
;
i
<
n
;
i
++
)
oids
=
(
Oid
*
)
palloc
(
n
um_elems
*
sizeof
(
Oid
));
for
(
elemno
=
0
;
elemno
<
num_elems
;
elemno
++
)
{
/*
* The pg_enum.oid is stored in user tables. This oid must be
* preserved by binary upgrades.
*/
oids
[
i
]
=
GetNewOid
(
pg_enum
);
oids
[
elemno
]
=
GetNewOid
(
pg_enum
);
}
/* sort them, just in case counter wrapped from high to low */
qsort
(
oids
,
n
,
sizeof
(
Oid
),
oid_cmp
);
qsort
(
oids
,
n
um_elems
,
sizeof
(
Oid
),
oid_cmp
);
/* and make the entries */
memset
(
nulls
,
false
,
sizeof
(
nulls
));
i
=
0
;
elemno
=
0
;
foreach
(
lc
,
vals
)
{
char
*
lab
=
strVal
(
lfirst
(
lc
));
...
...
@@ -101,13 +101,13 @@ EnumValuesCreate(Oid enumTypeOid, List *vals)
values
[
Anum_pg_enum_enumlabel
-
1
]
=
NameGetDatum
(
&
enumlabel
);
tup
=
heap_form_tuple
(
tupDesc
,
values
,
nulls
);
HeapTupleSetOid
(
tup
,
oids
[
i
]);
HeapTupleSetOid
(
tup
,
oids
[
elemno
]);
simple_heap_insert
(
pg_enum
,
tup
);
CatalogUpdateIndexes
(
pg_enum
,
tup
);
heap_freetuple
(
tup
);
i
++
;
elemno
++
;
}
/* clean up */
...
...
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