From: stronk7 Date: Sun, 22 Oct 2006 23:21:59 +0000 (+0000) Subject: Debugging sql_paging_limit() as deprecated and X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c1bf1b007359563a7ac5b9897d0aa23b6eb80da9;p=moodle.git Debugging sql_paging_limit() as deprecated and enforcing get_field_sql() to return 1 record max Merged from MOODLE_17_STABLE --- diff --git a/lib/dmllib.php b/lib/dmllib.php index 91b43be7e7..9a19fbf4db 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -894,7 +894,7 @@ function get_field_select($table, $return, $select) { function get_field_sql($sql) { global $CFG; - $rs = get_recordset_sql($sql); + $rs = get_recordset_sql($sql, 0, 1); if ($rs && $rs->RecordCount() == 1) { /// DIRTY HACK to retrieve all the ' ' (1 space) fields converted back @@ -1369,6 +1369,8 @@ function update_record($table, $dataobject) { function sql_paging_limit($page, $recordsperpage) { global $CFG; + debugging('Function sql_paging_limit() is deprecated. Replace it with the correct use of limitfrom, limitnum parameters', DEBUG_DEVELOPER); + switch ($CFG->dbtype) { case 'postgres7': return 'LIMIT '. $recordsperpage .' OFFSET '. $page;