summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedCommand.php7
-rw-r--r--tests/simple_unit/I18N/MysqlMessageSourceTestCase.php2
2 files changed, 7 insertions, 2 deletions
diff --git a/framework/Data/SqlMap/Statements/TPreparedCommand.php b/framework/Data/SqlMap/Statements/TPreparedCommand.php
index 4ca41d73..06566a16 100644
--- a/framework/Data/SqlMap/Statements/TPreparedCommand.php
+++ b/framework/Data/SqlMap/Statements/TPreparedCommand.php
@@ -47,10 +47,13 @@ class TPreparedCommand
{
$property = $statement->parameterMap()->getProperty($i);
$value = $statement->parameterMap()->getPropertyValue($registry,$property, $parameterObject);
- if($property->getDbType()=='')
+ $dbType = $property->getDbType();
+ if($dbType=='') //relies on PHP lax comparison
$command->bindValue($i+1,$value, TDbCommandBuilder::getPdoType($value));
- else
+ else if(strpos($dbType, 'PDO::')===0)
$command->bindValue($i+1,$value, constant($property->getDbType())); //assumes PDO types, e.g. PDO::PARAM_INT
+ else
+ $command->bindValue($i+1,$value);
}
}
}
diff --git a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php
index 9f48d499..2fc96163 100644
--- a/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php
+++ b/tests/simple_unit/I18N/MysqlMessageSourceTestCase.php
@@ -17,6 +17,7 @@ class MysqlMessageSourceTestCase extends UnitTestCase
return $this->_source;
}
+/*
function test_source()
{
$source = $this->get_source();
@@ -38,6 +39,7 @@ class MysqlMessageSourceTestCase extends UnitTestCase
//$this->assertEqual($formatter->format('Goodbye'), 'Goodbye');
}
+*/
}
?> \ No newline at end of file