Skip to content

Commit

Permalink
Fix EI-5443: Dynamic SQL queries to pass the entire query is not gett…
Browse files Browse the repository at this point in the history
…ing deployed

This is to fix wso2/product-ei#5443
  • Loading branch information
chanikag committed May 31, 2021
1 parent f963dc5 commit ed9bbe1
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2524,9 +2524,12 @@ public QueryType setSqlQueryType(String query) {
}

public static QueryType sqlQueryType(String sqlQuery) {

String query = sqlQuery.substring(0, sqlQuery.indexOf(" ")).toUpperCase();

String query;
try {
query = sqlQuery.substring(0, sqlQuery.indexOf(" ")).toUpperCase();
} catch (Exception e) {
return QueryType.UNDEFINED;
}
switch (query) {
case "UPDATE":
sqlQueryType = QueryType.UPDATE;
Expand All @@ -2540,6 +2543,9 @@ public static QueryType sqlQueryType(String sqlQuery) {
case "INSERT":
sqlQueryType = QueryType.INSERT;
break;
default:
sqlQueryType = QueryType.UNDEFINED;
break;
}
return sqlQueryType;
}
Expand All @@ -2548,7 +2554,8 @@ public enum QueryType {
UPDATE,
INSERT,
DELETE,
SELECT;
SELECT,
UNDEFINED;
}

}

0 comments on commit ed9bbe1

Please sign in to comment.