mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where Debugger is not getting started if arguments loaded from SQLite database. Fixes #6132
This commit is contained in:
parent
e8f0454b39
commit
41ceda01d0
@ -1836,6 +1836,9 @@ def set_arguments_sqlite(sid, did, scid, func_id):
|
||||
|
||||
# handle the Array list sent from the client
|
||||
array_string = ''
|
||||
if 'value' in data[i]:
|
||||
array_string = data[i]['value']
|
||||
|
||||
if 'is_array_value' in data[i] and 'value' in data[i] and data[i][
|
||||
'is_array_value']:
|
||||
array_string = get_array_string(data, i)
|
||||
|
@ -143,7 +143,7 @@ export default function DebuggerArgumentComponent({ debuggerInfo, restartDebug,
|
||||
let funcArgsData = [];
|
||||
if (res.data.data.args_count != 0) {
|
||||
setIsDisableDebug(false);
|
||||
for(const i of res.data.data.result) {
|
||||
for (const i of res.data.data.result) {
|
||||
// Below will format the data to be stored in sqlite database
|
||||
funcArgsData.push({
|
||||
'arg_id': i['arg_id'],
|
||||
@ -246,9 +246,9 @@ export default function DebuggerArgumentComponent({ debuggerInfo, restartDebug,
|
||||
return myObj;
|
||||
}
|
||||
|
||||
function setFuncObj(funcArgsData, argMode, argType, argName, defValList, isUnnamedParam=false) {
|
||||
let index, values, funcObj=[];
|
||||
for(const argData of funcArgsData) {
|
||||
function setFuncObj(funcArgsData, argMode, argType, argName, defValList, isUnnamedParam = false) {
|
||||
let index, values, funcObj = [];
|
||||
for (const argData of funcArgsData) {
|
||||
index = argData['arg_id'];
|
||||
if (debuggerInfo['proargmodes'] != null &&
|
||||
(argMode && argMode[index] == 'o' && !isEdbProc) && !isUnnamedParam) {
|
||||
@ -278,7 +278,7 @@ export default function DebuggerArgumentComponent({ debuggerInfo, restartDebug,
|
||||
}
|
||||
|
||||
function setUnnamedParamNonDefVal(argType, defValList, myargname) {
|
||||
let myObj= [];
|
||||
let myObj = [];
|
||||
for (let i = 0; i < argType.length; i++) {
|
||||
myObj.push({
|
||||
'name': myargname[i],
|
||||
@ -508,13 +508,15 @@ export default function DebuggerArgumentComponent({ debuggerInfo, restartDebug,
|
||||
});
|
||||
|
||||
// Update values if any change in the args.
|
||||
if (debuggerFinalArgs.current) {
|
||||
debuggerFinalArgs.current.changed.forEach(changedArg => {
|
||||
argsList.forEach((el, _index) => {
|
||||
if(changedArg.name == el.name) {
|
||||
if (changedArg.name == el.name) {
|
||||
argsList[_index] = changedArg;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -692,10 +694,11 @@ export default function DebuggerArgumentComponent({ debuggerInfo, restartDebug,
|
||||
function startDebugging() {
|
||||
var self = this;
|
||||
setLoaderText('Starting debugger.');
|
||||
try {
|
||||
/* Initialize the target once the debug button is clicked and create asynchronous connection
|
||||
and unique transaction ID If the debugging is started again then treeInfo is already stored. */
|
||||
var [treeInfo, d] = getSelectedNodeData();
|
||||
if(!d) return;
|
||||
if (!d) return;
|
||||
|
||||
var argsValueList = [];
|
||||
var sqliteFuncArgsList = [];
|
||||
@ -857,7 +860,13 @@ export default function DebuggerArgumentComponent({ debuggerInfo, restartDebug,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
} catch (err) {
|
||||
setLoaderText('');
|
||||
Notify.alert(
|
||||
gettext('Debugger Error'),
|
||||
gettext(err.message)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -878,20 +887,20 @@ export default function DebuggerArgumentComponent({ debuggerInfo, restartDebug,
|
||||
onDataChange={(isChanged, changedData) => {
|
||||
let isValid = false;
|
||||
let skipStep = false;
|
||||
if('_sessData' in debuggerArgsSchema.current) {
|
||||
if ('_sessData' in debuggerArgsSchema.current) {
|
||||
isValid = true;
|
||||
debuggerArgsSchema.current._sessData.aregsCollection.forEach((data)=> {
|
||||
debuggerArgsSchema.current._sessData.aregsCollection.forEach((data) => {
|
||||
|
||||
if(skipStep) {return;}
|
||||
if (skipStep) { return; }
|
||||
|
||||
if((data.is_null || data.use_default || data?.value?.toString()?.length > 0) && isValid) {
|
||||
if ((data.is_null || data.use_default || data?.value?.toString()?.length > 0) && isValid) {
|
||||
isValid = true;
|
||||
} else {
|
||||
isValid = false;
|
||||
skipStep = true;
|
||||
}
|
||||
|
||||
if(!data.isValid) {
|
||||
if (!data.isValid) {
|
||||
isValid = false;
|
||||
skipStep = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user