Uh oh!
There was an error while loading. Please reload this page.
Use the defined func()->count() instead of manual counting - #11942
Conversation
| public function count($input) { | ||
| return new QueryFunction('COUNT(' . $this->helper->quoteColumnName($input) . ')'); | ||
| public function count($count, $alias = '') { |
There was a problem hiding this comment.
wouldn't alias work by just using selectAlias($qb->func()->count(...), 'alias')
There was a problem hiding this comment.
Yeah, i added it here because its done quite often
There was a problem hiding this comment.
having it here doesn't make sense to me though, since for the caller it's not any easier (the only difference is where you place the )) and it's duplicating code/functionality
There was a problem hiding this comment.
I'm fine with this here. It also reduces function nesting.
MorrisJobke
commented
Nov 6, 2018
@icewind1991@rullzer Any comments on this one? |
MorrisJobke
commented
Nov 7, 2018
Yay PHPunit tests fail 😢 I should have checked that earlier |
MorrisJobke
commented
Nov 7, 2018
Ah - disk was just full -> let's do another round: https://drone.nextcloud.com/nextcloud/server/12482 |
MorrisJobke
commented
Nov 7, 2018
This causes the same "Disk is full" errors 😨 |
nickvergessen
commented
Nov 7, 2018
strange, let me investigate |
08ee437 to
7365078Compare| $qb->createFunction('COUNT(' . $qb->getColumnName('c.id') . ')'), | ||
| 'num_ids' | ||
| ) | ||
| ->addSelect($qb->func()->count('c.id', 'num_ids')) |
There was a problem hiding this comment.
@MorrisJobke the problem was select here instead of addSelect which caused a lot of spam with missing index fileId across tests
MorrisJobke
commented
Nov 8, 2018
Still this one: |
nickvergessen
commented
Nov 8, 2018
fixed |
7365078 to
82fb91bCompareMorrisJobke
commented
Nov 8, 2018
Fails on Postgres https://drone.nextcloud.com/nextcloud/server/12537/167: |
Signed-off-by: Joas Schilling <coding@schilljs.com>
82fb91b to
bb352fbCompare
Now there are only 2 "functions" left which are both called twice and don't have a wrapper:
Not sure if it's worth the effort.