Skip to content

Conversation

@rbygrave
Copy link
Member

@rbygrave rbygrave commented Feb 8, 2025

  • Modifies CQueryBuilder with the main fix which is to use the database platform selectCountWithColumnAlias for all distinct queries [and later disable it for single column case]

  • Modifies SqlTreeBuilder because we need to NOT use the column alias for the count distinct SINGLE COLUMN case. So change here to:

    • build the root SqlTreeNode first as part of constructor

    • use rootNode.isSingleProperty() to NOT use column alias for the single column case

    • Hence need to initialise DefaultDbSqlContext AFTER the root SqlTreeNode

    • Modifies DefaultDbSqlContext with no effective change, just columnIndex++ ONLY when we are actually using column alias

  • Modifies H2Platform to also use selectCountWithColumnAlias true

- Modifies CQueryBuilder with the main fix which is to use the database platform selectCountWithColumnAlias for all distinct queries [and later disable it for single column case]

- Modifies SqlTreeBuilder because we need to NOT use the column alias for the count distinct SINGLE COLUMN case. So change here to:
  - build the root SqlTreeNode first as part of constructor
  - use rootNode.isSingleProperty() to NOT use column alias for the single column case
  - Hence need to initialise DefaultDbSqlContext AFTER the root SqlTreeNode

  - Modifies DefaultDbSqlContext with no effective change, just columnIndex++ ONLY when we are actually using column alias

 - Modifies H2Platform to also use selectCountWithColumnAlias true
Plus fix TestRowCount for Oracle platform
@rbygrave rbygrave added this to the 14.8.2 milestone Feb 8, 2025
@rbygrave rbygrave merged commit 60aa899 into master Feb 8, 2025
6 checks passed
@rbygrave rbygrave deleted the feature/3553 branch February 8, 2025 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants