summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Schulz <aschulz@wikimedia.org>2021-12-03 17:12:18 -0800
committerKrinkle <krinkle@fastmail.com>2021-12-13 17:13:30 +0000
commita82b186df1d1a01a16c4910ba540a14402c2b62f (patch)
treeb85f3e6066237d5713ad25bfe020f394348a2100
parentfe75ca87724c9a9de4477c9acd918cfbdfac6f8d (diff)
rdbms: Explicitly set Sqlite PDO ATTR_ERRMODE to ERRMODE_SILENT
This to maintain forward-compat and consistency for the newer PDO version in PHP 8, which changes the default from ERRMODE_SILENT to ERRMODE_EXCEPTION. https://www.php.net/manual/en/pdo.error-handling.php Change-Id: Ieb6bbcbe884fcb8861e38c10b745d8a7502db7db
-rw-r--r--includes/libs/rdbms/database/DatabaseSqlite.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/libs/rdbms/database/DatabaseSqlite.php b/includes/libs/rdbms/database/DatabaseSqlite.php
index f2004eb2d5a5..e14cd7c600ba 100644
--- a/includes/libs/rdbms/database/DatabaseSqlite.php
+++ b/includes/libs/rdbms/database/DatabaseSqlite.php
@@ -156,7 +156,7 @@ class DatabaseSqlite extends Database {
throw $this->newExceptionAfterConnectError( "Got mode '{$this->trxMode}' for BEGIN" );
}
- $attributes = [];
+ $attributes = [ PDO::ATTR_ERRMODE => PDO::ERRMODE_SILENT ];
if ( $this->getFlag( self::DBO_PERSISTENT ) ) {
// Persistent connections can avoid some schema index reading overhead.
// On the other hand, they can cause horrible contention with DBO_TRX.