]> git.mjollnir.org Git - moodle.git/commitdiff
Debugging sql_paging_limit() as deprecated and
authorstronk7 <stronk7>
Sun, 22 Oct 2006 23:21:59 +0000 (23:21 +0000)
committerstronk7 <stronk7>
Sun, 22 Oct 2006 23:21:59 +0000 (23:21 +0000)
enforcing get_field_sql() to return 1 record max

Merged from MOODLE_17_STABLE

lib/dmllib.php

index 91b43be7e7f3d030fad3109223267a543de40791..9a19fbf4dbad1d1018e5326a61fa9e790092483f 100644 (file)
@@ -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;