Commit 4ce6ad88 authored by Carsten  Rose's avatar Carsten Rose

Fixes #10152: QCC() - Stored Procedure to escape : and ,

parent d4614f8c
Pipeline #3306 passed with stages
in 4 minutes and 35 seconds
......@@ -43,13 +43,29 @@ END;
#
DROP FUNCTION IF EXISTS QBAR;
CREATE FUNCTION QBAR(input TEXT)
RETURNS TEXT
DETERMINISTIC
SQL SECURITY INVOKER
RETURNS TEXT
DETERMINISTIC
SQL SECURITY INVOKER
BEGIN
DECLARE output TEXT;
SET output = REPLACE(input, '|', '\\|');
RETURN output;
DECLARE output TEXT;
SET output = REPLACE(input, '|', '\\|');
RETURN output;
END;
###
#
# QCC(input)
# replaces ':' (colon) and ',' (coma) in `input` with '\:' and '\,'
#
DROP FUNCTION IF EXISTS QCC;
CREATE FUNCTION QCC(input TEXT)
RETURNS TEXT
DETERMINISTIC
SQL SECURITY INVOKER
BEGIN
DECLARE output TEXT;
SET output = REPLACE(REPLACE(input, ':', '\\:'), ',', '\\,');
RETURN output;
END;
###
......@@ -59,9 +75,9 @@ END;
#
DROP FUNCTION IF EXISTS QNL2BR;
CREATE FUNCTION QNL2BR(input TEXT)
RETURNS TEXT
DETERMINISTIC
SQL SECURITY INVOKER
RETURNS TEXT
DETERMINISTIC
SQL SECURITY INVOKER
BEGIN
DECLARE output TEXT;
SET output = REPLACE(REPLACE(input, CHAR(13), ''), CHAR(10), '<br>');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment