Bug #35960 mysqldump dumps error in view definition
Submitted: 10 Apr 2008 12:26 Modified: 10 May 2008 13:31
Reporter: Roderick Smith Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:5.0.54-log OS:Linux
Assigned to: CPU Architecture:Any
Tags: mysqldump, VIEW

[10 Apr 2008 12:26] Roderick Smith
Description:
mysqldump is putting double = signs on the definer of a view, ex: DEFINER==user not DEFINER=user

How to repeat:
Create a table: 

CREATE TABLE `actions` (
  `action_id` bigint(20) unsigned NOT NULL auto_increment,
  `description` varchar(100) default NULL,
  PRIMARY KEY  (`action_id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8;
SET character_set_client = @saved_cs_client;

Create a View:

CREATE ALGORITHM=UNDEFINED 
DEFINER=`root`@`localhost` SQL SECURITY DEFINER
VIEW `v_test` AS select `actions`.`action_id`; 

dump your database and the view will come up something like this:

/*!50001 DROP TABLE `v_test`*/;
/*!50001 DROP VIEW IF EXISTS `v_test`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER==`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_test` AS select `actions`.`action_id`*/

NOTICE THE == ON DEFINER

Suggested fix:
/*!50013 DEFINER==`root`@`localhost` SQL SECURITY DEFINER */
[10 Apr 2008 12:28] Roderick Smith
UPDATE: While doing search and replace to fix my dump I noticed it happens in trigger definitions as well
[10 Apr 2008 13:31] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with mysqldump from a newer version, 5.0.58. In case of the same problem, please, send the exact mysqldump command used.

I've got:

--
-- Final view structure for view `v_test`
--

/*!50001 DROP TABLE `v_test`*/;
/*!50001 DROP VIEW IF EXISTS `v_test`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_test` AS select `actions`.`action_id` AS `action_id` from `acti
ons` */;
[10 May 2008 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".