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,11 +655,15 @@ 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)',
|
'(CASE WHEN $1 ~ \'(?:[0-9]{1,3}\\\\.){3}[0-9]{1,3}\' THEN $1::inet - \'0.0.0.0\' ELSE NULL END)',
|
||||||
$column
|
$column
|
||||||
);
|
);
|
||||||
$column = preg_replace(
|
if (version_compare($this->getIdoVersion(), '1.14.2', '>=')) {
|
||||||
'/UNIX_TIMESTAMP(\((?>[^()]|(?-1))*\))/i',
|
$column = str_replace('NOW()', 'localtimestamp', $column);
|
||||||
'CASE WHEN ($1 < \'1970-01-03 00:00:00+00\'::timestamp with time zone) THEN 0 ELSE UNIX_TIMESTAMP($1) END',
|
} else {
|
||||||
$column
|
$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',
|
||||||
|
$column
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user