Permalink
Browse files

Support dropping databases with leading space. Closes #427.

  • Loading branch information...
ansgarbecker committed Dec 4, 2018
1 parent 573055e commit 6f4eac6eeb60835bf85382b5844b1e83819369eb
Showing with 5 additions and 4 deletions.
  1. +5 −4 source/main.pas
@@ -3213,12 +3213,13 @@ procedure TMainForm.actDropObjectsExecute(Sender: TObject);
if DBTreeClicked(Sender) then begin
// drop table selected in tree view.
case ActiveDBObj.NodeType of
DBObject := ActiveDBObj;
case DBObject.NodeType of
lntDb: begin
if MessageDialog(f_('Drop Database "%s"?', [Conn.Database]), f_('WARNING: You will lose all objects in database %s!', [Conn.Database]), mtCriticalConfirmation, [mbok,mbcancel]) <> mrok then
if MessageDialog(f_('Drop Database "%s"?', [DBObject.Database]), f_('WARNING: You will lose all objects in database %s!', [DBObject.Database]), mtCriticalConfirmation, [mbok,mbcancel]) <> mrok then
Abort;
try
db := Conn.Database;
db := DBObject.Database;
Node := FindDBNode(DBtree, Conn, db);
SetActiveDatabase('', Conn);
Conn.Query('DROP DATABASE ' + Conn.QuoteIdent(db));
@@ -3232,7 +3233,7 @@ procedure TMainForm.actDropObjectsExecute(Sender: TObject);
end;
Exit;
end;
lntTable..lntEvent: ObjectList.Add(ActiveDbObj);
lntTable..lntEvent: ObjectList.Add(ActiveDBObj);
end;
end else begin
// Invoked from database tab

0 comments on commit 6f4eac6

Please sign in to comment.