42 |
|
unit IBServices; |
43 |
|
|
44 |
|
{$Mode Delphi} |
45 |
+ |
{$IF FPC_FULLVERSION >= 20700 } |
46 |
+ |
{$codepage UTF8} |
47 |
+ |
{$ENDIF} |
48 |
|
|
49 |
|
interface |
50 |
|
|
140 |
|
|
141 |
|
protected |
142 |
|
procedure Loaded; override; |
143 |
< |
function Login: Boolean; |
143 |
> |
function Login(var aServerName: string): Boolean; |
144 |
|
procedure CheckActive; |
145 |
|
procedure CheckInactive; |
146 |
|
procedure HandleException(Sender: TObject); |
317 |
|
published |
318 |
|
end; |
319 |
|
|
320 |
< |
TStatOption = (DataPages, DbLog, HeaderPages, IndexPages, SystemRelations); |
320 |
> |
TStatOption = (DataPages, {DbLog,} HeaderPages, IndexPages, SystemRelations); |
321 |
|
TStatOptions = set of TStatOption; |
322 |
|
|
323 |
|
TIBStatisticalService = class(TIBControlAndQueryService) |
524 |
|
var |
525 |
|
SPB: String; |
526 |
|
ConnectString: String; |
527 |
+ |
aServerName: string; |
528 |
|
begin |
529 |
|
CheckInactive; |
530 |
|
CheckServerName; |
531 |
|
|
532 |
< |
if FLoginPrompt and not Login then |
532 |
> |
aServerName := FServerName; |
533 |
> |
if FLoginPrompt and not Login(aServerName) then |
534 |
|
IBError(ibxeOperationCancelled, [nil]); |
535 |
|
|
536 |
|
{ Generate a new SPB if necessary } |
542 |
|
Move(SPB[1], FSPB[0], FSPBLength); |
543 |
|
end; |
544 |
|
case FProtocol of |
545 |
< |
TCP: ConnectString := FServerName + ':service_mgr'; {do not localize} |
546 |
< |
SPX: ConnectString := FServerName + '@service_mgr'; {do not localize} |
547 |
< |
NamedPipe: ConnectString := '\\' + FServerName + '\service_mgr'; {do not localize} |
545 |
> |
TCP: ConnectString := aServerName + ':service_mgr'; {do not localize} |
546 |
> |
SPX: ConnectString := aServerName + '@service_mgr'; {do not localize} |
547 |
> |
NamedPipe: ConnectString := '\\' + aServerName + '\service_mgr'; {do not localize} |
548 |
|
Local: ConnectString := 'service_mgr'; {do not localize} |
549 |
|
end; |
550 |
|
if call(isc_service_attach(StatusVector, Length(ConnectString), |
575 |
|
end; |
576 |
|
end; |
577 |
|
|
578 |
< |
function TIBCustomService.Login: Boolean; |
578 |
> |
function TIBCustomService.Login(var aServerName: string): Boolean; |
579 |
|
var |
580 |
|
IndexOfUser, IndexOfPassword: Integer; |
581 |
|
Username, Password: String; |
588 |
|
LoginParams.Assign(Params); |
589 |
|
FOnLogin(Self, LoginParams); |
590 |
|
Params.Assign (LoginParams); |
591 |
+ |
aServerName := ServerName; |
592 |
|
finally |
593 |
|
LoginParams.Free; |
594 |
|
end; |
606 |
|
Password := Copy(Params[IndexOfPassword], |
607 |
|
Pos('=', Params[IndexOfPassword]) + 1, {mbcs ok} |
608 |
|
Length(Params[IndexOfPassword])); |
609 |
< |
result := IBGUIInterface.ServerLoginDialog(serverName, Username, Password); |
609 |
> |
result := IBGUIInterface.ServerLoginDialog(aServerName, Username, Password); |
610 |
|
if result then |
611 |
|
begin |
612 |
|
IndexOfPassword := IndexOfSPBConst(SPBConstantNames[isc_spb_password]); |
1415 |
|
param := 0; |
1416 |
|
if (DataPages in Options) then |
1417 |
|
param := param or isc_spb_sts_data_pages; |
1418 |
< |
if (DbLog in Options) then |
1419 |
< |
param := param or isc_spb_sts_db_log; |
1418 |
> |
{ if (DbLog in Options) then |
1419 |
> |
param := param or isc_spb_sts_db_log; -- removed from Firebird 2} |
1420 |
|
if (HeaderPages in Options) then |
1421 |
|
param := param or isc_spb_sts_hdr_pages; |
1422 |
|
if (IndexPages in Options) then |
1528 |
|
if (Trim(FBackupFile[i]) = '') then continue; |
1529 |
|
if (Pos('=', FBackupFile[i]) <> 0) then {mbcs ok} |
1530 |
|
begin |
1531 |
< |
ServiceStartAddParam(FBackupFile.Names[i], isc_spb_bkp_file); |
1531 |
> |
ServiceStartAddParam(AnsiUpperCase(FBackupFile.Names[i]), isc_spb_bkp_file); |
1532 |
|
value := Copy(FBackupFile[i], Pos('=', FBackupFile[i]) + 1, Length(FBackupFile.Names[i])); {mbcs ok} |
1533 |
|
param := StrToInt(value); |
1534 |
|
ServiceStartAddParam(param, isc_spb_bkp_length); |