MyDAC bug when Executing query with QueryCount=True and query containing limit

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
GuzunNicolae
Posts: 78
Joined: Wed 17 Jan 2007 14:16

MyDAC bug when Executing query with QueryCount=True and query containing limit

Post by GuzunNicolae » Thu 14 Feb 2008 12:35

Hello I guess I've spotted a bug in MyDAC

It appears when you want to execute a query with QueryRecCount = True and within the query you have a 'LIMIT :start, :length'

If you have a 'LIMIT :length' only it will work. It does not work only with 'LIMIT :start, :length'

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

Post by Dimon » Tue 19 Feb 2008 13:21

You can not get record count for SELECT query with LIMIT clause. You can get only the maximum number of records to return from arguments of LIMIT clause.

GuzunNicolae
Posts: 78
Joined: Wed 17 Jan 2007 14:16

Post by GuzunNicolae » Tue 19 Feb 2008 13:34

The idea is that I cannot get anything :)

It gives an error when I run a query with limit clause. "Could not convert a variant of type (NULL) into type (Integer)

If I issue a query with 'LIMIT :length' it works properly. While if I issue one with 'LIMIT :start, :length' it gives me the error above.

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

Post by Dimon » Thu 21 Feb 2008 12:28

When QueryRecCount = True a query with 'LIMIT:length' does not cause error, but the RecordCount property for this query will be set incorrect, because it is impossible to get record count for SELECT query with LIMIT clause before executing the query.
We will fix this behavior in the nearest future, so that the query with 'LIMIT :start, :length' will not provoke error, but you won’t be able to get record count.

GuzunNicolae
Posts: 78
Joined: Wed 17 Jan 2007 14:16

Post by GuzunNicolae » Thu 21 Feb 2008 15:18

Well I guess the RecordCount will be available after I run the query.

Any idea when I will be able to get the new release? Since I am having the application with the bug at the customer.

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

Post by Dimon » Fri 22 Feb 2008 14:23

We will fix this problem in the next MyDAC build.

Post Reply