1097
if (($resolution)||(!$this->DetectSubseconds($postfix)))
1098
$req = "SELECT EXTENDED_UNIX_TIMESTAMP(MIN(time)) AS first, EXTENDED_UNIX_TIMESTAMP(MAX(time)) AS last${extra} FROM `$table`";
1100
// Querying 'ns' like this would be significantly slower
1101
//$req = "ADEI_TIMESTAMP(EXTENDED_UNIX_TIMESTAMP(MIN(time)),ns) AS first, ADEI_TIMESTAMP(EXTENDED_UNIX_TIMESTAMP(MAX(time)),ns) AS last";
1102
$req = "SELECT (SELECT ADEI_TIMESTAMP(EXTENDED_UNIX_TIMESTAMP(time),ns)/1000000000 FROM `$table` ORDER BY id LIMIT 1) as first, (SELECT ADEI_TIMESTAMP(EXTENDED_UNIX_TIMESTAMP(time),ns)/1000000000 FROM `$table` ORDER BY id DESC LIMIT 1) as last${extra}";
1097
$req = "SELECT EXTENDED_UNIX_TIMESTAMP(MIN(time)) AS first, EXTENDED_UNIX_TIMESTAMP(MAX(time)) AS last${extra} FROM `$table`";
1099
// DetectSubseconds will fail if caching table is not present yet. However, we would not refer to it during the caching process. Only Admin interface uses PREFER_EXACTINFO at the moment
1100
if ((!$resolution)&&($flags&REQUEST::PREFER_EXACTINFO)) {
1101
// In fact there could be difference between configuration & already existing caching tables. The best thing we can do is to fail with the error. If this gets a repeated problem, we will need to provide both values to the Admin interface
1102
if (($postfix)||(!isset($this->use_subseconds)))
1103
$use_subseconds = $this->DetectSubseconds($postfix);
1105
$use_subseconds = $this->use_subseconds;
1107
// Querying 'ns' like this would be significantly slower
1108
if ($use_subseconds)
1109
$req = "SELECT (SELECT ADEI_TIMESTAMP(EXTENDED_UNIX_TIMESTAMP(time),ns)/1000000000 FROM `$table` ORDER BY id LIMIT 1) as first, (SELECT ADEI_TIMESTAMP(EXTENDED_UNIX_TIMESTAMP(time),ns)/1000000000 FROM `$table` ORDER BY id DESC LIMIT 1) as last${extra}";
1111
} catch (ADEIException $ae) {
1112
// Just use non-subsecond version in this case
1105
1115
$res = mysql_query($req, $this->dbh);