leonbond opened a new issue #10225:
URL: https://github.com/apache/shardingsphere/issues/10225


   Sharding-jdbc 4.1.1 & 4.1.0
   
   The sql is very simple:
   `Table t = new Table();
    t.setSeq(post.getSeq());
    em.persist(t);`
   
   I also have a lot of other db statement, some with JPA, some just sql 
statement, they are all ok, but the above sql will cause the following problems:
   `java.lang.NullPointerException
           at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitInsert(MySQLDMLVisitor.java:147)
           at 
org.apache.shardingsphere.sql.parser.mysql.visitor.impl.MySQLDMLVisitor.visitInsert(MySQLDMLVisitor.java:127)
           at 
org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser$InsertContext.accept(MySQLStatementParser.java:1090)
           at 
org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:18)
           at 
org.apache.shardingsphere.sql.parser.SQLParserEngine.parse0(SQLParserEngine.java:80)
           at 
org.apache.shardingsphere.sql.parser.SQLParserEngine.parse(SQLParserEngine.java:61)
           at 
org.apache.shardingsphere.underlying.route.DataNodeRouter.createRouteContext(DataNodeRouter.java:97)
           at 
org.apache.shardingsphere.underlying.route.DataNodeRouter.executeRoute(DataNodeRouter.java:89)
           at 
org.apache.shardingsphere.underlying.route.DataNodeRouter.route(DataNodeRouter.java:76)
           at 
org.apache.shardingsphere.underlying.pluggble.prepare.PreparedQueryPrepareEngine.route(PreparedQueryPrepareEngine.java:54)
           at 
org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.executeRoute(BasePrepareEngine.java:96)
           at 
org.apache.shardingsphere.underlying.pluggble.prepare.BasePrepareEngine.prepare(BasePrepareEngine.java:83)
           at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.prepare(ShardingPreparedStatement.java:183)
           at 
org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.addBatch(ShardingPreparedStatement.java:235)
           at 
org.hibernate.jdbc.BatchingBatcher.addToBatch(BatchingBatcher.java:53)
           at 
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2435)
           at 
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2875)
           at 
org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
           at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273)
           at 
org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:265)
           at 
org.hibernate.engine.ActionQueue.executeInserts(ActionQueue.java:175)
           at 
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:286)
           at 
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
           at org.hibernate.even`
   
   pom
   `                <dependency>
                           <groupId>org.apache.shardingsphere</groupId>
                           
<artifactId>sharding-jdbc-spring-namespace</artifactId>
                           <version>4.1.1</version>
                   </dependency>`
   
   xml
   `<sharding:standard-strategy id="myTableStrategy" sharding-column="SEQ"
                                                                   
precise-algorithm-ref="myShardingAlgorithm"
                                                                   
range-algorithm-ref="myShardingAlgorithm"/>
           <sharding:data-source id="shardingDataSource">
                   <sharding:sharding-rule data-source-names="dataSource">
                           <sharding:table-rules>
                                   <sharding:table-rule logic-table="TM_TABLE" 
actual-data-nodes="dataSource.TM_TABLE_${0..9}" 
table-strategy-ref="myTableStrategy"/>
                           </sharding:table-rules>
                   </sharding:sharding-rule>
           </sharding:data-source>`
   
   -----
   It can be repeated all the time. Both in 4.1.1 & 4.1.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to