<h2 dir="auto">Bug Report</h2>
<p dir="auto">I followed this article <a href="https://my.oschina.net/u/3867294/blog/3089014" rel="nofollow">https://my.oschina.net/u/3867294/blog/3089014</a> to encry my data.<br>
When I'm using the  following configuration, the program insert data successfully,but throw an exception when querying it. I found out the program trys to decrypt <code class="notranslate">user_name</code>, while <code class="notranslate">user_name</code> is not encrypted , yet <code class="notranslate">user_name_encrypt</code> is .</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="spring:
  shardingsphere:
    datasource:
      names: ds0
      ds0:
        type: org.apache.commons.dbcp2.BasicDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        url: 
        username:
        password: 
    encrypt:
      encryptors:
        encryptor_aes:
          type: aes
          props:
            aes.key.value: 123456
      tables:
        user:
          columns:
            user_name:
              logicColumn: user_name
              plainColumn: user_name
              cipherColumn: user_name_encrypt
              encryptor: encryptor_aes
    props:
      sql.show: false
      query.with.cipher.column: false"><pre class="notranslate"><code class="notranslate">spring:
  shardingsphere:
    datasource:
      names: ds0
      ds0:
        type: org.apache.commons.dbcp2.BasicDataSource
        driver-class-name: com.mysql.cj.jdbc.Driver
        url: 
        username:
        password: 
    encrypt:
      encryptors:
        encryptor_aes:
          type: aes
          props:
            aes.key.value: 123456
      tables:
        user:
          columns:
            user_name:
              logicColumn: user_name
              plainColumn: user_name
              cipherColumn: user_name_encrypt
              encryptor: encryptor_aes
    props:
      sql.show: false
      query.with.cipher.column: false
</code></pre></div>
<p dir="auto">The sql query</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="select * from user"><pre class="notranslate"><code class="notranslate">select * from user
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="create table user
(
    id                int auto_increment
        primary key,
    user_name         varchar(200) null,
    age               int          null,
    email             varchar(200) null,
    user_name_encrypt varchar(200) null
)"><pre class="notranslate"><code class="notranslate">create table user
(
    id                int auto_increment
        primary key,
    user_name         varchar(200) null,
    age               int          null,
    email             varchar(200) null,
    user_name_encrypt varchar(200) null
)
</code></pre></div>
<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/apache/incubator-shardingsphere/issues">GitHub issues</a>.</li>
<li>Read documentation: <a href="https://shardingsphere.apache.org/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">4.0.0-RC2</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">get correct value of the column</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">program trys to decrypt the unencrypted column</p>
<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>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>
<p dir="auto">The current example is not good enough. It is difficult to understand, which users can not find their desired example codes quickly, the disadvantages are:</p>
<ol dir="auto">
<li>The categories of examples are not in same abstract level, they are not show the overview of ShardingSphere features and structure clearly;</li>
<li>The <code class="notranslate">example-core</code> module is too complicated which contains too many common and abstract codes, user do not need to understander them. It is better to use "flat" codes and make them independent each other;</li>
<li>Proxy and JDBC need to provide configurations for multiple dimensions, such as different modes, different kernel providers and different feature configs;</li>
<li>JDBC example can be split to different adaptors, such as <code class="notranslate">jdbc</code>, <code class="notranslate">spring boot starter &amp; jdbc</code>, <code class="notranslate">spring boot starter &amp; jpa</code>, <code class="notranslate">spring boot starter &amp; mybatis</code>, <code class="notranslate">spring namespace &amp; jdbc</code>, <code class="notranslate">spring namespace &amp; jpa</code> and , <code class="notranslate">spring namespace &amp; mybatis</code>;</li>
<li>Proxy do not need java connect example, config only is enough.</li>
</ol>
<p dir="auto">It is more clear if adjust example structure as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="shardingsphere-example
  ├- shardingsphere-jdbc-example
     ├- shardingsphere-jdbc-${mode}-example
        ├- shardingsphere-jdbc-${mode}-${transaction}-${feature}-example
           ├- shardingsphere-jdbc-${mode}-${transaction}-${feature}-${framework}-example
  ├- shardingsphere-proxy-example
     ├- shardingsphere-proxy-${mode}-example
        ├- shardingsphere-proxy-${mode}-${transaction}-${feature}-example
  ├- shardingsphere-parser-example"><pre class="notranslate"><code class="notranslate">shardingsphere-example
  ├- shardingsphere-jdbc-example
     ├- shardingsphere-jdbc-${mode}-example
        ├- shardingsphere-jdbc-${mode}-${transaction}-${feature}-example
           ├- shardingsphere-jdbc-${mode}-${transaction}-${feature}-${framework}-example
  ├- shardingsphere-proxy-example
     ├- shardingsphere-proxy-${mode}-example
        ├- shardingsphere-proxy-${mode}-${transaction}-${feature}-example
  ├- shardingsphere-parser-example
</code></pre></div>
<p dir="auto"><code class="notranslate">${xxx}</code> are variables which can be replaced by:</p>
<ul dir="auto">
<li><code class="notranslate">${mode}</code>: memory, standalone-file, cluster-zookeeper, cluster-etcd</li>
<li><code class="notranslate">${transaction}</code>: local, xa-atomikos, xa-bitronix, xa-narayana, base-seata</li>
<li><code class="notranslate">${feature}</code>: sharding, readwrite-splitting, db-discovery, encrypt, shadow and all permutation of them</li>
<li><code class="notranslate">${framework}</code>: jdbc, springboot-starter-jdbc, springboot-starter-jpa, springboot-starter-mybatis, springnamespace-jdbc, springnamespace-jpa, spring-namespace-mybatis</li>
</ul>
<p dir="auto">The duplicated codes may consider about using code-generation engine.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/5516298/132954397-406a0dbe-f28f-4e5b-89b2-1d79595422b4.png"><img src="https://user-images.githubusercontent.com/5516298/132954397-406a0dbe-f28f-4e5b-89b2-1d79595422b4.png" alt="example-code-gen-engine drawio" style="max-width: 100%;"></a></p>