| 1 |
------ Run plugin ------------------------------------------------ |
| 2 |
INSTALL PLUGIN test_services_command_services SONAME 'TEST_SERVICES_COMMAND_SERVICES_PLUGIN'; |
| 3 |
------ Show status of plugin ------------------------------------- |
| 4 |
SELECT PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS |
| 5 |
WHERE PLUGIN_NAME='test_services_command_services'; |
| 6 |
PLUGIN_STATUS |
| 7 |
ACTIVE |
| 8 |
# Test : must return '2' the output of SELECT 1+1; |
| 9 |
SELECT test_command_service_udf("select 1+1"); |
| 10 |
test_command_service_udf("select 1+1") |
| 11 |
2 |
| 12 |
# Test : must return '2.5' the output of SELECT 1.3+1.2; |
| 13 |
SELECT test_command_service_udf("select 1.3+1.2"); |
| 14 |
test_command_service_udf("select 1.3+1.2") |
| 15 |
2.5 |
| 16 |
# Test : must return error message |
| 17 |
SELECT test_command_service_udf("SELECT * FROM mysql.plugin ORDER BY name"); |
| 18 |
ERROR HY000: Error in command service backend interface, because of : "SELECT command denied to user 'mysql.session'@'localhost' for table 'plugin'" |
| 19 |
SELECT test_command_service_udf(); |
| 20 |
test_command_service_udf() |
| 21 |
NULL |
| 22 |
------ Stop plugin ----------------------------------------------- |
| 23 |
UNINSTALL PLUGIN test_services_command_services; |