nakijun / txquery

Automatically exported from code.google.com/p/txquery
Other
0 stars 0 forks source link

Recno Out of Range #35

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When a Txquery has a null value (or potentially an empty string too) in one of 
the transform or group by fields, it breaks with the error Recno Out of Range. 

Experienced Delphi 2007 using TxQuery 2.0 and 2.7.7

Original issue reported on code.google.com by adzad...@gmail.com on 23 Oct 2012 at 4:10

GoogleCodeExporter commented 9 years ago
Looking into this a little further, it would appear as though the script is 
assigning incorrect data. (This can also occur on non-null values). 

The Callstack for this error is
TCustomQuery.InternalOpen
TSqlAnalizer.DoSelect
TSqlAnalizer.SafeCreateResultSet
TSqlAnalizer.CreateResultSet
TSqlAnalizer.DoOrderBy
xqbase.TxqSortList.Sort
xqbase.QuickSort

I have found that in quicksort, In the following Code: 

      Case DataType Of
        ttString: s1 := FFields[Idx].AsString;

FFields[Idx].asstring returns an incorrect / corrupted value. It is the actual 
data, but then with additional charactersets hung on the end of it. 

As such, when SortCompare is executed, it never finds that same value (as it's 
looking for a value that does not exists), goes past the record count using the 
increments, and then raises the error. 

I am unable to find out why ffields[idx] is returning a bad result at this 
point. It appears to happen in very isolated instances, and simply changing 
that field by one value seems to resolve the issue. 

Original comment by adzad...@gmail.com on 23 Oct 2012 at 6:16

GoogleCodeExporter commented 9 years ago
Hi Could you please check issue #39, i have posted updated sources of TXQuery. 
As long as I remember  that issue was fixed in my sources long time ago.

Original comment by fdue...@gmail.com on 14 Apr 2013 at 11:12