dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rdbms: clean up use of ATTACH queries in DatabaseSqlite
[lhc/web/wiklou.git]
/
includes
/
libs
/
rdbms
/
database
/
Database.php
diff --git
a/includes/libs/rdbms/database/Database.php
b/includes/libs/rdbms/database/Database.php
index
084500a
..
6aa3f6f
100644
(file)
--- a/
includes/libs/rdbms/database/Database.php
+++ b/
includes/libs/rdbms/database/Database.php
@@
-1487,6
+1487,8
@@
abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
$this->trxAtomicCounter = 0;
$this->trxIdleCallbacks = []; // T67263; transaction already lost
$this->trxPreCommitCallbacks = []; // T67263; transaction already lost
$this->trxAtomicCounter = 0;
$this->trxIdleCallbacks = []; // T67263; transaction already lost
$this->trxPreCommitCallbacks = []; // T67263; transaction already lost
+ // Clear additional subclass fields
+ $this->doHandleSessionLossPreconnect();
// @note: leave trxRecurringCallbacks in place
if ( $this->trxDoneWrites ) {
$this->trxProfiler->transactionWritingOut(
// @note: leave trxRecurringCallbacks in place
if ( $this->trxDoneWrites ) {
$this->trxProfiler->transactionWritingOut(
@@
-1499,6
+1501,13
@@
abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
}
}
}
}
+ /**
+ * Reset any additional subclass trx* and session* fields
+ */
+ protected function doHandleSessionLossPreconnect() {
+ // no-op
+ }
+
/**
* Clean things up after session (and thus transaction) loss after reconnect
*/
/**
* Clean things up after session (and thus transaction) loss after reconnect
*/
@@
-3522,7
+3531,7
@@
abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
if ( in_array( $entry[2], $sectionIds, true ) ) {
$callback = $entry[0];
$this->trxEndCallbacks[$key][0] = function () use ( $callback ) {
if ( in_array( $entry[2], $sectionIds, true ) ) {
$callback = $entry[0];
$this->trxEndCallbacks[$key][0] = function () use ( $callback ) {
- // @phan-suppress-next-line PhanInfiniteRecursion
No recursion at all here, phan is confused
+ // @phan-suppress-next-line PhanInfiniteRecursion
, PhanUndeclaredInvokeInCallable
return $callback( self::TRIGGER_ROLLBACK, $this );
};
// This "on resolution" callback no longer belongs to a section.
return $callback( self::TRIGGER_ROLLBACK, $this );
};
// This "on resolution" callback no longer belongs to a section.
@@
-3647,6
+3656,7
@@
abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
try {
++$count;
list( $phpCallback ) = $callback;
try {
++$count;
list( $phpCallback ) = $callback;
+ // @phan-suppress-next-line PhanUndeclaredInvokeInCallable
$phpCallback( $this );
} catch ( Exception $ex ) {
( $this->errorLogger )( $ex );
$phpCallback( $this );
} catch ( Exception $ex ) {
( $this->errorLogger )( $ex );
@@
-3682,6
+3692,7
@@
abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
foreach ( $callbacks as $entry ) {
if ( $sectionIds === null || in_array( $entry[2], $sectionIds, true ) ) {
try {
foreach ( $callbacks as $entry ) {
if ( $sectionIds === null || in_array( $entry[2], $sectionIds, true ) ) {
try {
+ // @phan-suppress-next-line PhanUndeclaredInvokeInCallable
$entry[0]( $trigger, $this );
} catch ( Exception $ex ) {
( $this->errorLogger )( $ex );
$entry[0]( $trigger, $this );
} catch ( Exception $ex ) {
( $this->errorLogger )( $ex );