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
b2d9fbee
Commit
b2d9fbee
authored
Aug 11, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work around broken strtod() that's present in many Solaris releases.
Thanks to Michael Fuhr for identifying the problem.
parent
178ec6f4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
src/backend/utils/adt/float.c
src/backend/utils/adt/float.c
+25
-1
src/include/port/solaris.h
src/include/port/solaris.h
+8
-1
No files found.
src/backend/utils/adt/float.c
View file @
b2d9fbee
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.10
6 2004/08/04 21:34:02
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.10
7 2004/08/11 17:20:49
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -317,6 +317,18 @@ float4in(PG_FUNCTION_ARGS)
errmsg
(
"invalid input syntax for type real:
\"
%s
\"
"
,
orig_num
)));
}
#ifdef HAVE_BUGGY_SOLARIS_STRTOD
else
{
/*
* Many versions of Solaris have a bug wherein strtod sets endptr
* to point one byte beyond the end of the string when given
* "inf" or "infinity".
*/
if
(
endptr
!=
num
&&
endptr
[
-
1
]
==
'\0'
)
endptr
--
;
}
#endif
/* HAVE_BUGGY_SOLARIS_STRTOD */
/* skip trailing whitespace */
while
(
*
endptr
!=
'\0'
&&
isspace
((
unsigned
char
)
*
endptr
))
...
...
@@ -482,6 +494,18 @@ float8in(PG_FUNCTION_ARGS)
errmsg
(
"invalid input syntax for type double precision:
\"
%s
\"
"
,
orig_num
)));
}
#ifdef HAVE_BUGGY_SOLARIS_STRTOD
else
{
/*
* Many versions of Solaris have a bug wherein strtod sets endptr
* to point one byte beyond the end of the string when given
* "inf" or "infinity".
*/
if
(
endptr
!=
num
&&
endptr
[
-
1
]
==
'\0'
)
endptr
--
;
}
#endif
/* HAVE_BUGGY_SOLARIS_STRTOD */
/* skip trailing whitespace */
while
(
*
endptr
!=
'\0'
&&
isspace
((
unsigned
char
)
*
endptr
))
...
...
src/include/port/solaris.h
View file @
b2d9fbee
/* $PostgreSQL: pgsql/src/include/port/solaris.h,v 1.1
1 2004/03/15 03:29:22
tgl Exp $ */
/* $PostgreSQL: pgsql/src/include/port/solaris.h,v 1.1
2 2004/08/11 17:20:50
tgl Exp $ */
/*
* Sort this out for all operating systems some time. The __xxx
...
...
@@ -35,3 +35,10 @@
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#endif
/*
* Many versions of Solaris have broken strtod() --- see bug #4751182.
* For the moment we just assume they all do; it's probably not worth
* the trouble to add a configure test for this.
*/
#define HAVE_BUGGY_SOLARIS_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