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
现象: SQL: select count(*) as cnt from tbl;
select count(*) as cnt from tbl;
如果我使用 ResultSet.getLong() 或 getInt()都可以。 但是如果我使用 getObject(),就会报异常: ShardingJdbcException("Unsupported data type:%s", convertType)
ResultSet.getLong()
getInt()
getObject()
ShardingJdbcException("Unsupported data type:%s", convertType)
原因: s-jdbc在聚合Merge时,会根据调用方法的返回值来转换merge的结果,当调用getObject()取Number类型结果时,就需要将Number转为Object了,现在s-jdbc直接报不支持的类型。
s-jdbc
Merge
merge
Number
Object
修改方法: 对于返回类型为Object时,直接将Number值返回。
代码位置: com/dangdang/ddframe/rdb/sharding/merger/common/ResultSetUtil.java convertNumberValue方法: 我给增加了
com/dangdang/ddframe/rdb/sharding/merger/common/ResultSetUtil.java
convertNumberValue
case "java.lang.Object": return value;
在我本地测试没有问题了。
The text was updated successfully, but these errors were encountered:
@wangda 感谢您的bug回复,1.0.1的时候我们会进行修复
Sorry, something went wrong.
b78ca05
Merge pull request #18 from sharding-sphere/dev
2e4c47f
update from origin
Restore authority password after commit migration (refresh metadata) (#…
996cd13
…18)
No branches or pull requests
现象:
SQL:
select count(*) as cnt from tbl;
如果我使用
ResultSet.getLong()
或getInt()
都可以。但是如果我使用
getObject()
,就会报异常:ShardingJdbcException("Unsupported data type:%s", convertType)
原因:
s-jdbc
在聚合Merge
时,会根据调用方法的返回值来转换merge
的结果,当调用getObject()
取Number
类型结果时,就需要将Number
转为Object
了,现在s-jdbc
直接报不支持的类型。修改方法:
对于返回类型为
Object
时,直接将Number
值返回。代码位置:
com/dangdang/ddframe/rdb/sharding/merger/common/ResultSetUtil.java
convertNumberValue
方法:我给增加了
在我本地测试没有问题了。
The text was updated successfully, but these errors were encountered: