Commit 4d629c4d authored by catch's avatar catch

Issue #2627512 by gambry, jhedstrom, mpdonadio, Jo Fitzgerald, jibran, tedbow,...

Issue #2627512 by gambry, jhedstrom, mpdonadio, Jo Fitzgerald, jibran, tedbow, bkosborne, alexpott, vprocessor, xjm: Datetime Views plugins don't support timezones
parent 8c44f208
......@@ -39,6 +39,8 @@ function datetime_field_views_data(FieldStorageConfigInterface $field_storage) {
'argument' => [
'field' => $field_storage->getName() . '_value',
'id' => 'datetime_' . $argument_type,
'entity_type' => $field_storage->getTargetEntityTypeId(),
'field_name' => $field_storage->getName(),
],
'group' => $group,
];
......
......@@ -2,6 +2,9 @@
namespace Drupal\datetime\Plugin\views\argument;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\Plugin\views\argument\Date as NumericDate;
/**
......@@ -22,12 +25,36 @@
*/
class Date extends NumericDate {
use FieldAPIHandlerTrait;
/**
* Determines if the timezone offset is calculated.
*
* @var bool
*/
protected $calculateOffset = TRUE;
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $route_match);
$definition = $this->getFieldStorageDefinition();
if ($definition->getSetting('datetime_type') === DateTimeItem::DATETIME_TYPE_DATE) {
// Timezone offset calculation is not applicable to dates that are stored
// as date-only.
$this->calculateOffset = FALSE;
}
}
/**
* {@inheritdoc}
*/
public function getDateField() {
// Return the real field, since it is already in string format.
return "$this->tableAlias.$this->realField";
// Use string date storage/formatting since datetime fields are stored as
// strings rather than UNIX timestamps.
return $this->query->getDateField("$this->tableAlias.$this->realField", TRUE, $this->calculateOffset);
}
/**
......
......@@ -2,6 +2,7 @@
namespace Drupal\datetime\Plugin\views\filter;
use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Core\Datetime\DateFormatterInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
......@@ -41,6 +42,13 @@ class Date extends NumericDate implements ContainerFactoryPluginInterface {
*/
protected $dateFormat = DateTimeItemInterface::DATETIME_STORAGE_FORMAT;
/**
* Determines if the timezone offset is calculated.
*
* @var bool
*/
protected $calculateOffset = TRUE;
/**
* The request stack used to determin current time.
*
......@@ -67,10 +75,13 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
$this->dateFormatter = $date_formatter;
$this->requestStack = $request_stack;
// Date format depends on field storage format.
$definition = $this->getFieldStorageDefinition();
if ($definition->getSetting('datetime_type') === DateTimeItem::DATETIME_TYPE_DATE) {
// Date format depends on field storage format.
$this->dateFormat = DateTimeItemInterface::DATE_STORAGE_FORMAT;
// Timezone offset calculation is not applicable to dates that are stored
// as date-only.
$this->calculateOffset = FALSE;
}
}
......@@ -91,20 +102,23 @@ public static function create(ContainerInterface $container, array $configuratio
* Override parent method, which deals with dates as integers.
*/
protected function opBetween($field) {
$origin = ($this->value['type'] == 'offset') ? $this->requestStack->getCurrentRequest()->server->get('REQUEST_TIME') : 0;
$a = intval(strtotime($this->value['min'], $origin));
$b = intval(strtotime($this->value['max'], $origin));
$timezone = $this->getTimezone();
$origin_offset = $this->getOffset($this->value['min'], $timezone);
// Formatting will vary on date storage.
// Although both 'min' and 'max' values are required, default empty 'min'
// value as UNIX timestamp 0.
$min = (!empty($this->value['min'])) ? $this->value['min'] : '@0';
// Convert to ISO format and format for query. UTC timezone is used since
// dates are stored in UTC.
$a = $this->query->getDateFormat("'" . $this->dateFormatter->format($a, 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE) . "'", $this->dateFormat, TRUE);
$b = $this->query->getDateFormat("'" . $this->dateFormatter->format($b, 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE) . "'", $this->dateFormat, TRUE);
$a = new DateTimePlus($min, new \DateTimeZone($timezone));
$a = $this->query->getDateFormat($this->query->getDateField("'" . $this->dateFormatter->format($a->getTimestamp() + $origin_offset, 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE) . "'", TRUE, $this->calculateOffset), $this->dateFormat, TRUE);
$b = new DateTimePlus($this->value['max'], new \DateTimeZone($timezone));
$b = $this->query->getDateFormat($this->query->getDateField("'" . $this->dateFormatter->format($b->getTimestamp() + $origin_offset, 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE) . "'", TRUE, $this->calculateOffset), $this->dateFormat, TRUE);
// This is safe because we are manually scrubbing the values.
$operator = strtoupper($this->operator);
$field = $this->query->getDateFormat($field, $this->dateFormat, TRUE);
$field = $this->query->getDateFormat($this->query->getDateField($field, TRUE, $this->calculateOffset), $this->dateFormat, TRUE);
$this->query->addWhereExpression($this->options['group'], "$field $operator $a AND $b");
}
......@@ -112,15 +126,57 @@ protected function opBetween($field) {
* Override parent method, which deals with dates as integers.
*/
protected function opSimple($field) {
$origin = (!empty($this->value['type']) && $this->value['type'] == 'offset') ? $this->requestStack->getCurrentRequest()->server->get('REQUEST_TIME') : 0;
$value = intval(strtotime($this->value['value'], $origin));
$timezone = $this->getTimezone();
$origin_offset = $this->getOffset($this->value['value'], $timezone);
// Convert to ISO. UTC is used since dates are stored in UTC.
$value = $this->query->getDateFormat("'" . $this->dateFormatter->format($value, 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE) . "'", $this->dateFormat, TRUE);
// Convert to ISO. UTC timezone is used since dates are stored in UTC.
$value = new DateTimePlus($this->value['value'], new \DateTimeZone($timezone));
$value = $this->query->getDateFormat($this->query->getDateField("'" . $this->dateFormatter->format($value->getTimestamp() + $origin_offset, 'custom', DateTimeItemInterface::DATETIME_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE) . "'", TRUE, $this->calculateOffset), $this->dateFormat, TRUE);
// This is safe because we are manually scrubbing the value.
$field = $this->query->getDateFormat($field, $this->dateFormat, TRUE);
$field = $this->query->getDateFormat($this->query->getDateField($field, TRUE, $this->calculateOffset), $this->dateFormat, TRUE);
$this->query->addWhereExpression($this->options['group'], "$field $this->operator $value");
}
/**
* Get the proper time zone to use in computations.
*
* Date-only fields do not have a time zone associated with them, so the
* filter input needs to use UTC for reference. Otherwise, use the time zone
* for the current user.
*
* @return string
* The time zone name.
*/
protected function getTimezone() {
return $this->dateFormat === DateTimeItemInterface::DATE_STORAGE_FORMAT
? DateTimeItemInterface::STORAGE_TIMEZONE
: drupal_get_user_timezone();
}
/**
* Get the proper offset from UTC to use in computations.
*
* @param string $time
* A date/time string compatible with \DateTime. It is used as the
* reference for computing the offset, which can vary based on the time
* zone rules.
* @param string $timezone
* The time zone that $time is in.
*
* @return int
* The computed offset in seconds.
*/
protected function getOffset($time, $timezone) {
// Date-only fields do not have a time zone or offset from UTC associated
// with them. For relative (i.e. 'offset') comparisons, we need to compute
// the user's offset from UTC for use in the query.
$origin_offset = 0;
if ($this->dateFormat === DateTimeItemInterface::DATE_STORAGE_FORMAT && $this->value['type'] === 'offset') {
$origin_offset = $origin_offset + timezone_offset_get(new \DateTimeZone(drupal_get_user_timezone()), new \DateTime($time, new \DateTimeZone($timezone)));
}
return $origin_offset;
}
}
......@@ -2,6 +2,8 @@
namespace Drupal\datetime\Plugin\views\sort;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
use Drupal\views\FieldAPIHandlerTrait;
use Drupal\views\Plugin\views\sort\Date as NumericDate;
/**
......@@ -14,12 +16,38 @@
*/
class Date extends NumericDate {
use FieldAPIHandlerTrait;
/**
* Determines if the timezone offset is calculated.
*
* @var bool
*/
protected $calculateOffset = TRUE;
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$definition = $this->getFieldStorageDefinition();
if ($definition->getSetting('datetime_type') === DateTimeItem::DATETIME_TYPE_DATE) {
// Timezone offset calculation is not applicable to dates that are stored
// as date-only.
$this->calculateOffset = FALSE;
}
}
/**
* {@inheritdoc}
*
* Override to account for dates stored as strings.
*/
public function getDateField() {
// Return the real field, since it is already in string format.
return "$this->tableAlias.$this->realField";
// Use string date storage/formatting since datetime fields are stored as
// strings rather than UNIX timestamps.
return $this->query->getDateField("$this->tableAlias.$this->realField", TRUE, $this->calculateOffset);
}
/**
......
......@@ -28,6 +28,9 @@ protected function setUp($import_test_views = TRUE) {
'2000-10-10',
'2001-10-10',
'2002-01-01',
// Add a date that is the year 2002 in UTC, but 2003 in the site's time
// zone (Australia/Sydney).
'2002-12-31T23:00:00',
];
foreach ($dates as $date) {
$node = Node::create([
......@@ -64,6 +67,25 @@ public function testDatetimeArgumentYear() {
$expected[] = ['nid' => $this->nodes[2]->id()];
$this->assertIdenticalResultset($view, $expected, $this->map);
$view->destroy();
$view->setDisplay('default');
$this->executeView($view, ['2003']);
$expected = [];
$expected[] = ['nid' => $this->nodes[3]->id()];
$this->assertIdenticalResultset($view, $expected, $this->map);
$view->destroy();
// Tests different system timezone with the same nodes.
$this->setSiteTimezone('America/Vancouver');
$view->setDisplay('default');
$this->executeView($view, ['2002']);
$expected = [];
// Only the 3rd node is returned here since UTC 2002-01-01T00:00:00 is still
// in 2001 for this user timezone.
$expected[] = ['nid' => $this->nodes[3]->id()];
$this->assertIdenticalResultset($view, $expected, $this->map);
$view->destroy();
}
/**
......@@ -87,6 +109,7 @@ public function testDatetimeArgumentMonth() {
$this->executeView($view, ['01']);
$expected = [];
$expected[] = ['nid' => $this->nodes[2]->id()];
$expected[] = ['nid' => $this->nodes[3]->id()];
$this->assertIdenticalResultset($view, $expected, $this->map);
$view->destroy();
}
......@@ -112,6 +135,7 @@ public function testDatetimeArgumentDay() {
$this->executeView($view, ['01']);
$expected = [];
$expected[] = ['nid' => $this->nodes[2]->id()];
$expected[] = ['nid' => $this->nodes[3]->id()];
$this->assertIdenticalResultset($view, $expected, $this->map);
$view->destroy();
}
......@@ -157,6 +181,7 @@ public function testDatetimeArgumentWeek() {
$this->executeView($view, ['01']);
$expected = [];
$expected[] = ['nid' => $this->nodes[2]->id()];
$expected[] = ['nid' => $this->nodes[3]->id()];
$this->assertIdenticalResultset($view, $expected, $this->map);
$view->destroy();
}
......
......@@ -41,6 +41,7 @@
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
$this->installSchema('node', 'node_access');
$this->installEntitySchema('node');
$this->installEntitySchema('user');
......@@ -76,4 +77,18 @@ protected function setUp($import_test_views = TRUE) {
ViewTestData::createTestViews(get_class($this), ['datetime_test']);
}
/**
* Sets the site timezone to a given timezone.
*
* @param string $timezone
* The timezone identifier to set.
*/
protected function setSiteTimezone($timezone) {
// Set an explicit site timezone, and disallow per-user timezones.
$this->config('system.date')
->set('timezone.user.configurable', 0)
->set('timezone.default', $timezone)
->save();
}
}
......@@ -2,8 +2,8 @@
namespace Drupal\Tests\datetime\Kernel\Views;
use Drupal\Component\Datetime\DateTimePlus;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItem;
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\node\Entity\Node;
use Drupal\views\Views;
......@@ -21,9 +21,26 @@ class FilterDateTest extends DateTimeHandlerTestBase {
public static $testViews = ['test_filter_datetime'];
/**
* For offset tests, set to the current time.
* An array of timezone extremes to test.
*
* @var string[]
*/
protected static $date;
protected static $timezones = [
// UTC-12, no DST.
'Pacific/Kwajalein',
// UTC-11, no DST.
'Pacific/Midway',
// UTC-7, no DST.
'America/Phoenix',
// UTC.
'UTC',
// UTC+5:30, no DST.
'Asia/Kolkata',
// UTC+12, no DST.
'Pacific/Funafuti',
// UTC+13, no DST.
'Pacific/Tongatapu',
];
/**
* {@inheritdoc}
......@@ -33,30 +50,24 @@ class FilterDateTest extends DateTimeHandlerTestBase {
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
// Set to 'today'.
static::$date = REQUEST_TIME;
// Change field storage to date-only.
$storage = FieldStorageConfig::load('node.' . static::$field_name);
$storage->setSetting('datetime_type', DateTimeItem::DATETIME_TYPE_DATE);
$storage->save();
$dates = [
// Tomorrow.
\Drupal::service('date.formatter')->format(static::$date + 86400, 'custom', DateTimeItemInterface::DATE_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE),
// Today.
\Drupal::service('date.formatter')->format(static::$date, 'custom', DateTimeItemInterface::DATE_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE),
// Yesterday.
\Drupal::service('date.formatter')->format(static::$date - 86400, 'custom', DateTimeItemInterface::DATE_STORAGE_FORMAT, DateTimeItemInterface::STORAGE_TIMEZONE),
];
// Retrieve tomorrow, today and yesterday dates just to create the nodes.
$timestamp = $this->getUTCEquivalentOfUserNowAsTimestamp();
$dates = $this->getRelativeDateValuesFromTimestamp($timestamp);
// Clean the nodes on setUp.
$this->nodes = [];
foreach ($dates as $date) {
$node = Node::create([
'title' => $this->randomMachineName(8),
'type' => 'page',
'field_date' => [
'value' => $date,
]
],
]);
$node->save();
$this->nodes[] = $node;
......@@ -70,48 +81,156 @@ public function testDateOffsets() {
$view = Views::getView('test_filter_datetime');
$field = static::$field_name . '_value';
// Test simple operations.
$view->initHandlers();
// A greater than or equal to 'now', should return the 'today' and
// the 'tomorrow' node.
$view->filter[$field]->operator = '>=';
$view->filter[$field]->value['type'] = 'offset';
$view->filter[$field]->value['value'] = 'now';
$view->setDisplay('default');
$this->executeView($view);
$expected_result = [
['nid' => $this->nodes[0]->id()],
['nid' => $this->nodes[1]->id()],
];
$this->assertIdenticalResultset($view, $expected_result, $this->map);
$view->destroy();
// Only dates in the past.
$view->initHandlers();
$view->filter[$field]->operator = '<';
$view->filter[$field]->value['type'] = 'offset';
$view->filter[$field]->value['value'] = 'now';
$view->setDisplay('default');
$this->executeView($view);
$expected_result = [
['nid' => $this->nodes[2]->id()],
];
$this->assertIdenticalResultset($view, $expected_result, $this->map);
$view->destroy();
// Test offset for between operator. Only the 'tomorrow' node should appear.
$view->initHandlers();
$view->filter[$field]->operator = 'between';
$view->filter[$field]->value['type'] = 'offset';
$view->filter[$field]->value['max'] = '+2 days';
$view->filter[$field]->value['min'] = '+1 day';
$view->setDisplay('default');
$this->executeView($view);
$expected_result = [
['nid' => $this->nodes[0]->id()],
foreach (static::$timezones as $timezone) {
$this->setSiteTimezone($timezone);
$timestamp = $this->getUTCEquivalentOfUserNowAsTimestamp();
$dates = $this->getRelativeDateValuesFromTimestamp($timestamp);
$this->updateNodesDateFieldsValues($dates);
// Test simple operations.
$view->initHandlers();
// A greater than or equal to 'now', should return the 'today' and the
// 'tomorrow' node.
$view->filter[$field]->operator = '>=';
$view->filter[$field]->value['type'] = 'offset';
$view->filter[$field]->value['value'] = 'now';
$view->setDisplay('default');
$this->executeView($view);
$expected_result = [
['nid' => $this->nodes[0]->id()],
['nid' => $this->nodes[1]->id()],
];
$this->assertIdenticalResultset($view, $expected_result, $this->map);
$view->destroy();
// Only dates in the past.
$view->initHandlers();
$view->filter[$field]->operator = '<';
$view->filter[$field]->value['type'] = 'offset';
$view->filter[$field]->value['value'] = 'now';
$view->setDisplay('default');
$this->executeView($view);
$expected_result = [
['nid' => $this->nodes[2]->id()],
];
$this->assertIdenticalResultset($view, $expected_result, $this->map);
$view->destroy();
// Test offset for between operator. Only 'tomorrow' node should appear.
$view->initHandlers();
$view->filter[$field]->operator = 'between';
$view->filter[$field]->value['type'] = 'offset';
$view->filter[$field]->value['max'] = '+2 days';
$view->filter[$field]->value['min'] = '+1 day';
$view->setDisplay('default');
$this->executeView($view);
$expected_result = [
['nid' => $this->nodes[0]->id()],
];
$this->assertIdenticalResultset($view, $expected_result, $this->map);
$view->destroy();
}
}
/**
* Test date filter with date-only fields.
*/
public function testDateIs() {
$view = Views::getView('test_filter_datetime');
$field = static::$field_name . '_value';
foreach (static::$timezones as $timezone) {
$this->setSiteTimezone($timezone);
$timestamp = $this->getUTCEquivalentOfUserNowAsTimestamp();
$dates = $this->getRelativeDateValuesFromTimestamp($timestamp);
$this->updateNodesDateFieldsValues($dates);
// Test simple operations.
$view->initHandlers();
// Filtering with nodes date-only values (format: Y-m-d) to test UTC
// conversion does NOT change the day.
$view->filter[$field]->operator = '=';
$view->filter[$field]->value['type'] = 'date';
$view->filter[$field]->value['value'] = $this->nodes[2]->field_date->first()->getValue()['value'];
$view->setDisplay('default');
$this->executeView($view);
$expected_result = [
['nid' => $this->nodes[2]->id()],
];
$this->assertIdenticalResultset($view, $expected_result, $this->map);
$view->destroy();
// Test offset for between operator. Only 'today' and 'tomorrow' nodes
// should appear.
$view->initHandlers();
$view->filter[$field]->operator = 'between';
$view->filter[$field]->value['type'] = 'date';
$view->filter[$field]->value['max'] = $this->nodes[0]->field_date->first()->getValue()['value'];
$view->filter[$field]->value['min'] = $this->nodes[1]->field_date->first()->getValue()['value'];
$view->setDisplay('default');
$this->executeView($view);
$expected_result = [
['nid' => $this->nodes[0]->id()],
['nid' => $this->nodes[1]->id()],
];
$this->assertIdenticalResultset($view, $expected_result, $this->map);
$view->destroy();
}
}
/**
* Returns UTC timestamp of user's TZ 'now'.
*
* The date field stores date_only values without conversion, considering them
* already as UTC. This method returns the UTC equivalent of user's 'now' as a
* unix timestamp, so they match using Y-m-d format.
*
* @return int
* Unix timestamp.
*/
protected function getUTCEquivalentOfUserNowAsTimestamp() {
$user_now = new DateTimePlus('now', new \DateTimeZone(drupal_get_user_timezone()));
$utc_equivalent = new DateTimePlus($user_now->format('Y-m-d H:i:s'), new \DateTimeZone(DATETIME_STORAGE_TIMEZONE));
return $utc_equivalent->getTimestamp();
}
/**
* Returns an array formatted date_only values.
*
* @param int $timestamp
* Unix Timestamp equivalent to user's "now".
*
* @return array
* An array of DATETIME_DATE_STORAGE_FORMAT date values. In order tomorrow,
* today and yesterday.
*/
protected function getRelativeDateValuesFromTimestamp($timestamp) {
return [
// Tomorrow.
\Drupal::service('date.formatter')->format($timestamp + 86400, 'custom', DATETIME_DATE_STORAGE_FORMAT, DATETIME_STORAGE_TIMEZONE),
// Today.
\Drupal::service('date.formatter')->format($timestamp, 'custom', DATETIME_DATE_STORAGE_FORMAT, DATETIME_STORAGE_TIMEZONE),
// Yesterday.
\Drupal::service('date.formatter')->format($timestamp - 86400, 'custom', DATETIME_DATE_STORAGE_FORMAT, DATETIME_STORAGE_TIMEZONE),
];
$this->assertIdenticalResultset($view, $expected_result, $this->map);
}
/**
* Updates tests nodes date fields values.
*
* @param array $dates
* An array of DATETIME_DATE_STORAGE_FORMAT date values.
*/
protected function updateNodesDateFieldsValues(array $dates) {
foreach ($dates as $index => $date) {
$this->nodes[$index]->{static::$field_name}->value = $date;
$this->nodes[$index]->save();
}
}
}
......@@ -40,6 +40,9 @@ protected function setUp($import_test_views = TRUE) {
// Set the timezone.
date_default_timezone_set(static::$timezone);
$this->config('system.date')
->set('timezone.default', static::$timezone)
->save();
// Add some basic test nodes.
$dates = [
......
<?php
namespace Drupal\views\Plugin\views\query;
/**
* Defines an interface for handling date queries with SQL.
*
* @internal
* Classes implementing this interface should only be used by the Views SQL
* query plugin.
*
* @see \Drupal\views\Plugin\views\query\Sql
*/
interface DateSqlInterface {
/**
* Returns a native database expression for a given field.
*
* @param string $field
* The query field that will be used in the expression.
* @param bool $string_date
* For certain databases, date format functions vary depending on string or
* numeric storage.
*
* @return string
* An expression representing a date field with timezone.
*/
public function getDateField($field, $string_date);
/**
* Creates a native database date formatting.
*
* @param string $field
* An appropriate query expression pointing to the date field.
* @param string $format
* A format string for the result. For example: 'Y-m-d H:i:s'.
*
* @return string
* A string representing the field formatted as a date as specified by
* $format.
*/
public function getDateFormat($field, $format);
/**
* Applies the given offset to the given field.
*
* @param string &$field
* The date field in a string format.
* @param int $offset
* The timezone offset in seconds.
*/
public function setFieldTimezoneOffset(&$field, $offset);
/**
* Set the database to the given timezone.
*
* @param string $offset
* The timezone.
*/
public function setTimezoneOffset($offset);
}
<?php
namespace Drupal\views\Plugin\views\query;
use Drupal\Core\Database\Connection;
/**
* MySQL-specific date handling.
*
* @internal
* This class should only be used by the Views SQL query plugin.