Commit 84bbcbbb authored by Jonathan Vollebregt's avatar Jonathan Vollebregt

MySqlPlatform: Fix default isolation level

Default isolation level on mysql is REPEATABLE READ

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_tx_isolation
parent e0169b2a
...@@ -25,6 +25,7 @@ use Doctrine\DBAL\Schema\Index; ...@@ -25,6 +25,7 @@ use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\BlobType; use Doctrine\DBAL\Types\BlobType;
use Doctrine\DBAL\Types\TextType; use Doctrine\DBAL\Types\TextType;
use Doctrine\DBAL\Connection;
/** /**
* The MySqlPlatform provides the behavior, features and SQL dialect of the * The MySqlPlatform provides the behavior, features and SQL dialect of the
...@@ -1126,4 +1127,12 @@ class MySqlPlatform extends AbstractPlatform ...@@ -1126,4 +1127,12 @@ class MySqlPlatform extends AbstractPlatform
return parent::quoteStringLiteral($str); return parent::quoteStringLiteral($str);
} }
/**
* {@inheritdoc}
*/
public function getDefaultTransactionIsolationLevel()
{
return Connection::TRANSACTION_REPEATABLE_READ;
}
} }
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\MySqlPlatform; use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Connection;
class MySqlPlatformTest extends AbstractMySQLPlatformTestCase class MySqlPlatformTest extends AbstractMySQLPlatformTestCase
{ {
...@@ -10,4 +11,12 @@ class MySqlPlatformTest extends AbstractMySQLPlatformTestCase ...@@ -10,4 +11,12 @@ class MySqlPlatformTest extends AbstractMySQLPlatformTestCase
{ {
return new MysqlPlatform; return new MysqlPlatform;
} }
public function testHasCorrectDefaultTransactionIsolationLevel()
{
$this->assertEquals(
Connection::TRANSACTION_REPEATABLE_READ,
$this->_platform->getDefaultTransactionIsolationLevel()
);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment