]> git.mjollnir.org Git - moodle.git/commitdiff
Prevent MSSQL to return from insert_record() before
authorstronk7 <stronk7>
Mon, 23 Oct 2006 00:01:57 +0000 (00:01 +0000)
committerstronk7 <stronk7>
Mon, 23 Oct 2006 00:01:57 +0000 (00:01 +0000)
trying to execute the updating of LOBs.

Merged from MOODLE_17_STABLE

lib/dmllib.php

index 9a19fbf4dbad1d1018e5326a61fa9e790092483f..2907fc658e5343aba29f47c8f5dfedd5285438a5 100644 (file)
@@ -1207,8 +1207,8 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
         }
     }
 
-/// If a return ID is not needed then just return true now
-    if (!$returnid) {
+/// If a return ID is not needed then just return true now (but not in MSSQL DBs, where we may have some pending tasks)
+    if (!$returnid && !($CFG->dbtype == 'mssql' || $CFG->dbtype == 'odbc_mssql' || $CFG->dbtype == 'mssql_n')) {
         return true;
     }
 
@@ -1218,7 +1218,7 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
         return $dataobject->{$primarykey};
     }
 
-/// This only gets triggered with non-Postgres databases
+/// This only gets triggered with MySQL and MSQL databases
 /// however we have some postgres fallback in case we failed
 /// to find the sequence.
     $id = $db->Insert_ID();