orm: fix string with colom
This commit is contained in:
@@ -1178,7 +1178,7 @@ abstract class BaseQueryComposer implements QueryComposer
|
||||
|
||||
$entityType = $entity->getEntityType();
|
||||
|
||||
if (strpos($attribute, ':')) {
|
||||
if (strpos($attribute, ':') && !Util::isArgumentString($attribute)) {
|
||||
/** @var int $delimiterPosition */
|
||||
$delimiterPosition = strpos($attribute, ':');
|
||||
$function = substr($attribute, 0, $delimiterPosition);
|
||||
|
||||
@@ -3146,4 +3146,16 @@ class MysqlQueryComposerTest extends \PHPUnit\Framework\TestCase
|
||||
$this->query->composeSelect($query2)
|
||||
);
|
||||
}
|
||||
|
||||
public function testStringWithColon(): void
|
||||
{
|
||||
$query = SelectBuilder::create()
|
||||
->select(["'2020-10-10 20:20:20'"])
|
||||
->from('Post')
|
||||
->build();
|
||||
|
||||
$sql = $this->query->composeSelect($query);
|
||||
|
||||
$this->assertIsString($sql);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user