Merge branch 'master' of github.com:doctrine/doctrine2
This commit is contained in:
commit
4934c49537
@ -527,7 +527,7 @@ class Expr
|
||||
*/
|
||||
private function _quoteLiteral($literal)
|
||||
{
|
||||
if (is_numeric($literal)) {
|
||||
if (is_numeric($literal) && !is_string($literal)) {
|
||||
return (string) $literal;
|
||||
} else {
|
||||
return "'" . str_replace("'", "''", $literal) . "'";
|
||||
|
@ -220,6 +220,15 @@ class ExprTest extends \Doctrine\Tests\OrmTestCase
|
||||
$this->assertEquals(5, (string) $this->_expr->literal(5));
|
||||
}
|
||||
|
||||
/**
|
||||
* @group regression
|
||||
* @group DDC-610
|
||||
*/
|
||||
public function testLiteralExprProperlyQuotesStrings()
|
||||
{
|
||||
$this->assertEquals("'00010001'", (string) $this->_expr->literal('00010001'));
|
||||
}
|
||||
|
||||
public function testGreaterThanOrEqualToExpr()
|
||||
{
|
||||
$this->assertEquals('5 >= 2', (string) $this->_expr->gte(5, 2));
|
||||
|
Loading…
x
Reference in New Issue
Block a user