Bug 1855448 - Cleanup: remove non necessary SQLITE_MAX_LIKE_PATTERN_LENGTH define. r=asuth

Depends on D189392

Differential Revision: https://phabricator.services.mozilla.com/D189393
This commit is contained in:
Marco Bonardo 2023-09-28 11:41:47 +00:00
Родитель 69b45023f2
Коммит 30115fd206
2 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -97,10 +97,6 @@ FINAL_LIBRARY = "xul"
if CONFIG["MOZ_THUNDERBIRD"] or CONFIG["MOZ_SUITE"]:
DEFINES["MOZ_SQLITE_FTS3_TOKENIZER"] = 1
# This is the default value. If we ever change it when compiling sqlite, we
# will need to change it here as well.
DEFINES["SQLITE_MAX_LIKE_PATTERN_LENGTH"] = 50000
# Disable auxiliary files persistence if requested.
if not CONFIG["MOZ_AVOID_DISK_REMNANT_ON_CLOSE"]:
DEFINES["MOZ_SQLITE_PERSIST_AUXILIARY_FILES"] = 1

Просмотреть файл

@ -10,6 +10,7 @@
#include "nsTArray.h"
#include "nsUnicharUtils.h"
#include <algorithm>
#include "sqlite3.h"
namespace mozilla {
namespace storage {
@ -284,7 +285,9 @@ void caseFunction(sqlite3_context* aCtx, int aArgc, sqlite3_value** aArgv) {
void likeFunction(sqlite3_context* aCtx, int aArgc, sqlite3_value** aArgv) {
NS_ASSERTION(2 == aArgc || 3 == aArgc, "Invalid number of arguments!");
if (::sqlite3_value_bytes(aArgv[0]) > SQLITE_MAX_LIKE_PATTERN_LENGTH) {
if (::sqlite3_value_bytes(aArgv[0]) >
::sqlite3_limit(::sqlite3_context_db_handle(aCtx),
SQLITE_LIMIT_LIKE_PATTERN_LENGTH, -1)) {
::sqlite3_result_error(aCtx, "LIKE or GLOB pattern too complex",
SQLITE_TOOBIG);
return;