Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLReplaceStatement.toString not working! #3929

Closed
xkrivzooh opened this issue Sep 3, 2020 · 0 comments
Closed

SQLReplaceStatement.toString not working! #3929

xkrivzooh opened this issue Sep 3, 2020 · 0 comments
Labels
Milestone

Comments

@xkrivzooh
Copy link

xkrivzooh commented Sep 3, 2020

SQLReplaceStatement.toString not working. for example:

  @Test
    public void test_druid_repace_parse() {
        String sql = "replace into table1 (id,name) values('1','aa'),('2','bb')";
        SQLReplaceStatement statement = parseSingleStatement(sql);
        String string = statement.toString();
        Assert.assertEquals("table1idname('1', 'aa')('2', 'bb')", string);
    }

  protected <T extends SQLStatement> T parseSingleStatement(String sql) {
        final SQLStatement sqlStatement = SQLUtils.parseSingleStatement(sql, JdbcConstants.MYSQL, SkipComments);
        return (T) sqlStatement;
    }

but it's not correct. expected toString() result is : "replace into table1 (id,name) values('1','aa'),('2','bb')"

this bug is stail exist in latest version druid 1.1.23.

wenshao added a commit that referenced this issue Oct 6, 2020
@wenshao wenshao added this to the 1.2.0 milestone Oct 6, 2020
@wenshao wenshao added the Bug label Oct 6, 2020
@wenshao wenshao closed this as completed Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants