Ticket #1561 (new defect)

Opened 9 months ago

Last modified 3 weeks 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 (3.2 KB) - added by esycat 8 months ago.
Test Case.

Change History

Changed 9 months ago by jwage

  • milestone changed from Unknown to 1.0.4

Changed 8 months ago by esycat

  • description modified (diff)
  • has_test set

Changed 8 months ago by esycat

Test Case.

Changed 7 months ago by jwage

  • milestone changed from 1.0.5 to 1.0.6

Changed 7 months ago by jwage

  • milestone changed from 1.0.6 to 1.0.7

Changed 5 months ago by jwage

  • milestone changed from 1.0.7 to 1.2.0

Changed 3 weeks 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.