Ticket #1561 (new defect)

Opened 2 years ago

Last modified 15 months ago

Result cache inactive for count() queries

Reported by: francois Owned by: romanb
Priority: minor Milestone: 1.2.0
Component: Caching Version: 1.0.3
Severity: abc Keywords:
Cc: Has Test: yes
Status: Pending Core Response Has Patch: no

Description (last modified by esycat) (diff)

If I terminate a query with count() instead of execute(), the result cache settings are ignored and the SQL query is always executed.

Test script:

// execute once
$query = Doctrine_Query::create()
  ->useResultCache(new Doctrine_Cache_Apc())
  ->select('b.title')
  ->from('Blog b')
  ->count();
// execute a second time
$query = Doctrine_Query::create()
  ->useResultCache(new Doctrine_Cache_Apc())
  ->select('b.title')
  ->from('Blog b')
  ->count();
// this should not execute a new SQL query, yet it does

If Doctrine_Query::count() ignores cache settings n purpose, this should at leat be mentioned in the documentation.

Attachments

1561TestCase.php Download (3.2 KB) - added by esycat 22 months ago.
Test Case.

Change History

Changed 23 months ago by jwage

  • milestone changed from Unknown to 1.0.4

Changed 22 months ago by esycat

  • description modified (diff)
  • has_test set

Changed 22 months ago by esycat

Test Case.

Changed 21 months ago by jwage

  • milestone changed from 1.0.5 to 1.0.6

Changed 21 months ago by jwage

  • milestone changed from 1.0.6 to 1.0.7

Changed 19 months ago by jwage

  • milestone changed from 1.0.7 to 1.2.0

Changed 15 months ago by sunrise

  • severity set to abc
This works ok for me.. but It probably needs feedback. Nike Air Yeezy Shoes
Note: See TracTickets for help on using tickets.