Fixed an issue where the query is not getting executed after giving a password and connecting to the server on the not saved password server. #6502

This commit is contained in:
Anil Sahoo 2024-09-18 20:55:29 +05:30 committed by GitHub
parent b0cd028ff8
commit 38d4728333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -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) {
@ -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));

View File

@ -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)*/