cycle / database

Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
MIT License
53 stars 22 forks source link

Fix incorrect parameters processing for JOIN subquery #133

Closed smelesh closed 9 months ago

smelesh commented 9 months ago

Fixes #117

Parameters are processed incorrectly for JOIN subquery:

smelesh commented 9 months ago

During the fix of failing test for SQLServer, I've spotted another issue - joins part must be executed exactly when it's added to the statement, otherwise an order of parameters parsed from JOIN tokens is broken. So, I've reverted this part and only parse names and register aliases, but with a temporary QueryParameters container to avoid parameters duplication. This allows to resolve all names and aliases without affecting the result statement.

codecov[bot] commented 9 months ago

Codecov Report

Merging #133 (2370e89) into 2.x (fc0c2da) will increase coverage by 0.02%. Report is 4 commits behind head on 2.x. The diff coverage is 100.00%.

@@             Coverage Diff              @@
##                2.x     #133      +/-   ##
============================================
+ Coverage     94.68%   94.70%   +0.02%     
- Complexity     1666     1678      +12     
============================================
  Files            96       96              
  Lines          4494     4516      +22     
============================================
+ Hits           4255     4277      +22     
  Misses          239      239              
Files Coverage Δ
src/Driver/Compiler.php 96.10% <100.00%> (+0.05%) :arrow_up:
src/Driver/CompilerCache.php 88.96% <100.00%> (-0.08%) :arrow_down:
src/Driver/SQLServer/SQLServerCompiler.php 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

roxblnfk commented 9 months ago

Thanks!