terrymanu commented on a change in pull request #4477: Parse mysql variable
value for SET statement
URL:
https://github.com/apache/incubator-shardingsphere/pull/4477#discussion_r386312039
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/java/org/apache/shardingsphere/sql/parser/integrate/asserts/statement/dal/impl/SetVariableStatementAssert.java
##########
@@ -42,11 +42,12 @@
* @param expected expected variable statement test case
*/
public static void assertIs(final SQLCaseAssertContext assertContext,
final SetStatement actual, final SetVariableStatementTestCase expected) {
- if (null != expected.getVariable()) {
- assertNotNull(assertContext.getText("Actual variable expression
should exist."), actual.getVariable());
- assertThat(assertContext.getText("variable expression assertion
error: "), actual.getVariable().getVariable(), is(expected.getVariable()));
+ if (null != expected.getVariableName()) {
+ assertNotNull(assertContext.getText("Actual variable expression
should exist."), actual.getVariableExprList());
+ assertThat(assertContext.getText("variable expression assertion
error: "), actual.getVariableExprList().get(0).getVariable().getVariableName(),
is(expected.getVariableName()));
Review comment:
Why judge the first variable here?
FIY: `actual.getVariableExprList().get(0)`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services