Commit 0d4b4ee4 authored by Carsten  Rose's avatar Carsten Rose

reformat functions.sql

parent bf186d49
Pipeline #2255 passed with stages
in 2 minutes and 39 seconds
###
#
# GETFUNCTIONSHASH() is used for checking whether this file has been played properly in DatabaseUpdate.php
#
DROP FUNCTION IF EXISTS GETFUNCTIONSHASH;
CREATE FUNCTION GETFUNCTIONSHASH ()
RETURNS TEXT
DETERMINISTIC
CREATE FUNCTION GETFUNCTIONSHASH()
RETURNS TEXT
DETERMINISTIC
BEGIN
RETURN '%%FUNCTIONSHASH%%';
RETURN '%%FUNCTIONSHASH%%';
END;
......@@ -19,20 +17,20 @@ END;
# inserts a span into `input` after `maxlen` number of characters and returns it.
#
DROP FUNCTION IF EXISTS QMORE;
CREATE FUNCTION QMORE ( input TEXT, maxlen INT )
RETURNS TEXT
DETERMINISTIC
CREATE FUNCTION QMORE(input TEXT, maxlen INT)
RETURNS TEXT
DETERMINISTIC
BEGIN
DECLARE output TEXT;
IF maxlen < 1 THEN
SET maxlen = 1;
END IF;
IF CHAR_LENGTH(input) > maxlen THEN
SET output = CONCAT(INSERT(input, maxlen, 0, '<span class="qfq-more-text">'), '</span>');
ELSE
SET output = input;
END IF;
RETURN output;
DECLARE output TEXT;
IF maxlen < 1 THEN
SET maxlen = 1;
END IF;
IF CHAR_LENGTH(input) > maxlen THEN
SET output = CONCAT(INSERT(input, maxlen, 0, '<span class="qfq-more-text">'), '</span>');
ELSE
SET output = input;
END IF;
RETURN output;
END;
......@@ -42,13 +40,13 @@ END;
# replaces '|' in `input` with '\|'
#
DROP FUNCTION IF EXISTS QBAR;
CREATE FUNCTION QBAR ( input TEXT )
RETURNS TEXT
DETERMINISTIC
CREATE FUNCTION QBAR(input TEXT)
RETURNS TEXT
DETERMINISTIC
BEGIN
DECLARE output TEXT;
SET output = REPLACE(input, '|', '\\|');
RETURN output;
DECLARE output TEXT;
SET output = REPLACE(input, '|', '\\|');
RETURN output;
END;
###
......@@ -57,13 +55,13 @@ END;
# replaces '|' in `input` with '\|'
#
DROP FUNCTION IF EXISTS QNL2BR;
CREATE FUNCTION QNL2BR ( input TEXT )
RETURNS TEXT
DETERMINISTIC
CREATE FUNCTION QNL2BR(input TEXT)
RETURNS TEXT
DETERMINISTIC
BEGIN
DECLARE output TEXT;
SET output = REPLACE( REPLACE(input, CHAR(13), ''), CHAR(10), '<br>');
RETURN output;
DECLARE output TEXT;
SET output = REPLACE(REPLACE(input, CHAR(13), ''), CHAR(10), '<br>');
RETURN output;
END;
###
......
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