1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Merge branch 'DDC-3018' into 2.4

This commit is contained in:
Benjamin Eberlei 2014-03-23 15:17:56 +01:00
commit 333fa1090a
2 changed files with 17 additions and 5 deletions

View File

@ -1497,6 +1497,7 @@ class SqlWalker implements TreeWalker
break; break;
} }
$fieldType = 'string';
switch (true) { switch (true) {
case ($e instanceof AST\PathExpression): case ($e instanceof AST\PathExpression):
$fieldName = $e->field; $fieldName = $e->field;
@ -1517,10 +1518,6 @@ class SqlWalker implements TreeWalker
break; break;
} }
break; break;
default:
$fieldType = 'string';
break;
} }
$this->scalarResultAliasMap[$resultAlias] = $columnAlias; $this->scalarResultAliasMap[$resultAlias] = $columnAlias;

View File

@ -592,12 +592,20 @@ class LanguageRecognitionTest extends \Doctrine\Tests\OrmTestCase
} }
/** /**
* @gorup DDC-1858 * @group DDC-1858
*/ */
public function testHavingSupportIsNullExpression() public function testHavingSupportIsNullExpression()
{ {
$this->assertValidDQL("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING u.username IS NULL"); $this->assertValidDQL("SELECT u.name FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING u.username IS NULL");
} }
/**
* @group DDC-3018
*/
public function testNewLiteralExpression()
{
$this->assertValidDQL("SELECT new " . __NAMESPACE__ . "\\DummyStruct(u.id, 'foo', 1, true) FROM Doctrine\Tests\Models\CMS\CmsUser u");
}
} }
/** @Entity */ /** @Entity */
@ -617,3 +625,10 @@ class DQLKeywordsModelGroup
/** @Column */ /** @Column */
private $from; private $from;
} }
class DummyStruct
{
public function __construct($id, $arg1, $arg2, $arg3)
{
}
}