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
7b69b6ce
Commit
7b69b6ce
authored
Sep 01, 2017
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix assorted carelessness about Datum vs. int64 vs. uint64
Bugs introduced by commit
81c5e46c
parent
0d9506d1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
src/backend/utils/adt/arrayfuncs.c
src/backend/utils/adt/arrayfuncs.c
+1
-1
src/backend/utils/adt/date.c
src/backend/utils/adt/date.c
+3
-2
src/backend/utils/adt/numeric.c
src/backend/utils/adt/numeric.c
+1
-1
src/backend/utils/adt/rangetypes.c
src/backend/utils/adt/rangetypes.c
+3
-2
No files found.
src/backend/utils/adt/arrayfuncs.c
View file @
7b69b6ce
...
@@ -4084,7 +4084,7 @@ hash_array_extended(PG_FUNCTION_ARGS)
...
@@ -4084,7 +4084,7 @@ hash_array_extended(PG_FUNCTION_ARGS)
{
{
/* Apply the hash function */
/* Apply the hash function */
locfcinfo
.
arg
[
0
]
=
elt
;
locfcinfo
.
arg
[
0
]
=
elt
;
locfcinfo
.
arg
[
1
]
=
seed
;
locfcinfo
.
arg
[
1
]
=
Int64GetDatum
(
seed
)
;
locfcinfo
.
argnull
[
0
]
=
false
;
locfcinfo
.
argnull
[
0
]
=
false
;
locfcinfo
.
argnull
[
1
]
=
false
;
locfcinfo
.
argnull
[
1
]
=
false
;
locfcinfo
.
isnull
=
false
;
locfcinfo
.
isnull
=
false
;
...
...
src/backend/utils/adt/date.c
View file @
7b69b6ce
...
@@ -2223,14 +2223,15 @@ Datum
...
@@ -2223,14 +2223,15 @@ Datum
timetz_hash_extended
(
PG_FUNCTION_ARGS
)
timetz_hash_extended
(
PG_FUNCTION_ARGS
)
{
{
TimeTzADT
*
key
=
PG_GETARG_TIMETZADT_P
(
0
);
TimeTzADT
*
key
=
PG_GETARG_TIMETZADT_P
(
0
);
uint64
seed
=
PG_GETARG_DATUM
(
1
);
Datum
seed
=
PG_GETARG_DATUM
(
1
);
uint64
thash
;
uint64
thash
;
/* Same approach as timetz_hash */
/* Same approach as timetz_hash */
thash
=
DatumGetUInt64
(
DirectFunctionCall2
(
hashint8extended
,
thash
=
DatumGetUInt64
(
DirectFunctionCall2
(
hashint8extended
,
Int64GetDatumFast
(
key
->
time
),
Int64GetDatumFast
(
key
->
time
),
seed
));
seed
));
thash
^=
DatumGetUInt64
(
hash_uint32_extended
(
key
->
zone
,
seed
));
thash
^=
DatumGetUInt64
(
hash_uint32_extended
(
key
->
zone
,
DatumGetInt64
(
seed
)));
PG_RETURN_UINT64
(
thash
);
PG_RETURN_UINT64
(
thash
);
}
}
...
...
src/backend/utils/adt/numeric.c
View file @
7b69b6ce
...
@@ -2285,7 +2285,7 @@ hash_numeric_extended(PG_FUNCTION_ARGS)
...
@@ -2285,7 +2285,7 @@ hash_numeric_extended(PG_FUNCTION_ARGS)
hash_len
*
sizeof
(
NumericDigit
),
hash_len
*
sizeof
(
NumericDigit
),
seed
);
seed
);
result
=
digit_hash
^
weight
;
result
=
UInt64GetDatum
(
DatumGetUInt64
(
digit_hash
)
^
weight
)
;
PG_RETURN_DATUM
(
result
);
PG_RETURN_DATUM
(
result
);
}
}
...
...
src/backend/utils/adt/rangetypes.c
View file @
7b69b6ce
...
@@ -1288,7 +1288,7 @@ Datum
...
@@ -1288,7 +1288,7 @@ Datum
hash_range_extended
(
PG_FUNCTION_ARGS
)
hash_range_extended
(
PG_FUNCTION_ARGS
)
{
{
RangeType
*
r
=
PG_GETARG_RANGE
(
0
);
RangeType
*
r
=
PG_GETARG_RANGE
(
0
);
uint64
seed
=
PG_GETARG_INT64
(
1
);
Datum
seed
=
PG_GETARG_DATUM
(
1
);
uint64
result
;
uint64
result
;
TypeCacheEntry
*
typcache
;
TypeCacheEntry
*
typcache
;
TypeCacheEntry
*
scache
;
TypeCacheEntry
*
scache
;
...
@@ -1335,7 +1335,8 @@ hash_range_extended(PG_FUNCTION_ARGS)
...
@@ -1335,7 +1335,8 @@ hash_range_extended(PG_FUNCTION_ARGS)
upper_hash
=
0
;
upper_hash
=
0
;
/* Merge hashes of flags and bounds */
/* Merge hashes of flags and bounds */
result
=
hash_uint32_extended
((
uint32
)
flags
,
seed
);
result
=
DatumGetUInt64
(
hash_uint32_extended
((
uint32
)
flags
,
DatumGetInt64
(
seed
)));
result
^=
lower_hash
;
result
^=
lower_hash
;
result
=
ROTATE_HIGH_AND_LOW_32BITS
(
result
);
result
=
ROTATE_HIGH_AND_LOW_32BITS
(
result
);
result
^=
upper_hash
;
result
^=
upper_hash
;
...
...
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