Ensure that Truncate and Reset statistics should work. Fixes #7096

pull/64/head
Yogesh Mahajan 2021-12-30 12:19:33 +05:30 committed by Akshay Joshi
parent 191e2b6242
commit 0ceb2e2767
2 changed files with 54 additions and 57 deletions

View File

@ -23,3 +23,4 @@ Bug fixes
| `Issue #7034 <https://redmine.postgresql.org/issues/7034>`_ - Fixed an issue where Columns with default value not showing when adding a new row. | `Issue #7034 <https://redmine.postgresql.org/issues/7034>`_ - Fixed an issue where Columns with default value not showing when adding a new row.
| `Issue #7077 <https://redmine.postgresql.org/issues/7077>`_ - Fixed an issue where the Owner is not displayed in the reverse engineering SQL for Procedures. | `Issue #7077 <https://redmine.postgresql.org/issues/7077>`_ - Fixed an issue where the Owner is not displayed in the reverse engineering SQL for Procedures.
| `Issue #7078 <https://redmine.postgresql.org/issues/7078>`_ - Fixed an issue where an operation error message pop up showing the database object's name incorrectly. | `Issue #7078 <https://redmine.postgresql.org/issues/7078>`_ - Fixed an issue where an operation error message pop up showing the database object's name incorrectly.
| `Issue #7096 <https://redmine.postgresql.org/issues/7096>`_ - Ensure that Truncate and Reset statistics should work.

View File

@ -183,38 +183,36 @@ define('pgadmin.node.table', [
Notify.confirm( Notify.confirm(
gettext('Truncate Table'), gettext('Truncate Table'),
gettext('Are you sure you want to truncate table %s?', d.label), gettext('Are you sure you want to truncate table %s?', d.label),
function (e) { function () {
if (e) { var data = d;
var data = d; $.ajax({
$.ajax({ url: obj.generate_url(i, 'truncate' , d, true),
url: obj.generate_url(i, 'truncate' , d, true), type:'PUT',
type:'PUT', data: params,
data: params, dataType: 'json',
dataType: 'json', })
}) .done(function(res) {
.done(function(res) { if (res.success == 1) {
if (res.success == 1) { Notify.success(res.info);
Notify.success(res.info); t.removeIcon(i);
t.removeIcon(i); data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
data.icon = data.is_partitioned ? 'icon-partition': 'icon-table'; t.addIcon(i, {icon: data.icon});
t.addIcon(i, {icon: data.icon});
t.unload(i);
t.setInode(i);
t.deselect(i);
// Fetch updated data from server
setTimeout(function() {
t.select(i);
}, 10);
}
if (res.success == 2) {
Notify.error(res.info, 0);
}
})
.fail(function(xhr, status, error) {
Notify.pgRespErrorNotify(xhr, error);
t.unload(i); t.unload(i);
}); t.setInode(i);
} t.deselect(i);
// Fetch updated data from server
setTimeout(function() {
t.select(i);
}, 10);
}
if (res.success == 2) {
Notify.error(res.info, 0);
}
})
.fail(function(xhr, status, error) {
Notify.pgRespErrorNotify(xhr, error);
t.unload(i);
});
}, function() {} }, function() {}
); );
}, },
@ -231,33 +229,31 @@ define('pgadmin.node.table', [
Notify.confirm( Notify.confirm(
gettext('Reset statistics'), gettext('Reset statistics'),
gettext('Are you sure you want to reset the statistics for table "%s"?', d._label), gettext('Are you sure you want to reset the statistics for table "%s"?', d._label),
function (e) { function () {
if (e) { var data = d;
var data = d; $.ajax({
$.ajax({ url: obj.generate_url(i, 'reset' , d, true),
url: obj.generate_url(i, 'reset' , d, true), type:'DELETE',
type:'DELETE', })
}) .done(function(res) {
.done(function(res) { if (res.success == 1) {
if (res.success == 1) { Notify.success(res.info);
Notify.success(res.info); t.removeIcon(i);
t.removeIcon(i); data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
data.icon = data.is_partitioned ? 'icon-partition': 'icon-table'; t.addIcon(i, {icon: data.icon});
t.addIcon(i, {icon: data.icon});
t.unload(i);
t.setInode(i);
t.deselect(i);
// Fetch updated data from server
setTimeout(function() {
t.select(i);
}, 10);
}
})
.fail(function(xhr, status, error) {
Notify.pgRespErrorNotify(xhr, error);
t.unload(i); t.unload(i);
}); t.setInode(i);
} t.deselect(i);
// Fetch updated data from server
setTimeout(function() {
t.select(i);
}, 10);
}
})
.fail(function(xhr, status, error) {
Notify.pgRespErrorNotify(xhr, error);
t.unload(i);
});
}, },
function() {} function() {}
); );