File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments