8000 [fix] parsing render_complex_sql queries · DHTMLX/connector-java@2ddd1d7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ddd1d7

Browse files
[fix] parsing render_complex_sql queries
1 parent 92a18b4 commit 2ddd1d7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

sources/com/dhtmlx/connector/DBDataWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public ConnectorResultSet select(DataRequest source) throws ConnectorOperationEx
307307
* @return the string
308308
*/
309309
protected String select_query(String select,String from,String where,String sort,String start,String count){
310-
if (from == "")
310+
if (from.equals(""))
311311
return select;
312312

313313
String sql="SELECT "+select+" FROM "+from;

sources/com/dhtmlx/connector/DataRequest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,13 @@ public void parse_sql(String sql, Boolean as_is) throws ConnectorConfigException
265265
fieldset = sql;
266266
return;
267267
}
268-
Pattern limit_regex = Pattern.compile("[ \n]+limit[\n ,0-9]", Pattern.CASE_INSENSITIVE);
269-
Pattern where_regex = Pattern.compile("[ \n]+where", Pattern.CASE_INSENSITIVE);
270-
Pattern from_regex = Pattern.compile("[ \n]+from", Pattern.CASE_INSENSITIVE);
268+
Pattern limit_regex = Pattern.compile("[ \n\t]+limit[\n\t ,0-9]", Pattern.CASE_INSENSITIVE);
269+
Pattern where_regex = Pattern.compile("[ \n\t]+where[ \n\t]+", Pattern.CASE_INSENSITIVE);
270+
Pattern from_regex = Pattern.compile("[ \n\t]+from[ \n\t]+", Pattern.CASE_INSENSITIVE);
271271
Pattern select_regex = Pattern.compile("select", Pattern.CASE_INSENSITIVE);
272-
Pattern order_regex = Pattern.compile("[ \n]+order[ ]+by", Pattern.CASE_INSENSITIVE);
272+
Pattern order_regex = Pattern.compile("[ \n\t]+order[ \n\t]+by[ \n\t]+", Pattern.CASE_INSENSITIVE);
273273
Pattern empty_regex = Pattern.compile("[ ]+", Pattern.CASE_INSENSITIVE);
274-
Pattern groupby_regex = Pattern.compile("[ \n]+group[ \n]+by[ \n]+", Pattern.CASE_INSENSITIVE);
274+
Pattern groupby_regex = Pattern.compile("[ \n\t]+group[ \n\t]+by[ \n\t]+", Pattern.CASE_INSENSITIVE);
275275

276276
sql = limit_regex.split(sql)[0]; //drop limit part;
277277

0 commit comments

Comments
 (0)
0