Page 1 of 1

SHOW create function return string not longer than 2048

Posted: Mon 31 Aug 2020 13:21
by hkarmeh
hello

i am using Mydac 10.3.1 and embarcadero 10.4.
i will demonstrate next example:

we have a function 'yyy' that is longer than 2048 character.

MyQuery1->SQL->Text= "SHOW create function yyy";
MyQuery1->Open();
int i;
i= MyQuery1->FieldByName("Create function")->AsString.Length();

variable i will always be 2048 and the function definition will be returned smaller as it is.

I have tried it with MyDac 10.0.1 it was Ok.

To create such an example function:
DELIMITER $$

DROP FUNCTION IF EXISTS `yyy` $$
CREATE DEFINER=`root`@`localhost` FUNCTION yyy() RETURNS double
READS SQL DATA
BEGIN

/*
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111


11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
*/

return(10);

END $$

DELIMITER ;

Re: SHOW create function return string not longer than 2048

Posted: Wed 02 Sep 2020 18:05
by ViktorV
Unfortunately, we cannot reproduce the problem in our environment based on the data you provide.
When testing, we get the correct length.
In order to get a detailed answer, please compose a small sample demonstrating the specified behavior and send it to us through the contact form (https://devart.com/company/contactform.html) including scripts for creating and filling database objects. Also specify the exact MySQL version.

Re: SHOW create function return string not longer than 2048

Posted: Wed 02 Sep 2020 20:15
by hkarmeh
Hello,
i have used Mydac version 10.3.1 and Mysql Ver 5.0.45-community-nt for Win32 on ia32 (MySQL Community Edition (GPL)).

Re: SHOW create function return string not longer than 2048

Posted: Thu 03 Sep 2020 19:28
by ViktorV
Upon investigation, we found that this behavior was not correct for MySQL 5.0 server and not MyDAC.
We've already fixed the issue, the fix will be included in the next version of MyDAC.