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

DDL 异常 #581

Closed
nobody2014100 opened this issue Jan 27, 2018 · 2 comments
Closed

DDL 异常 #581

nobody2014100 opened this issue Jan 27, 2018 · 2 comments

Comments

@nobody2014100
Copy link

Please answer these questions before submitting your issue. Thanks!

使用读写分离配置,alter表的时候,应该只更新master 连接对应的表就可以,现在是同时还会更新slave对应的表

private Collection<PreparedStatement> generatePreparedStatementForDDL(final SQLExecutionUnit sqlExecutionUnit) throws SQLException {
    Collection<PreparedStatement> result = new LinkedList<>();
    Collection<Connection> connections = getConnection().getAllConnections(sqlExecutionUnit.getDataSource());
    for (Connection each : connections) {
        result.add(each.prepareStatement(sqlExecutionUnit.getSql(), resultSetType, resultSetConcurrency, resultSetHoldability));
    }
    return result;
}

Which version of Sharding-Jdbc do you using?

2.0.2

Expected behavior

只更新master表结构

Actual behavior

Steps to reproduce the behavior

Please provide the reproduce example codes (such as github link)

Code should based on https://github.com/shardingjdbc/sharding-jdbc-example

@terrymanu
Copy link
Member

terrymanu commented Jan 27, 2018

你好,我花了两个小时的时间把所有的example都过了一遍,没有发现你说的问题。
如果你认为仍然有问题,请提供可重现的代码并reopen这个issue,供我们重现,谢谢

@terrymanu
Copy link
Member

duplicate with #522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants