diff --git a/CHANGELOG.md b/CHANGELOG.md index 2377b3e78..8cfa01b62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Allow resuming OSPd-based OpenVAS tasks [#869](https://github.com/greenbone/gvmd/pull/869) - Require Postgres 9.6 as a minimum [#872](https://github.com/greenbone/gvmd/pull/872) - Speed up the SCAP sync [#875](https://github.com/greenbone/gvmd/pull/875) [#877](https://github.com/greenbone/gvmd/pull/877) [#879](https://github.com/greenbone/gvmd/pull/879) [#881](https://github.com/greenbone/gvmd/pull/881) [#883](https://github.com/greenbone/gvmd/pull/883) [#887](https://github.com/greenbone/gvmd/pull/887) [#889](https://github.com/greenbone/gvmd/pull/889) [#890](https://github.com/greenbone/gvmd/pull/890) [#891](https://github.com/greenbone/gvmd/pull/891) +- Change rows of built-in default filters to -2 (use "Rows Per Page" setting) [#896](https://github.com/greenbone/gvmd/pull/896) - Force NVT update in migrate_219_to_220 [#895](https://github.com/greenbone/gvmd/pull/895) ### Fixed diff --git a/src/manage_sql.c b/src/manage_sql.c index 861a16796..458762103 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -1975,14 +1975,7 @@ split_filter_add_specials (array_t *parts, const gchar* given_filter) { keyword = g_malloc0 (sizeof (keyword_t)); keyword->column = g_strdup ("rows"); - /* If there was a filter, make max_return default to Rows Per - * Page. This keeps the pre-filters GMP behaviour when the filter - * is empty, but is more convenenient for clients that set the - * filter. */ - if (strlen (given_filter)) - keyword->string = g_strdup ("-2"); - else - keyword->string = g_strdup ("-1"); + keyword->string = g_strdup ("-2"); keyword->type = KEYWORD_TYPE_STRING; keyword->relation = KEYWORD_RELATION_COLUMN_EQUAL; array_add (parts, keyword); @@ -2203,7 +2196,7 @@ manage_filter_controls (const gchar *filter, int *first, int *max, if (first) *first = 1; if (max) - *max = -1; + *max = -2; if (sort_field) *sort_field = g_strdup ("name"); if (sort_order) @@ -2235,7 +2228,7 @@ manage_filter_controls (const gchar *filter, int *first, int *max, point = (keyword_t**) split->pdata; if (max) { - *max = -1; + *max = -2; while (*point) { keyword_t *keyword; @@ -3335,7 +3328,7 @@ filter_clause (const char* type, const char* filter, /* Add SQL to the clause for each keyword or phrase. */ if (max_return) - *max_return = -1; + *max_return = -2; clause = g_string_new (""); order = g_string_new (""); diff --git a/src/schema_formats/XML/GMP.xml.in b/src/schema_formats/XML/GMP.xml.in index 3acd9789e..fa7c66a3f 100644 --- a/src/schema_formats/XML/GMP.xml.in +++ b/src/schema_formats/XML/GMP.xml.in @@ -27256,7 +27256,24 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - + + GET_... Commands using filters + GET_... commands will default to "rows=-2" filter + +

+ If no filter or a filter without a rows keyword is given, the various + GET_... commands using filters will behave as if "rows=-2" was given + instead of "rows=-1". +

+

+ This means they will only return the number of rows defined by the + "Rows Per Page" setting and the maximum amount of rows has to be + requested explicitly with a "rows=-1" filter keyword or + (where available) the ignore_pagination option. +

+
+ 9.0 +
CREATE_CONFIG NVT preferences without IDs are no longer accepted