mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
优化count查询兼容informix
This commit is contained in:
@@ -148,8 +148,10 @@ public interface Dialect extends Serializable {
|
||||
* @since 5.7.2
|
||||
*/
|
||||
default PreparedStatement psForCount(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);
|
||||
|
Reference in New Issue
Block a user