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
478c95a0
Commit
478c95a0
authored
Feb 13, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent timetz2tm() from scribbling on its input in HAVE_INT64_TIMESTAMP case.
parent
1a9b0613
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
src/backend/utils/adt/date.c
src/backend/utils/adt/date.c
+10
-11
No files found.
src/backend/utils/adt/date.c
View file @
478c95a0
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.7
8 2003/01/31 01:08:08
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.7
9 2003/02/13 17:04:19
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1349,23 +1349,22 @@ timetz_out(PG_FUNCTION_ARGS)
/* timetz2tm()
* Convert TIME WITH TIME ZONE data type to POSIX time structure.
* For dates within the system-supported time_t range, convert to the
* local time zone. If out of this range, leave as GMT. - tgl 97/05/27
*/
static
int
timetz2tm
(
TimeTzADT
*
time
,
struct
tm
*
tm
,
fsec_t
*
fsec
,
int
*
tzp
)
{
#ifdef HAVE_INT64_TIMESTAMP
tm
->
tm_hour
=
(
time
->
time
/
INT64CONST
(
3600000000
));
time
->
time
-=
(
tm
->
tm_hour
*
INT64CONST
(
3600000000
));
tm
->
tm_min
=
(
time
->
time
/
INT64CONST
(
60000000
));
time
->
time
-=
(
tm
->
tm_min
*
INT64CONST
(
60000000
));
tm
->
tm_sec
=
(
time
->
time
/
INT64CONST
(
1000000
));
*
fsec
=
(
time
->
time
-
(
tm
->
tm_sec
*
INT64CONST
(
1000000
)));
int64
trem
=
time
->
time
;
tm
->
tm_hour
=
(
trem
/
INT64CONST
(
3600000000
));
trem
-=
(
tm
->
tm_hour
*
INT64CONST
(
3600000000
));
tm
->
tm_min
=
(
trem
/
INT64CONST
(
60000000
));
trem
-=
(
tm
->
tm_min
*
INT64CONST
(
60000000
));
tm
->
tm_sec
=
(
trem
/
INT64CONST
(
1000000
));
*
fsec
=
(
trem
-
(
tm
->
tm_sec
*
INT64CONST
(
1000000
)));
#else
double
trem
;
double
trem
=
time
->
time
;
trem
=
time
->
time
;
TMODULO
(
trem
,
tm
->
tm_hour
,
3600e0
);
TMODULO
(
trem
,
tm
->
tm_min
,
60e0
);
TMODULO
(
trem
,
tm
->
tm_sec
,
1e0
);
...
...
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