Bug #41094 system call not available from a stored program / trigger / function
Submitted: 28 Nov 2008 13:44 Modified: 14 Nov 2009 17:57
Reporter: Miroslav Kubiczek Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any
Triage: Needs Triage: D5 (Feature request)

[28 Nov 2008 13:44] Miroslav Kubiczek
Description:
An error is generated:

ERROR 1064 (42000) at line 328: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'snmptrap $myparams'
END' at line 11

When loading this trigger:

CREATE TRIGGER snmpSender BEFORE UPDATE ON alarms
FOR EACH ROW
BEGIN
  system snmptrap $myparams
END $$

How to repeat:
See the description.

Suggested fix:
Make it possible to invoke a system call from within a stored procedure. Further, some possibility to pass variable values to the syscall argument list is required.
[14 Nov 2009 17:57] Valeriy Kravchuk
Indeed, it would be nice to have some (controlled) way to call OS level commands from SP.