Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.8.4, 1.9.16
-
Fix Version/s: STABLE backlog
-
Component/s: Authentication
-
Labels:
-
Database:MySQL
-
Affected Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
-
Pull from Repository:
-
Pull 1.9 Branch:MDL-13458_m19
Description
In the creation of the temporary table in auth/ldap/auth.php's sync_users() function, there are two issues:
1) the width of the username column is set to 64, whereas mdl_user.username is 100 characters.
C.f. auth/ldap/auth.php version 1.47, lines 538, 543, 549, 555
2) there is no reference to the mnethostid in the temporary table.
This second issue becomes a significant problem when sync_users() performs the User Additions section. Because mdl_user.username is only indexed in mdl_user_mneuse_uix, the select is EXTREMELY slow and resource intensive. MySQL would lock up for several minutes on our site. I added a nonunique index to mdl_user.username to avoid the issue. Alternately, the local mnethostid could be utilized in the temptable and SQL.
C.f. auth/ldap/auth.php version 1.47, line 789.
Attachments
Issue Links
| This issue will help resolve: | ||||
| MDL-19779 | {mdl}_user table needs an index on the username column |
|
|
|
adding more ppl as watcher, if nobody steps up I will at least fix the field length, that mnethostid would need more thinking and testing I am afraid