]> git.mjollnir.org Git - moodle.git/commitdiff
And finally I've found the annoying bug that was causing Oracle to
authorstronk7 <stronk7>
Sun, 28 Jan 2007 01:07:52 +0000 (01:07 +0000)
committerstronk7 <stronk7>
Sun, 28 Jan 2007 01:07:52 +0000 (01:07 +0000)
execute strange SQL statements! Argh! Now I can go to sleep...

lib/dmllib.php

index b850a15b6368f725730846f46a731446a39ac813..ac57d7e0c6fa9fcc01e92628d964044a23379f1c 100644 (file)
@@ -1297,6 +1297,8 @@ function insert_record($table, $dataobject, $returnid=true, $primarykey='id') {
         }
         if ($nextval = (int)$db->GenID($seqname)) {
             $dataobject->{$primarykey} = $nextval;
+        } else {
+            debugging('Not able to get value from sequence ' . $seqname, DEBUG_DEVELOPER);
         }
     }
 
@@ -2003,7 +2005,7 @@ function db_detect_lobs ($table, &$dataobject, &$clobs, &$blobs, $unset = false,
     /// If the field is CLOB, update its value to '@#CLOB#@' and store it in the $clobs array
         if (strtoupper($columns[strtolower($fieldname)]->type) == $clobdbtype) { 
         /// Oracle optimization. CLOBs under 4000cc can be directly inserted (no need to apply 2-phases to them)
-            if ($CFG->dbfamily = 'oracle' && strlen($dataobject->$fieldname) < 4000) {
+            if ($CFG->dbfamily == 'oracle' && strlen($dataobject->$fieldname) < 4000) {
                 continue;
             }
             $clobs[$fieldname] = $dataobject->$fieldname;