Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit b2e02e0

Browse files
committed
Wrap the quote_identifier function body within BEGIN .. END, to ensure 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).
1 parent 5bedaa4 commit b2e02e0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

functions/quote_identifier.sql

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
DROP FUNCTION IF EXISTS quote_identifier;
1717

18+
DELIMITER $$
19+
1820
-- https://dev.mysql.com/doc/refman/5.7/en/identifiers.html
1921
-- Maximum supported length for any of the current identifiers in 5.7.5+ is 256 characters.
2022
-- Before that, user variables could have any length.
@@ -62,4 +64,8 @@ CREATE DEFINER='root'@'localhost' FUNCTION quote_identifier(in_identifier TEXT)
6264
SQL SECURITY INVOKER
6365
DETERMINISTIC
6466
NO SQL
65-
RETURN CONCAT('`', REPLACE(in_identifier, '`', '``'), '`');
67+
BEGIN
68+
RETURN CONCAT('`', REPLACE(in_identifier, '`', '``'), '`');
69+
END$$
70+
71+
DELIMITER ;

0 commit comments

Comments
 (0)