diff --git a/lib/db/install.php b/lib/db/install.php index 0379785..96553e5 100644 --- a/lib/db/install.php +++ b/lib/db/install.php @@ -27,7 +27,7 @@ defined('MOODLE_INTERNAL') || die(); function xmldb_main_install() { - global $CFG, $DB, $SITE; + global $CFG, $DB, $SITE, $OUTPUT; /// make sure system context exists $syscontext = get_system_context(false); @@ -173,7 +173,12 @@ function xmldb_main_install() { $admin->timemodified = time(); $admin->lastip = CLI_SCRIPT ? '0.0.0.0' : getremoteaddr(); // installation hijacking prevention $admin->id = $DB->insert_record('user', $admin); - if ($admin->id != 2) { + if ($admin->id == 2) { + //expected result on standard acid compliant systems + } else if ($admin->id == 3) { + // this might be the even-odd mysql cluster, warn admins that it is not supported at all + echo $OUTPUT->notification('Non-continuous id numbering detected - database engine is not supported.', 'notifyproblem'); + } else { throw new moodle_exception('generalexceptionmessage', 'error', '', 'Unexpected new admin user id!'); } /// Store list of admins