Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
f930ea82
Unverified
Commit
f930ea82
authored
Jun 19, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expressions like SELECT DATABASE() will always return one row
parent
e48861ec
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
4 deletions
+40
-4
AbstractMySQLDriver.php
lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
+10
-1
AbstractPostgreSQLDriver.php
lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php
+10
-1
AbstractSQLAnywhereDriver.php
lib/Doctrine/DBAL/Driver/AbstractSQLAnywhereDriver.php
+10
-1
AbstractSQLServerDriver.php
lib/Doctrine/DBAL/Driver/AbstractSQLServerDriver.php
+10
-1
No files found.
lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
View file @
f930ea82
...
@@ -12,6 +12,7 @@ use Doctrine\DBAL\Platforms\MySQL80Platform;
...
@@ -12,6 +12,7 @@ use Doctrine\DBAL\Platforms\MySQL80Platform;
use
Doctrine\DBAL\Platforms\MySqlPlatform
;
use
Doctrine\DBAL\Platforms\MySqlPlatform
;
use
Doctrine\DBAL\Schema\MySqlSchemaManager
;
use
Doctrine\DBAL\Schema\MySqlSchemaManager
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
function
assert
;
use
function
preg_match
;
use
function
preg_match
;
use
function
stripos
;
use
function
stripos
;
use
function
version_compare
;
use
function
version_compare
;
...
@@ -197,7 +198,15 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
...
@@ -197,7 +198,15 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
{
{
$params
=
$conn
->
getParams
();
$params
=
$conn
->
getParams
();
return
$params
[
'dbname'
]
??
$conn
->
query
(
'SELECT DATABASE()'
)
->
fetchColumn
();
if
(
isset
(
$params
[
'dbname'
]))
{
return
$params
[
'dbname'
];
}
$database
=
$conn
->
query
(
'SELECT DATABASE()'
)
->
fetchColumn
();
assert
(
$database
!==
false
);
return
$database
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/AbstractPostgreSQLDriver.php
View file @
f930ea82
...
@@ -13,6 +13,7 @@ use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
...
@@ -13,6 +13,7 @@ use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use
Doctrine\DBAL\Platforms\PostgreSqlPlatform
;
use
Doctrine\DBAL\Platforms\PostgreSqlPlatform
;
use
Doctrine\DBAL\Schema\PostgreSqlSchemaManager
;
use
Doctrine\DBAL\Schema\PostgreSqlSchemaManager
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
function
assert
;
use
function
preg_match
;
use
function
preg_match
;
use
function
strpos
;
use
function
strpos
;
use
function
version_compare
;
use
function
version_compare
;
...
@@ -119,7 +120,15 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri
...
@@ -119,7 +120,15 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri
{
{
$params
=
$conn
->
getParams
();
$params
=
$conn
->
getParams
();
return
$params
[
'dbname'
]
??
$conn
->
query
(
'SELECT CURRENT_DATABASE()'
)
->
fetchColumn
();
if
(
isset
(
$params
[
'dbname'
]))
{
return
$params
[
'dbname'
];
}
$database
=
$conn
->
query
(
'SELECT CURRENT_DATABASE()'
)
->
fetchColumn
();
assert
(
$database
!==
false
);
return
$database
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/AbstractSQLAnywhereDriver.php
View file @
f930ea82
...
@@ -12,6 +12,7 @@ use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
...
@@ -12,6 +12,7 @@ use Doctrine\DBAL\Platforms\SQLAnywhere16Platform;
use
Doctrine\DBAL\Platforms\SQLAnywherePlatform
;
use
Doctrine\DBAL\Platforms\SQLAnywherePlatform
;
use
Doctrine\DBAL\Schema\SQLAnywhereSchemaManager
;
use
Doctrine\DBAL\Schema\SQLAnywhereSchemaManager
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
function
assert
;
use
function
preg_match
;
use
function
preg_match
;
use
function
version_compare
;
use
function
version_compare
;
...
@@ -119,7 +120,15 @@ abstract class AbstractSQLAnywhereDriver implements Driver, ExceptionConverterDr
...
@@ -119,7 +120,15 @@ abstract class AbstractSQLAnywhereDriver implements Driver, ExceptionConverterDr
{
{
$params
=
$conn
->
getParams
();
$params
=
$conn
->
getParams
();
return
$params
[
'dbname'
]
??
$conn
->
query
(
'SELECT DB_NAME()'
)
->
fetchColumn
();
if
(
isset
(
$params
[
'dbname'
]))
{
return
$params
[
'dbname'
];
}
$database
=
$conn
->
query
(
'SELECT DB_NAME()'
)
->
fetchColumn
();
assert
(
$database
!==
false
);
return
$database
;
}
}
/**
/**
...
...
lib/Doctrine/DBAL/Driver/AbstractSQLServerDriver.php
View file @
f930ea82
...
@@ -11,6 +11,7 @@ use Doctrine\DBAL\Platforms\SQLServer2012Platform;
...
@@ -11,6 +11,7 @@ use Doctrine\DBAL\Platforms\SQLServer2012Platform;
use
Doctrine\DBAL\Platforms\SQLServerPlatform
;
use
Doctrine\DBAL\Platforms\SQLServerPlatform
;
use
Doctrine\DBAL\Schema\SQLServerSchemaManager
;
use
Doctrine\DBAL\Schema\SQLServerSchemaManager
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
Doctrine\DBAL\VersionAwarePlatformDriver
;
use
function
assert
;
use
function
preg_match
;
use
function
preg_match
;
use
function
version_compare
;
use
function
version_compare
;
...
@@ -60,7 +61,15 @@ abstract class AbstractSQLServerDriver implements Driver, VersionAwarePlatformDr
...
@@ -60,7 +61,15 @@ abstract class AbstractSQLServerDriver implements Driver, VersionAwarePlatformDr
{
{
$params
=
$conn
->
getParams
();
$params
=
$conn
->
getParams
();
return
$params
[
'dbname'
]
??
$conn
->
query
(
'SELECT DB_NAME()'
)
->
fetchColumn
();
if
(
isset
(
$params
[
'dbname'
]))
{
return
$params
[
'dbname'
];
}
$database
=
$conn
->
query
(
'SELECT DB_NAME()'
)
->
fetchColumn
();
assert
(
$database
!==
false
);
return
$database
;
}
}
/**
/**
...
...
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