mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Support Icinga 2.6 IDO w/ PostgreSQL
This commit is contained in:
parent
bcc5b8c1a7
commit
665557be27
@ -655,6 +655,9 @@ abstract class IdoQuery extends DbQuery
|
||||
'(CASE WHEN $1 ~ \'(?:[0-9]{1,3}\\\\.){3}[0-9]{1,3}\' THEN $1::inet - \'0.0.0.0\' ELSE NULL END)',
|
||||
$column
|
||||
);
|
||||
if (version_compare($this->getIdoVersion(), '1.14.2', '>=')) {
|
||||
$column = str_replace('NOW()', 'localtimestamp', $column);
|
||||
} else {
|
||||
$column = preg_replace(
|
||||
'/UNIX_TIMESTAMP(\((?>[^()]|(?-1))*\))/i',
|
||||
'CASE WHEN ($1 < \'1970-01-03 00:00:00+00\'::timestamp with time zone) THEN 0 ELSE UNIX_TIMESTAMP($1) END',
|
||||
@ -663,6 +666,7 @@ abstract class IdoQuery extends DbQuery
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up this query and join the initial tables
|
||||
|
Loading…
x
Reference in New Issue
Block a user