From 466c414ebc9dde38e80f20fd96fd891431404fca Mon Sep 17 00:00:00 2001 From: "godzilla80@gmx.net" <> Date: Sun, 22 Mar 2009 08:02:35 +0000 Subject: Fixed Issue #88 - SQLMap $Param$ re-evaluation bug --- framework/Data/SqlMap/Statements/TPreparedCommand.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'framework/Data/SqlMap/Statements/TPreparedCommand.php') diff --git a/framework/Data/SqlMap/Statements/TPreparedCommand.php b/framework/Data/SqlMap/Statements/TPreparedCommand.php index 99bb6eff..66ff2a70 100644 --- a/framework/Data/SqlMap/Statements/TPreparedCommand.php +++ b/framework/Data/SqlMap/Statements/TPreparedCommand.php @@ -25,9 +25,15 @@ class TPreparedCommand { public function create(TSqlMapManager $manager, $connection, $statement, $parameterObject,$skip=null,$max=null) { - $prepared = $statement->getSQLText()->getPreparedStatement($parameterObject); + $sqlText = $statement->getSQLText(); + + $prepared = $sqlText->getPreparedStatement($parameterObject); $connection->setActive(true); $sql = $prepared->getPreparedSql(); + + if($sqlText instanceof TSimpleDynamicSql) + $sql = $sqlText->replaceDynamicParameter($sql, $parameterObject); + if($max!==null || $skip!==null) { $builder = TDbMetaData::getInstance($connection)->createCommandBuilder(); @@ -35,6 +41,7 @@ class TPreparedCommand } $command = $connection->createCommand($sql); $this->applyParameterMap($manager, $command, $prepared, $statement, $parameterObject); + return $command; } -- cgit v1.2.3