CAST() target types aren't very portable. Use DECIMAL which works
for MySQL and Pg.
DECIMAL does seem to be supported in Oracle - but the syntax seems
different. We may still need a compat function.
$sql = "SELECT name, value
FROM {$CFG->prefix}config_plugins
WHERE plugin='accesslib/dirtycontexts'
- AND CAST(value AS integer) > $time";
+ AND CAST(value AS DECIMAL) > $time";
if ($ctx = get_records_sql($sql)) {
return $ctx;
}
global $CFG;
$sql = "plugin='accesslib/dirtycontexts' AND
- CAST(value to integer) < " . time() - $CFG->sessiontimeout;
+ CAST(value AS DECIMAL) < " . time() - $CFG->sessiontimeout;
delete_records_select('config_plugins', $sql);
}