Script ExecuteStream and UseUnicode?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Script ExecuteStream and UseUnicode?

Post by upscene » Mon 18 May 2015 08:59

Hi,

When using ExecuteStream on the script component, what Encoding should the stream use and does it require a "preamble" if UseUnicode on the Connection is set to True?

And what about other character sets?

What Encoding does using the Execute method use when executing the script in the SQL property of the script component?

Example:

Code: Select all

  s := TStringStream.Create(Memo1.Text, TEncoding.UTF8);
  s := TFileStream.Create('C:\Users\Martijn\Documents\Database Workbench 5 Pro\scripttest_utf8.sql', fmOpenRead);
  try
    MyScript1.ExecuteStream(s);
  finally
    s.Free;
  end;
Using the stringstream works, using the file to open a UTF8 encoded file, including "preamble" fails. Using Unicode as the encoding on the string stream fails with: "
Parser: The unknown symbol ' "

Any clue? Using MyDAC 8.5.14 Delphi 2009.

With regards,

Martijn Tonies

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

Re: Script ExecuteStream and UseUnicode?

Post by ViktorV » Tue 19 May 2015 09:57

Thank you for the information. We are investigating this behavior of MyDAC, and we will inform you about the results.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: Script ExecuteStream and UseUnicode?

Post by upscene » Tue 26 May 2015 10:26

Any news yet?

with regards,

Martijn

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

Re: Script ExecuteStream and UseUnicode?

Post by ViktorV » Tue 26 May 2015 14:01

We continue the problem investigation and we'll inform you as soon as we get any results.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: Script ExecuteStream and UseUnicode?

Post by upscene » Mon 08 Jun 2015 07:45

Have you been able to reproduce this issue?

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

Re: Script ExecuteStream and UseUnicode?

Post by ViktorV » Fri 12 Jun 2015 13:27

The fix for TMyScript functioning when working with UTF8 files will be included in the next MyDAC build.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: Script ExecuteStream and UseUnicode?

Post by upscene » Fri 12 Jun 2015 13:34

And other streams, I hope, as long as they have a "preamble" available?

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

Re: Script ExecuteStream and UseUnicode?

Post by ViktorV » Mon 15 Jun 2015 14:04

Are you asking whether any "preamble" will be used on file loading? If yes, then what other "preambles" do you mean?

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: Script ExecuteStream and UseUnicode?

Post by upscene » Wed 17 Jun 2015 15:08

I meant, is the updated version able to use any type of stream and read it properly, as long as the stream contains the "preamble sequence of bytes" that described the type of data is provides in the stream?

I'm asking, cause I noticed differences in using TStringStream and TFileStream.

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

Re: Script ExecuteStream and UseUnicode?

Post by ViktorV » Thu 18 Jun 2015 12:14

Yes, you are right. MyDAC takes preamble into account on script execution from a thread independently on the class type: TFileStream or TStringSream.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: Script ExecuteStream and UseUnicode?

Post by upscene » Mon 22 Jun 2015 13:44

Any release date set yet?

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

Re: Script ExecuteStream and UseUnicode?

Post by ViktorV » Tue 23 Jun 2015 08:30

The new MyDAC build with a fix for TMyScript functioning when working with UTF8 files are available for download now.

upscene
Posts: 306
Joined: Thu 19 Oct 2006 08:13

Re: Script ExecuteStream and UseUnicode?

Post by upscene » Tue 23 Jun 2015 08:33

Excellent, thank you.

Post Reply