Closed thebenkahn closed 2 years ago
Hi @thebenkahn,
I acknowledge the issue. This was reported at #2083 a few days ago, and seems only affecting PostgreSQL database. It's likely to do with how PostgreSQL implements COALESCE function.
We have been mainly using MySQL in our environments, so haven't seen this issue ourselves. I'll try to setup an site using PostgreSQL database to reproduce the issue, and look for a solution.
Regards, Lai
Subscribing to this, as this affecting us too.
Hi all,
The fix to the issue has been included in the release from today. Please upgrade your plugins to the latest version to see the fix.
I'm going to close this issue.
Regards, Lai
Hello, using the Microsoft 365 username search field on the Microsoft 365 Integration > Advanced > Manage User Connections page is presenting me with a DML error.
Moodle version 3.11.7 (Build: 20220509) DB: postgres (11.13) MS365 plugins : local_o365 3.11.4
Based on the debug it looks like a column alias 'o365username' is used in the HAVING clause. This works in MariaDB/MySQL. Apparently not allowed in PGSQL. https://stackoverflow.com/questions/7511064/postgresql-aliases-column-and-having
In a test query this can be resolved by replacing the alias with the full expression:
HAVING COALESCE(aotok.oidcusername, o365match.aadupn, objects.o365name)
Stack trace