Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Block Comments /*….*/ Don't Work In 'restore From Sql Dump&#

forums forums SQLyog SQLyog: Bugs / Feature Requests Block Comments /*….*/ Don't Work In 'restore From Sql Dump&#

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #10485
      Simeon
      Member

      6.05 community on XP SP2. MySQL5.0.26

      Create a SP like this: (Note: Definer, db name, and drop clauses removed for compatibilty)

      DELIMITER $$

      CREATE PROCEDURE `testSP`()

      BEGIN

      /* Here's a block comment

      Created 20070816 by Simeon

      This SP is being used to demonstrate standard block comments in the SQL Dump / Restore context

      – Currently they don't work because the Asterisk, forward slash combination

      is used as a delimiter in the restore process. The editor can work around this??

      */

      SELECT 'Hello' greeting;

      END$$

      DELIMITER ;

      Now right click on the database name in the object explorer, and “Backup database as SQL Dump”

      Right click again on the database name, and “Restore from SQL dump”

      You will see an error generated like this:

      Query:

      /*!50003 CREATE DEFINER=`xxx`@“ PROCEDURE `testSP`()

      BEGIN

      /* Here's a block comment

      Created 20070816 by Simeon

      This SP is being used to demonstrate block comments in the SQL Dump / Restore context

      – Currently they don't work because the Asterisk, forward slash combination

      is used as a delimiter in the restore process. The editor can work around this??

      Error occured at:2007-08-16 09:45:31

      Line no.:83

      Error Code: 1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

      If you open the SQL Dump file in the SQLYog editor, then [Ctrl+a],[Shift=F5] the script will run with no error.

    • #24684
      peterlaursen
      Participant

      The error is confirmed on MySQL 5.0.45

      Could you explain “Currently they don't work because the Asterisk, forward slash combination

      is used as a delimiter in the restore proces” ??

      Now as we can execute this from the editor we also should when executing an external script. I think it might be an issue with 'multiline' comments.

      We will have to find out now!

    • #24685
      peterlaursen
      Participant

      the issue is that the SP itself is enclosed in 'version dependent conditional comments' in the DUMP file like

      /*!50003 CREATE DEFINER=`root`@`localhost` PROCEDURE `testSP`()

      BEGIN

      /* comment */

      SELECT 'Hello' greeting;

      END */

      And this we do not handle correctly in case of external file execution!

      This will be fixed of course!

    • #24686
      peterlaursen
      Participant
    • #24687
      Simeon
      Member

      😀

      peterlaursen wrote on Aug 18 2007, 12:57 AM:

      Yes, this has fixed the problem outlined here, and also the issue raised in “Restore From Sql Dump 'glitch' For Stored Procedure”

      Thanks for your prompt fix – this has already made life much easier!

Viewing 4 reply threads
  • You must be logged in to reply to this topic.