salix/db/routines/util/functions/quoteIdentifier.sql

10 lines
265 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `util`.`quoteIdentifier`(vString TEXT)
RETURNS text CHARSET utf8mb3 COLLATE utf8mb3_general_ci
DETERMINISTIC
NO SQL
BEGIN
RETURN CONCAT('`', REPLACE(vString, '`', '``'), '`');
END$$
DELIMITER ;