Make mysql_has_trigger_privilege() work better / more robust
Bug #1779049 reported by
Robert Lyon
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Robert Lyon |
Bug Description
Currently the function mysql_has_
Also mysql_has_
We need to do 2 things
1) Make the need to run mysql_has_
2) Make the check more robust so that if the 'testtable' already exists (was not cleaned up) we handle that in a better manner, eg drop trigger if exists then try adding trigger again
Changed in mahara: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
milestone: | none → 18.10.0 |
assignee: | nobody → Robert Lyon (robertl-9) |
Changed in mahara: | |
status: | Confirmed → In Progress |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
https:/ /mahara. org/interaction /forum/ topic.php? id=8305
Hi Robert,
If binary logging is enabled, this requires either SUPER privileges or enabling the global log_bin_ trust_function_ creators system variable for creating a trigger and this applies to both MySQL 5.7 & latest MySQL 8.0.
Having the SUPER privileges all the time is not a good practice, so enable this during an upgrade and revoke it as soon it finishes would be ideal practice or enable global variable log_bin_ trust_function_ creators permanently. Both of these steps are manual at this stage which requires a DBA for each upgrade being a larger organization unless Mahara states log_bin_ trust_function_ creators as a mandatory requirement when binary logging is enabled - wink ;).
For this scenario where binary logging is enabled and want to avoid SUPER privileges/ log_bin_ trust_function_ creators permanently, the check should happen each time whenever an upgrade is invoked (htdocs/ admin/upgrade. php - the function ensure_ upgrade_ sanity is already doing this). To minimize the impact this routine should be removed from init.php.
Kind regards,
Yaju Mahida