fix: support return data type of stored function containing white spaces

work around non-greedy expression when extracting the return data type of a stored function with a space in it.
Todo: a better solution would be to create a tokenizer and iterate through the tokens, instead of parsing per regular expression

Refs #768
This commit is contained in:
Ansgar Becker
2025-10-26 13:46:06 +01:00
parent 18a21ef9e4
commit d7b1faa637

View File

@@ -7933,7 +7933,7 @@ begin
// | SQL SECURITY { DEFINER | INVOKER }
// | COMMENT 'string'
rx.Expression := '^\s*('+
'RETURNS\s+(\S+(\s+UNSIGNED)?(\s+CHARSET\s+\S+)?(\s+COLLATE\s\S+)?)|'+
'RETURNS\s+((\S+\([^\)]+\)|\S+)(\s+UNSIGNED)?(\s+CHARSET\s+\S+)?(\s+COLLATE\s\S+)?)|'+
// MySQL function characteristics - see http://dev.mysql.com/doc/refman/5.1/de/create-procedure.html
'LANGUAGE\s+SQL|'+
'(NOT\s+)?DETERMINISTIC|'+
@@ -7961,7 +7961,7 @@ begin
else if (Pos('CONTAINS SQL', Match) = 1) or (Pos('NO SQL', Match) = 1) or (Pos('READS SQL DATA', Match) = 1) or (Pos('MODIFIES SQL DATA', Match) = 1) then
Obj.DataAccess := rx.Match[1]
else if Pos('SQL SECURITY', Match) = 1 then
Obj.Security := rx.Match[7];
Obj.Security := rx.Match[8];
Delete(Body, 1, rx.MatchLen[0]);