Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
db927005
Commit
db927005
authored
Dec 08, 2020
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#3186999
by alexpott, neclimdul, longwave: Make the version a private class property
(cherry picked from commit
702514c1
)
parent
cce00b6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
+12
-4
core/tests/Drupal/Tests/Core/Database/Driver/mysql/ConnectionTest.php
...rupal/Tests/Core/Database/Driver/mysql/ConnectionTest.php
+0
-1
No files found.
core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
View file @
db927005
...
...
@@ -65,6 +65,15 @@ class Connection extends DatabaseConnection {
*/
protected
$needsCleanup
=
FALSE
;
/**
* Stores the server version after it has been retrieved from the database.
*
* @var string
*
* @see \Drupal\Core\Database\Driver\mysql\Connection::version
*/
private
$serverVersion
;
/**
* The minimal possible value for the max_allowed_packet setting of MySQL.
*
...
...
@@ -290,11 +299,10 @@ protected function getMariaDbVersionMatch(): ?string {
* The PDO server version.
*/
protected
function
getServerVersion
():
string
{
static
$server_version
;
if
(
!
$server_version
)
{
$server_version
=
$this
->
connection
->
query
(
'SELECT VERSION()'
)
->
fetchColumn
();
if
(
!
$this
->
serverVersion
)
{
$this
->
serverVersion
=
$this
->
connection
->
query
(
'SELECT VERSION()'
)
->
fetchColumn
();
}
return
$server
_v
ersion
;
return
$
this
->
server
V
ersion
;
}
public
function
databaseType
()
{
...
...
core/tests/Drupal/Tests/Core/Database/Driver/mysql/ConnectionTest.php
View file @
db927005
...
...
@@ -10,7 +10,6 @@
*
* @coversDefaultClass \Drupal\Core\Database\Driver\mysql\Connection
* @group Database
* @runTestsInSeparateProcesses
*/
class
ConnectionTest
extends
UnitTestCase
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment