Skip to content

Commit

Permalink
Use BINARY instead of CAST in GeometryType
Browse files Browse the repository at this point in the history
According to the docs, these constructs are equivalent, and GeometryType is now using the same construct as PDOEngine.
  • Loading branch information
BenMorel committed Apr 20, 2021
1 parent dcce548 commit a5325ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Doctrine/Types/GeometryType.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function convertToDatabaseValue($value, AbstractPlatform $platform)
public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform)
{
if ($platform instanceof MySqlPlatform) {
$sqlExpr = sprintf('CAST(%s AS BINARY)', $sqlExpr);
$sqlExpr = sprintf('BINARY %s', $sqlExpr);
}

return sprintf('ST_GeomFromWKB(%s, %d)', $sqlExpr, self::$srid);
Expand Down

0 comments on commit a5325ea

Please sign in to comment.