File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
main/java/org/nlpcn/es4sql/parse
test/java/org/nlpcn/es4sql Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,6 @@ public void scanIdentifier() {
88
88
89
89
90
90
private boolean isElasticIdentifierChar (char ch ) {
91
- return ch == '*' || ch == ':' || ch == '-' || ch == '.' || isIdentifierChar (ch );
91
+ return ch == '*' || ch == ':' || ch == '-' || ch == '.' || ch == ';' || isIdentifierChar (ch );
92
92
}
93
93
}
Original file line number Diff line number Diff line change @@ -414,14 +414,23 @@ public void innerQueryTestTwoQueries() throws SqlParseException {
414
414
}
415
415
416
416
@ Test
417
- public void indexWithDotsAndHyphen () throws SqlParseException {
417
+ public void indexWithDotsAndHyphen () throws SqlParseException {
418
418
String query = "select * from data-2015.08.22" ;
419
419
SQLExpr sqlExpr = queryToExpr (query );
420
420
Select select = parser .parseSelect ((SQLQueryExpr ) sqlExpr );
421
421
Assert .assertEquals (1 ,select .getFrom ().size ());
422
422
Assert .assertEquals ("data-2015.08.22" ,select .getFrom ().get (0 ).getIndex ());
423
423
}
424
424
425
+ @ Test
426
+ public void indexWithSemiColons () throws SqlParseException {
427
+ String query = "select * from some;index" ;
428
+ SQLExpr sqlExpr = queryToExpr (query );
429
+ Select select = parser .parseSelect ((SQLQueryExpr ) sqlExpr );
430
+ Assert .assertEquals (1 ,select .getFrom ().size ());
431
+ Assert .assertEquals ("some;index" ,select .getFrom ().get (0 ).getIndex ());
432
+ }
433
+
425
434
@ Test
426
435
public void scriptFiledPlusLiteralTest () throws SqlParseException {
427
436
String query = "SELECT field1 + 3 FROM index/type" ;
You can’t perform that action at this time.
0 commit comments