summaryrefslogtreecommitdiff
path: root/contrib/btree_gist/btree_utils_num.h
diff options
context:
space:
mode:
authorTeodor Sigaev2004-06-03 12:26:10 +0000
committerTeodor Sigaev2004-06-03 12:26:10 +0000
commit7b81988f9b5275e2cdf7bbb0ca0620a24f1afc82 (patch)
treea21263073a48e6b7f9e6949734a3f0724a799579 /contrib/btree_gist/btree_utils_num.h
parent921d749bd4c34c3349f1c254d5faa2f1cec03911 (diff)
- Add aligment of variable data types
- Add aligment for interval data types - Avoid floating point overflow in penalty functions Janko Richter <[email protected]> and teodor
Diffstat (limited to 'contrib/btree_gist/btree_utils_num.h')
-rw-r--r--contrib/btree_gist/btree_utils_num.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/btree_gist/btree_utils_num.h b/contrib/btree_gist/btree_utils_num.h
index e9e9e9eb234..122fba379a1 100644
--- a/contrib/btree_gist/btree_utils_num.h
+++ b/contrib/btree_gist/btree_utils_num.h
@@ -41,6 +41,17 @@ typedef struct
* Numeric btree functions
*/
+
+#define penalty_range_enlarge(olower,oupper,nlower,nupper) do { \
+ res = 0; \
+ if ( (nupper) > (oupper) ) \
+ res += ( (nupper) - (oupper) ); \
+ if ( (olower) > (nlower) ) \
+ res += ( (olower) - (nlower) ); \
+} while (0);
+
+
+
extern bool gbt_num_consistent( const GBT_NUMKEY_R * key , const void * query,
const StrategyNumber * strategy , bool is_leaf,
const gbtree_ninfo * tinfo );