mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
优化count查询兼容informix
This commit is contained in:
parent
ffe5a08628
commit
17357d29b5
@ -3,7 +3,7 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 6.0.0.M1 (2023-04-23)
|
||||
# 6.0.0.M4 (2023-05-09)
|
||||
|
||||
### 计划实现
|
||||
* 【poi 】 Markdown相关(如HTML转换等),基于commonmark-java
|
||||
@ -14,5 +14,6 @@
|
||||
### ❌不兼容特性
|
||||
|
||||
### 🐣新特性
|
||||
* 【db 】 优化count查询兼容informix(issue#I713XQ@Gitee)
|
||||
|
||||
### 🐞Bug修复
|
@ -160,8 +160,10 @@ public interface Dialect extends Serializable {
|
||||
* @since 5.7.2
|
||||
*/
|
||||
default PreparedStatement psForCount(final Connection conn, SqlBuilder sqlBuilder) throws SQLException {
|
||||
// https://gitee.com/dromara/hutool/issues/I713XQ
|
||||
// 为了兼容informix等数据库,此处使用count(*)而非count(1)
|
||||
sqlBuilder = sqlBuilder
|
||||
.insertPreFragment("SELECT count(1) from(")
|
||||
.insertPreFragment("SELECT count(*) from(")
|
||||
// issue#I3IJ8X@Gitee,在子查询时需设置单独别名,此处为了防止和用户的表名冲突,使用自定义的较长别名
|
||||
.append(") hutool_alias_count_");
|
||||
return psForPage(conn, sqlBuilder, null);
|
||||
|
Loading…
x
Reference in New Issue
Block a user