From 1a192b6530396a5e235b7777e655f006eb92560e Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Sat, 3 Mar 2012 23:10:56 -0500 Subject: [PATCH] Moved SQRT function to Platform. --- lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php | 5 +++-- lib/vendor/doctrine-dbal | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php index 087b93be1..a8478c9ac 100644 --- a/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php +++ b/lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php @@ -41,8 +41,9 @@ class SqrtFunction extends FunctionNode */ public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { - //TODO: Use platform to get SQL - return 'SQRT(' . $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) . ')'; + return $sqlWalker->getConnection()->getDatabasePlatform()->getSqrtExpression( + $sqlWalker->walkSimpleArithmeticExpression($this->simpleArithmeticExpression) + ); } /** diff --git a/lib/vendor/doctrine-dbal b/lib/vendor/doctrine-dbal index 480b127fb..b8d8d9535 160000 --- a/lib/vendor/doctrine-dbal +++ b/lib/vendor/doctrine-dbal @@ -1 +1 @@ -Subproject commit 480b127fb5c35d6fbd70964a228cd63cfe2b7e14 +Subproject commit b8d8d9535472ea805f14187343f80ac6cb3c2614