Skip to content

Commit

Permalink
Merge pull request #1245 from doctrine/1.12.x-merge-up-into-2.0.x_5fa…
Browse files Browse the repository at this point in the history
…6607ee566b9.61157081
  • Loading branch information
ostrolucky authored Nov 7, 2020
2 parents ae25798 + df45ea4 commit a11125d
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Automatic Releases"

on:
milestone:
types:
- "closed"

jobs:
release:
name: "Git tag, release & create merge-up PR"
runs-on: "ubuntu-20.04"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Release"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:release"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create Merge-Up Pull Request"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create new milestones"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-milestones"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
14 changes: 14 additions & 0 deletions Controller/ProfilerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Doctrine\Bundle\DoctrineBundle\Controller;

use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Platforms\OraclePlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Exception;
Expand Down Expand Up @@ -63,6 +64,8 @@ public function explainAction($token, $connectionName, $query)
$results = $this->explainSQLitePlatform($connection, $query);
} elseif ($platform instanceof SQLServerPlatform) {
$results = $this->explainSQLServerPlatform($connection, $query);
} elseif ($platform instanceof OraclePlatform) {
$results = $this->explainOraclePlatform($connection, $query);
} else {
$results = $this->explainOtherPlatform($connection, $query);
}
Expand Down Expand Up @@ -130,4 +133,15 @@ private function explainOtherPlatform(Connection $connection, string $query): ar
return $connection->executeQuery('EXPLAIN ' . $query['sql'], $params, $query['types'])
->fetchAll(PDO::FETCH_ASSOC);
}

/**
* @param mixed[] $query
*/
private function explainOraclePlatform(Connection $connection, array $query)
{
$connection->executeQuery('EXPLAIN PLAN FOR ' . $query['sql']);

return $connection->executeQuery('SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY())')
->fetchAll(PDO::FETCH_ASSOC);
}
}
1 change: 0 additions & 1 deletion DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ protected function getConnectionOptions($connection)
if (! empty($options['slaves']) || ! empty($options['replica'])) {
$nonRewrittenKeys = [
'driver' => true,
'driverOptions' => true,
'driverClass' => true,
'wrapperClass' => true,
'keepSlave' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class_exists(PrimaryReadReplicaConnection::class) ?
'dbname' => 'mysql_db',
'host' => 'localhost',
'unix_socket' => '/path/to/mysqld.sock',
'driverOptions' => [],
],
$param['primary'] ?? $param['master'] // TODO: Remove 'master' support here when we require dbal >= 2.11
);
Expand Down

0 comments on commit a11125d

Please sign in to comment.