From d7b1faa637869472ffbdabd28d5885caa3a33dc9 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sun, 26 Oct 2025 13:46:06 +0100 Subject: [PATCH] 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 --- source/dbconnection.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index a0c53d40..aa536114 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -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]);