Permalink
Browse files

Wrap the quote_identifier function body within BEGIN .. END, to ensur…

…e that it is dumped/reloaded consistently (without this, on reload within the mysqldump test, the trailing semi-colon from the function body was removed on reload otherwise).
  • Loading branch information...
1 parent 5bedaa4 commit b2e02e0c16ff5b7a1e30bc96c94a1515ff83486d @MarkLeith MarkLeith committed Jun 3, 2016
Showing with 7 additions and 1 deletion.
  1. +7 −1 functions/quote_identifier.sql
@@ -15,6 +15,8 @@
DROP FUNCTION IF EXISTS quote_identifier;
+DELIMITER $$
+
-- https://dev.mysql.com/doc/refman/5.7/en/identifiers.html
-- Maximum supported length for any of the current identifiers in 5.7.5+ is 256 characters.
-- Before that, user variables could have any length.
@@ -62,4 +64,8 @@ CREATE DEFINER='root'@'localhost' FUNCTION quote_identifier(in_identifier TEXT)
SQL SECURITY INVOKER
DETERMINISTIC
NO SQL
- RETURN CONCAT('`', REPLACE(in_identifier, '`', '``'), '`');
+BEGIN
+ RETURN CONCAT('`', REPLACE(in_identifier, '`', '``'), '`');
+END$$
+
+DELIMITER ;

0 comments on commit b2e02e0

Please sign in to comment.