Skip to content

Commit

Permalink
Fixed issue causing DEFINER stripping to only apply to TRIGGERS and n…
Browse files Browse the repository at this point in the history
…ot ALGORITHM in dumps
  • Loading branch information
davidalger committed Jul 3, 2019
1 parent e1a82dd commit 182260d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/db.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ case "${WARDEN_PARAMS[0]}" in
mysql -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}" "$@"
;;
import)
LC_ALL=C sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | "${WARDEN_DIR}/bin/warden" env exec -T db \
LC_ALL=C sed -E 's/DEFINER[ ]*=[ ]*`[^`]+`@`[^`]+`/DEFINER=CURRENT_USER/g' \
| "${WARDEN_DIR}/bin/warden" env exec -T db \
mysql -u"${MYSQL_USER}" -p"${MYSQL_PASSWORD}" "${MYSQL_DATABASE}"
;;
*)
Expand Down

0 comments on commit 182260d

Please sign in to comment.