[MDEV-30833] mariadb-dump needs --add-drop-procedure Created: 2023-03-11  Updated: 2023-03-11

Status: Open
Project: MariaDB Server
Component/s: Backup
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Philip orleans Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I was trying to script all my stored procedures, add some changes and send them back to the database, but I could not find a way to make the new version replace the existing version automatically. I think we all agree that mariadb-dump needs a new option
--add-drop-procedure

Right now I am using
db=test
name=test
name1=test_copy

mysqldump --quick --no-create-db --no-create-info --no-data --triggers --routines \
--skip-opt --add-drop-trigger --skip-extended-insert --compact \
--where="db='${db}' AND type='PROCEDURE' AND name IN ('${name}', '${name1}')" --databases "${db}"

I aim to script two stored procedures test and test_copy only, and right after send them back like below:
MySQL test < test.sql


Generated at Thu Feb 08 10:19:14 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.