Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24200

Syntax error in mysqldump (triggers with ; endings)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 10.3.25
    • Fix Version/s: N/A
    • Component/s: Backup, Triggers
    • Labels:
      None
    • Environment:

      Description

      Hi,

      When dumping a database with triggers for a customer I got the current output:

      DELIMITER ;;
      /*!50003 CREATE*/ /*!50017 DEFINER=`mydb`@`%` */ /*!50003 TRIGGER trigger_LabelsUsers_insert_before BEFORE INSERT ON LabelsUsers FOR EACH ROW SET NEW.LabelsUsersID2 = MD5(CONCAT(NOW(),RAND())); */;;
      DELIMITER ;
      

      When restoring or running it manually I get:

      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '*/' at line 1
      

      If I remove the last ; so the query looks like this:

      /*!50003 CREATE*/ /*!50017 DEFINER=`mydb`@`%` */ /*!50003 TRIGGER trigger_LabelsUsers_insert_before BEFORE INSERT ON LabelsUsers FOR EACH ROW SET NEW.LabelsUsersID2 = MD5(CONCAT(NOW(),RAND())) */;;
      

      then it works.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              Desdic Kim Gert Nielsen
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration