Skip to content

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

Merged
hamza221 merged 1 commit into
test/stop-using-internal-databasefrom
fix/Oracle/blob-groupby
Jul 23, 2026
Merged

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

Conversation

@hamza221

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 teamJuly 8, 2026 13:17
@hamza221hamza221 added the 3. to review Waiting for reviews label Jul 8, 2026
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221
hamza221force-pushed the fix/Oracle/blob-groupby branch from 1e42413 to ffbf65bCompareJuly 8, 2026 13:18
@hamza221hamza221 changed the title tesl(dav): fix ORA-00932: inconsistent datatypes: expected - got BLOBtest(dav): fix ORA-00932: inconsistent datatypes: expected - got BLOBJul 8, 2026
@hamza221
hamza221 marked this pull request as draft July 8, 2026 13:23
@tcitworld

Copy link
Copy Markdown
Member

Sigh… Oracle

CopilotAI 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.

FileDescription
apps/user_status/lib/Db/UserStatusMapper.phpAdds a deterministic ORDER BY user_id for findAll() results (not mentioned in PR’s DAV/Oracle focus).
apps/dav/tests/unit/CalDAV/Reminder/BackendTest.phpUpdates test dataset and assertions to include a duplicate reminder row and adjusted counts.
apps/dav/lib/CalDAV/Reminder/Backend.phpRemoves 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');
@hamza221
hamza221 marked this pull request as ready for review July 23, 2026 14:53

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Makes sense to no longer deduplicate on DB level. It is unlikely to happen, and should it then the PHP deduplication catches it.

@hamza221
hamza221 merged commit 15c106d into test/stop-using-internal-databaseJul 23, 2026
172 of 189 checks passed
@hamza221
hamza221 deleted the fix/Oracle/blob-groupby branch July 23, 2026 14:53
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@hamza221@tcitworld@ChristophWurst