We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
2.0.3
SQL
select create_time createTime , enterprise_id enterpriseId, interval_log_id intervalLogId , interval_type intervalType , p_member_integral_name pmemberIntegralName , member_integral_name memberIntegralName , remark remark , interval_remark intervalRemark , interval_inout intervalInout , interval_history intervalHistory, interval_status intervalStatus, frozen_status frozenStatus, unfreeze_time unfreezeTime, interval_effect intervalEffect, open_store_id openStoreId , main_part_store_id mainPartStoreId , main_store_id mainStoreId from tab_gic_member_interval_log where member_id in ('ff80808158016b390158041bfc7001eb','ff80808157dcf78e0157e67dbd611b28') and interval_history !=0 and p_member_integral_code not in('1000','1001') order by create_time desc
分片的查询结果正确的按照create_time进行排序
并没有按照时间排序
sql解析日志如下: 2018-05-07 11:48:21,021 INFO main Sharding-JDBC-SQL: SQLStatement: SelectStatement(super=DQLStatement(super=AbstractSQLStatement(type=DQL, tables=Tables(tables=[Table(name=tab_gic_member_interval_log, alias=Optional.of(log))]), conditions=Conditions(conditions={Column(name=member_id, tableName=tab_gic_member_interval_log)=Condition(column=Column(name=member_id, tableName=tab_gic_member_interval_log), operator=IN, positionValueMap={0=ff80808158016b390158041bfc7001eb, 1=ff80808157dcf78e0157e67dbd611b28}, positionIndexMap={})}), sqlTokens=[TableToken(beginPosition=765, originalLiterals=tab_gic_member_interval_log)], parametersIndex=0)), containStar=false, selectListLastPosition=752, groupByLastPosition=0, items=[CommonSelectItem(expression=log.interval_effect, alias=Optional.of(intervalEffect)), CommonSelectItem(expression=log.interval_type, alias=Optional.of(intervalType)), CommonSelectItem(expression=log.interval_history, alias=Optional.of(intervalHistory)), CommonSelectItem(expression=log.create_time, alias=Optional.of(createTime)), CommonSelectItem(expression=log.unfreeze_time, alias=Optional.of(unfreezeTime)), CommonSelectItem(expression=log.member_integral_name, alias=Optional.of(memberIntegralName)), CommonSelectItem(expression=log.remark, alias=Optional.of(remark)), CommonSelectItem(expression=log.interval_log_id, alias=Optional.of(intervalLogId)), CommonSelectItem(expression=log.p_member_integral_name, alias=Optional.of(pmemberIntegralName)), CommonSelectItem(expression=log.interval_remark, alias=Optional.of(intervalRemark)), CommonSelectItem(expression=log.enterprise_id, alias=Optional.of(enterpriseId)), CommonSelectItem(expression=log.interval_inout, alias=Optional.of(intervalInout)), CommonSelectItem(expression=log.main_part_store_id, alias=Optional.of(mainPartStoreId)), CommonSelectItem(expression=log.open_store_id, alias=Optional.of(openStoreId)), CommonSelectItem(expression=log.main_store_id, alias=Optional.of(mainStoreId)), CommonSelectItem(expression=log.interval_status, alias=Optional.of(intervalStatus)), CommonSelectItem(expression=log.frozen_status, alias=Optional.of(frozenStatus))], groupByItems=[], orderByItems=[], limit=null, subQueryStatement=null)
如果sql语句改为以下格式:
select create_time createTime , enterprise_id enterpriseId, interval_log_id intervalLogId , interval_type intervalType , p_member_integral_name pmemberIntegralName , member_integral_name memberIntegralName , remark remark , interval_remark intervalRemark , interval_inout intervalInout , interval_history intervalHistory, interval_status intervalStatus, frozen_status frozenStatus, unfreeze_time unfreezeTime, interval_effect intervalEffect, open_store_id openStoreId , main_part_store_id mainPartStoreId , main_store_id mainStoreId from tab_gic_member_interval_log where member_id in ('ff80808158016b390158041bfc7001eb','ff80808157dcf78e0157e67dbd611b28') and interval_history !=0 and p_member_integral_code !='1000' and p_member_integral_code!='1001' 则能获得正常结果,其解析日志如下:
2018-05-07 11:53:58,058 INFO main Sharding-JDBC-SQL: SQLStatement: SelectStatement(super=DQLStatement(super=AbstractSQLStatement(type=DQL, tables=Tables(tables=[Table(name=tab_gic_member_interval_log, alias=Optional.absent())]), conditions=Conditions(conditions={Column(name=member_id, tableName=tab_gic_member_interval_log)=Condition(column=Column(name=member_id, tableName=tab_gic_member_interval_log), operator=IN, positionValueMap={0=ff80808158016b390158041bfc7001eb, 1=ff80808157dcf78e0157e67dbd611b28}, positionIndexMap={})}), sqlTokens=[TableToken(beginPosition=697, originalLiterals=tab_gic_member_interval_log)], parametersIndex=0)), containStar=false, selectListLastPosition=684, groupByLastPosition=884, items=[CommonSelectItem(expression=unfreeze_time, alias=Optional.of(unfreezeTime)), CommonSelectItem(expression=interval_log_id, alias=Optional.of(intervalLogId)), CommonSelectItem(expression=interval_inout, alias=Optional.of(intervalInout)), CommonSelectItem(expression=p_member_integral_name, alias=Optional.of(pmemberIntegralName)), CommonSelectItem(expression=frozen_status, alias=Optional.of(frozenStatus)), CommonSelectItem(expression=member_integral_name, alias=Optional.of(memberIntegralName)), CommonSelectItem(expression=enterprise_id, alias=Optional.of(enterpriseId)), CommonSelectItem(expression=interval_type, alias=Optional.of(intervalType)), CommonSelectItem(expression=remark, alias=Optional.of(remark)), CommonSelectItem(expression=create_time, alias=Optional.of(createTime)), CommonSelectItem(expression=interval_remark, alias=Optional.of(intervalRemark)), CommonSelectItem(expression=open_store_id, alias=Optional.of(openStoreId)), CommonSelectItem(expression=interval_effect, alias=Optional.of(intervalEffect)), CommonSelectItem(expression=main_store_id, alias=Optional.of(mainStoreId)), CommonSelectItem(expression=main_part_store_id, alias=Optional.of(mainPartStoreId)), CommonSelectItem(expression=interval_history, alias=Optional.of(intervalHistory)), CommonSelectItem(expression=interval_status, alias=Optional.of(intervalStatus))], groupByItems=[OrderItem(owner=Optional.absent(), name=Optional.of(create_time), type=ASC, nullOrderType=ASC, index=-1, alias=Optional.of(createTime))], orderByItems=[OrderItem(owner=Optional.absent(), name=Optional.of(create_time), type=DESC, nullOrderType=ASC, index=-1, alias=Optional.of(createTime))], limit=null, subQueryStatement=null)
The text was updated successfully, but these errors were encountered:
fixed at 3.0.0.M1
Sorry, something went wrong.
for #806 update release notes
45c3c19
NOT IN
maxiaoguang64
No branches or pull requests
Which version of Sharding-Jdbc do you using?(您使用的Sharding-Jdbc版本为?)
2.0.3
Expected behavior (您预期的结果是)
SQL
select
create_time createTime ,
enterprise_id enterpriseId,
interval_log_id intervalLogId ,
interval_type intervalType ,
p_member_integral_name pmemberIntegralName ,
member_integral_name memberIntegralName ,
remark remark ,
interval_remark intervalRemark ,
interval_inout intervalInout ,
interval_history intervalHistory,
interval_status intervalStatus,
frozen_status frozenStatus,
unfreeze_time unfreezeTime,
interval_effect intervalEffect,
open_store_id openStoreId ,
main_part_store_id mainPartStoreId ,
main_store_id mainStoreId
from
tab_gic_member_interval_log
where
member_id in ('ff80808158016b390158041bfc7001eb','ff80808157dcf78e0157e67dbd611b28') and interval_history !=0 and p_member_integral_code not in('1000','1001')
order by create_time desc
分片的查询结果正确的按照create_time进行排序
Actual behavior (实际运行的结果是)
并没有按照时间排序
sql解析日志如下:
2018-05-07 11:48:21,021 INFO main Sharding-JDBC-SQL: SQLStatement:
SelectStatement(super=DQLStatement(super=AbstractSQLStatement(type=DQL, tables=Tables(tables=[Table(name=tab_gic_member_interval_log, alias=Optional.of(log))]), conditions=Conditions(conditions={Column(name=member_id, tableName=tab_gic_member_interval_log)=Condition(column=Column(name=member_id, tableName=tab_gic_member_interval_log), operator=IN, positionValueMap={0=ff80808158016b390158041bfc7001eb, 1=ff80808157dcf78e0157e67dbd611b28}, positionIndexMap={})}),
sqlTokens=[TableToken(beginPosition=765, originalLiterals=tab_gic_member_interval_log)], parametersIndex=0)),
containStar=false, selectListLastPosition=752, groupByLastPosition=0,
items=[CommonSelectItem(expression=log.interval_effect, alias=Optional.of(intervalEffect)), CommonSelectItem(expression=log.interval_type, alias=Optional.of(intervalType)), CommonSelectItem(expression=log.interval_history, alias=Optional.of(intervalHistory)), CommonSelectItem(expression=log.create_time, alias=Optional.of(createTime)), CommonSelectItem(expression=log.unfreeze_time, alias=Optional.of(unfreezeTime)), CommonSelectItem(expression=log.member_integral_name, alias=Optional.of(memberIntegralName)), CommonSelectItem(expression=log.remark, alias=Optional.of(remark)), CommonSelectItem(expression=log.interval_log_id, alias=Optional.of(intervalLogId)), CommonSelectItem(expression=log.p_member_integral_name, alias=Optional.of(pmemberIntegralName)), CommonSelectItem(expression=log.interval_remark, alias=Optional.of(intervalRemark)), CommonSelectItem(expression=log.enterprise_id, alias=Optional.of(enterpriseId)), CommonSelectItem(expression=log.interval_inout, alias=Optional.of(intervalInout)), CommonSelectItem(expression=log.main_part_store_id, alias=Optional.of(mainPartStoreId)), CommonSelectItem(expression=log.open_store_id, alias=Optional.of(openStoreId)), CommonSelectItem(expression=log.main_store_id, alias=Optional.of(mainStoreId)), CommonSelectItem(expression=log.interval_status, alias=Optional.of(intervalStatus)), CommonSelectItem(expression=log.frozen_status, alias=Optional.of(frozenStatus))], groupByItems=[], orderByItems=[], limit=null, subQueryStatement=null)
如果sql语句改为以下格式:
select
create_time createTime ,
enterprise_id enterpriseId,
interval_log_id intervalLogId ,
interval_type intervalType ,
p_member_integral_name pmemberIntegralName ,
member_integral_name memberIntegralName ,
remark remark ,
interval_remark intervalRemark ,
interval_inout intervalInout ,
interval_history intervalHistory,
interval_status intervalStatus,
frozen_status frozenStatus,
unfreeze_time unfreezeTime,
interval_effect intervalEffect,
open_store_id openStoreId ,
main_part_store_id mainPartStoreId ,
main_store_id mainStoreId
from
tab_gic_member_interval_log
where
member_id in ('ff80808158016b390158041bfc7001eb','ff80808157dcf78e0157e67dbd611b28') and interval_history !=0 and p_member_integral_code !='1000' and p_member_integral_code!='1001'
则能获得正常结果,其解析日志如下:
2018-05-07 11:53:58,058 INFO main Sharding-JDBC-SQL: SQLStatement: SelectStatement(super=DQLStatement(super=AbstractSQLStatement(type=DQL, tables=Tables(tables=[Table(name=tab_gic_member_interval_log, alias=Optional.absent())]), conditions=Conditions(conditions={Column(name=member_id, tableName=tab_gic_member_interval_log)=Condition(column=Column(name=member_id, tableName=tab_gic_member_interval_log), operator=IN, positionValueMap={0=ff80808158016b390158041bfc7001eb, 1=ff80808157dcf78e0157e67dbd611b28}, positionIndexMap={})}), sqlTokens=[TableToken(beginPosition=697, originalLiterals=tab_gic_member_interval_log)], parametersIndex=0)), containStar=false, selectListLastPosition=684, groupByLastPosition=884, items=[CommonSelectItem(expression=unfreeze_time, alias=Optional.of(unfreezeTime)), CommonSelectItem(expression=interval_log_id, alias=Optional.of(intervalLogId)), CommonSelectItem(expression=interval_inout, alias=Optional.of(intervalInout)), CommonSelectItem(expression=p_member_integral_name, alias=Optional.of(pmemberIntegralName)), CommonSelectItem(expression=frozen_status, alias=Optional.of(frozenStatus)), CommonSelectItem(expression=member_integral_name, alias=Optional.of(memberIntegralName)), CommonSelectItem(expression=enterprise_id, alias=Optional.of(enterpriseId)), CommonSelectItem(expression=interval_type, alias=Optional.of(intervalType)), CommonSelectItem(expression=remark, alias=Optional.of(remark)), CommonSelectItem(expression=create_time, alias=Optional.of(createTime)), CommonSelectItem(expression=interval_remark, alias=Optional.of(intervalRemark)), CommonSelectItem(expression=open_store_id, alias=Optional.of(openStoreId)), CommonSelectItem(expression=interval_effect, alias=Optional.of(intervalEffect)), CommonSelectItem(expression=main_store_id, alias=Optional.of(mainStoreId)), CommonSelectItem(expression=main_part_store_id, alias=Optional.of(mainPartStoreId)), CommonSelectItem(expression=interval_history, alias=Optional.of(intervalHistory)), CommonSelectItem(expression=interval_status, alias=Optional.of(intervalStatus))], groupByItems=[OrderItem(owner=Optional.absent(), name=Optional.of(create_time), type=ASC, nullOrderType=ASC, index=-1, alias=Optional.of(createTime))], orderByItems=[OrderItem(owner=Optional.absent(), name=Optional.of(create_time), type=DESC, nullOrderType=ASC, index=-1, alias=Optional.of(createTime))], limit=null, subQueryStatement=null)
The text was updated successfully, but these errors were encountered: