diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-04-27 21:11:00 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-05-08 17:50:55 +0800 |
commit | 936e759536705b22218afaceff4d81d348021402 (patch) | |
tree | eaee79600e8148ebb912239f0ea58161b9110513 /lib/history/ephy-history-service-urls-table.c | |
parent | bb10c338f3acb2dbdfe7405e7305f928df636f42 (diff) | |
download | gsoc2013-epiphany-936e759536705b22218afaceff4d81d348021402.tar gsoc2013-epiphany-936e759536705b22218afaceff4d81d348021402.tar.gz gsoc2013-epiphany-936e759536705b22218afaceff4d81d348021402.tar.bz2 gsoc2013-epiphany-936e759536705b22218afaceff4d81d348021402.tar.lz gsoc2013-epiphany-936e759536705b22218afaceff4d81d348021402.tar.xz gsoc2013-epiphany-936e759536705b22218afaceff4d81d348021402.tar.zst gsoc2013-epiphany-936e759536705b22218afaceff4d81d348021402.zip |
ephy-history-service: trim query strings to avoid reaching sqlite limit
Sqlite limits the length of a LIKE pattern to 50000 bytes, therefore
we need to make sure that longer strings are not used as queries.
https://bugzilla.gnome.org/show_bug.cgi?id=674848
Diffstat (limited to 'lib/history/ephy-history-service-urls-table.c')
-rw-r--r-- | lib/history/ephy-history-service-urls-table.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c index 9bcb5f62b..1e0a9c136 100644 --- a/lib/history/ephy-history-service-urls-table.c +++ b/lib/history/ephy-history-service-urls-table.c @@ -311,7 +311,7 @@ ephy_history_service_find_url_rows (EphyHistoryService *self, EphyHistoryQuery * } } for (substring = query->substring_list; substring != NULL; substring = substring->next) { - char *string = g_strdup_printf ("%%%s%%", (char*)substring->data); + char *string = ephy_sqlite_create_match_pattern ((char*)substring->data); if (ephy_sqlite_statement_bind_string (statement, i++, string, &error) == FALSE) { g_error ("Could not build urls table query statement: %s", error->message); g_error_free (error); |