MDL-77306 core: Remove LIMIT from SQL statement
Adding LIMIT to the primary auth type SQL statement does not play well with Oracle. We can just remove the LIMIT clause from the SQL statement and and pass IGNORE_MULTIPLE to the call to $DB->get_field_sql() instead.
This commit is contained in:
@@ -185,9 +185,10 @@ class registration {
|
||||
$siteinfo['dbtype'] = $CFG->dbtype;
|
||||
$siteinfo['coursesnodates'] = $DB->count_records_select('course', 'startdate = ? AND enddate = ?', [0, 0]) - 1;
|
||||
$siteinfo['sitetheme'] = get_config('core', 'theme');
|
||||
$siteinfo['primaryauthtype'] = $DB->get_field_sql(
|
||||
'SELECT auth, count(auth) as tc FROM {user} GROUP BY auth ORDER BY tc DESC LIMIT 1'
|
||||
);
|
||||
|
||||
// Primary auth type.
|
||||
$primaryauthsql = 'SELECT auth, count(auth) as tc FROM {user} GROUP BY auth ORDER BY tc DESC';
|
||||
$siteinfo['primaryauthtype'] = $DB->get_field_sql($primaryauthsql, null, IGNORE_MULTIPLE);
|
||||
|
||||
// Version and url.
|
||||
$siteinfo['moodlerelease'] = $CFG->release;
|
||||
|
||||
Reference in New Issue
Block a user