Bug #54162 MySQL Windows Service Stops - when opening certain view definitions
Submitted: 1 Jun 2010 21:38 Modified: 1 Jul 2010 22:33
Reporter: P Lance Sheldon Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.0.77 OS:Windows (XP Professional)
Assigned to: CPU Architecture:Any

[1 Jun 2010 21:38] P Lance Sheldon
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.
[1 Jun 2010 22:33] MySQL Verification Team
Thank you for the bug report. Could you please try version 5.0.91. Thanks in advance.
[1 Jul 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".