TIMESTAMPDIFF MySQL causes TLargeintField

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
alamonaca
Posts: 3
Joined: Fri 19 Jun 2009 20:16

TIMESTAMPDIFF MySQL causes TLargeintField

Post by alamonaca » Mon 29 Jun 2009 21:04

Hellow, i'm using UniDAC V 2.70.0.8.

Have a TUniQuery with the following text:

SELECT TIMESTAMPDIFF(DAY, DATE_MEET,NOW()) DELAY
FROM TABLE_1;

When I retrieve the fields, DELAY is a TLargeintField. The MySQL reference manual says than de return value of TIMESTAMPDIFF is an Integer type, so DELAY would be an TIntegerField.

I've set the OptimizedBigInt property to True, but still getting TLargeintField.

here the script to generate the test table:

CREATE TABLE TABLE_1 (DATE_MEET DATETIME);

INSERT TABLE_1 VALUES ('2009-06-01');

INSERT TABLE_1 VALUES ('2009-05-01');

INSERT TABLE_1 VALUES ('2009-04-11');


Thanks!

Alex

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 30 Jun 2009 07:37

Setting the OptimizedBigInt property converts fields with field length less than 11 of TLargeIntField type into TIntegerField.
For the specified field MySQL returns the field length 21 (as for LargeInt), therefore converting into TIntegerField is not executed.

Post Reply