analitica.cron.indeg.y.run.a_insert
). And when creating a dump, mysqldump does not take into account this circumstance and adds a structure for their drop of the following form: /*!50032 DROP TRIGGER IF EXISTS analitica.cron.indeg.y.run.a_insert */;
git clone --recursive --depth 1 https://github.com/percona/percona-server/
client/mysqldump.c
file and added apostrophes to the DROP TRIGGER IF EXISTS
construct in a couple of places. If you look diff , it turns out this patch: @@ -3517,7 +3517,7 @@ static void dump_trigger_old(FILE *sql_file, MYSQL_RES *show_triggers_rs, fprintf(sql_file, "/*!50003 SET @OLD_SQL_MODE=@@SQL_MODE*/;\n"); if (opt_drop_trigger) - fprintf(sql_file, "/*!50032 DROP TRIGGER IF EXISTS %s */;\n", (*show_trigger_row)[0]); + fprintf(sql_file, "/*!50032 DROP TRIGGER IF EXISTS `%s` */;\n", (*show_trigger_row)[0]); fprintf(sql_file, "DELIMITER ;;\n" @@ -3604,7 +3604,7 @@ static int dump_trigger(FILE *sql_file, MYSQL_RES *show_create_trigger_rs, switch_sql_mode(sql_file, ";", row[1]); if (opt_drop_trigger) - fprintf(sql_file, "/*!50032 DROP TRIGGER IF EXISTS %s */;\n", row[0]); + fprintf(sql_file, "/*!50032 DROP TRIGGER IF EXISTS `%s` */;\n", row[0]);
apt-get install build-essential cmake bison libaio-dev libncurses5-dev libreadline-dev cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF make mysqldump
./percona-server/client/mysqldump \ --socket=/var/run/mysqld/mysqld.sock \ -uroot -p --routines --events --triggers \ --add-drop-trigger --quote-names \ --no-create-info --no-data --no-create-db --skip-opt \ database_name | sed -r 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > dump.sql
Source: https://habr.com/ru/post/268569/
All Articles