osv: Fix error on group by when double inherits in table