<p dir="auto">Please answer these questions before submitting your issue. Thanks!<br>
开源不易，我们希望将精力放在完成新功能和解决有价值的问题上，为了让大家的配合更具有效率，请填写以下列出的全部问题</p>
<h3 dir="auto">Which version of Sharding-Jdbc do you using?（您使用的Sharding-Jdbc版本为？）</h3>
<p dir="auto">2.0.2</p>
<h3 dir="auto">Expected behavior （您预期的结果是）</h3>
<p dir="auto">ddl只在master执行</p>
<h3 dir="auto">Actual behavior （实际运行的结果是）</h3>
<p dir="auto">ddl在master  &amp; slave均有执行</p>
<h3 dir="auto">Steps to reproduce the behavior （可重现问题的操作步骤）</h3>
<p dir="auto">很简单的做法，比如你执行一个创建tables的脚本，检查发现master与slave均有创建。</p>
<h3 dir="auto">Please provide the reproduce example codes (such as github link)，otherwise we will label the issue as Invalid and close it.（为了节省复现问题的时间，请务必提供可重现的代码，否则我们会将issue直接标记为invalid并关闭）</h3>
<p dir="auto">Code should based on <a href="https://github.com/shardingjdbc/sharding-jdbc-example">https://github.com/shardingjdbc/sharding-jdbc-example</a><br>
（代码请基于 <a href="https://github.com/shardingjdbc/sharding-jdbc-example%EF%BC%89">https://github.com/shardingjdbc/sharding-jdbc-example）</a></p>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>For English only</strong>, other languages will not accept.</p>
<p dir="auto">Before report a bug, make sure you have:</p>
<ul dir="auto">
<li>Searched open and closed <a href="https://github.com/sharding-sphere/sharding-sphere/issues">GitHub issues</a>.</li>
<li>Read documentation: <a href="http://shardingsphere.io/document/current/en/overview/" rel="nofollow">ShardingSphere Doc</a>.</li>
</ul>
<p dir="auto">Please pay attention on issues you submitted, because we maybe need more details.<br>
If no response <strong>more than 7 days</strong> and we cannot reproduce it on current information, we will <strong>close it</strong>.</p>
<p dir="auto">Please answer these questions before submitting your issue. Thanks!</p>
<h3 dir="auto">Which version of ShardingSphere did you use?</h3>
<p dir="auto">3.1.0</p>
<h3 dir="auto">Which project did you use? Sharding-JDBC or Sharding-Proxy?</h3>
<p dir="auto">Sharding-JDBC</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">no error</p>
<h3 dir="auto">Actual behavior</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR 3054 (HY000): Unknown exception: java.lang.Integer cannot be cast to java.lang.String"><pre class="notranslate"><code class="notranslate">ERROR 3054 (HY000): Unknown exception: java.lang.Integer cannot be cast to java.lang.String
</code></pre></div>
<h3 dir="auto">Reason analyze (If you can)</h3>
<h3 dir="auto">Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</h3>
<ol dir="auto">
<li>configure a string column A as sharding column.</li>
<li>select * from x where A='abc';</li>
<li>error</li>
</ol>
<p dir="auto">my preciseAlgorithmClass：</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public class StringHash128By30Char implements PreciseShardingAlgorithm&lt;String&gt; {
    private PartitionByString partitionByString = new PartitionByString(128, &quot;:30&quot;);

    @Override
    public String doSharding(Collection&lt;String&gt; availableTargetNames, PreciseShardingValue&lt;String&gt; shardingValue) {
        for (String availableTargetName : availableTargetNames) {
            Integer calculate = partitionByString.calculate(shardingValue.getValue());
            String suffix = String.format(&quot;_%03d&quot;, calculate);
            if (availableTargetName.endsWith(suffix)) {
                return availableTargetName;
            }
        }
        throw new UnsupportedOperationException(&quot;sharding value:&quot; + shardingValue);
    }

}"><pre class="notranslate"><code class="notranslate">public class StringHash128By30Char implements PreciseShardingAlgorithm&lt;String&gt; {
    private PartitionByString partitionByString = new PartitionByString(128, ":30");

    @Override
    public String doSharding(Collection&lt;String&gt; availableTargetNames, PreciseShardingValue&lt;String&gt; shardingValue) {
        for (String availableTargetName : availableTargetNames) {
            Integer calculate = partitionByString.calculate(shardingValue.getValue());
            String suffix = String.format("_%03d", calculate);
            if (availableTargetName.endsWith(suffix)) {
                return availableTargetName;
            }
        }
        throw new UnsupportedOperationException("sharding value:" + shardingValue);
    }

}
</code></pre></div>
<p dir="auto">I debug and find shardingValue.value=-1</p>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>