12
12
13
13
typedef struct QueryInfo
14
14
{
15
- StrategyNumber strategy ;
16
- Datum datum ;
15
+ StrategyNumber strategy ;
16
+ Datum datum ;
17
17
} QueryInfo ;
18
18
19
19
20
20
PG_FUNCTION_INFO_V1 (rum_timestamp_extract_value );
21
21
Datum
22
22
rum_timestamp_extract_value (PG_FUNCTION_ARGS )
23
23
{
24
- Datum datum = PG_GETARG_DATUM (0 );
25
- int32 * nentries = (int32 * ) PG_GETARG_POINTER (1 );
26
- Datum * entries = (Datum * ) palloc (sizeof (Datum ));
24
+ Datum datum = PG_GETARG_DATUM (0 );
25
+ int32 * nentries = (int32 * ) PG_GETARG_POINTER (1 );
26
+ Datum * entries = (Datum * ) palloc (sizeof (Datum ));
27
27
28
28
entries [0 ] = datum ;
29
29
* nentries = 1 ;
@@ -35,12 +35,12 @@ PG_FUNCTION_INFO_V1(rum_timestamp_extract_query);
35
35
Datum
36
36
rum_timestamp_extract_query (PG_FUNCTION_ARGS )
37
37
{
38
- Datum datum = PG_GETARG_DATUM (0 );
39
- int32 * nentries = (int32 * ) PG_GETARG_POINTER (1 );
38
+ Datum datum = PG_GETARG_DATUM (0 );
39
+ int32 * nentries = (int32 * ) PG_GETARG_POINTER (1 );
40
40
StrategyNumber strategy = PG_GETARG_UINT16 (2 );
41
41
bool * * partialmatch = (bool * * ) PG_GETARG_POINTER (3 );
42
42
Pointer * * extra_data = (Pointer * * ) PG_GETARG_POINTER (4 );
43
- Datum * entries = (Datum * ) palloc (sizeof (Datum ));
43
+ Datum * entries = (Datum * ) palloc (sizeof (Datum ));
44
44
QueryInfo * data = (QueryInfo * ) palloc (sizeof (QueryInfo ));
45
45
bool * ptr_partialmatch ;
46
46
@@ -52,7 +52,7 @@ rum_timestamp_extract_query(PG_FUNCTION_ARGS)
52
52
* extra_data = (Pointer * ) palloc (sizeof (Pointer ));
53
53
* * extra_data = (Pointer ) data ;
54
54
55
- switch (strategy )
55
+ switch (strategy )
56
56
{
57
57
case BTLessStrategyNumber :
58
58
case BTLessEqualStrategyNumber :
@@ -79,16 +79,17 @@ PG_FUNCTION_INFO_V1(rum_timestamp_compare_prefix);
79
79
Datum
80
80
rum_timestamp_compare_prefix (PG_FUNCTION_ARGS )
81
81
{
82
- Datum a = PG_GETARG_DATUM (0 );
83
- Datum b = PG_GETARG_DATUM (1 );
82
+ Datum a = PG_GETARG_DATUM (0 );
83
+ Datum b = PG_GETARG_DATUM (1 );
84
84
QueryInfo * data = (QueryInfo * ) PG_GETARG_POINTER (3 );
85
- int32 res , cmp ;
85
+ int32 res ,
86
+ cmp ;
86
87
87
88
cmp = DatumGetInt32 (DirectFunctionCall2Coll (timestamp_cmp ,
88
89
PG_GET_COLLATION (),
89
- (data -> strategy == BTLessStrategyNumber ||
90
+ (data -> strategy == BTLessStrategyNumber ||
90
91
data -> strategy == BTLessEqualStrategyNumber )
91
- ? data -> datum : a , b ));
92
+ ? data -> datum : a , b ));
92
93
93
94
switch (data -> strategy )
94
95
{
@@ -141,7 +142,7 @@ PG_FUNCTION_INFO_V1(rum_timestamp_consistent);
141
142
Datum
142
143
rum_timestamp_consistent (PG_FUNCTION_ARGS )
143
144
{
144
- bool * recheck = (bool * ) PG_GETARG_POINTER (5 );
145
+ bool * recheck = (bool * ) PG_GETARG_POINTER (5 );
145
146
146
147
* recheck = false;
147
148
PG_RETURN_BOOL (true);
@@ -226,10 +227,10 @@ PG_FUNCTION_INFO_V1(rum_timestamp_outer_distance);
226
227
Datum
227
228
rum_timestamp_outer_distance (PG_FUNCTION_ARGS )
228
229
{
229
- StrategyNumber strategy = PG_GETARG_UINT16 (2 );
230
+ StrategyNumber strategy = PG_GETARG_UINT16 (2 );
230
231
Datum diff ;
231
232
232
- switch (strategy )
233
+ switch (strategy )
233
234
{
234
235
case RUM_TMST_DISTANCE :
235
236
diff = DirectFunctionCall2 (timestamp_distance ,
@@ -253,4 +254,3 @@ rum_timestamp_outer_distance(PG_FUNCTION_ARGS)
253
254
254
255
PG_RETURN_DATUM (diff );
255
256
}
256
-
0 commit comments