Kouhei Sutou
null+****@clear*****
Mon Oct 14 10:51:07 JST 2013
Kouhei Sutou 2013-10-14 10:51:07 +0900 (Mon, 14 Oct 2013) New Revision: e00179a6d5f98aff7ddd4cc4905ab384d0de518a https://github.com/groonga/groonga/commit/e00179a6d5f98aff7ddd4cc4905ab384d0de518a Message: cache_limit: don't return the current value on error Modified files: lib/proc.c test/command/suite/cache_limit/invalid/minus.expected test/command/suite/cache_limit/invalid/string.expected Modified: lib/proc.c (+6 -1) =================================================================== --- lib/proc.c 2013-10-14 09:52:24 +0900 (3cef265) +++ lib/proc.c 2013-10-14 10:51:07 +0900 (3b2a9bf) @@ -2577,8 +2577,10 @@ static grn_obj * proc_cache_limit(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data) { grn_cache *cache; + unsigned int current_max_n_entries; + cache = grn_cache_current_get(ctx); - GRN_OUTPUT_INT64(grn_cache_get_max_n_entries(ctx, cache)); + current_max_n_entries = grn_cache_get_max_n_entries(ctx, cache); if (GRN_TEXT_LEN(VAR(0))) { const char *rest; uint32_t max = grn_atoui(GRN_TEXT_VALUE(VAR(0)), @@ -2591,6 +2593,9 @@ proc_cache_limit(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_da (int)GRN_TEXT_LEN(VAR(0)), GRN_TEXT_VALUE(VAR(0))); } } + if (ctx->rc == GRN_SUCCESS) { + GRN_OUTPUT_INT64(current_max_n_entries); + } return NULL; } Modified: test/command/suite/cache_limit/invalid/minus.expected (+1 -1) =================================================================== --- test/command/suite/cache_limit/invalid/minus.expected 2013-10-14 09:52:24 +0900 (2883039) +++ test/command/suite/cache_limit/invalid/minus.expected 2013-10-14 10:51:07 +0900 (8ea087b) @@ -1,3 +1,3 @@ cache_limit --max -1 -[[[-22,0.0,0.0],"max value is invalid unsigned integer format: <-1>"],100] +[[[-22,0.0,0.0],"max value is invalid unsigned integer format: <-1>"]] #|e| max value is invalid unsigned integer format: <-1> Modified: test/command/suite/cache_limit/invalid/string.expected (+1 -1) =================================================================== --- test/command/suite/cache_limit/invalid/string.expected 2013-10-14 09:52:24 +0900 (1f67ed0) +++ test/command/suite/cache_limit/invalid/string.expected 2013-10-14 10:51:07 +0900 (59023a5) @@ -1,3 +1,3 @@ cache_limit --max LIMIT -[[[-22,0.0,0.0],"max value is invalid unsigned integer format: <LIMIT>"],100] +[[[-22,0.0,0.0],"max value is invalid unsigned integer format: <LIMIT>"]] #|e| max value is invalid unsigned integer format: <LIMIT> -------------- next part -------------- HTML����������������������������...Download