Skip to content

test(dav): fix ORA-00932: inconsistent datatypes: expected - got BLOB#61913

Draft
hamza221 wants to merge 1 commit into
test/stop-using-internal-databasefrom
fix/Oracle/blob-groupby
Draft

test(dav): fix ORA-00932: inconsistent datatypes: expected - got BLOB#61913
hamza221 wants to merge 1 commit into
test/stop-using-internal-databasefrom
fix/Oracle/blob-groupby

Conversation

@hamza221

@hamza221 hamza221 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Oracle can't group-by blob

I tried to make sure that these fixes were not regressed:

@hamza221 hamza221 requested review from Altahrim, ArtificialOwl, leftybournes and salmart-dev and removed request for a team July 8, 2026 13:17
@hamza221 hamza221 added the 3. to review Waiting for reviews label Jul 8, 2026
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 force-pushed the fix/Oracle/blob-groupby branch from 1e42413 to ffbf65b Compare July 8, 2026 13:18
@hamza221 hamza221 changed the title tesl(dav): fix ORA-00932: inconsistent datatypes: expected - got BLOB test(dav): fix ORA-00932: inconsistent datatypes: expected - got BLOB Jul 8, 2026
@hamza221 hamza221 marked this pull request as draft July 8, 2026 13:23
@tcitworld

Copy link
Copy Markdown
Member

Sigh… Oracle

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CalDAV reminder backend and its unit tests to avoid Oracle’s ORA-00932 error by removing a GROUP BY that included BLOB columns, while still handling duplicate reminder rows during processing.

Changes:

  • Removed the GROUP BY from getRemindersToProcess() and introduced PHP-side deduplication of reminder rows.
  • Updated CalDAV reminder backend unit tests to account for an explicit duplicate reminder row and to stabilize row ordering where needed.
  • Added deterministic ordering to UserStatusMapper::findAll() (scope-wise unrelated to the DAV/Oracle change as described).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
apps/user_status/lib/Db/UserStatusMapper.php Adds a deterministic ORDER BY user_id for findAll() results (not mentioned in PR’s DAV/Oracle focus).
apps/dav/tests/unit/CalDAV/Reminder/BackendTest.php Updates test dataset and assertions to include a duplicate reminder row and adjusted counts.
apps/dav/lib/CalDAV/Reminder/Backend.php Removes BLOB-incompatible GROUP BY and adds PHP-side deduplication for reminders-to-process.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 42 to +46
$query->select(['cr.id', 'cr.calendar_id','cr.object_id','cr.is_recurring','cr.uid','cr.recurrence_id','cr.is_recurrence_exception','cr.event_hash','cr.alarm_hash','cr.type','cr.is_relative','cr.notification_date','cr.is_repeat_based','co.calendardata', 'c.displayname', 'c.principaluri'])
->from('calendar_reminders', 'cr')
->where($query->expr()->lte('cr.notification_date', $query->createNamedParameter($this->timeFactory->getTime())))
->join('cr', 'calendarobjects', 'co', $query->expr()->eq('cr.object_id', 'co.id'))
->join('cr', 'calendars', 'c', $query->expr()->eq('cr.calendar_id', 'c.id'))
->groupBy('cr.event_hash', 'cr.notification_date', 'cr.type', 'cr.id', 'cr.calendar_id', 'cr.object_id', 'cr.is_recurring', 'cr.uid', 'cr.recurrence_id', 'cr.is_recurrence_exception', 'cr.alarm_hash', 'cr.is_relative', 'cr.is_repeat_based', 'co.calendardata', 'c.displayname', 'c.principaluri');
->join('cr', 'calendars', 'c', $query->expr()->eq('cr.calendar_id', 'c.id'));
Comment on lines +187 to +191
$key = implode("\0", [
(string)$row['notification_date'],
(string)$row['event_hash'],
(string)$row['type'],
]);
Comment on lines 39 to +41
->from($this->tableName)
->where($qb->expr()->eq('is_backup', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL)));
->where($qb->expr()->eq('is_backup', $qb->createNamedParameter(false, IQueryBuilder::PARAM_BOOL)))
->orderBy('user_id', 'ASC');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants