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-RC2

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

Sharding-JDBC

Expected behavior

INSERT INTO table_a (id,col_1,col_2) VALUES(1,#{bean.val1}, #{bean.val2}) ON DUPLICATE KEY UPDATE col_2 = col_2 + #{bean.val2} should execute successfully.

Actual behavior

got exception

org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: java.sql.SQLException: No value specified for parameter 3
### The error may involve com.duoku.vipintegral.dao.vipscore.UserScoreLevelMapper.insertOrUpdate-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO test_a (id,col_1,col_2) VALUES(1,?, ?) ON DUPLICATE KEY UPDATE col_2 = col_2 + ?
### Cause: java.sql.SQLException: No value specified for parameter 3
; bad SQL grammar []; nested exception is java.sql.SQLException: No value specified for parameter 3

Reason analyze (If you can)

Debug from the source,found that the num of parameters just only get from InsertValuesSegment, but the parameter after ON DUPLICATE KEY UPDATE is not included in the calculation.And I also can not find values that belong to 'OnDuplicateKey' expression in OnDuplicateKeyColumnsSegment.

https://github.com/apache/incubator-shardingsphere/blob/85f2ff877a7aaf122998964a0d03f7c9b2830e36/sharding-core/sharding-core-optimize/src/main/java/org/apache/shardingsphere/core/optimize/sharding/engnie/dml/ShardingInsertOptimizeEngine.java#L70

currentParameters do not contains the parameter for 'ON DUPLICATE KEY UPDATE',and parameters is full.

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

sql

CREATE TABLE `user` (
`id` int(10) unsigned NOT NULL COMMENT '主键',
`col_1` varchar(20) NOT NULL DEFAULT '' COMMENT 'val_1',
`col_2` int(10) NOT NULL DEFAULT '0' COMMENT 'val_int_2',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO table_a (id,col_1,col_2) VALUES(1,#{bean.val1}, #{bean.val2}) ON DUPLICATE KEY UPDATE col_2 = col_2 + #{bean.val2}

in mybatis3

any shareding rule.

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

Issue 2:
Feature Request

For English only, other languages will not accept.

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

If no response more than 7 days and we cannot make decision by current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Is your feature request related to a problem?

No.

Describe the feature you would like.

hope the sharding.jdbc.datasource.names in application.properties can support expression like ds,ds_${0..3}。

but， the SpringBootConfiguration show me that only support datasource names separated by comma. if tens of names， the conf is unfriendly at all.