Ticket #1262 (closed defect: fixed)

Opened 12 months ago

Last modified 10 months ago

Missing identifier quoting in join condition

Reported by: mm Owned by: romanb
Priority: blocker Milestone:
Component: Query/Hydration Version: 0.11.0
Severity: Keywords: quoting, query, ATTR_QUOTE_IDENTIFIER
Cc: Has Test: no
Status: Pending Core Response Has Patch: yes

Description (last modified by mm) (diff)

Missing identifier quoting (when it's on Doctrine::ATTR_QUOTE_IDENTIFIER) in join condition affects query behavior. In real example, at building limit subquery table alias cannot be found (because missing quoting) and replaced for correct one, we have condition from top query to the deepest one, exec time jump from 0.94 ms to few minutes (with possible wrong results). Occur only with limit in query.

Db: PostgreSQL 8.3.3 Doctrine: 0.11

Actual (replace problem) Doctrine_Query line: 1338

$match => '"f2"."date"' 
$replace => '"f4"."date"' 
$subject => 'f2.date' 
$result => 'f2.date'

Expected:

$match => '"f2"."date"' 
$replace => '"f4"."date"' 
$subject => '"f2"."date"' 
$result => '"f4"."date"'

Reason, class Doctrine_Query_JoinCondition line: 142

. $alias . '.' . $field

Patch

. $conn->quoteIdentifier($alias . '.' . $field)

Attachments

JoinCondition.php (6.0 KB) - added by mm 12 months ago.
Patched file

Change History

Changed 12 months ago by mm

Patched file

Changed 12 months ago by mm

  • description modified (diff)

Changed 12 months ago by mm

  • description modified (diff)

Changed 12 months ago by guilhermeblanco

  • status changed from new to closed
  • resolution set to fixed

In r4708 fixed #1262 and fixed #1272.

Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.