Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Mysql SP Func Metadata error:Variable length column[PARAM_TYPENAME]overflow


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Francisco Arman...

Posts: 11
Registered: 3/3/01
Mysql SP Func Metadata error:Variable length column[PARAM_TYPENAME]overflow  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 7, 2018 2:45 AM
Delphi: Tokio 10.2.3
FD Version: 25.29899 (build 2631)
BD: MariaDB 10.2.14 / Mysql 5.7

Hi there is an exception that still happens in fireDAC in delphi tokio 10.2.3.

When using MySQL/Mariadb with a TFDStoredProc, assigning a Stored Function that has as a RESULT of any Type that doesn't has Dimensioning

I.E: DATE, DOUBLE, DATETIME, INTEGER.

So Using Double(10,2), Integer(10), DateTime(6) will work

The issue also happens when using the TFDMetainFoQuery and get the resultset for the mkProcArgs for that Function


Error

[FireDAC][DatS]-32. Variable length column [PARAM_TYPENAME] overflow. Value length - [197], column maximum length - [128].

OK

The error happens here
function TFDPhysMySQLCommand.FetchSPParamRows(ATable: TFDDatSTable;
  AParentRow: TFDDatSRow): Integer;


Because it fails to parse the last part after the 'RETURNS' statement, and SO it returnS all the part of the SQL DDL defition that is after the 'RETURNS' statement

Example function to test:
DELIMITER $$
 
DROP FUNCTION IF EXISTS `fnSysGetDivisaValorParidad`$$
 
CREATE DEFINER=`root`@`localhost` FUNCTION `fnSysGetDivisaValorParidad`(
        `p_divisaCVE` CHAR(20),
        `p_divisaReferenciaCVE` CHAR(20),
        `p_zonaParidadDivisaID` INTEGER,
        `p_fecha` DATE,
        `p_tipoParidadValor` INTEGER,
        `p_usarCodigoISO` DOUBLE
    ) RETURNS DATE
  BEGIN
   #ADD SOME CHARS TO CAUSE LENGTH OVERFLOW 24475384758375087349587398738
   #798765987676984756984736987498674398574859678457698476894769847684976
   #574387508943750984370894375098375098375039875093875938759875983758937
   #573458739857389457RYUYWIURYUWEIYROUIWEYRUIWEYROUIWEYROUWIEYROWEYORWEW
              
   RETURN(NULL);
  END$$
 
DELIMITER ;


If I specify DOUBLE(15,2) instead of 'DOUBLE' it works correctly

NOTE: since mysql 5.5.3 and newer (including MariaDB 5.6, 10.x) there is a new INFORMATION_SCHEMA.PARAMETERS table which will let you get the parameters easily

https://dev.mysql.com/doc/refman/5.5/en/parameters-table.html

¿How can I fix that issue?

Edited by: Francisco Armando Dueñas Rodriguez on Apr 7, 2018 3:48 AM

Edited by: Francisco Armando Dueñas Rodriguez on Apr 7, 2018 4:08 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02