TMyDump throws sql exception

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
vindac
Posts: 20
Joined: Tue 18 Mar 2014 16:44

TMyDump throws sql exception

Post by vindac » Tue 26 Sep 2017 16:16

Hi,
I have a program which has been dumping data with TMyDump for a long time, and recently it began giving problems.
I use a dump query like

Code: Select all

select * from table where 1
. I won't explain the reason behind why I pass a where statement to get all records, but the "where 1" used to work, and now it throws an error:

Code: Select all

#42000You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND 0=1' at line 1
If I execute the same query in a mysql cmd prompt, it runs fine showing all records.

With TMyDump, it still works when I use "

Code: Select all

select * from table where true
.
Is it possible that this was changed in a recent mydac version?
Current MyDac version: 9.0.2 (for XE3)

The problem can be reproduced with this piece of code:

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  dmp: TMyDump;
  ms: TMemoryStream;
begin
  ms := TMemoryStream.Create;
  dmp := TMyDump.Create(Nil);
        dmp.Connection := MyConnection1;
        dmp.Options.AddDrop := False; 
        dmp.Options.InsertType := itInsert;
             dmp.Objects := [];
            dmp.Objects := dmp.Objects + [doData];
            dmp.BackupToStream(ms,'select * from mytable where 1 ');//THROWS SQL EXCEPTION
            //...
end;

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TMyDump throws sql exception

Post by ViktorV » Wed 27 Sep 2017 11:28

Thank you for the information. We have reproduced the problem and it will be fixed in the next MyDAC build.

vindac
Posts: 20
Joined: Tue 18 Mar 2014 16:44

Re: TMyDump throws sql exception

Post by vindac » Mon 02 Oct 2017 07:11

Thanks!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TMyDump throws sql exception

Post by ViktorV » Tue 03 Oct 2017 06:50

Thank you for the interest in our products.
Please contact us if you have any questions about our products.

Post Reply