Description:
If a view that contains the SUM/GROUP BY aggregate in its definition was created using a non-existing user in the "DEFINER=" clause, then the MySQL Windows Service will stop whenever someone tries to open its definition with either Workbench or MySQL Query Browser GUI interface by right clicking and selecting alter view. Also, the MySQL Windows service will stop, if someone attempts to use the Workbench model Diff Report or Synchronize tools to compare the view to a model or another copy on a different server. A debug dialog will appear, and as soon as the user selects the "No" button when asked to enter debug, the MySQL service is absolutely stopped and the MySQL Server cannot be accessed at all until after its service is restarted again.
How to repeat:
/*** CAUTION! Do NOT try this on a production server! ***/
/*** 1. Run the following sql DDL ("bogusUser" must not exist for this demo): ***/
CREATE SCHEMA IF NOT EXISTS DebugCrashTest CHARACTER SET = 'utf8' COLLATE = 'utf8_general_ci';
USE DebugCrashTest;
CREATE TABLE IF NOT EXISTS TestTable (ID INT, Cost INT);
CREATE OR REPLACE ALGORITHM=UNDEFINED DEFINER=`bogusUser`@`%` SQL SECURITY DEFINER VIEW DebugCrashTest.vwAggregateTestTable
AS
SELECT
ID
, SUM(Cost)
FROM DebugCrashTest.TestTable
GROUP BY ID
;
/*** 2. Attempt to alter this newly created view by right clicking and selecting "Alter View..." in MySQL Workbench (5.2.21) or MySQL Query Browser (1.2.17). ***/
/*** 3. A debug dialog will appear. When you select "No", the MySQL service will be stopped. ***/
Suggested fix:
* MySQL service should not stop when someone hits "No" in a debug window for GUIs attached to a MySQL server instance.
* The MySQL Workbench and Query Browser GUIs should handle the error when opening an incorrectly defined view or view that was defined with a user that may no longer exist without throwing a debug dialog.