76 |
|
public |
77 |
|
constructor Create(aOwner: TComponent); override; |
78 |
|
procedure Assign(Source: TPersistent); override; |
79 |
< |
procedure DataOut(SelectQuery: string; Add2Log: TAdd2Log); |
79 |
> |
function DataOut(SelectQuery: string; Add2Log: TAdd2Log): boolean; |
80 |
|
procedure SetCommand(command, aValue, stmt: string; var Done: boolean); virtual; |
81 |
|
class procedure ShowPerfStats(Statement: IStatement; Add2Log: TAdd2Log); |
82 |
|
published |
369 |
|
if ar = nil then |
370 |
|
s += 'NULL' |
371 |
|
else |
372 |
< |
s += TIBXMLProcessor.FormatArray(ar); |
372 |
> |
s += TIBXMLProcessor.FormatArray(Database,ar); |
373 |
|
end; |
374 |
|
|
375 |
|
SQL_TEXT, SQL_VARYING: |
504 |
|
end; |
505 |
|
end; |
506 |
|
|
507 |
< |
procedure TIBCustomDataOutput.DataOut(SelectQuery: string; Add2Log: TAdd2Log); |
507 |
> |
function TIBCustomDataOutput.DataOut(SelectQuery: string; Add2Log: TAdd2Log |
508 |
> |
): boolean; |
509 |
|
var Count: integer; |
510 |
|
begin |
511 |
|
FIBSQL.SQL.Text := SelectQuery; |
516 |
|
if PlanOptions = poPlanOnly then |
517 |
|
Exit; |
518 |
|
|
518 |
– |
if IncludeHeader then |
519 |
– |
HeaderOut(Add2Log); |
519 |
|
Count := 0; |
520 |
|
FIBSQL.ExecQuery; |
521 |
|
try |
522 |
+ |
if IncludeHeader and not FIBSQL.EOF then |
523 |
+ |
HeaderOut(Add2Log); |
524 |
|
while (not FIBSQL.EOF) and ((FRowCount = 0) or (Count < FRowCount)) do |
525 |
|
begin |
526 |
|
FormattedDataOut(Add2Log); |
531 |
|
finally |
532 |
|
FIBSQL.Close; |
533 |
|
end; |
534 |
+ |
Result := Count > 0; |
535 |
|
end; |
536 |
|
|
537 |
|
procedure TIBCustomDataOutput.SetCommand(command, aValue, stmt: string; |
600 |
|
begin |
601 |
|
if Statement.GetPerfStatistics(stats) then |
602 |
|
begin |
603 |
< |
Add2Log(Format('Current memory = %d',[stats[psCurrentMemory]])); |
604 |
< |
Add2Log(Format('Delta memory = %d',[stats[psDeltaMemory]])); |
605 |
< |
Add2Log(Format('Max memory = %d',[stats[psMaxMemory]])); |
603 |
> |
Add2Log(Format('Current memory = %f',[stats[psCurrentMemory]])); |
604 |
> |
Add2Log(Format('Delta memory = %f',[stats[psDeltaMemory]])); |
605 |
> |
Add2Log(Format('Max memory = %f',[stats[psMaxMemory]])); |
606 |
|
Add2Log('Elapsed time= ' + FormatFloat('#0.000',stats[psRealTime]/1000) +' sec'); |
607 |
|
Add2Log('Cpu = ' + FormatFloat('#0.000',stats[psUserTime]/1000) + ' sec'); |
608 |
< |
Add2Log(Format('Buffers = %d',[stats[psBuffers]])); |
609 |
< |
Add2Log(Format('Reads = %d',[stats[psReads]])); |
610 |
< |
Add2Log(Format('Writes = %d',[stats[psWrites]])); |
611 |
< |
Add2Log(Format('Fetches = %d',[stats[psFetches]])); |
608 |
> |
Add2Log(Format('Buffers = %f',[stats[psBuffers]])); |
609 |
> |
Add2Log(Format('Reads = %f',[stats[psReads]])); |
610 |
> |
Add2Log(Format('Writes = %f',[stats[psWrites]])); |
611 |
> |
Add2Log(Format('Fetches = %f',[stats[psFetches]])); |
612 |
|
end; |
613 |
|
end; |
614 |
|
|