Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Pheasant/Mapper/RowMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function query(Criteria $criteria=null, $alias=null)
$query = new Query($this->_connection);

if($alias) {
$query->from($this->_tableName." AS ".$alias);
$query->from($this->_tableName." AS `".$alias."`");
} else {
$query->from($this->_tableName);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Pheasant/Query/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private function _join($type, $mixed, $criteria, $alias='')
if (is_object($mixed)) {
$this->_joins []= sprintf('%s (%s) %s %s', $type, $mixed, $alias ?: 'derived', $criteria);
} elseif ($alias) {
$this->_joins []= sprintf('%s `%s` AS %s %s', $type, $mixed, $alias, $criteria);
$this->_joins []= sprintf('%s `%s` AS `%s` %s', $type, $mixed, $alias, $criteria);
} else {
$this->_joins []= sprintf('%s `%s` %s', $type, $mixed, $criteria);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Pheasant/Tests/LockingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testLockingAnInstance()
});

$this->assertTrue(in_array(
"SELECT * FROM animal AS Animal WHERE ((`id`='1')) FOR UPDATE",
"SELECT * FROM animal AS `Animal` WHERE ((`id`='1')) FOR UPDATE",
$this->queries
));
}
Expand Down