<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/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.R2</p>
<h3 dir="auto">Which project did you use? Sharding-JDBC or Sharding-Proxy?</h3>
<p dir="auto">Sharding-JDBC<br>
When executing the following sql (fulltext index was already added):<br>
select a from b where MATCH (c) AGAINST ( 'Test*' IN BOOLEAN MODE) limit 100<br>
I used EntityManager's native query as:<br>
Query query = em.createNativeQuery(querySql);</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">response the query result</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">line 1:233 no viable alternative at input 'MATCH(hc.content)AGAINST(?INBOOLEAN'<br>
2019-09-02 18:35:42.640 ERROR 85171 --- [ault-executor-0] io.grpc.internal.SerializingExecutor     : Exception while executing runnable io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed@41ef22cf</p>
<p dir="auto">java.lang.ClassCastException: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext<br>
at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extractPredicate(PredicateExtractor.java:101) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extractRecursiveWithParen(PredicateExtractor.java:85) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extractRecursiveWithLogicalOperation(PredicateExtractor.java:71) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.PredicateExtractor.extract(PredicateExtractor.java:65) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.parse.core.extractor.impl.dml.WhereExtractor.extract(WhereExtractor.java:48) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.parse.core.extractor.SQLSegmentsExtractorEngine.extract(SQLSegmentsExtractorEngine.java:47) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.parse.core.SQLParseKernel.parse(SQLParseKernel.java:62) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.parse.SQLParseEngine.parse0(SQLParseEngine.java:71) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.parse.SQLParseEngine.parse(SQLParseEngine.java:53) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.route.router.sharding.ParsingSQLRouter.parse(ParsingSQLRouter.java:66) ~[sharding-core-route-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.route.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:64) ~[sharding-core-route-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.PreparedQueryShardingEngine.route(PreparedQueryShardingEngine.java:60) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.BaseShardingEngine.executeRoute(BaseShardingEngine.java:86) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.core.BaseShardingEngine.shard(BaseShardingEngine.java:70) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.shard(ShardingPreparedStatement.java:224) ~[sharding-jdbc-core-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.executeQuery(ShardingPreparedStatement.java:110) ~[sharding-jdbc-core-4.0.0-RC2.jar:4.0.0-RC2]<br>
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.Loader.getResultSet(Loader.java:2167) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1930) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1892) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.Loader.doQuery(Loader.java:937) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:340) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.Loader.doList(Loader.java:2689) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.Loader.doList(Loader.java:2672) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2506) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.Loader.list(Loader.java:2501) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:338) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:2223) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.internal.AbstractSharedSessionContract.list(AbstractSharedSessionContract.java:1069) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.query.internal.NativeQueryImpl.doList(NativeQueryImpl.java:170) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1505) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at org.hibernate.query.Query.getResultList(Query.java:132) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]<br>
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]<br>
at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:403) ~[spring-orm-5.1.9.RELEASE.jar:5.1.9.RELEASE]<br>
at com.sun.proxy.$Proxy99.getResultList(Unknown Source) ~[na:na]<br>
at  xxxxx (my class url)<br>
at com.hblinks.data.grpc.DalHsSearchServiceGrpc$MethodHandlers.invoke(DalHsSearchServiceGrpc.java:279) ~[classes/:na]<br>
at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172) ~[grpc-stub-1.23.0.jar:1.23.0]<br>
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331) ~[grpc-core-1.23.0.jar:1.23.0]<br>
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:808) ~[grpc-core-1.23.0.jar:1.23.0]<br>
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.23.0.jar:1.23.0]<br>
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[grpc-core-1.23.0.jar:1.23.0]<br>
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_171]<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_171]<br>
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]</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">Sharding rule is simply:</p>
<p dir="auto">spring.shardingsphere.sharding.default-data-source-name=ds0<br>
spring.shardingsphere.datasource.names=ds0<br>
spring.shardingsphere.datasource.ds0.type=com.zaxxer.hikari.HikariDataSource<br>
spring.shardingsphere.datasource.ds0.driver-class-name=com.mysql.cj.jdbc.Driver<br>
spring.shardingsphere.datasource.ds0.jdbc-url=<br>
spring.shardingsphere.datasource.ds0.username=<br>
spring.shardingsphere.datasource.ds0.password=</p>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>
<h2 dir="auto">Bug Report</h2>
<h3 dir="auto">Which version of ShardingSphere did you use?</h3>
<p dir="auto">I am using the 4.0.0-RC2 build by myself from the source<br>
【BTW】the build fail in openjdk, success only in Oracle jdk. it seems the build use a tool only available in Oracle jdk</p>
<h3 dir="auto">Which project did you use? Sharding-JDBC or Sharding-Proxy?</h3>
<p dir="auto">Sharding-Proxy</p>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">return the limit record when using the match against in boolean mode</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">return all the records when using the match against in boolean mode, but for natural language mode ,it works well.</p>
<h3 dir="auto">Reason analyze (If you can)</h3>
<p dir="auto">May be in the boolean mode, the proxy didn't send the limit  offset to the real db?</p>
<h3 dir="auto">Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.</h3>
<p dir="auto"><code class="notranslate">SELECT * FROM SMS_SIGN_MISS_REPORT WHERE FINAL_STATUS_ID = 'SignUndefine' and ASSIGN_TO_USER_ID ='_NA_' and MATCH(SIGN_TEXT) AGAINST('+韵达 *快递' in boolean mode ) limit 5 offset 0;</code><br>
when I execute this in the real db like</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="SELECT * FROM SMS_SIGN_MISS_REPORT_0
WHERE FINAL_STATUS_ID = 'SignUndefine' and ASSIGN_TO_USER_ID ='_NA_'
  and MATCH(SIGN_TEXT) AGAINST('+韵达 *快递' in boolean mode )
limit 5 offset 0;"><pre class="notranslate"><code class="notranslate">SELECT * FROM SMS_SIGN_MISS_REPORT_0
WHERE FINAL_STATUS_ID = 'SignUndefine' and ASSIGN_TO_USER_ID ='_NA_'
  and MATCH(SIGN_TEXT) AGAINST('+韵达 *快递' in boolean mode )
limit 5 offset 0;
</code></pre></div>
<p dir="auto">it works as expected</p>
<h3 dir="auto">Example codes for reproduce this issue (such as a github link).</h3>