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 anymore 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?

master 80e2fc2

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

Proxy

Expected behavior

Create READWRITE_SPLITTING RULE and SHADOW RULE respectively with the same name, it should report duplicate data source

CREATE READWRITE_SPLITTING RULE duplicate_ds (
WRITE_STORAGE_UNIT=ds_0,
READ_STORAGE_UNITS(ds_1,ds_2),
TYPE(NAME="random")
);
CREATE SHADOW RULE duplicate_ds (
SOURCE=ds_0,
SHADOW=ds_1,
t_order(TYPE(NAME="SQL_HINT"))
);

Actual behavior

Query OK, 0 rows affected

Reason analyze (If you can)

missing check

Issue 2:
Bug Report

i have raise this bug for twice, but the project owner close it twice.

But it's not a duplicated and nonsensical issue, it's really a bug, please pay attention to the description as below.

select * from t_order where create_time between '2018-01-01 00:00:00' and '2018-01-02 00:00:00'

SQL like above is not supported, we use create_time for RangeShardingAlgorithm

and we always get the wrong RangeShardingValue ( we expected Range ['2018-01-01 00:00:00', '2018-01-02 00:00:00'] bu we received Range [-1, -1] ), the column type of create_time is datetime.

in the OrConditionFilter.java line 206, there is a bug

private com.google.common.base.Optional<SQLExpression> buildExpression(final SelectStatement selectStatement, final ExpressionSegment expressionSegment, final String sql,
final ShardingRule shardingRule, final ShardingTableMetaData shardingTableMetaData) {
if (!(expressionSegment instanceof CommonExpressionSegment)) {
new ExpressionFiller().fill(expressionSegment, selectStatement, sql, shardingRule, shardingTableMetaData);
return com.google.common.base.Optional.absent();
}
CommonExpressionSegment commonExpressionSegment = (CommonExpressionSegment) expressionSegment;
if (-1 < commonExpressionSegment.getIndex()) {
return com.google.common.base.Optional.<SQLExpression>of(new SQLPlaceholderExpression(commonExpressionSegment.getIndex()));
}
// it will always return SQLNumberExpression because there is a default value -1 for commonExpressionSegment.getValue()
if (null != commonExpressionSegment.getValue()) {
return com.google.common.base.Optional.<SQLExpression>of(new SQLNumberExpression(commonExpressionSegment.getValue()));
}
String expression = sql.substring(commonExpressionSegment.getStartPosition(), commonExpressionSegment.getEndPosition() + 1);
return Optional.<SQLExpression>of(new SQLTextExpression(expression));
}

the value field in CommonExpressionSegment has a default value -1. so it will be always consider as SQLNumberExpression.

after i remove the default value -1 for field value in CommonExpressionSegment.java, it's ok.

public final class CommonExpressionSegment extends ExpressionWithAliasSegment
{

private final int startPosition;

private final int endPosition;

private int index = -1;

//remove the default value -1
private Number value;
}

but the range value keep the single quote for the string like this:

['2018-01-01 00:00:00', '2018-01-01 23:59:59']

lowerEndpoint: '2018-01-01 00:00:00' upperEndpoint: '2018-01-01 23:59:59'

and what we expected is like this:

[2018-01-01 00:00:00, 2018-01-01 23:59:59]

lowerEndpoint: 2018-01-01 00:00:00 upperEndpoint: 2018-01-01 23:59:59

the source code for RangeShardingAlgorithm is like this:

public Collection<String> doSharding(Collection<String> availableTargetNames, RangeShardingValue<String> value)

Which version of ShardingSphere did you use?

3.1.0

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

Sharding-JDBC

Expected behavior

supported

Actual behavior

not supported

Reason analyze (If you can)

as mentioned above

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

as mentioned above

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

as mentioned above