Update SqlWalker.php
Always be sure that only a-z characters are used for table alias, otherwise use generic "t" for "table"
This commit is contained in:
parent
06b5c84728
commit
ebc996c820
@ -291,7 +291,11 @@ class SqlWalker implements TreeWalker
|
|||||||
$tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : '';
|
$tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : '';
|
||||||
|
|
||||||
if ( ! isset($this->tableAliasMap[$tableName])) {
|
if ( ! isset($this->tableAliasMap[$tableName])) {
|
||||||
$this->tableAliasMap[$tableName] = strtolower(substr($tableName, 0, 1)) . $this->tableAliasCounter++ . '_';
|
$tablePrefixAlias = strtolower(substr($tableName, 0, 1));
|
||||||
|
if( ! preg_match("/[a-z]/", $tablePrefixAlias)) {
|
||||||
|
$tablePrefixAlias = 't';
|
||||||
|
}
|
||||||
|
$this->tableAliasMap[$tableName] = $tablePrefixAlias . $this->tableAliasCounter++ . '_';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->tableAliasMap[$tableName];
|
return $this->tableAliasMap[$tableName];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user