Prefixing alias counter with _
to fix DDC-3042 and prevent collisions
This commit is contained in:
parent
11b3065fd1
commit
e6bf096583
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user