Issue 1:
Bug Report

Which version of ShardingSphere did you use?

4.0.1

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

Sharding-JDBC

Expected behavior

I modify the Data ID of nacos: .shardingDataSource.config.schema.logic_db.rule content

For example: actualDataNodes hope to change the configuration of the shard table

Actual behavior

nothing happened

Reason analyze (If you can)

not watch the key .shardingDataSource.config.schema.logic_db.rule

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

modify the Data ID of nacos: .shardingDataSource.config.schema.logic_db.rule content

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

the spring xml

<orchestraion:registry-center id="regCenter" type="nacos" server-lists="localhost:8848" namespace="728acf9f-34fb-42fd-af25-984de5686535" operation-timeout-milliseconds="3000" max-retries="3"/>

<orchestraion:sharding-data-source id="shardingDataSource" registry-center-ref="regCenter" overwrite="false"/>

the nacos dataId:.shardingDataSource.config.schema.logic_db.rule content:

tables:
log_process:
actualDataNodes: dataSource.log_process,dataSource.log_process_2020_$->{4..12}
keyGenerator:
column: id
props:
worker.id: '421'
type: SNOWFLAKE
logicTable: log_process
tableStrategy:
standard:
preciseAlgorithmClassName: com.xxx.base.shardingjdbc.shardingAlgorithm.IDPrecise
shardingColumn: id

I found that modifying .shardingDataSource.config.props is effective，but shardingDataSource.config.schema.logic_db.rule

Issue 2:
Bug Report

when execute sql that likes follow

insert into product_source_list (product_code,store_code,primary_supplier,condition_no,supplier_code,return_mark,purchase_price,price_unit,order_unit,article_no,begin_time,expiration_time,type,creation_date,issued_time,external_id,archived,version) values (?, ?,?, ?,?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,0) on duplicate key update product_code = if(@update_condition :=(issued_time < values(issued_time)),values(product_code),product_code),store_code = if(@update_condition,values(store_code),store_code),supplier_code = if(@update_condition,values(supplier_code),supplier_code),return_mark = if(@update_condition,values(return_mark),return_mark),purchase_price = if(@update_condition,values(purchase_price),purchase_price),price_unit = if(@update_condition,values(price_unit),price_unit),order_unit = if(@update_condition,values(order_unit),order_unit),primary_supplier = if(@update_condition,values(primary_supplier),primary_supplier),article_no = if(@update_condition,values(article_no),article_no),begin_time = if(@update_condition,values(begin_time),begin_time),expiration_time = if(@update_condition,values(expiration_time),expiration_time),type = if(@update_condition,values(type),type),archived = if(@update_condition,values(archived),archived),external_id = if(@update_condition,values(external_id),external_id),version = if(@update_condition,version +1,version),issued_time = if(@update_condition,values(issued_time),issued_time)

occurs IllegaStateException

details:

java.lang.IllegalStateException

at com.google.common.base.Preconditions.checkState(Preconditions.java:158)

at org.apache.shardingsphere.core.parse.core.extractor.util.ExtractorUtils.getFirstChildNode(ExtractorUtils.java:48)

at org.apache.shardingsphere.core.parse.core.extractor.impl.common.column.ColumnExtractor.getColumnSegment(ColumnExtractor.java:45)

at org.apache.shardingsphere.core.parse.core.extractor.impl.common.column.ColumnExtractor.extract(ColumnExtractor.java:41)

at org.apache.shardingsphere.core.parse.core.extractor.impl.common.column.ColumnsExtractor.extract(ColumnsExtractor.java:44)

at org.apache.shardingsphere.core.parse.core.extractor.SQLSegmentsExtractorEngine.extract(SQLSegmentsExtractorEngine.java:52)

at org.apache.shardingsphere.core.parse.core.SQLParseKernel.parse(SQLParseKernel.java:62)

at org.apache.shardingsphere.core.parse.SQLParseEngine.parse0(SQLParseEngine.java:71)

at org.apache.shardingsphere.core.parse.SQLParseEngine.parse(SQLParseEngine.java:53)

at org.apache.shardingsphere.core.route.router.masterslave.MasterSlaveRouter.route(MasterSlaveRouter.java:56)

at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.MasterSlavePreparedStatement.(MasterSlavePreparedStatement.java:63)

at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.MasterSlavePreparedStatement.(MasterSlavePreparedStatement.java:51)

at org.apache.shardingsphere.shardingjdbc.jdbc.core.connection.MasterSlaveConnection.prepareStatement(MasterSlaveConnection.java:76)

at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1555)

at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:614)

at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:646)

at org.springframework.jdbc.core.JdbcTemplate.batchUpdate(JdbcTemplate.java:935)

at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.batchUpdate(NamedParameterJdbcTemplate.java:365)

at com.cbest.platform.product.core.service.impl.ProductSourceListServiceImpl.saveOrUpdateIfNecessary(ProductSourceListServiceImpl.java:127)

at com.cbest.platform.product.core.service.impl.ProductSourceListServiceImpl$$FastClassBySpringCGLIB$$78117739.invoke()

at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)

at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)

at com.cbest.platform.product.core.service.impl.ProductSourceListServiceImpl$$EnhancerBySpringCGLIB$$d043c704.saveOrUpdateIfNecessary()

at com.cbest.platform.product.job.SyncSourceListJob.execute(SyncSourceListJob.java:88)

at com.xxl.job.core.thread.JobThread.run(JobThread.java:152)

Which version of ShardingSphere did you use?

4.0.0-RC3

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

Sharding-JDBC

Expected behavior

insert into product_source_list (product_code,store_code,primary_supplier,condition_no,supplier_code,return_mark,purchase_price,price_unit,order_unit,article_no,begin_time,expiration_time,type,creation_date,issued_time,external_id,archived,version) values (?, ?,?, ?,?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,0) on duplicate key update product_code = if(@update_condition :=(issued_time < values(issued_time)),values(product_code),product_code),store_code = if(@update_condition,values(store_code),store_code),supplier_code = if(@update_condition,values(supplier_code),supplier_code),return_mark = if(@update_condition,values(return_mark),return_mark),purchase_price = if(@update_condition,values(purchase_price),purchase_price),price_unit = if(@update_condition,values(price_unit),price_unit),order_unit = if(@update_condition,values(order_unit),order_unit),primary_supplier = if(@update_condition,values(primary_supplier),primary_supplier),article_no = if(@update_condition,values(article_no),article_no),begin_time = if(@update_condition,values(begin_time),begin_time),expiration_time = if(@update_condition,values(expiration_time),expiration_time),type = if(@update_condition,values(type),type),archived = if(@update_condition,values(archived),archived),external_id = if(@update_condition,values(external_id),external_id),version = if(@update_condition,version +1,version),issued_time = if(@update_condition,values(issued_time),issued_time)

should execute successfully

Actual behavior

Reason analyze (If you can)

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

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