<h2 dir="auto">Bug Report</h2>
<h3 dir="auto">Which version of ShardingSphere did you use?</h3>
<p dir="auto">master - <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/apache/shardingsphere/commit/b31a5439e0c608ee9a735aadb426ed03b1e98a42/hovercard" href="https://github.com/apache/shardingsphere/commit/b31a5439e0c608ee9a735aadb426ed03b1e98a42"><tt>b31a543</tt></a></p>
<h3 dir="auto">Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?</h3>
<p dir="auto">ShardingSphere-Proxy MySQL</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Batched update succeed.</p>
<h3 dir="auto">Actual behavior</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Exception in thread &quot;main&quot; java.sql.SQLException: Unsupported command: [COM_SET_OPTION]
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
	at com.mysql.jdbc.MysqlIO.disableMultiQueries(MysqlIO.java:3670)
	at com.mysql.jdbc.PreparedStatement.executePreparedBatchAsMultiStatement(PreparedStatement.java:1492)
	at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1303)
	at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:970)
	at icu.wwj.MySQLBatchedUpdate.main(MySQLBatchedUpdate.java:18)"><pre class="notranslate"><code class="notranslate">Exception in thread "main" java.sql.SQLException: Unsupported command: [COM_SET_OPTION]
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
	at com.mysql.jdbc.MysqlIO.disableMultiQueries(MysqlIO.java:3670)
	at com.mysql.jdbc.PreparedStatement.executePreparedBatchAsMultiStatement(PreparedStatement.java:1492)
	at com.mysql.jdbc.PreparedStatement.executeBatchInternal(PreparedStatement.java:1303)
	at com.mysql.jdbc.StatementImpl.executeBatch(StatementImpl.java:970)
	at icu.wwj.MySQLBatchedUpdate.main(MySQLBatchedUpdate.java:18)
</code></pre></div>
<h3 dir="auto">Reason analyze (If you can)</h3>
<p dir="auto">MySQL JDBC driver enable <code class="notranslate">rewriteBatchedStatements=true</code>.</p>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="try (Connection connection = DriverManager.getConnection(&quot;jdbc:mysql://127.0.0.1:13306/sbtest?useSSL=false&amp;rewriteBatchedStatements=true&quot;, &quot;root&quot;, &quot;root&quot;)) {
    connection.setAutoCommit(false);
    try (PreparedStatement preparedStatement = connection.prepareStatement(&quot;update sbtest2 set k=k+1 where id = ?&quot;)) {
        for (int i = 0; i &lt; 10; i++) {
            preparedStatement.setInt(1, i + 1);
            preparedStatement.addBatch();
        }
        preparedStatement.executeBatch();
    }
    connection.rollback();
}
"><pre class="notranslate"><span class="pl-k">try</span> (<span class="pl-smi">Connection</span> <span class="pl-s1">connection</span> = <span class="pl-smi">DriverManager</span>.<span class="pl-en">getConnection</span>(<span class="pl-s">"jdbc:mysql://127.0.0.1:13306/sbtest?useSSL=false&amp;rewriteBatchedStatements=true"</span>, <span class="pl-s">"root"</span>, <span class="pl-s">"root"</span>)) {
    <span class="pl-s1">connection</span>.<span class="pl-en">setAutoCommit</span>(<span class="pl-c1">false</span>);
    <span class="pl-k">try</span> (<span class="pl-smi">PreparedStatement</span> <span class="pl-s1">preparedStatement</span> = <span class="pl-s1">connection</span>.<span class="pl-en">prepareStatement</span>(<span class="pl-s">"update sbtest2 set k=k+1 where id = ?"</span>)) {
        <span class="pl-k">for</span> (<span class="pl-smi">int</span> <span class="pl-s1">i</span> = <span class="pl-c1">0</span>; <span class="pl-s1">i</span> &lt; <span class="pl-c1">10</span>; <span class="pl-s1">i</span>++) {
            <span class="pl-s1">preparedStatement</span>.<span class="pl-en">setInt</span>(<span class="pl-c1">1</span>, <span class="pl-s1">i</span> + <span class="pl-c1">1</span>);
            <span class="pl-s1">preparedStatement</span>.<span class="pl-en">addBatch</span>();
        }
        <span class="pl-s1">preparedStatement</span>.<span class="pl-en">executeBatch</span>();
    }
    <span class="pl-s1">connection</span>.<span class="pl-en">rollback</span>();
}</pre></div>
<h3 dir="auto">How</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Supports COM_SET_OPTION.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Handle multi-statements update in COM_QUERY executor.</li>
</ul>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/35563513/60227720-eb48b980-98c2-11e9-83d8-e4f7ba6ae4be.png"><img src="https://user-images.githubusercontent.com/35563513/60227720-eb48b980-98c2-11e9-83d8-e4f7ba6ae4be.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/35563513/60227726-f00d6d80-98c2-11e9-81a0-bc72b9cce4e0.png"><img src="https://user-images.githubusercontent.com/35563513/60227726-f00d6d80-98c2-11e9-81a0-bc72b9cce4e0.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/35563513/60227750-04ea0100-98c3-11e9-9132-1ffbea66e650.png"><img src="https://user-images.githubusercontent.com/35563513/60227750-04ea0100-98c3-11e9-9132-1ffbea66e650.png" alt="image" style="max-width: 100%;"></a></p>