diff --git a/lib/Doctrine/ORM/Mapping/AnsiQuoteStrategy.php b/lib/Doctrine/ORM/Mapping/AnsiQuoteStrategy.php index 526c5ac51..d18c8be7c 100644 --- a/lib/Doctrine/ORM/Mapping/AnsiQuoteStrategy.php +++ b/lib/Doctrine/ORM/Mapping/AnsiQuoteStrategy.php @@ -91,6 +91,6 @@ class AnsiQuoteStrategy implements QuoteStrategy */ public function getColumnAlias($columnName, $counter, AbstractPlatform $platform, ClassMetadata $class = null) { - return $platform->getSQLResultCasing($columnName . $counter); + return $platform->getSQLResultCasing($columnName . '_' . $counter); } } diff --git a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php index 5adfa8b16..eb2d22332 100644 --- a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php +++ b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php @@ -131,7 +131,7 @@ class DefaultQuoteStrategy implements QuoteStrategy // If the alias is to long, characters are cut off from the beginning. // 3 ) Strip non alphanumeric characters // 4 ) Prefix with "_" if the result its numeric - $columnName = $columnName . $counter; + $columnName = $columnName . '_' . $counter; $columnName = substr($columnName, -$platform->getMaxIdentifierLength()); $columnName = preg_replace('/[^A-Za-z0-9_]/', '', $columnName); $columnName = is_numeric($columnName) ? '_' . $columnName : $columnName;