Different index order between MyDAC (on Windows) and MySQL
Posted: Wed 06 Jun 2012 08:17
Hello,
Here is the code to reproduce the issue:
Regards.
Here is the code to reproduce the issue:
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
Query.SQL.Text := 'SELECT * FROM (' +
'(SELECT 1 AS Field1, "AAA" AS Field2) UNION ' +
'(SELECT 2, "AAA-BBB") UNION ' +
'(SELECT 3, "aaaBBB") UNION ' +
'(SELECT 4, "aaa BBB")) t ' +
'&OrderByClause';
Query.MacroByName('OrderByClause').Value := 'ORDER BY Field2';
Query.IndexFieldNames := '';
Query.Open;
MessageDlg('Ordered by MySQL', mtInformation, [mbOK], 0);
Query.MacroByName('OrderByClause').Value := '';
Query.IndexFieldNames := 'Field2 CIS';
Query.Open;
MessageDlg('Ordered by MyDAC', mtInformation, [mbOK], 0);
end;