Returns: formatted SQL for limiting number of rows returned from query
with optional offset (e.g. LIMIT 1, 1) (scalar)
+=item C<sql_from_days>
+
+ Description: Outputs SQL syntax for converting Julian days to date.
+ Abstract method, should be overriden by database specific code.
+ Params: $days = days to convert to date
+ Returns: formatted SQL for returning Julian days in dates. (scalar)
+
=item C<sql_to_days>
Description: Outputs SQL syntax for converting date to Julian days.
$dbh->sql_to_days('current_date') . " AS end, " .
$dbh->sql_to_days("'1970-01-01'") .
" FROM bugs $from_product WHERE " .
- $dbh->sql_to_days('creation_ts') . " != 'NULL'" .
+ $dbh->sql_to_days('creation_ts') . " IS NOT NULL " .
$and_product .
" ORDER BY start " . $dbh->sql_limit(1));
# Get a list of bugs that were created the previous day, and
# add those bugs to the list of bugs for this product.
SendSQL("SELECT bug_id FROM bugs $from_product " .
- "WHERE bugs.creation_ts < from_days(" . ($day - 1) . ") " .
- "AND bugs.creation_ts >= from_days(" . ($day - 2) . ") " .
+ " WHERE bugs.creation_ts < " . $dbh->sql_from_days($day - 1) .
+ " AND bugs.creation_ts >= " . $dbh->sql_from_days($day - 2) .
$and_product .
" ORDER BY bug_id");
" ON bugs_activity.fieldid = fielddefs.fieldid " .
" WHERE fielddefs.name = 'bug_status' " .
" AND bugs_activity.bug_id = $bug " .
- " AND bugs_activity.bug_when >= from_days($day) " .
- "ORDER BY bugs_activity.bug_when " .
+ " AND bugs_activity.bug_when >= " . $dbh->sql_from_days($day) .
+ " ORDER BY bugs_activity.bug_when " .
$dbh->sql_limit(1));
my $status;
" ON bugs_activity.fieldid = fielddefs.fieldid " .
" WHERE fielddefs.name = 'resolution' " .
" AND bugs_activity.bug_id = $bug " .
- " AND bugs_activity.bug_when >= from_days($day) " .
- "ORDER BY bugs_activity.bug_when " .
+ " AND bugs_activity.bug_when >= " . $dbh->sql_from_days($day) .
+ " ORDER BY bugs_activity.bug_when " .
$dbh->sql_limit(1));
if (@row = FetchSQLData()) {