Moodle

LDAP authentication (sync_users) doesn't support MSSQL and Oracle

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7, 1.8
  • Fix Version/s: 1.8
  • Labels:
    None
  • Environment:
    MSSQL & ORACLE
  • Database:
    Microsoft SQL, Oracle
  • Affected Branches:
    MOODLE_17_STABLE, MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE

Description

In the ldap authentication plugin, the sync_users() function, has some conditional code to use temporal tables under MySQL and PostgreSQL, but there isn't corresponding code for MSSQL and Oracle.

While it shouldn't be problematic for Oracle:

create global temporary table $CFG->prefix .'extuser'
......
(on commit preserve rows?)

MSSQL has a limitatio: All the temp tables are named with '#' being the 1st char in the name. Obviously this breaks current code and $CFG->prefix usage

Any idea?

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Adding it too to the SQL Component to be able to follow it from more places.

Show
Eloy Lafuente (stronk7) added a comment - Adding it too to the SQL Component to be able to follow it from more places.
Hide
Iñaki Arenaza added a comment -

Like I say in MDL-7525, if temporary table creation is database dependant, we should add support for it in lib/{ddllib,dmllib}.php, to take care of it once and for all.

Saludos. Iñaki.

Show
Iñaki Arenaza added a comment - Like I say in MDL-7525, if temporary table creation is database dependant, we should add support for it in lib/{ddllib,dmllib}.php, to take care of it once and for all. Saludos. Iñaki.
Hide
Eloy Lafuente (stronk7) added a comment -

Hating temp tables here!

Uhm...looking forward for a nice solution.... could we relay one static tables instead? Say, create the prefix_temp_values table:

id
session
value

and handle them where necessary. It will leave us free from temporal tables and their "un-compatible" behaviour, using standard table instead. Such table could be there always and work with a few functions:

temp_values_clean(session)
temp_values_put(session,value)
temp_values_get(session)

Exactly like the backups_ids table is performing since ages.

Yes/no?

This will fix 2-3 bugs together and will provide us with a central place to storage big-temp collections of "things", hehe

Show
Eloy Lafuente (stronk7) added a comment - Hating temp tables here! Uhm...looking forward for a nice solution.... could we relay one static tables instead? Say, create the prefix_temp_values table: id session value and handle them where necessary. It will leave us free from temporal tables and their "un-compatible" behaviour, using standard table instead. Such table could be there always and work with a few functions: temp_values_clean(session) temp_values_put(session,value) temp_values_get(session) Exactly like the backups_ids table is performing since ages. Yes/no? This will fix 2-3 bugs together and will provide us with a central place to storage big-temp collections of "things", hehe
Hide
Iñaki Arenaza added a comment -

This should work as long as we don't need multi-column temporary tables (do we? I don't know, as I don't master all the internals of Moodle).

Saludos. Iñaki.

Show
Iñaki Arenaza added a comment - This should work as long as we don't need multi-column temporary tables (do we? I don't know, as I don't master all the internals of Moodle). Saludos. Iñaki.
Hide
Eloy Lafuente (stronk7) added a comment -

Finally I've added temp tables creation both for MSSQL and Oracle, instead of creating the small API specified above. I've performed tests about the temp tables under all DBs but Oracle (my box is broken here) no LDAP itself (the modifications haven't changed one line ldap-related.

Please if somebody can confirm it works now with everything up (LDAP and Oracle/MSSQL). TIA!

Show
Eloy Lafuente (stronk7) added a comment - Finally I've added temp tables creation both for MSSQL and Oracle, instead of creating the small API specified above. I've performed tests about the temp tables under all DBs but Oracle (my box is broken here) no LDAP itself (the modifications haven't changed one line ldap-related. Please if somebody can confirm it works now with everything up (LDAP and Oracle/MSSQL). TIA!
Hide
Eloy Lafuente (stronk7) added a comment -

Temp tables code working properly under MySQL, PostgresQL and MSSQL.

My Oracle box is broken right now so some feedback will be really welcome! 18_STABLE and HEAD only!

Show
Eloy Lafuente (stronk7) added a comment - Temp tables code working properly under MySQL, PostgresQL and MSSQL. My Oracle box is broken right now so some feedback will be really welcome! 18_STABLE and HEAD only!
Hide
Eloy Lafuente (stronk7) added a comment -

Any comment about how temp tables are working under Oracle?

Show
Eloy Lafuente (stronk7) added a comment - Any comment about how temp tables are working under Oracle?
Hide
Iñaki Arenaza added a comment -

I don't have any Oracle box at hand to test it, so I can't comment on it

Saludos. Iñaki.

Show
Iñaki Arenaza added a comment - I don't have any Oracle box at hand to test it, so I can't comment on it Saludos. Iñaki.
Hide
Eloy Lafuente (stronk7) added a comment -

just looking if I am able to install/test it in my Win32 XP old-slow-512MB PC... arghhh.

(why the hell those Oracle guys don't configure-make-make install OracleInstantClient for Intel MacOS X. It's really incredible!).

Show
Eloy Lafuente (stronk7) added a comment - just looking if I am able to install/test it in my Win32 XP old-slow-512MB PC... arghhh. (why the hell those Oracle guys don't configure-make-make install OracleInstantClient for Intel MacOS X. It's really incredible!).
Hide
Petr Škoda (skodak) added a comment -

should be fixed now, please file a new report for 1.8 if needed, thanks!

Show
Petr Škoda (skodak) added a comment - should be fixed now, please file a new report for 1.8 if needed, thanks!

People

Dates

  • Created:
    Updated:
    Resolved: