diff --git a/Documentation/Filters/Maxrows.md b/Documentation/Filters/Maxrows.md index f85a929ce..a871a2f55 100644 --- a/Documentation/Filters/Maxrows.md +++ b/Documentation/Filters/Maxrows.md @@ -46,14 +46,16 @@ The default value is `-1`. #### `max_resultset_size` -Specifies the maximum size a resultset can have, measured in kibibytes, -in order to be sent to the client. A resultset larger than this, will +Specifies the maximum size a resultset can have in order +to be sent to the client. A resultset larger than this, will not be sent: an empty resultset will be sent instead. +The size can be specified as described +[here](../Getting-Started/Configuration-Guide.md#sizes). ``` -max_resultset_size=128 +max_resultset_size=128Ki ``` -The default value is 64. +The default value is 64Ki #### `max_resultset_return` diff --git a/server/modules/filter/maxrows/maxrows.c b/server/modules/filter/maxrows/maxrows.c index 77b691ffc..1676a3cc7 100644 --- a/server/modules/filter/maxrows/maxrows.c +++ b/server/modules/filter/maxrows/maxrows.c @@ -131,7 +131,7 @@ MXS_MODULE* MXS_CREATE_MODULE() }, { "max_resultset_size", - MXS_MODULE_PARAM_COUNT, + MXS_MODULE_PARAM_SIZE, MAXROWS_DEFAULT_MAX_RESULTSET_SIZE }, { @@ -244,8 +244,8 @@ static MXS_FILTER *createInstance(const char *name, cinstance->name = name; cinstance->config.max_resultset_rows = config_get_integer(params, "max_resultset_rows"); - cinstance->config.max_resultset_size = config_get_integer(params, - "max_resultset_size"); + cinstance->config.max_resultset_size = config_get_size(params, + "max_resultset_size"); cinstance->config.m_return = config_get_enum(params, "max_resultset_return", return_option_values); @@ -1226,6 +1226,7 @@ static int send_maxrows_reply_limit(MAXROWS_SESSION_DATA *csdata) default: MXS_ERROR("MaxRows config value not expected!"); ss_dassert(!true); + return 0; break; } }