From 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:33 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- storage/mozStorageConnection.cpp | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'storage/mozStorageConnection.cpp') diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp index e10458a68b..5dd2c9223e 100644 --- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -1155,19 +1155,20 @@ nsresult Connection::initialize(nsIFileURL* aFileURL) { bool hasKey = false; bool hasDirectoryLockId = false; - MOZ_ALWAYS_TRUE(URLParams::Parse( - query, [&hasKey, &hasDirectoryLockId](const nsAString& aName, - const nsAString& aValue) { - if (aName.EqualsLiteral("key")) { - hasKey = true; - return true; - } - if (aName.EqualsLiteral("directoryLockId")) { - hasDirectoryLockId = true; - return true; - } - return true; - })); + MOZ_ALWAYS_TRUE( + URLParams::Parse(query, true, + [&hasKey, &hasDirectoryLockId](const nsAString& aName, + const nsAString& aValue) { + if (aName.EqualsLiteral("key")) { + hasKey = true; + return true; + } + if (aName.EqualsLiteral("directoryLockId")) { + hasDirectoryLockId = true; + return true; + } + return true; + })); bool exclusive = StaticPrefs::storage_sqlite_exclusiveLock_enabled(); @@ -2468,6 +2469,18 @@ Connection::GetVariableLimit(int32_t* _limit) { return NS_OK; } +NS_IMETHODIMP +Connection::SetVariableLimit(int32_t limit) { + if (!connectionReady()) { + return NS_ERROR_NOT_INITIALIZED; + } + int oldLimit = ::sqlite3_limit(mDBConn, SQLITE_LIMIT_VARIABLE_NUMBER, limit); + if (oldLimit < 0) { + return NS_ERROR_UNEXPECTED; + } + return NS_OK; +} + NS_IMETHODIMP Connection::BeginTransaction() { if (!connectionReady()) { -- cgit v1.2.3