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
dcdf9119
Commit
dcdf9119
authored
Nov 21, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak interval_avg support to avoid coredump with Alpha/Tru64 compiler.
Per report from Bernd Tegge.
parent
52ca149b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
src/backend/utils/adt/timestamp.c
src/backend/utils/adt/timestamp.c
+11
-5
No files found.
src/backend/utils/adt/timestamp.c
View file @
dcdf9119
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.
59 2001/10/25 05:49:45 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.
60 2001/11/21 18:29:48 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1570,9 +1570,12 @@ interval_accum(PG_FUNCTION_ARGS)
* buggy array code: it won't ensure proper alignment of Interval
* objects on machines where double requires 8-byte alignment. That
* should be fixed, but in the meantime...
*
* Note: must use DatumGetPointer here, not DatumGetIntervalP,
* else some compilers optimize into double-aligned load/store anyway.
*/
memcpy
(
&
sumX
,
DatumGetIntervalP
(
transdatums
[
0
]),
sizeof
(
Interval
));
memcpy
(
&
N
,
DatumGetIntervalP
(
transdatums
[
1
]),
sizeof
(
Interval
));
memcpy
(
(
void
*
)
&
sumX
,
DatumGetPointer
(
transdatums
[
0
]),
sizeof
(
Interval
));
memcpy
(
(
void
*
)
&
N
,
DatumGetPointer
(
transdatums
[
1
]),
sizeof
(
Interval
));
newsum
=
DatumGetIntervalP
(
DirectFunctionCall2
(
interval_pl
,
IntervalPGetDatum
(
&
sumX
),
...
...
@@ -1609,9 +1612,12 @@ interval_avg(PG_FUNCTION_ARGS)
* buggy array code: it won't ensure proper alignment of Interval
* objects on machines where double requires 8-byte alignment. That
* should be fixed, but in the meantime...
*
* Note: must use DatumGetPointer here, not DatumGetIntervalP,
* else some compilers optimize into double-aligned load/store anyway.
*/
memcpy
(
&
sumX
,
DatumGetIntervalP
(
transdatums
[
0
]),
sizeof
(
Interval
));
memcpy
(
&
N
,
DatumGetIntervalP
(
transdatums
[
1
]),
sizeof
(
Interval
));
memcpy
(
(
void
*
)
&
sumX
,
DatumGetPointer
(
transdatums
[
0
]),
sizeof
(
Interval
));
memcpy
(
(
void
*
)
&
N
,
DatumGetPointer
(
transdatums
[
1
]),
sizeof
(
Interval
));
/* SQL92 defines AVG of no values to be NULL */
if
(
N
.
time
==
0
)
...
...
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