enforcing get_field_sql() to return 1 record max
Merged from MOODLE_17_STABLE
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
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;