SHOW create function return string not longer than 2048

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
hkarmeh
Posts: 4
Joined: Thu 01 Apr 2010 22:41

SHOW create function return string not longer than 2048

Post by hkarmeh » Mon 31 Aug 2020 13:21

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 ;

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SHOW create function return string not longer than 2048

Post by ViktorV » Wed 02 Sep 2020 18:05

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.

hkarmeh
Posts: 4
Joined: Thu 01 Apr 2010 22:41

Re: SHOW create function return string not longer than 2048

Post by hkarmeh » Wed 02 Sep 2020 20:15

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)).

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: SHOW create function return string not longer than 2048

Post by ViktorV » Thu 03 Sep 2020 19:28

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.

Post Reply