Hi,
Please find the patch to fix the issue while using ANALYZE option in IE.
*Issue:*
We were using .startsWith() function to check the sql if it is already
starts with explain clause or not, which was added in commit:
c758920890309e50f47a9427039cf735ddf04d37
But IE do not support .startsWith() function.
- Desktop
- Mobile
FeatureChromeFirefox (Gecko)EdgeInternet ExplorerOperaSafari
Basic support 41 17
<https://developer.mozilla.org/en-US/Firefox/Releases/17> (17) (Yes)
No support 28 9
But IE do not support .startsWith() function.
I have also changed the code for File Manager module as well for the same
issue.
So affected modules are,
- Query tool
- File Manager
Please review.
RM#2347
--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
index ff2504c..2fb0c52 100755
--- a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
+++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js
@@ -14,7 +14,8 @@
// use alertify and underscore js
var alertify = require("alertify"),
- _ = require("underscore");
+ _ = require("underscore"),
+ S = require("underscore.string");
/*---------------------------------------------------------
Define functions used for various operations
@@ -173,7 +174,7 @@ var setUploader = function(path) {
$('.storage_dialog #uploader .input-path').val(path);
}
} else if (!config.options.platform_type === "win32" &&
- (path == '' || !path.startsWith('/'))) {
+ (path == '' || !S.startsWith(path, '/'))) {
path = '/' + path;
$('.storage_dialog #uploader .input-path').val(path);
} else {
@@ -1488,7 +1489,7 @@ function InputObject() {
path = path.replace(/\//g, '\\')
} else {
path = path.replace(/\\/g, '/')
- if (!path.startsWith('/')) {
+ if (!S.startsWith(path, '/')) {
path = '/' + path;
}
}
diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
index f9d4f15..2062aa2 100644
--- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
+++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js
@@ -3089,8 +3089,10 @@ define(
$("#btn-flash").prop('disabled', true);
- if (explain_prefix != undefined &&
!sql.trim().toUpperCase().startsWith("EXPLAIN"))
+ if (explain_prefix != undefined &&
+ !S.startsWith(sql.trim().toUpperCase(), "EXPLAIN")) {
sql = explain_prefix + ' ' + sql;
+ }
self.query_start_time = new Date();
self.query = sql;
--
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers