Prevent Oracle to fail when inserting records with log->info empty

(will be solved once we got all those NOT NULL fields fixed)
This commit is contained in:
stronk7
2006-10-30 19:51:44 +00:00
parent d040f940a2
commit f5303bd518
+6
View File
@@ -1292,6 +1292,12 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; $PERF->logwrites++;};
if ($CFG->type = 'oci8po') {
if (empty($info)) {
$info = ' ';
}
}
$result = $db->Execute('INSERT INTO '. $CFG->prefix .'log (time, userid, course, ip, module, cmid, action, url, info)
VALUES (' . "'$timenow', '$userid', '$courseid', '$REMOTE_ADDR', '$module', '$cm', '$action', '$url', '$info')");