- Added identifier escaping to match differents PDO drivers

This commit is contained in:
Dave Mc Nicoll committed 2020-04-09 13:20:07 -04:00
1 parent def8decb4e
commit 3ff97f3bf0
8 files changed
+71 -30

No files matched your search

+11
View File
@@ -123,4 +123,15 @@ class MySQL implements AdapterInterface {
$this->charset = $configuration['charset'];
}
}
public function escapeIdentifier(string $segment, int $type) : string
{
switch($type) {
case static::IDENTIFIER_DATABASE:
case static::IDENTIFIER_TABLE:
case static::IDENTIFIER_FIELD:
return "`" . str_replace("`", "``", $segment) . "`";
}
}
}