1

MySQL 5.7.24, phpmyadmin 4.8.3

phpMyAdmin appears to export corrupted definition on all views of one of my MySQL database. Eg: show create view v_contacts returns

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_contacts` AS select `d`.`rowseq` AS `rowseq`,`d`.`airline_rowseq` AS `airline_rowseq`,`a`.`name` AS `airline_name`,`c`.`name` AS `country_name`,`d`.`i_type` AS `i_type`,`ab`.`hint` AS `contact_type`,`d`.`i_index` AS `i_index`,`d`.`i_value` AS `i_value`,`d`.`updated` AS `updated` from (((`atdb6`.`directory` `d` join `atdb6`.`airline` `a`) join `atdb6`.`country` `c`) join `atdb6`.`abbreviations` `ab`) where ((`d`.`airline_rowseq` = `a`.`rowseq`) and (`a`.`country` = `c`.`rowseq`) and (`ab`.`type` = 'D') and (`d`.`i_type` = `ab`.`code`) and (`d`.`i_type` <> 'LG'))  utf8    utf8_general_ci

Exporting with phpMyAdmin generates a file which contains:

DROP TABLE IF EXISTS `v_contacts`;
/*!50001 DROP VIEW IF EXISTS `v_contacts`*/;
SET @saved_cs_client     = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE VIEW `v_contacts` AS SELECT 
 1 AS `rowseq`,
 1 AS `airline_rowseq`,
 1 AS `airline_name`,
 1 AS `country_name`,
 1 AS `i_type`,
 1 AS `contact_type`,
 1 AS `i_index`,
 1 AS `i_value`,
 1 AS `updated`*/;
SET character_set_client = @saved_cs_client;

and later in the export file, the correct definition:

/*!50001 DROP VIEW IF EXISTS `v_contacts`*/;
/*!50001 SET @saved_cs_client          = @@character_set_client */;
/*!50001 SET @saved_cs_results         = @@character_set_results */;
/*!50001 SET @saved_col_connection     = @@collation_connection */;
/*!50001 SET character_set_client      = utf8 */;
/*!50001 SET character_set_results     = utf8 */;
/*!50001 SET collation_connection      = utf8_general_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `v_contacts` AS select `d`.`rowseq` AS `rowseq`,`d`.`airline_rowseq` AS `airline_rowseq`,`a`.`name` AS `airline_name`,`c`.`name` AS `country_name`,`d`.`i_type` AS `i_type`,`ab`.`hint` AS `contact_type`,`d`.`i_index` AS `i_index`,`d`.`i_value` AS `i_value`,`d`.`updated` AS `updated` from (((`atdb6`.`directory` `d` join `atdb6`.`airline` `a`) join `atdb6`.`country` `c`) join `atdb6`.`abbreviations` `ab`) where ((`d`.`airline_rowseq` = `a`.`rowseq`) and (`a`.`country` = `c`.`rowseq`) and (`ab`.`type` = 'D') and (`d`.`i_type` = `ab`.`code`) and (`d`.`i_type` <> 'LG')) */;
/*!50001 SET character_set_client      = @saved_cs_client */;
/*!50001 SET character_set_results     = @saved_cs_results */;
/*!50001 SET collation_connection      = @saved_col_connection */;

However only the first part is used when importing on another computer with phpMyAdmin 4.0.10.14, so all columns are set to 1.

Same for all views in the same database. Is this a bug, and no export file generated by phpMyAdmin 5.7 should be reused for import by phpMyAdmin 4.8 ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.