Unidac 7.4.12 Delphi XE2 MySQL Problem
Unidac 7.4.12 Delphi XE2 MySQL Problem
Hello ,
Our application is running on oracle 12c and MariaDB 5.5
Oracle is everything seems ok with charset euckr
but there are some problem on MariaDB.
I Attached sample project , including table creation.
Thank you in advance.
http://wbjsoft.com/down/UnidacEucKRError.zip
Our application is running on oracle 12c and MariaDB 5.5
Oracle is everything seems ok with charset euckr
but there are some problem on MariaDB.
I Attached sample project , including table creation.
Thank you in advance.
http://wbjsoft.com/down/UnidacEucKRError.zip
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
To solve the issue, please try to set the property UniConnection.SpecificOptions.Values['UseUnicode'] in True:
Code: Select all
UniConnection.SpecificOptions.Values['UseUnicode'] := 'True';
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
I cannot use that option Because of compatibility.
my customers use ansi DB.
please fix it. that is bug.
my customers use ansi DB.
please fix it. that is bug.
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
Your example does not demonstrate the issue. It contains only the script for table creation and lacks scripts for its population. Also, run of your example without modifications throws the 'Field BLOB not found' error.
In order for us to be able to give you a detailed answer please provide more detailed and clear description of the issue: what issues you face, what errors you get, exact steps to reproduce the issue. Also, please compose a full sample demonstrating the described behavior and send it to us.
In order for us to be able to give you a detailed answer please provide more detailed and clear description of the issue: what issues you face, what errors you get, exact steps to reproduce the issue. Also, please compose a full sample demonstrating the described behavior and send it to us.
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
0.Adjust Connection Infomation
1.Create Table Button -> Will Create Sample Table
2.Select Error Button -> Will demonstrate sql parse error.
3.Blob Error Button -> and choose a image file , and will demonstrate Blob error.
I will attach source.
procedure TForm2.Button1Click(Sender: TObject);
begin
cdsMariaEuckr.CommandText := 'CREATE TABLE `testtb` ( `COL1` VARCHAR(50) NULL, `PIC1` BLOB NULL ) COLLATE=''euckr_korean_ci'' ENGINE=InnoDB; ';
cdsMariaEuckr.Execute;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
cdsMariaEuckr.Close;
cdsMariaEucKr.CommandText := 'select * from testtb where COL1 = :COL1 and COL1 = ''접속'' ';
cdsMariaEucKr.Params.ParamByName('COL1').AsString := 'COL1';
cdsMariaEuckr.Open;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
if OpenDialog1.Execute then // BMP Load
begin
cdsMariaEuckr.CommandText := 'insert into testtb (COL1,PIC1) values (:COL1,:PIC1) ';
cdsMariaEuckr.Params.ParamByName('COL1').AsString := 'COL1';
cdsMariaEuckr.Params.ParamByName('PIC1').LoadFromFile(OpenDialog1.FileName,ftBlob);
cdsMariaEuckr.Execute;
end;
end;
object Button1: TButton
Left = 24
Top = 8
Width = 369
Height = 25
Caption = '1. Create Table'
TabOrder = 0
OnClick = Button1Click
end
object Button2: TButton
Left = 24
Top = 39
Width = 369
Height = 25
Caption = '2.Select Error'
TabOrder = 1
OnClick = Button2Click
end
object Button3: TButton
Left = 24
Top = 70
Width = 369
Height = 25
Caption = '3.Blob Error'
TabOrder = 2
OnClick = Button3Click
end
object UniCon_MariaDB_euckr: TUniConnection
ProviderName = 'MySQL'
Database = 'testdb'
SpecificOptions.Strings = (
'MySQL.Charset=euckr')
Username = 'root'
Server = 'localhost'
LoginPrompt = False
Left = 64
Top = 112
EncryptedPassword = '8DFF90FF90FF8BFF'
end
object quMariaEucKR: TUniQuery
Connection = UniCon_MariaDB_euckr
SQL.Strings = (
'select * from testtb')
Left = 176
Top = 120
end
object dspMariaEucKR: TDataSetProvider
DataSet = quMariaEucKR
Options = [poPropogateChanges, poAllowCommandText]
UpdateMode = upWhereKeyOnly
Left = 280
Top = 120
end
object cdsMariaEuckr: TClientDataSet
Aggregates = <>
CommandText = 'select * from testtb'
FieldDefs = <
item
Name = 'COL1'
DataType = ftString
Size = 100
end
item
Name = 'BLOB'
DataType = ftBlob
end>
IndexDefs = <>
PacketRecords = 1
Params = <>
ProviderName = 'dspMariaEucKR'
StoreDefs = True
Left = 376
Top = 120
object cdsMariaEuckrCOL1: TStringField
FieldName = 'COL1'
Size = 100
end
object cdsMariaEuckrBLOB: TBlobField
FieldName = 'BLOB'
end
end
object MySQLUniProvider1: TMySQLUniProvider
Left = 456
Top = 208
end
object OpenDialog1: TOpenDialog
Left = 448
Top = 56
end
1.Create Table Button -> Will Create Sample Table
2.Select Error Button -> Will demonstrate sql parse error.
3.Blob Error Button -> and choose a image file , and will demonstrate Blob error.
I will attach source.
procedure TForm2.Button1Click(Sender: TObject);
begin
cdsMariaEuckr.CommandText := 'CREATE TABLE `testtb` ( `COL1` VARCHAR(50) NULL, `PIC1` BLOB NULL ) COLLATE=''euckr_korean_ci'' ENGINE=InnoDB; ';
cdsMariaEuckr.Execute;
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
cdsMariaEuckr.Close;
cdsMariaEucKr.CommandText := 'select * from testtb where COL1 = :COL1 and COL1 = ''접속'' ';
cdsMariaEucKr.Params.ParamByName('COL1').AsString := 'COL1';
cdsMariaEuckr.Open;
end;
procedure TForm2.Button3Click(Sender: TObject);
begin
if OpenDialog1.Execute then // BMP Load
begin
cdsMariaEuckr.CommandText := 'insert into testtb (COL1,PIC1) values (:COL1,:PIC1) ';
cdsMariaEuckr.Params.ParamByName('COL1').AsString := 'COL1';
cdsMariaEuckr.Params.ParamByName('PIC1').LoadFromFile(OpenDialog1.FileName,ftBlob);
cdsMariaEuckr.Execute;
end;
end;
object Button1: TButton
Left = 24
Top = 8
Width = 369
Height = 25
Caption = '1. Create Table'
TabOrder = 0
OnClick = Button1Click
end
object Button2: TButton
Left = 24
Top = 39
Width = 369
Height = 25
Caption = '2.Select Error'
TabOrder = 1
OnClick = Button2Click
end
object Button3: TButton
Left = 24
Top = 70
Width = 369
Height = 25
Caption = '3.Blob Error'
TabOrder = 2
OnClick = Button3Click
end
object UniCon_MariaDB_euckr: TUniConnection
ProviderName = 'MySQL'
Database = 'testdb'
SpecificOptions.Strings = (
'MySQL.Charset=euckr')
Username = 'root'
Server = 'localhost'
LoginPrompt = False
Left = 64
Top = 112
EncryptedPassword = '8DFF90FF90FF8BFF'
end
object quMariaEucKR: TUniQuery
Connection = UniCon_MariaDB_euckr
SQL.Strings = (
'select * from testtb')
Left = 176
Top = 120
end
object dspMariaEucKR: TDataSetProvider
DataSet = quMariaEucKR
Options = [poPropogateChanges, poAllowCommandText]
UpdateMode = upWhereKeyOnly
Left = 280
Top = 120
end
object cdsMariaEuckr: TClientDataSet
Aggregates = <>
CommandText = 'select * from testtb'
FieldDefs = <
item
Name = 'COL1'
DataType = ftString
Size = 100
end
item
Name = 'BLOB'
DataType = ftBlob
end>
IndexDefs = <>
PacketRecords = 1
Params = <>
ProviderName = 'dspMariaEucKR'
StoreDefs = True
Left = 376
Top = 120
object cdsMariaEuckrCOL1: TStringField
FieldName = 'COL1'
Size = 100
end
object cdsMariaEuckrBLOB: TBlobField
FieldName = 'BLOB'
end
end
object MySQLUniProvider1: TMySQLUniProvider
Left = 456
Top = 208
end
object OpenDialog1: TOpenDialog
Left = 448
Top = 56
end
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
Thank you for the information. We will investigate this MyDAC behavior and let you know the result.
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
Hello,
I wonder when I get your fix?
I wonder when I get your fix?
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
We will set high-priority status to your question and inform you as soon as any results are available, but we can't tell any timeframe at the moment.
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
I Found bug.
procedure TMySQLCommand.PlaceParamValues(SQL: AnsiStringBuilder);
SQL.Append(AnsiString(FSQL), Prev - 1, Length(FSQL) - Prev + 1);
=>
SQL.Append(AnsiString(FSQL), Prev - 1, Length(AnsiString(FSQL)) - Prev + 1); // wbj modified
BLOB bug
function TMySQLConnection.EscapeAndQuoteStr(const p: PAnsiChar; Len: integer): AnsiString;
IsEuckr := FUsedCharset = 'euckr';
=>
IsEuckr := False; // FUsedCharset = 'euckr'; -- WBJ Modified 2014-12-14
procedure TMySQLCommand.PlaceParamValues(SQL: AnsiStringBuilder);
SQL.Append(AnsiString(FSQL), Prev - 1, Length(FSQL) - Prev + 1);
=>
SQL.Append(AnsiString(FSQL), Prev - 1, Length(AnsiString(FSQL)) - Prev + 1); // wbj modified
BLOB bug
function TMySQLConnection.EscapeAndQuoteStr(const p: PAnsiChar; Len: integer): AnsiString;
IsEuckr := FUsedCharset = 'euckr';
=>
IsEuckr := False; // FUsedCharset = 'euckr'; -- WBJ Modified 2014-12-14
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
I have mistake... above solution is not perfect.
anyway PlaceParamValues procedure has bug.
anyway PlaceParamValues procedure has bug.
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
We have already fixed this issue.
We can send you MyDAC night build including the fix. Please send your license number and IDE version to us using the contact form https://devart.com/company/contactform.html and we will send you night build.
We can send you MyDAC night build including the fix. Please send your license number and IDE version to us using the contact form https://devart.com/company/contactform.html and we will send you night build.
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
Thank you!
I just have posted contact form and i will wait.
I just have posted contact form and i will wait.
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
We have answered you via e-mail.
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
I have installed your night build.
BLOB problem is fixed! OK. Thank you.
Param parse problem is fixed. but I found another case.
select COL1 '컬럼1',PIC1 from testeuckr.testtb where COL1 = :COL1 and COL1 = '접속'
when SQL contains field alias , #42000 syntax error occured.
I will wait your night build. thank you.
BLOB problem is fixed! OK. Thank you.
Param parse problem is fixed. but I found another case.
select COL1 '컬럼1',PIC1 from testeuckr.testtb where COL1 = :COL1 and COL1 = '접속'
when SQL contains field alias , #42000 syntax error occured.
I will wait your night build. thank you.
Re: Unidac 7.4.12 Delphi XE2 MySQL Problem
Thank you for the information. We will investigate this MyDAC behavior and let you know the result.