mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 20:00:16 +08:00
Fix 3 compiler warnings
This commit is contained in:
@ -465,7 +465,7 @@ type
|
||||
function IsNull(Column: String): Boolean; overload;
|
||||
function HasResult: Boolean; virtual; abstract;
|
||||
procedure CheckEditable;
|
||||
function DeleteRow: Boolean;
|
||||
procedure DeleteRow;
|
||||
function InsertRow: Cardinal;
|
||||
procedure SetCol(Column: Integer; NewText: String; Null: Boolean);
|
||||
function EnsureFullRow: Boolean;
|
||||
@ -2682,6 +2682,7 @@ begin
|
||||
if Assigned(ForeignKeys) then ForeignKeys.Clear;
|
||||
if CreateTable = '' then
|
||||
Exit;
|
||||
Collations := CollationTable;
|
||||
rx := TRegExpr.Create;
|
||||
rx.ModifierS := False;
|
||||
rx.ModifierM := True;
|
||||
@ -2764,8 +2765,6 @@ begin
|
||||
Delete(ColSpec, 1, rxCol.MatchLen[0]);
|
||||
end;
|
||||
if Col.Collation = '' then begin
|
||||
if not Assigned(Collations) then
|
||||
Collations := CollationTable;
|
||||
if Assigned(Collations) then begin
|
||||
Collations.First;
|
||||
while not Collations.Eof do begin
|
||||
@ -3771,7 +3770,7 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function TDBQuery.DeleteRow: Boolean;
|
||||
procedure TDBQuery.DeleteRow;
|
||||
var
|
||||
sql: String;
|
||||
IsVirtual: Boolean;
|
||||
@ -3782,17 +3781,14 @@ begin
|
||||
if not IsVirtual then begin
|
||||
sql := Connection.ApplyLimitClause('DELETE', 'FROM ' + QuotedDbAndTableName + ' WHERE ' + GetWhereClause, 1, 0);
|
||||
Connection.Query(sql);
|
||||
if Connection.RowsAffected = 0 then begin
|
||||
if Connection.RowsAffected = 0 then
|
||||
raise EDatabaseError.Create(FormatNumber(Connection.RowsAffected)+' rows deleted when that should have been 1.');
|
||||
Result := False;
|
||||
end;
|
||||
end;
|
||||
if Assigned(FCurrentUpdateRow) then begin
|
||||
FUpdateData.Remove(FCurrentUpdateRow);
|
||||
FCurrentUpdateRow := nil;
|
||||
FRecNo := -1;
|
||||
end;
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -2683,7 +2683,6 @@ var
|
||||
SQL: String;
|
||||
i, BatchStartOffset, ResultCount: Integer;
|
||||
PacketSize, MaxAllowedPacket: Int64;
|
||||
QueryResult: TDBQuery;
|
||||
DoStoreResult, ErrorAborted: Boolean;
|
||||
begin
|
||||
inherited;
|
||||
|
@ -3009,12 +3009,11 @@ begin
|
||||
RowNum := Grid.GetNodeData(Node);
|
||||
ShowStatusMsg('Deleting row #'+FormatNumber(ProgressBarStatus.Position+1)+' of '+FormatNumber(ProgressBarStatus.Max)+' ...');
|
||||
Results.RecNo := RowNum^;
|
||||
if Results.DeleteRow then begin
|
||||
Results.DeleteRow;
|
||||
ProgressStep;
|
||||
SetLength(Nodes, Length(Nodes)+1);
|
||||
Nodes[Length(Nodes)-1] := Node;
|
||||
FocusAfterDelete := Node;
|
||||
end;
|
||||
Node := GetNextNode(Grid, Node, True);
|
||||
end;
|
||||
ShowStatusMsg('Clean up ...');
|
||||
@ -6804,6 +6803,7 @@ var
|
||||
begin
|
||||
// Set wanted main tab and call SetMainTab later, when all lists have been invalidated
|
||||
MainTabToActivate := nil;
|
||||
PrevDBObj := nil;
|
||||
|
||||
if Assigned(Node) then begin
|
||||
LogSQL('DBtreeFocusChanged, Node level: '+IntToStr(Sender.GetNodeLevel(Node))+', FTreeRefreshInProgress: '+IntToStr(Integer(FTreeRefreshInProgress)), lcDebug);
|
||||
|
Reference in New Issue
Block a user