Skip to content

Commit 4bc9dda

Browse files
authored
Merge pull request #38 from moufmouf/oracle_quote_issue
Fixing quoting problem in Oracle
2 parents 476269c + 8c0920a commit 4bc9dda

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Mouf/Database/MagicQuery.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,12 @@ private function magicJoinOnOneQuery(MagicJoinSelect $magicJoinSelect)
210210
$onNode = new Equal();
211211
$leftCol = new ColRef();
212212
$leftCol->setTable($foreignKey->getLocalTableName());
213-
$leftCol->setColumn($foreignKey->getLocalColumns()[0]);
213+
// For some reasons, with Oracle, DBAL returns quoted identifiers. We need to unquote them.
214+
$leftCol->setColumn($foreignKey->getUnquotedLocalColumns()[0]);
214215

215216
$rightCol = new ColRef();
216217
$rightCol->setTable($foreignKey->getForeignTableName());
217-
$rightCol->setColumn($foreignKey->getForeignColumns()[0]);
218+
$rightCol->setColumn($foreignKey->getUnquotedForeignColumns()[0]);
218219

219220
$onNode->setLeftOperand($leftCol);
220221
$onNode->setRightOperand($rightCol);

0 commit comments

Comments
 (0)