Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

between报错 #103

Closed
chenhz2284 opened this issue Jun 8, 2016 · 7 comments
Closed

between报错 #103

chenhz2284 opened this issue Jun 8, 2016 · 7 comments

Comments

@chenhz2284
Copy link

报错的sql为:
select * from pos where 1=1 and (gather_time between '2015-01-01' and '2015-01-02') and (partition_by between '20150101' and '20150102')

表结构如下:

create table pos_20150101
(
    id varchar(32) primary key,
    longitude double,
    latitude double,
    gather_time datetime,
    partition_by varchar(100)
)
engine=INNODB
DEFAULT charset=gbk;


create table pos_20150102
(
    id varchar(32) primary key,
    longitude double,
    latitude double,
    gather_time datetime,
    partition_by varchar(100)
)
engine=INNODB
DEFAULT charset=gbk;



create table pos_20160101
(
    id varchar(32) primary key,
    longitude double,
    latitude double,
    gather_time datetime,
    partition_by varchar(100)
)
engine=INNODB
DEFAULT charset=gbk;



create table pos_20160102
(
    id varchar(32) primary key,
    longitude double,
    latitude double,
    gather_time datetime,
    partition_by varchar(100)
)
engine=INNODB
DEFAULT charset=gbk;

partition_by 是分库分区键。

具体的代码见附件:

@chenhz2284
Copy link
Author

@jinfei21
Copy link
Contributor

jinfei21 commented Jun 8, 2016

报错的信息可不可贴出来一下。

@chenhz2284
Copy link
Author

image
报错信息如图

@chenhz2284
Copy link
Author

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:635)
at java.util.ArrayList.get(ArrayList.java:411)
at java.util.Collections$UnmodifiableList.get(Collections.java:1211)
at com.dangdang.ddframe.rdb.sharding.jdbc.AbstractShardingResultSet.(AbstractShardingResultSet.java:46)
at com.dangdang.ddframe.rdb.sharding.merger.iterator.IteratorResultSet.(IteratorResultSet.java:35)
at com.dangdang.ddframe.rdb.sharding.merger.ResultSetFactory.getResultSet(ResultSetFactory.java:66)
at com.dangdang.ddframe.rdb.sharding.jdbc.ShardingStatement.executeQuery(ShardingStatement.java:99)
at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:452)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:402)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:468)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:478)
at org.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:518)
at test.Main.main(Main.java:156)

@terrymanu
Copy link
Member

请问使用的哪个版本

@hanahmily
Copy link
Contributor

这应该是一个比较pipeline改造之前的老版本,当时对于空ResultSet列表没有任何校验。请使用最新版本,已经修复了这个问题

@chenhz2284
Copy link
Author

bm出错的版本是1.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants