Skip to content

Commit aa0f350

Browse files
committed
feat: Use fully qualified table name in "Select Top x rows" action when a click on it is combined with Shift
https://www.heidisql.com/forum.php?t=45359
1 parent 2508516 commit aa0f350

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎source/main.pas‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5134,6 +5134,7 @@ procedure TMainForm.actQueryTableExecute(Sender: TObject);
51345134
Obj: TDBObject;
51355135
Tab: TQueryTab;
51365136
Conn: TDBConnection;
5137+
TableName: String;
51375138
begin
51385139
// Query table data
51395140
Conn := ActiveConnection;
@@ -5146,7 +5147,11 @@ procedure TMainForm.actQueryTableExecute(Sender: TObject);
51465147

51475148
for Obj in Objects do begin
51485149
Tab := GetOrCreateEmptyQueryTab(True);
5149-
Tab.Memo.Text := Conn.ApplyLimitClause('SELECT', '* FROM '+Obj.QuotedName, AppSettings.ReadInt(asDatagridRowsPerStep), 0);
5150+
if KeyPressed(VK_SHIFT) then
5151+
TableName := Obj.QuotedDbAndTableName
5152+
else
5153+
TableName := Obj.QuotedName;
5154+
Tab.Memo.Text := Conn.ApplyLimitClause('SELECT', '* FROM '+TableName, AppSettings.ReadInt(asDatagridRowsPerStep), 0);
51505155
SetTabCaption(Tab.TabSheet.TabIndex, Obj.Name);
51515156
actExecuteQueryExecute(Sender);
51525157
end;

0 commit comments

Comments
 (0)