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
5c639755
Commit
5c639755
authored
Mar 23, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Float-to-int conversion functions should return NULL when given NULL
input, not throw a gratuitous elog().
parent
37ab0887
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/backend/utils/adt/float.c
src/backend/utils/adt/float.c
+9
-9
No files found.
src/backend/utils/adt/float.c
View file @
5c639755
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.5
4 2000/03/14 23:06:36 thomas
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/float.c,v 1.5
5 2000/03/23 07:40:00 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -830,8 +830,8 @@ dtoi4(float64 num)
{
int32
result
;
if
(
!
PointerIsValid
(
num
)
)
elog
(
ERROR
,
"dtoi4: unable to convert null"
);
if
(
!
num
)
return
0
;
/* fmgr will return NULL anyway */
if
((
*
num
<
INT_MIN
)
||
(
*
num
>
INT_MAX
))
elog
(
ERROR
,
"dtoi4: integer out of range"
);
...
...
@@ -849,8 +849,8 @@ dtoi2(float64 num)
{
int16
result
;
if
(
!
PointerIsValid
(
num
)
)
elog
(
ERROR
,
"dtoi2: unable to convert null"
);
if
(
!
num
)
return
0
;
/* fmgr will return NULL anyway */
if
((
*
num
<
SHRT_MIN
)
||
(
*
num
>
SHRT_MAX
))
elog
(
ERROR
,
"dtoi2: integer out of range"
);
...
...
@@ -898,8 +898,8 @@ ftoi4(float32 num)
{
int32
result
;
if
(
!
PointerIsValid
(
num
)
)
elog
(
ERROR
,
"ftoi4: unable to convert null"
);
if
(
!
num
)
return
0
;
/* fmgr will return NULL anyway */
if
((
*
num
<
INT_MIN
)
||
(
*
num
>
INT_MAX
))
elog
(
ERROR
,
"ftoi4: integer out of range"
);
...
...
@@ -917,8 +917,8 @@ ftoi2(float32 num)
{
int16
result
;
if
(
!
PointerIsValid
(
num
)
)
elog
(
ERROR
,
"ftoi2: unable to convert null"
);
if
(
!
num
)
return
0
;
/* fmgr will return NULL anyway */
if
((
*
num
<
SHRT_MIN
)
||
(
*
num
>
SHRT_MAX
))
elog
(
ERROR
,
"ftoi2: integer out of range"
);
...
...
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