Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't rewrite defaultTableOptions in sharded or master/slave connections #915

Merged
merged 2 commits into from Feb 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions DependencyInjection/DoctrineExtension.php
Expand Up @@ -251,6 +251,7 @@ protected function getConnectionOptions($connection)
'master' => true,
'shards' => true,
'serverVersion' => true,
'defaultTableOptions' => true,
// included by safety but should have been unset already
'logging' => true,
'profiling' => true,
Expand Down Expand Up @@ -285,6 +286,7 @@ protected function getConnectionOptions($connection)
'global' => true,
'shards' => true,
'serverVersion' => true,
'defaultTableOptions' => true,
// included by safety but should have been unset already
'logging' => true,
'profiling' => true,
Expand Down
4 changes: 2 additions & 2 deletions Tests/DependencyInjection/AbstractDoctrineExtensionTest.php
Expand Up @@ -118,7 +118,6 @@ public function testDbalLoadSingleMasterSlaveConnection()
'dbname' => 'mysql_db',
'host' => 'localhost',
'unix_socket' => '/path/to/mysqld.sock',
'defaultTableOptions' => [],
],
$param['master']
);
Expand All @@ -133,6 +132,7 @@ public function testDbalLoadSingleMasterSlaveConnection()
],
$param['slaves']['slave1']
);
$this->assertEquals(['engine' => 'InnoDB'], $param['defaultTableOptions']);
}

public function testDbalLoadPoolShardingConnection()
Expand All @@ -152,7 +152,6 @@ public function testDbalLoadPoolShardingConnection()
'dbname' => 'mysql_db',
'host' => 'localhost',
'unix_socket' => '/path/to/mysqld.sock',
'defaultTableOptions' => [],
],
$param['global']
);
Expand All @@ -168,6 +167,7 @@ public function testDbalLoadPoolShardingConnection()
],
$param['shards'][0]
);
$this->assertEquals(['engine' => 'InnoDB'], $param['defaultTableOptions']);
}

public function testDbalLoadSavepointsForNestedTransactions()
Expand Down
Expand Up @@ -9,6 +9,7 @@
<config>
<dbal dbname="mysql_db" user="mysql_user" password="mysql_s3cr3t" unix-socket="/path/to/mysqld.sock" shard-choser-service="foo.shard_choser">
<shard id="1" dbname="shard_db" user="shard_user" password="shard_s3cr3t" unix-socket="/path/to/mysqld_shard.sock" />
<default-table-option name="engine">InnoDB</default-table-option>
</dbal>
</config>
</srv:container>
Expand Up @@ -9,6 +9,7 @@
<config>
<dbal dbname="mysql_db" user="mysql_user" password="mysql_s3cr3t" unix-socket="/path/to/mysqld.sock" keep-slave="true">
<slave name="slave1" dbname="slave_db" user="slave_user" password="slave_s3cr3t" unix-socket="/path/to/mysqld_slave.sock" />
<default-table-option name="engine">InnoDB</default-table-option>
</dbal>
</config>
</srv:container>
Expand Up @@ -5,6 +5,8 @@ doctrine:
password: mysql_s3cr3t
unix_socket: /path/to/mysqld.sock
shard_choser_service: foo.shard_choser
default_table_options:
engine: InnoDB
shards:
-
id: 1
Expand Down
Expand Up @@ -5,6 +5,8 @@ doctrine:
password: mysql_s3cr3t
unix_socket: /path/to/mysqld.sock
keep_slave: true
default_table_options:
engine: InnoDB
slaves:
slave1:
user: slave_user
Expand Down