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
c996c7f5
Commit
c996c7f5
authored
Dec 28, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let's try this again on accepting the correct range of Oid input values
for 64-bit platforms ...
parent
0a8da825
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
src/backend/utils/adt/oid.c
src/backend/utils/adt/oid.c
+11
-4
No files found.
src/backend/utils/adt/oid.c
View file @
c996c7f5
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.4
2 2000/12/22 21:36:09
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.4
3 2000/12/28 01:51:15
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -67,14 +67,21 @@ oidin_subr(const char *funcname, const char *s, char **endloc)
result
=
(
Oid
)
cvt
;
/*
* Cope with possibility that unsigned long is wider than Oid.
* Cope with possibility that unsigned long is wider than Oid,
* in which case strtoul will not raise an error for some values
* that are out of the range of Oid.
*
* For backwards compatibility, we want to accept inputs that
* are given with a minus sign, so allow the input value if it
* matches after either signed or unsigned extension to long.
*
* To ensure consistent results on 32-bit and 64-bit platforms,
* make sure the error message is the same as if strtoul() had
* returned ERANGE.
*/
#if OID_MAX < ULONG_MAX
if
(
cvt
>
(
unsigned
long
)
OID_MAX
)
#if OID_MAX != ULONG_MAX
if
(
cvt
!=
(
unsigned
long
)
result
&&
cvt
!=
(
unsigned
long
)
((
int
)
result
))
elog
(
ERROR
,
"%s: error reading
\"
%s
\"
: %s"
,
funcname
,
s
,
strerror
(
ERANGE
));
#endif
...
...
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