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
b2c04d5e
Commit
b2c04d5e
authored
Oct 05, 2006
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around buggy strtod on (some versions of?) IRIX. Combination of
proposed patches from John Jorgensen and Steve Singer.
parent
9e6c3582
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
2 deletions
+60
-2
src/backend/utils/adt/float.c
src/backend/utils/adt/float.c
+53
-1
src/include/port/irix.h
src/include/port/irix.h
+7
-1
No files found.
src/backend/utils/adt/float.c
View file @
b2c04d5e
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.1
29 2006/10/04 00:29:58 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.1
30 2006/10/05 01:40:45 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -328,6 +328,32 @@ float4in(PG_FUNCTION_ARGS)
}
#endif
/* HAVE_BUGGY_SOLARIS_STRTOD */
#ifdef HAVE_BUGGY_IRIX_STRTOD
/*
* In some IRIX versions, strtod() recognizes only "inf", so if the
* input is "infinity" we have to skip over "inity". Also, it may
* return positive infinity for "-inf".
*/
if
(
isinf
(
val
))
{
if
(
pg_strncasecmp
(
num
,
"Infinity"
,
8
)
==
0
)
{
val
=
get_float4_infinity
();
endptr
=
num
+
8
;
}
else
if
(
pg_strncasecmp
(
num
,
"-Infinity"
,
9
)
==
0
)
{
val
=
-
get_float4_infinity
();
endptr
=
num
+
9
;
}
else
if
(
pg_strncasecmp
(
num
,
"-inf"
,
4
)
==
0
)
{
val
=
-
get_float4_infinity
();
endptr
=
num
+
4
;
}
}
#endif
/* HAVE_BUGGY_IRIX_STRTOD */
/* skip trailing whitespace */
while
(
*
endptr
!=
'\0'
&&
isspace
((
unsigned
char
)
*
endptr
))
endptr
++
;
...
...
@@ -495,6 +521,32 @@ float8in(PG_FUNCTION_ARGS)
}
#endif
/* HAVE_BUGGY_SOLARIS_STRTOD */
#ifdef HAVE_BUGGY_IRIX_STRTOD
/*
* In some IRIX versions, strtod() recognizes only "inf", so if the
* input is "infinity" we have to skip over "inity". Also, it may
* return positive infinity for "-inf".
*/
if
(
isinf
(
val
))
{
if
(
pg_strncasecmp
(
num
,
"Infinity"
,
8
)
==
0
)
{
val
=
get_float8_infinity
();
endptr
=
num
+
8
;
}
else
if
(
pg_strncasecmp
(
num
,
"-Infinity"
,
9
)
==
0
)
{
val
=
-
get_float8_infinity
();
endptr
=
num
+
9
;
}
else
if
(
pg_strncasecmp
(
num
,
"-inf"
,
4
)
==
0
)
{
val
=
-
get_float8_infinity
();
endptr
=
num
+
4
;
}
}
#endif
/* HAVE_BUGGY_IRIX_STRTOD */
/* skip trailing whitespace */
while
(
*
endptr
!=
'\0'
&&
isspace
((
unsigned
char
)
*
endptr
))
endptr
++
;
...
...
src/include/port/irix.h
View file @
b2c04d5e
/* $PostgreSQL: pgsql/src/include/port/irix.h,v 1.3 2006/03/11 04:38:38 momjian Exp $ */
/* $PostgreSQL: pgsql/src/include/port/irix.h,v 1.4 2006/10/05 01:40:45 tgl Exp $ */
/*
* IRIX 6.5.26f and 6.5.22f (at least) have a strtod() that accepts
* "infinity", but leaves endptr pointing to "inity".
*/
#define HAVE_BUGGY_IRIX_STRTOD
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