Skip to content

Commit

Permalink
For #628: add update sql support for :: grammars.
Browse files Browse the repository at this point in the history
  • Loading branch information
haocao committed Apr 1, 2018
1 parent 7d87737 commit c66e08c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private void parseSetItem(final DMLStatement updateStatement) {
parseSetColumn(updateStatement);
lexerEngine.skipIfEqual(Symbol.EQ, Symbol.COLON_EQ);
parseSetValue(updateStatement);
skipsDoubleColon();
}

private void parseSetColumn(final DMLStatement updateStatement) {
Expand All @@ -79,4 +80,10 @@ private void parseSetColumn(final DMLStatement updateStatement) {
private void parseSetValue(final DMLStatement updateStatement) {
basicExpressionParser.parse(updateStatement);
}

private void skipsDoubleColon() {
if (lexerEngine.skipIfEqual(Symbol.DOUBLE_COLON)) {
lexerEngine.nextToken();
}
}
}
2 changes: 0 additions & 2 deletions sharding-core/src/test/resources/parser/update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
</conditions>
</parser-result>

<!-- TODO add update :: support
<parser-result sql-case-id="assertUpdateWithGeoInPostgreSQL" parameters="'2017-06-07' 100 200 '{&quot;rule2&quot;:&quot;null2&quot;}' 3 5 7 200">
<tables>
<table name="t_place" />
Expand All @@ -51,5 +50,4 @@
</condition>
</conditions>
</parser-result>
-->
</parser-result-sets>

0 comments on commit c66e08c

Please sign in to comment.