1 |
< |
unit Test13; |
1 |
> |
unit Test13; |
2 |
> |
{$IFDEF MSWINDOWS} |
3 |
> |
{$DEFINE WINDOWS} |
4 |
> |
{$ENDIF} |
5 |
|
|
6 |
< |
{$mode objfpc}{$H+} |
6 |
> |
{$IFDEF FPC} |
7 |
> |
{$mode delphi} |
8 |
|
{$codepage UTF8} |
9 |
+ |
{$ENDIF} |
10 |
|
|
11 |
|
{Test 13: Tranasction over two databases} |
12 |
|
|
33 |
|
procedure ModifyDatabase1(Attachment: IAttachment; Transaction: ITransaction); |
34 |
|
procedure ModifyDatabase2(Attachment: IAttachment; Transaction: ITransaction); |
35 |
|
public |
36 |
< |
function TestTitle: string; override; |
37 |
< |
procedure RunTest(CharSet: string; SQLDialect: integer); override; |
36 |
> |
function TestTitle: AnsiString; override; |
37 |
> |
procedure RunTest(CharSet: AnsiString; SQLDialect: integer); override; |
38 |
|
end; |
39 |
|
|
40 |
|
implementation |
47 |
|
'Notes VarChar(64) Character Set ISO8859_1,'+ |
48 |
|
'BlobData Blob sub_type 1 Character Set WIN1252, '+ |
49 |
|
'BlobData2 Blob sub_type 1 Character Set UTF8, '+ |
50 |
< |
'InClear VarChar(16) Character Set NONE, '+ |
50 |
> |
'InClear VarChar(16) Character Set OCTETS, '+ |
51 |
|
'Primary Key(RowID)'+ |
52 |
|
')'; |
53 |
|
|
67 |
|
with Statement.GetSQLParams do |
68 |
|
begin |
69 |
|
ByName('rowid').AsInteger := 1; |
70 |
+ |
{$IFDEF DCC} |
71 |
+ |
ByName('title').AsString := UTF8Encode('Blob Test ©€'); |
72 |
+ |
ByName('Notes').AsString := UTF8Encode('Écoute moi'); |
73 |
+ |
{$ELSE} |
74 |
|
ByName('title').AsString := 'Blob Test ©€'; |
75 |
|
ByName('Notes').AsString := 'Écoute moi'; |
76 |
+ |
{$ENDIF} |
77 |
|
ByName('BlobData').AsString := 'Some German Special Characters like ÖÄÜöäüß'; |
78 |
|
ByName('BlobData2').AsBlob := Attachment.CreateBlob(Transaction,'TestData','BlobData').SetString('Some German Special Characters like ÖÄÜöäüß'); |
79 |
|
ByName('InClear').AsString := #$01'Test'#$0D#$C3; |
107 |
|
Statement.Execute; |
108 |
|
end; |
109 |
|
|
110 |
< |
function TTest13.TestTitle: string; |
110 |
> |
function TTest13.TestTitle: AnsiString; |
111 |
|
begin |
112 |
|
Result := 'Test 13: Transaction over two databases'; |
113 |
|
end; |
114 |
|
|
115 |
< |
procedure TTest13.RunTest(CharSet: string; SQLDialect: integer); |
115 |
> |
procedure TTest13.RunTest(CharSet: AnsiString; SQLDialect: integer); |
116 |
|
var DPB: IDPB; |
117 |
|
Attachment, Attachment2: IAttachment; |
118 |
|
Transaction: ITransaction; |