Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
2ec95872
Commit
2ec95872
authored
23 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Tweak int8in to accept -9223372036854775808, per recent discussion in
pgsql-patches.
parent
215f0964
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/src/sgml/datatype.sgml
+2
-2
2 additions, 2 deletions
doc/src/sgml/datatype.sgml
src/backend/utils/adt/int8.c
+24
-3
24 additions, 3 deletions
src/backend/utils/adt/int8.c
with
26 additions
and
5 deletions
doc/src/sgml/datatype.sgml
+
2
−
2
View file @
2ec95872
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.7
5
2001/11/2
1 21:12:34
tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.7
6
2001/11/2
4 19:57:06
tgl Exp $
-->
<chapter id="datatype">
...
...
@@ -385,7 +385,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.75 2001/11/21 21:12:34 tg
<entry><type>bigint</></entry>
<entry>8 bytes</entry>
<entry>Very large range fixed-precision</entry>
<entry>-922337203685477580
7
to 9223372036854775807</entry>
<entry>-922337203685477580
8
to 9223372036854775807</entry>
</row>
<row>
...
...
This diff is collapsed.
Click to expand it.
src/backend/utils/adt/int8.c
+
24
−
3
View file @
2ec95872
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.3
5
2001/1
0
/2
5
1
4:10
:06 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.3
6
2001/1
1
/2
4
1
9:57
:06 tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -26,6 +26,12 @@
#define INT64_FORMAT "%ld"
#endif
#ifdef HAVE_LL_CONSTANTS
#define INT64CONST(x) ((int64) x##LL)
#else
#define INT64CONST(x) ((int64) x)
#endif
#define MAXINT8LEN 25
#ifndef INT_MAX
...
...
@@ -69,8 +75,23 @@ int8in(PG_FUNCTION_ARGS)
*/
while
(
*
ptr
&&
isspace
((
unsigned
char
)
*
ptr
))
/* skip leading spaces */
ptr
++
;
if
(
*
ptr
==
'-'
)
/* handle sign */
sign
=
-
1
,
ptr
++
;
/* handle sign */
if
(
*
ptr
==
'-'
)
{
ptr
++
;
sign
=
-
1
;
/*
* Do an explicit check for INT64_MIN. Ugly though this is, it's
* cleaner than trying to get the loop below to handle it portably.
*/
#ifndef INT64_IS_BUSTED
if
(
strcmp
(
ptr
,
"9223372036854775808"
)
==
0
)
{
result
=
-
INT64CONST
(
0x7fffffffffffffff
)
-
1
;
PG_RETURN_INT64
(
result
);
}
#endif
}
else
if
(
*
ptr
==
'+'
)
ptr
++
;
if
(
!
isdigit
((
unsigned
char
)
*
ptr
))
/* require at least one digit */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment