<h2 dir="auto">Bug Report</h2>
<h3 dir="auto">Which version of ShardingSphere did you use?</h3>
<p dir="auto">Current master branch.</p>
<h3 dir="auto">Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?</h3>
<p dir="auto">ShardingSphere-JDBC</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">when i user shardingSephere-jdbc, this sql will occur error.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="insert into social_count (image, video, feeds, organization,createTime,updateTime) values (  ?, ?, ?, ?, now(), now()) on duplicate key update image = image + ?,video = video + ?,feeds = feeds + ?,updateTime = now()"><pre class="notranslate"><code class="notranslate">insert into social_count (image, video, feeds, organization,createTime,updateTime) values (  ?, ?, ?, ?, now(), now()) on duplicate key update image = image + ?,video = video + ?,feeds = feeds + ?,updateTime = now()
</code></pre></div>
<p dir="auto">social_count is single table in single database.</p>
<p dir="auto">error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter 6"><pre class="notranslate"><code class="notranslate">bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter 6
</code></pre></div>
<h3 dir="auto">Reason analyze (If you can)</h3>
<p dir="auto">In code of <strong>org.apache.shardingsphere.infra.binder.segment.insert.values.OnDuplicateUpdateContext</strong>, we have a function</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="     private int calculateParameterCount(final Collection&lt;ExpressionSegment&gt; assignments) {
        int result = 0;
        for (ExpressionSegment each : assignments) {
            if (each instanceof ParameterMarkerExpressionSegment) {
                result++;
            } 
        }
        return result;
    }"><pre class="notranslate"><code class="notranslate">     private int calculateParameterCount(final Collection&lt;ExpressionSegment&gt; assignments) {
        int result = 0;
        for (ExpressionSegment each : assignments) {
            if (each instanceof ParameterMarkerExpressionSegment) {
                result++;
            } 
        }
        return result;
    }
</code></pre></div>
<p dir="auto">when i step into this function, each of element in assignments is an instanceof <strong>BinaryOperationExpression</strong>, not <strong>ParameterMarkerExpressionSegment</strong>, so it will course <code class="notranslate">parameterCount</code> always be 0.</p>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>
<p dir="auto">To fix this bug, i modified the code as below.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="private int calculateParameterCount(final Collection&lt;ExpressionSegment&gt; assignments) {
        int result = 0;
        for (ExpressionSegment each : assignments) {
            if (each instanceof ParameterMarkerExpressionSegment) {
                result++;
            } else if (each instanceof BinaryOperationExpression) {
                if (((BinaryOperationExpression) each).getRight() instanceof ParameterMarkerExpressionSegment) {
                    result++;
                }
            }
        }
        return result;
    }"><pre class="notranslate"><code class="notranslate">private int calculateParameterCount(final Collection&lt;ExpressionSegment&gt; assignments) {
        int result = 0;
        for (ExpressionSegment each : assignments) {
            if (each instanceof ParameterMarkerExpressionSegment) {
                result++;
            } else if (each instanceof BinaryOperationExpression) {
                if (((BinaryOperationExpression) each).getRight() instanceof ParameterMarkerExpressionSegment) {
                    result++;
                }
            }
        }
        return result;
    }
</code></pre></div>
<h2 dir="auto">Version</h2>
<p dir="auto">io.shardingsphere.sharding-jdbc-spring-boot-starter:3.0.0</p>
<p dir="auto">During the initializing, shardingspere will load all table meta in TableMetaDataInitializer.</p>
<p dir="auto">TableMetaDataInitializer.load(final ShardingRule shardingRule) {<br>
...<br>
result.putAll(loadDefaultTables(shardingRule));<br>
}</p>
<p dir="auto">It takes much time(almost 2 minutes) to load all meta data.</p>
<h2 dir="auto">Question</h2>
<p dir="auto">Why shardingspere need to load all meta data? If I don't load them, what will happen?</p>
<p dir="auto">Thanks a lot.</p>