Skip to content

2.0.0版本,查询count时包含sum等聚合函数的sql被解析为SimpleCount #175

@jiachengyan

Description

@jiachengyan

我有一个报表的查询,在没有其它维度进行分组时。
执行sql为:select IFNULL( ROUND( SUM( highprice_sum ),2), 0) AS highPrice from dsp_basic_report
被解析为:select count(*) from dsp_basic_report
看了com.github.pagehelper.parser.DefaultCountSqlParser.isSimpleCount方法,只解析了IFNULL函数不在AGGREGATE_FUNCTIONS中,就直接返回了true,这种里面包含SUM这种AGGREGATE_FUNCTION是不是不该被认定为SimpleCount
详细可参考:https://juejin.cn/post/7366446446819049511

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions