Issue 1:
Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Searched open and closed GitHub issues.

Read documentation: ShardingSphere Doc.

Please pay attention on issues you submitted, because we maybe need more details.

If no response more than 7 days and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ShardingSphere did you use?

4.0.0.R2

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-JDBC

When executing the following sql (fulltext index was already added):

select a from b where MATCH (c) AGAINST ( 'Test*' IN BOOLEAN MODE) limit 100

I used EntityManager's native query as:

Query query = em.createNativeQuery(querySql);

Expected behavior

response the query result

Actual behavior

line 1:233 no viable alternative at input 'MATCH(hc.content)AGAINST(?INBOOLEAN'

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

java.lang.ClassCastException: org.antlr.v4.runtime.tree.ErrorNodeImpl cannot be cast to org.antlr.v4.runtime.ParserRuleContext

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]

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]

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]

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]

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]

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]

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]

at org.apache.shardingsphere.core.parse.SQLParseEngine.parse0(SQLParseEngine.java:71) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.parse.SQLParseEngine.parse(SQLParseEngine.java:53) ~[sharding-core-parse-common-4.0.0-RC2.jar:4.0.0-RC2]

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]

at org.apache.shardingsphere.core.route.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:64) ~[sharding-core-route-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.PreparedQueryShardingEngine.route(PreparedQueryShardingEngine.java:60) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.BaseShardingEngine.executeRoute(BaseShardingEngine.java:86) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]

at org.apache.shardingsphere.core.BaseShardingEngine.shard(BaseShardingEngine.java:70) ~[sharding-core-entry-4.0.0-RC2.jar:4.0.0-RC2]

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]

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]

at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.Loader.getResultSet(Loader.java:2167) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1930) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1892) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.Loader.doQuery(Loader.java:937) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:340) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.Loader.doList(Loader.java:2689) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.Loader.doList(Loader.java:2672) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2506) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.Loader.list(Loader.java:2501) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:338) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:2223) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.internal.AbstractSharedSessionContract.list(AbstractSharedSessionContract.java:1069) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.query.internal.NativeQueryImpl.doList(NativeQueryImpl.java:170) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1505) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at org.hibernate.query.Query.getResultList(Query.java:132) ~[hibernate-core-5.3.10.Final.jar:5.3.10.Final]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_171]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_171]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_171]

at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_171]

at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:403) ~[spring-orm-5.1.9.RELEASE.jar:5.1.9.RELEASE]

at com.sun.proxy.$Proxy99.getResultList(Unknown Source) ~[na:na]

at xxxxx (my class url)

at com.hblinks.data.grpc.DalHsSearchServiceGrpc$MethodHandlers.invoke(DalHsSearchServiceGrpc.java:279) ~[classes/:na]

at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:172) ~[grpc-stub-1.23.0.jar:1.23.0]

at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:331) ~[grpc-core-1.23.0.jar:1.23.0]

at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:808) ~[grpc-core-1.23.0.jar:1.23.0]

at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[grpc-core-1.23.0.jar:1.23.0]

at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[grpc-core-1.23.0.jar:1.23.0]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_171]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_171]

at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]

Reason analyze (If you can)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Sharding rule is simply:

spring.shardingsphere.sharding.default-data-source-name=ds0

spring.shardingsphere.datasource.names=ds0

spring.shardingsphere.datasource.ds0.type=com.zaxxer.hikari.HikariDataSource

spring.shardingsphere.datasource.ds0.driver-class-name=com.mysql.cj.jdbc.Driver

spring.shardingsphere.datasource.ds0.jdbc-url=

spring.shardingsphere.datasource.ds0.username=

spring.shardingsphere.datasource.ds0.password=

Example codes for reproduce this issue (such as a github link).

Issue 2:
Bug Report

Which version of ShardingSphere did you use?

I am using the 4.0.0-RC2 build by myself from the source

【BTW】the build fail in openjdk, success only in Oracle jdk. it seems the build use a tool only available in Oracle jdk

Which project did you use? Sharding-JDBC or Sharding-Proxy?

Sharding-Proxy

Expected behavior

return the limit record when using the match against in boolean mode

Actual behavior

return all the records when using the match against in boolean mode, but for natural language mode ,it works well.

Reason analyze (If you can)

May be in the boolean mode, the proxy didn't send the limit offset to the real db?

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

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;

when I execute this in the real db like

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;

it works as expected

Example codes for reproduce this issue (such as a github link).