Skip to content

Commit

Permalink
Fixed an issue where the query is not getting executed after giving a…
Browse files Browse the repository at this point in the history
… password and connecting to the server on the not saved password server. #6502
  • Loading branch information
anilsahoo20 authored Sep 18, 2024
1 parent b0cd028 commit 38d4728
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export default function QueryToolComponent({params, pgWindow, pgAdmin, selectedN
}
};

const initializeQueryTool = (password, explainObject=null, macroSQL='', executeCursor=false)=>{
const initializeQueryTool = (password, explainObject=null, macroSQL='', executeCursor=false, reexecute=false)=>{
let selectedConn = _.find(qtState.connection_list, (c)=>c.is_selected);
let baseUrl = '';
if(qtState.params.is_query_tool) {
Expand Down Expand Up @@ -363,7 +363,8 @@ export default function QueryToolComponent({params, pgWindow, pgAdmin, selectedN
connected_once: true,
obtaining_conn: false,
});
if(!qtState.params.is_query_tool) {
//this condition works if user is in View/Edit Data or user does not saved server or tunnel password and disconnected the server and executing the query
if(!qtState.params.is_query_tool || reexecute) {
eventBus.current.fireEvent(QUERY_TOOL_EVENTS.TRIGGER_EXECUTION, explainObject, macroSQL, executeCursor);
let msg = `${selectedConn['server_name']}/${selectedConn['database_name']} - Database connected`;
pgAdmin.Browser.notifier.success(_.escape(msg));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export class ResultSetUtils {
if(e?.response?.status == 428){
this.connectServerModal(e.response?.data?.result, async (passwordData)=>{
await this.connectServer(this.queryToolCtx.params.sid, this.queryToolCtx.params.user, passwordData, async ()=>{
await this.eventBus.fireEvent(QUERY_TOOL_EVENTS.REINIT_QT_CONNECTION, '', explainObject, macroSQL, flags.executeCursor);
await this.eventBus.fireEvent(QUERY_TOOL_EVENTS.REINIT_QT_CONNECTION, '', explainObject, macroSQL, flags.executeCursor, true);
});
}, ()=>{
/*This is intentional (SonarQube)*/
Expand Down

0 comments on commit 38d4728

Please sign in to comment.