mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-24 09:40:21 -06:00
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:
parent
b0cd028ff8
commit
38d4728333
@ -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));
|
||||
|
@ -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)*/
|
||||
|
Loading…
Reference in New Issue
Block a user