Skip to content

Commit

Permalink
Disable native JSON support for MariaDB 10.2.x
Browse files Browse the repository at this point in the history
Since the JSON type is simply an alias to a LONG TEXT we must force
a comment, otherwise things will not work properly.

Also the test for JSON types should work regardless of native JSON
support (DBAL should add a comment to identify the correct type).
  • Loading branch information
lcobucci committed Nov 19, 2017
1 parent 6fa8549 commit 52b4692
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/MariaDb1027Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class MariaDb1027Platform extends MySqlPlatform
*/
public function hasNativeJsonType() : bool
{
return true;
return false;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@

class MySqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
{

protected function setUp()
{
parent::setUp();

if (!Type::hasType('point')) {
if ( ! Type::hasType('point')) {
Type::addType('point', MySqlPointType::class);
}
}
Expand Down Expand Up @@ -337,11 +336,6 @@ public function testListFloatTypeColumns()

public function testJsonColumnType() : void
{
$platform = $this->_sm->getDatabasePlatform();
if ( ! $platform->hasNativeJsonType()) {
$this->markTestSkipped("Requires native JSON type");
}

$table = new Table('test_mysql_json');
$table->addColumn('col_json', 'json');
$this->_sm->dropAndCreateTable($table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function createPlatform() : MariaDb1027Platform

public function testHasNativeJsonType() : void
{
self::assertTrue($this->_platform->hasNativeJsonType());
self::assertFalse($this->_platform->hasNativeJsonType());
}

/**
Expand Down

0 comments on commit 52b4692

Please sign in to comment.