Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.7
-
Component/s: Authentication
-
Labels:None
-
Environment:Hide-Patch tested on WinXP/Apache/PHP 5.1/MSSQL Server
-Oracle code has not been tested and probably needs work (suspect Oracle also does not support multiple inserts)
-eDirectory is only LDAP Server I've tested against but LDAP specific stuff should remain unchanged in this patchShow-Patch tested on WinXP/Apache/PHP 5.1/MSSQL Server -Oracle code has not been tested and probably needs work (suspect Oracle also does not support multiple inserts) -eDirectory is only LDAP Server I've tested against but LDAP specific stuff should remain unchanged in this patch
-
Database:Microsoft SQL, Oracle
-
Affected Branches:MOODLE_17_STABLE
-
Fixed Branches:MOODLE_18_STABLE, MOODLE_19_STABLE
Description
auth_sync_users() in auth/ldap/lib.php needs to create a temporary table so that it can quickly determine which external ldap accounts exist or don't exist in moodle. The code currently only knows how to create temporary tables for mysql and postgres. This patch should add support for doing it in mssql and oracle. A few comments:
-this is my first patch submission attempt so go easy on me, I'd really appreciate constructive criticism
-I looked but was unable to find a way to abstract the temporary table creation with adodb, if anyone knows of a way, it would be much prettier than the switch case statement I have now. As it stands, this will need updating with every new database system moodle supports.
-It seemed to me that mssql was not dropping the temporary table when I ran the script multiple times within a few minutes of each other so I added the DROP table command at the end to be sure each run would be working with fresh data.
Attachments
Issue Links
| This issue will be resolved by: | ||||
| MDL-8590 | Auth cleanup - META |
|
|
|
| This issue is duplicated by: | ||||
| MDL-8153 | LDAP authentication (sync_users) doesn't support MSSQL and Oracle |
|
|
|
| MDL-8023 | CLONE -auth_ldap_bulk_insert() potential problem for MSSQL and Oracle |
|
|
|
| This issue has a non-specific relationship to: | ||||
| MDL-8153 | LDAP authentication (sync_users) doesn't support MSSQL and Oracle |
|
|
|
Also, for MySQL databases, SET SQL_BIG_TABLES=1 should no longer be necessary. It was needed for MySQL 3.x since MySQL would use memory based temp tables by default but would report an error if the table exceeded a memory limitation. As of MySQL 4.0, temporary tables will be memory based until such a time as they grow larger than the memory allows, at that point they will be written to disk without causing any errors. We should leave SET SQL_BIG_TABLES unset so that MySQL can use memory for the temporary table when it can. Further details can be found in MySQL's docs at:
http://dev.mysql.com/doc/refman/4.1/en/set-option.html#id2832220