<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 sharding tables  use default-data-source</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">no sharding tables's select actions did not use default-data-source(ds2) but use ds0.<br>
But update,insert and delete actions use ds2</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>
<p dir="auto">config:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="sharding:
  jdbc:
    datasource:
      names: ds0,ds1,ds2
      ds0:
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://10.82.27.177:3306/ds0
        username: root
        password: 123456
      ds1:
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://10.82.27.177:3306/ds1
        username: root
        password: 123456
      ds2:
        type: com.alibaba.druid.pool.DruidDataSource
        driver-class-name: com.mysql.jdbc.Driver
        url: jdbc:mysql://10.82.27.177:3306/ds2
        username: root
        password: 123456
    config:
      sharding:
        # 默认数据源，可以将不分库分表的数据表放在这里
        default-data-source-name: ds2
        default-database-strategy:
          inline:
            sharding-column: uId
            algorithm-expression: ds$-&gt;{uId % 2}
        tables:
          order:
            key-generator-column-name: orderId
            actual-data-nodes: ds$-&gt;{0..1}.order$-&gt;{0..1}
            table-strategy:
              inline:
                sharding-column: orderId
                algorithm-expression: order$-&gt;{orderId%2}
          order_item:
            key-generator-column-name: orderItemId
            actual-data-nodes: ds$-&gt;{0..1}.order_item$-&gt;{0..1}
            table-strategy:
              inline:
                sharding-column: orderId
                algorithm-expression: orderItemId$-&gt;{orderId%2}
      props:
        sql.show: true"><pre class="notranslate"><span class="pl-ent">sharding</span>:
  <span class="pl-ent">jdbc</span>:
    <span class="pl-ent">datasource</span>:
      <span class="pl-ent">names</span>: <span class="pl-s">ds0,ds1,ds2</span>
      <span class="pl-ent">ds0</span>:
        <span class="pl-ent">type</span>: <span class="pl-s">com.alibaba.druid.pool.DruidDataSource</span>
        <span class="pl-ent">driver-class-name</span>: <span class="pl-s">com.mysql.jdbc.Driver</span>
        <span class="pl-ent">url</span>: <span class="pl-s">jdbc:mysql://10.82.27.177:3306/ds0</span>
        <span class="pl-ent">username</span>: <span class="pl-s">root</span>
        <span class="pl-ent">password</span>: <span class="pl-c1">123456</span>
      <span class="pl-ent">ds1</span>:
        <span class="pl-ent">type</span>: <span class="pl-s">com.alibaba.druid.pool.DruidDataSource</span>
        <span class="pl-ent">driver-class-name</span>: <span class="pl-s">com.mysql.jdbc.Driver</span>
        <span class="pl-ent">url</span>: <span class="pl-s">jdbc:mysql://10.82.27.177:3306/ds1</span>
        <span class="pl-ent">username</span>: <span class="pl-s">root</span>
        <span class="pl-ent">password</span>: <span class="pl-c1">123456</span>
      <span class="pl-ent">ds2</span>:
        <span class="pl-ent">type</span>: <span class="pl-s">com.alibaba.druid.pool.DruidDataSource</span>
        <span class="pl-ent">driver-class-name</span>: <span class="pl-s">com.mysql.jdbc.Driver</span>
        <span class="pl-ent">url</span>: <span class="pl-s">jdbc:mysql://10.82.27.177:3306/ds2</span>
        <span class="pl-ent">username</span>: <span class="pl-s">root</span>
        <span class="pl-ent">password</span>: <span class="pl-c1">123456</span>
    <span class="pl-ent">config</span>:
      <span class="pl-ent">sharding</span>:
        <span class="pl-c"><span class="pl-c">#</span> 默认数据源，可以将不分库分表的数据表放在这里</span>
        <span class="pl-ent">default-data-source-name</span>: <span class="pl-s">ds2</span>
        <span class="pl-ent">default-database-strategy</span>:
          <span class="pl-ent">inline</span>:
            <span class="pl-ent">sharding-column</span>: <span class="pl-s">uId</span>
            <span class="pl-ent">algorithm-expression</span>: <span class="pl-s">ds$-&gt;{uId % 2}</span>
        <span class="pl-ent">tables</span>:
          <span class="pl-ent">order</span>:
            <span class="pl-ent">key-generator-column-name</span>: <span class="pl-s">orderId</span>
            <span class="pl-ent">actual-data-nodes</span>: <span class="pl-s">ds$-&gt;{0..1}.order$-&gt;{0..1}</span>
            <span class="pl-ent">table-strategy</span>:
              <span class="pl-ent">inline</span>:
                <span class="pl-ent">sharding-column</span>: <span class="pl-s">orderId</span>
                <span class="pl-ent">algorithm-expression</span>: <span class="pl-s">order$-&gt;{orderId%2}</span>
          <span class="pl-ent">order_item</span>:
            <span class="pl-ent">key-generator-column-name</span>: <span class="pl-s">orderItemId</span>
            <span class="pl-ent">actual-data-nodes</span>: <span class="pl-s">ds$-&gt;{0..1}.order_item$-&gt;{0..1}</span>
            <span class="pl-ent">table-strategy</span>:
              <span class="pl-ent">inline</span>:
                <span class="pl-ent">sharding-column</span>: <span class="pl-s">orderId</span>
                <span class="pl-ent">algorithm-expression</span>: <span class="pl-s">orderItemId$-&gt;{orderId%2}</span>
      <span class="pl-ent">props</span>:
        <span class="pl-ent">sql.show</span>: <span class="pl-c1">true</span></pre></div>
