From 1111de844658f8ff2de55da024740a5a83b3d667 Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 16 Nov 2020 15:15:37 +0000 Subject: [PATCH] Issue #3118591 by alexpott, xjm, chesnut: Datetime-related test failures on PostgreSQL 12 --- core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php | 2 +- .../tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php b/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php index c919fadb67..60b1f298bd 100644 --- a/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php +++ b/core/modules/views/src/Plugin/views/query/PostgresqlDateSql.php @@ -66,7 +66,7 @@ public function __construct(Connection $database) { public function getDateField($field, $string_date) { if ($string_date) { // Ensures compatibility with field offset operation below. - return "TO_TIMESTAMP($field, 'YYYY-MM-DD HH24:MI:SS')"; + return "TO_TIMESTAMP($field, 'YYYY-MM-DD\"T\"HH24:MI:SS')"; } return "TO_TIMESTAMP($field)"; } diff --git a/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php b/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php index 4bef1efb5c..2ea1f72fca 100644 --- a/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/views/query/PostgresqlDateSqlTest.php @@ -38,7 +38,7 @@ public function setUp(): void { public function testGetDateField() { $date_sql = new PostgresqlDateSql($this->database); - $expected = "TO_TIMESTAMP(foo.field, 'YYYY-MM-DD HH24:MI:SS')"; + $expected = "TO_TIMESTAMP(foo.field, 'YYYY-MM-DD\"T\"HH24:MI:SS')"; $this->assertEquals($expected, $date_sql->getDateField('foo.field', TRUE)); $expected = 'TO_TIMESTAMP(foo.field)'; -- GitLab