hypery2k / owncloud

In this repo you'll find apps and enhancements for owncloud
Other
156 stars 85 forks source link

error subquery for admin chart #336

Closed mckaygerhard closed 9 years ago

mckaygerhard commented 9 years ago

when fixed the db the query are wrong for standars..

-- An exception occurred while executing 'SELECT stc_id, stc_dayts, oc_uid FROM (SELECT * FROM oc_storagecharts2 ORDER BY oc_uid,stc_dayts DESC) last GROUP BY oc_uid': SQLSTATE[42803]: 

Grouping error: 7 ERROR: column "last.stc_id" must appear in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT stc_id, stc_dayts, oc_uid FROM (SELECT * FROM oc_stor... ^

the query in question are:

SELECT stc_id, stc_dayts, oc_uid FROM (SELECT * FROM oc_storagecharts2 ORDER BY oc_uid,stc_dayts DESC) last GROUP BY oc_uid

on a gourping all the fileds must appears in the group by cluse..

so i'll repair the query to made available for all databases, so i tests under mysql and mysql soes not follow sql strict that's why the charts does not work for oracle, sqlite and postgres backends..

mckaygerhard commented 9 years ago

reopened due #327

mckaygerhard commented 9 years ago

i have the proper join.. i'll commit in hours after some tests in oracle and postgres (need wait until users registered some activity in space used by each one)