Skip to content

Commit 290add3

Browse files
committed
Fixed MySQL 8 build issues
1 parent a26a2bf commit 290add3

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/MysqlConnection.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function __construct($pdo, $database = '', $tablePrefix = '', array $conf
2424
'multilinestring',
2525
'multipolygon',
2626
'geometrycollection',
27+
'geomcollection'
2728
];
2829
$dbPlatform = $this->getDoctrineSchemaManager()->getDatabasePlatform();
2930
foreach ($geometries as $type) {

tests/Integration/SpatialTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ public function createApplication()
3232
$app['config']->set('database.connections.mysql.database', 'spatial_test');
3333
$app['config']->set('database.connections.mysql.username', 'root');
3434
$app['config']->set('database.connections.mysql.password', '');
35+
$app['config']->set('database.connections.mysql.modes', [
36+
'ONLY_FULL_GROUP_BY',
37+
'STRICT_TRANS_TABLES',
38+
'NO_ZERO_IN_DATE',
39+
'NO_ZERO_DATE',
40+
'ERROR_FOR_DIVISION_BY_ZERO',
41+
'NO_ENGINE_SUBSTITUTION',
42+
]);
3543

3644
return $app;
3745
}
@@ -71,7 +79,7 @@ private function isMySQL8AfterFix()
7179
$results = DB::select(DB::raw('select version()'));
7280
$mysql_version = $results[0]->{'version()'};
7381

74-
return strpos($mysql_version, '8.0.4') !== false;
82+
return version_compare($mysql_version, '8.0.4', '>=');
7583
}
7684

7785
protected function assertDatabaseHas($table, array $data, $connection = null)

0 commit comments

Comments
 (0)