Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
0d4b4ee4
Commit
0d4b4ee4
authored
Aug 27, 2019
by
Carsten Rose
Browse files
reformat functions.sql
parent
bf186d49
Pipeline
#2255
passed with stages
in 2 minutes and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extension/Classes/Sql/function.sql
View file @
0d4b4ee4
###
#
#
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
;
###
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment