diff options
author | sunnavy <sunnavy@bestpractical.com> | 2022-03-31 00:27:48 +0300 |
---|---|---|
committer | Brian Conry <bconry@bestpractical.com> | 2022-05-09 22:40:26 +0300 |
commit | f782e929b38611132b5347d13209adf3bfaec226 (patch) | |
tree | 7a3130b91dbb6cf240a7e96a97f1e4f9c67d6ff6 | |
parent | 97507f71ce00ab5e4f2c99697471e23a414129b5 (diff) |
Support to search CLOB fields for Oracle5.0/oracle-clob-search
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
-rw-r--r-- | lib/RT/SearchBuilder.pm | 10 |
1 files changed, 10 insertions, 0 deletions
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 ); } |