<p dir="auto">test sql</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="try (
        try (
                Connection conn = dataSource.getConnection();
                Statement statement = conn.createStatement();
        ) {
            statement.execute(&quot;insert into user(name,age) value('2012-12-12 12:12:12',1212)&quot;);
            statement.execute(&quot;select * from user&quot;);
        }"><pre class="notranslate"><span class="pl-k">try</span> (
        <span class="pl-s1">try</span> (
                <span class="pl-smi">Connection</span> <span class="pl-s1">conn</span> = <span class="pl-s1">dataSource</span>.<span class="pl-en">getConnection</span>();
                <span class="pl-smi">Statement</span> <span class="pl-s1">statement</span> = <span class="pl-s1">conn</span>.<span class="pl-en">createStatement</span>();
        ) {
            <span class="pl-s1">statement</span>.<span class="pl-en">execute</span>(<span class="pl-s">"insert into user(name,age) value('2012-12-12 12:12:12',1212)"</span>);
            <span class="pl-s1">statement</span>.<span class="pl-en">execute</span>(<span class="pl-s">"select * from user"</span>);
        }</pre></div>
<p dir="auto">log:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" ShardingSphere-SQL                       : Rule Type: sharding
ShardingSphere-SQL                       : Logic SQL: insert into user(name,age) value('2012-12-12 12:12:12',1212)
 ShardingSphere-SQL                       : SQLStatement: InsertStatement(super=DMLStatement(super=io.shardingsphere.core.parsing.parser.sql.dml.insert.InsertStatement@33215ffb), columns=[Column(name=name, tableName=user), Column(name=age, tableName=user)], generatedKeyConditions=[], insertValues=InsertValues(insertValues=[InsertValue(type=VALUES, expression=('2012-12-12 12:12:12',1212), parametersCount=0)]), columnsListLastPosition=25, generateKeyColumnIndex=-1, insertValuesListLastPosition=60)
 ShardingSphere-SQL                       : Actual SQL: ds2 ::: insert into user(name,age) value('2012-12-12 12:12:12',1212)
 ShardingSphere-SQL                       : Rule Type: sharding
 ShardingSphere-SQL                       : Logic SQL: select * from user
 ShardingSphere-SQL                       : SQLStatement: SelectStatement(super=DQLStatement(super=io.shardingsphere.core.parsing.parser.sql.dql.select.SelectStatement@12548f9a), containStar=true, firstSelectItemStartPosition=7, selectListLastPosition=9, groupByLastPosition=0, items=[StarSelectItem(owner=Optional.absent())], groupByItems=[], orderByItems=[], limit=null, subQueryStatement=null, subQueryStatements=[], subQueryConditions=[])

 ShardingSphere-SQL                       : Actual SQL: ds0 ::: select * from user"><pre lang="log" class="notranslate"><code class="notranslate"> ShardingSphere-SQL                       : Rule Type: sharding
ShardingSphere-SQL                       : Logic SQL: insert into user(name,age) value('2012-12-12 12:12:12',1212)
 ShardingSphere-SQL                       : SQLStatement: InsertStatement(super=DMLStatement(super=io.shardingsphere.core.parsing.parser.sql.dml.insert.InsertStatement@33215ffb), columns=[Column(name=name, tableName=user), Column(name=age, tableName=user)], generatedKeyConditions=[], insertValues=InsertValues(insertValues=[InsertValue(type=VALUES, expression=('2012-12-12 12:12:12',1212), parametersCount=0)]), columnsListLastPosition=25, generateKeyColumnIndex=-1, insertValuesListLastPosition=60)
 ShardingSphere-SQL                       : Actual SQL: ds2 ::: insert into user(name,age) value('2012-12-12 12:12:12',1212)
 ShardingSphere-SQL                       : Rule Type: sharding
 ShardingSphere-SQL                       : Logic SQL: select * from user
 ShardingSphere-SQL                       : SQLStatement: SelectStatement(super=DQLStatement(super=io.shardingsphere.core.parsing.parser.sql.dql.select.SelectStatement@12548f9a), containStar=true, firstSelectItemStartPosition=7, selectListLastPosition=9, groupByLastPosition=0, items=[StarSelectItem(owner=Optional.absent())], groupByItems=[], orderByItems=[], limit=null, subQueryStatement=null, subQueryStatements=[], subQueryConditions=[])

 ShardingSphere-SQL                       : Actual SQL: ds0 ::: select * from user
</code></pre></div>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>
<p dir="auto">sharding jdbc &amp; proxy<br>
version:3.1.0<br>
when i use sql like<br>
" select snapshot_no from pt_item_base_snapshot where snapshot_no ='20190304152137155168409726302111' "<br>
sharding-sphere can't get the value of column snapshot_no correctly<br>
, it's always be -1;<br>
I debug the source code ,in the class <strong>PredicateExtractor</strong> ,the method <strong>buildExpression</strong><br>
only support number:<br>
<code class="notranslate"> Optional&lt;ParserRuleContext&gt; bitExprNode = ExtractorUtils.findFirstChildNode(valueNode, RuleName.BIT_EXPR); expressionNode = ExtractorUtils.findFirstChildNode(valueNode, RuleName.NUMBER); if (expressionNode.isPresent() &amp;&amp; (!bitExprNode.isPresent() || 1 == bitExprNode.get().getChildCount())) { commonExpressionSegment.setValue(NumberUtil.getExactlyNumber(expressionNode.get().getText(), 10)); }</code></p>
<p dir="auto">if I change code like '  expressionNode = ExtractorUtils.findFirstChildNode(valueNode, RuleName.STRING);' , the sql going well !</p>