Page 1 of 1
MyDAC bug when Executing query with QueryCount=True and query containing limit
Posted: Thu 14 Feb 2008 12:35
by GuzunNicolae
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'
Posted: Tue 19 Feb 2008 13:21
by Dimon
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.
Posted: Tue 19 Feb 2008 13:34
by GuzunNicolae
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.
Posted: Thu 21 Feb 2008 12:28
by Dimon
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.
Posted: Thu 21 Feb 2008 15:18
by GuzunNicolae
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.
Posted: Fri 22 Feb 2008 14:23
by Dimon
We will fix this problem in the next MyDAC build.