One suggestion and one bug. Uniconnection

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kaffeburk
Posts: 214
Joined: Mon 29 Jan 2007 08:03

One suggestion and one bug. Uniconnection

Post by kaffeburk » Sat 06 Jun 2020 06:32

Hello,

(1) Suggestion (regarding MySql)

If Unicon / Options / UseUnicode is True and DataTypeMapping translates varchar intoto String, the unicode will get lost. According to Embarcardero String is an alias for "UnicodeString" so we have a UnicodeString that can't handle Unicode. WideString is "Intended for COM interop". To get Unicode, DataTypeMapping must translate Varchar to Widestring or not be set so it defaults to WideString.

Suggestion. If UseUnicode is True then both Widestring and String should get Unicode depending on the DataTypeMapping .

(2) Bug assignconnect

When using assignconnect with DataTypeMapping there are a few bugs. The Assigned connection will not use the "new masters" DataTypeMapping . It will either use no DataTypeMapping if it newer was opended before assignconnect. If it previous was opended it will use its own DataTypeMapping after a connect to another Unicon regardless of a assignconnect(Nil) was done or not.

Here is a simple project that demonstates this. I did it with Secirebridge, but it will fail regardless of using an IO component to a SHH client or a direct connect. If You like the simple way to send a SSH Private key in a tMemo you are welcome to use and change the little workbench. Maybe convenient if another user want to send another case to you involving SecureBridege SSH?

Regards, Pär

https://www.dropbox.com/s/awdfe2nvm225z ... n.rar?dl=0

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

Re: One suggestion and one bug. Uniconnection

Post by ViktorV » Fri 19 Jun 2020 15:03

1. You can see the implementation of the function method TStringField.GetValue (var Value: AnsiString): Boolean; in the module Data.DB.pas. as you can see Value is of type AnsiString. If you want TStringField to return a unicode string, then you should contact Embarcadero technical support with such a proposal.
2. Using your example, unfortunately it was not possible to reproduce the problem with DataTypeMapping, could you send an example through the contact form (https://devart.com/company/contactform.html), along with the script for creating database objects that will more accurately reproduce the problem you described.

Post Reply