[Rt-commit] rt branch 5.0/oracle-clob-search created. rt-5.0.2-113-g65fb323139
BPS Git Server
git at git.bestpractical.com
Wed Mar 30 22:07:40 UTC 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".
The branch, 5.0/oracle-clob-search has been created
at 65fb323139ba4598bc9bfa82fe7a8127a618133f (commit)
- Log -----------------------------------------------------------------
commit 65fb323139ba4598bc9bfa82fe7a8127a618133f
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Mar 31 05:27:48 2022 +0800
Support to search CLOB fields for Oracle
This is initially for RT::Dashboard::CurrentUserCanDelete, where we
check if current dashboard is used as system default by searching
Content field, which is a CLOB in Oracle. It's to fix errors like:
ORA-00932: inconsistent datatypes: expected - got CLOB
diff --git a/lib/RT/SearchBuilder.pm b/lib/RT/SearchBuilder.pm
index caf1d035b1..6c8c3d05cc 100644
--- a/lib/RT/SearchBuilder.pm
+++ b/lib/RT/SearchBuilder.pm
@@ -999,6 +999,16 @@ sub Limit {
$ARGS{'CASESENSITIVE'} = 1;
}
+ # Oracle doesn't support to directly compare CLOB with VARCHAR/INTEGER.
+ # DefaultDashboard search in RT::Dashboard::CurrentUserCanDelete needs this
+ if ( $ARGS{OPERATOR} !~ /IS/i
+ && !$ARGS{FUNCTION}
+ && RT->Config->Get('DatabaseType') eq 'Oracle'
+ && $self->RecordClass->_Accessible( $ARGS{FIELD}, 'is_blob' ) )
+ {
+ $ARGS{FUNCTION} = 'TO_CHAR(?)';
+ }
+
return $self->SUPER::Limit( %ARGS );
}
-----------------------------------------------------------------------
hooks/post-receive
--
rt
More information about the rt-commit
mailing list