[DDC-3018] Fix string literals in new operator.
This commit is contained in:
parent
24d4fd17f3
commit
2aea3036b6
@ -1514,6 +1514,7 @@ class SqlWalker implements TreeWalker
|
||||
break;
|
||||
}
|
||||
|
||||
$fieldType = 'string';
|
||||
switch (true) {
|
||||
case ($e instanceof AST\PathExpression):
|
||||
$fieldName = $e->field;
|
||||
@ -1534,10 +1535,6 @@ class SqlWalker implements TreeWalker
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$fieldType = 'string';
|
||||
break;
|
||||
}
|
||||
|
||||
$this->scalarResultAliasMap[$resultAlias] = $columnAlias;
|
||||
|
@ -592,7 +592,7 @@ class LanguageRecognitionTest extends \Doctrine\Tests\OrmTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @gorup DDC-1858
|
||||
* @group DDC-1858
|
||||
*/
|
||||
public function testHavingSupportIsNullExpression()
|
||||
{
|
||||
@ -600,12 +600,20 @@ class LanguageRecognitionTest extends \Doctrine\Tests\OrmTestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @gorup DDC-1858
|
||||
* @group DDC-1858
|
||||
*/
|
||||
public function testHavingSupportLikeExpression()
|
||||
{
|
||||
$this->assertValidDQL("SELECT _u.id, count(_articles) as uuuu FROM Doctrine\Tests\Models\CMS\CmsUser _u LEFT JOIN _u.articles _articles GROUP BY _u HAVING uuuu LIKE '3'");
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 */
|
||||
@ -625,3 +633,10 @@ class DQLKeywordsModelGroup
|
||||
/** @Column */
|
||||
private $from;
|
||||
}
|
||||
|
||||
class DummyStruct
|
||||
{
|
||||
public function __construct($id, $arg1, $arg2, $arg3)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user