Skip to content

Commit 99472ee

Browse files
committed
add "partial" parameter
1 parent 6adb9ef commit 99472ee

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

src/Query.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,22 @@ namespace griddb {
9090
/**
9191
* Set fetch limit option
9292
*/
93-
void Query::set_fetch_options(int limit){
94-
GSFetchOption fetchOption = GS_FETCH_LIMIT;
95-
GSResult ret = gsSetFetchOption(mQuery, fetchOption, &limit, GS_TYPE_INTEGER);
96-
if (ret != GS_RESULT_OK) {
97-
throw GSException(mQuery, ret);
93+
void Query::set_fetch_options(int limit, bool partial){
94+
if (limit >= 0) {
95+
GSFetchOption fetchOption = GS_FETCH_LIMIT;
96+
GSResult ret = gsSetFetchOption(mQuery, fetchOption, &limit, GS_TYPE_INTEGER);
97+
if (ret != GS_RESULT_OK) {
98+
throw GSException(mQuery, ret);
99+
}
100+
}
101+
if (partial == true) {
102+
#if GS_COMPATIBILITY_SUPPORT_4_0
103+
GSFetchOption fetchOption = GS_FETCH_PARTIAL_EXECUTION;
104+
GSResult ret = gsSetFetchOption(mQuery, fetchOption, &partial, GS_TYPE_BOOL);
105+
if (ret != GS_RESULT_OK) {
106+
throw GSException(mQuery, ret);
107+
}
108+
#endif
98109
}
99110
}
100111
}

src/Query.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Query {
4242
RowSet* fetch(bool for_update = false);
4343
void set_fetch_option_integer(GSFetchOption fetchOption, int32_t value);
4444
void set_fetch_option_long(GSFetchOption fetchOption, int64_t value);
45-
void set_fetch_options(int limit = -1);
45+
void set_fetch_options(int limit = -1, bool partial = false);
4646
RowSet* get_row_set();
4747
GSQuery* gs_ptr();
4848

0 commit comments

Comments
 (0)