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

mysqldump --sys-triggers creates unloadable dump

    XMLWordPrintable

Details

    • Q3/2026 Server Maintenance

    Description

      CREATE TRIGGER trg1 AFTER STARTUP SET @x=1;
       
      --exec $MYSQL_DUMP --sys-triggers test > $MYSQLTEST_VARDIR/tmp/dump.sql 
      DROP TRIGGER trg1;
       
      --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/dump.sql 
       
      DROP TRIGGER trg1;
      --remove_file $MYSQLTEST_VARDIR/tmp/dump.sql
      

      --------------
      ALTER DATABASE `` CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci
      --------------
       
      ERROR 1102 (42000) at line 18: Incorrect database name ''
      

      Also there is no "USE ..." database in that dump, owning schema of the system trigger is not preserved.

      if I have tr1 in test, tr2 in test2:
      --sys-triggers test - ends up with an error:

      DELIMITER ;;
      /*!50003 CREATE*/ /*!50017 DEFINER=`alice`@`localhost`*/ /*!50003 TRIGGER tr1 AFTER STARTUP SET @x=1 
      */;;
      DELIMITER ;
      /*!50003 SET sql_mode              = @saved_sql_mode */ ;
      /*!50003 SET character_set_client  = @saved_cs_client */ ;
      /*!50003 SET character_set_results = @saved_cs_results */ ;
      /*!50003 SET collation_connection  = @saved_col_connection */ ;
      mysqldump: Couldn't execute 'SHOW CREATE TRIGGER `tr2`': Trigger does not exist (1360)
      

      Attachments

        Issue Links

          Activity

            People

              shulga Dmitry Shulga
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.