Arm32: Fix Datum to int cast issue#1299
Conversation
svenklemm
left a comment
There was a problem hiding this comment.
I dont think this is an improvement as you check for type twice now with this change
c412c45 to
0568f75
Compare
|
the current code incorrectly assumes that the You are right that this makes an extra function call. I can inline the function or turn it into a macro if you think it would be an issue but if I understand it correctly this code runs once in the planning phase so should not add significant overhead. The issue is very similar to this I will add this info to the commit message. Just made a PR to get it tested on all postgres versions on ARM then remembered that I need to push to prerelease_tests for that. |
0568f75 to
495c634
Compare
Codecov Report
@@ Coverage Diff @@
## master #1299 +/- ##
=========================================
Coverage ? 91.85%
=========================================
Files ? 111
Lines ? 14451
Branches ? 0
=========================================
Hits ? 13274
Misses ? 1177
Partials ? 0
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1299 +/- ##
==========================================
- Coverage 91.95% 91.95% -0.01%
==========================================
Files 111 111
Lines 14365 14372 +7
==========================================
+ Hits 13210 13216 +6
- Misses 1155 1156 +1
Continue to review full report at Codecov.
|
e13d46f to
1525d8d
Compare
| errmsg("can only use const_datum_get_int with integer types"))); | ||
|
|
||
| Assert(false); | ||
| return 0; |
There was a problem hiding this comment.
this should be pg_unreachable();
a23b173 to
abdfea3
Compare
Given a query like: SELECT * FROM hyper WHERE time_bucket(10, time) < 100 where time column has type bigint the current `time_bucket` parser assumes the type of (Const*)100 to be the same as the type of the `time` column of the table. This does not have to be the same for integer types: `time` can be a `bigint`, but if the operand fits in an `int`, the relevant (Const*) object will have type `int` (reflected in its `consttype` attribute). This PR makes sure that we use this type information to accordingly extract value from Datum and not rely on the type information of the column.
abdfea3 to
89ac865
Compare
No description provided.