adem0x / txquery

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

Bug fixes in yQuery.pas #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I noticed 2 bugs in xQuery.pas
Here are the fixes.

1) in procedure TSqlAnalizer.DoGroupBy, a query without results should have no 
'Group By' results

  if ResultSet.RecordCount=0 Then
  Begin
    ResultSetHasRecords:= False;
//  ResultSet.Insert(); // changed by eLion. Queries without results should 
have no GroupBy results
  End Else
    ResultSetHasRecords:= True;

and further:

    // all but pivots are marked with negative number
    if vSortList.Count > 0 then begin // changed by eLion
      vSortList.Recno := 1;
      vSortList.SourceRecno := -vSortList.SourceRecno;
    end;

2) The patch in function TSqlAnalizer.ReplaceParams is wrong (at least for 
D2007: for D2010, this should be tested.

//  Result := List.ParseSQL(SQL, True); // Result:= 
StrPas(PChar(List.ParseSQL(SQL, True))); {patched by ccy} <- wrong patch
//  above patch would replace parameter condition like ':ElementNr' by 
'1'#0'mentNr' which is wrong: it should be '1'
    Result:= PWideChar(List.ParseSQL(SQL, True)); // changed by eLion

Hope this will help.

eLion

Original issue reported on code.google.com by lion.emm...@gmail.com on 5 Aug 2010 at 6:55

Attachments: