Closed Tigrov closed 1 year ago
Update to CHANGELOG.md A new entry has been added to the CHANGELOG to document the changes made related to Bug #761. This change specifically addresses the quoting of aliases (alternative names) used in certain types of queries called "WITH" queries.
Improvements to withQuery
method
The withQuery
method in the Query.php
and QueryPartsInterface.php
files now accepts either an ExpressionInterface
(a designated format for expressions within the system) or a string as the alias parameter. This change will make the code more flexible in handling different inputs.
Enhancement of AbstractDQLQueryBuilder.php
Two significant changes were made to this file:
buildWithQueries
method now includes a call to a new function quoteCteAlias
which ensures that the alias of Common Table Expressions (CTE, a type of temporary result sets) is properly formatted within the query. quoteCteAlias
has been added to handle the quoting of CTE alias.Addition of Test Cases
Several new test cases have been added to the AbstractQueryBuilderTest.php
and CommonQueryTest.php
files. These tests ensure that the WITH
query functions as expected when using an alias, both with and without column names, and in the case of recursive CTEs.
New Data Provider in QueryBuilderProvider.php
A new data provider has been added to support different cases for the cteAliases
test case. This means that more diverse scenarios can be tested, ensuring robustness of the code against various use-cases.
All modified lines are covered by tests :white_check_mark:
Comparison is base (
071f46a
) 99.05% compared to head (d362637
) 99.73%.:exclamation: Current head d362637 differs from pull request most recent head 93ba140. Consider uploading reports for the commit 93ba140 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Fix bug with Oracle when CTE aliases is not quoted.
- Fix bug with Oracle and MSSQL:
RECURSIVE
expression is not needed for CTE.Q A Is bugfix? ✔️ New feature? ❌ Breaks BC? ❌ Fixed issues -
Please add links to db-* PR's
Done
RECURSIVE
expression is not needed for CTE.Related PRs