projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ec8b028
)
change ILIKE into LOWER() for compatibility with non-Pg and Pg before 7.1
author
ivan
<ivan>
Sun, 13 Oct 2002 01:14:34 +0000
(
01:14
+0000)
committer
ivan
<ivan>
Sun, 13 Oct 2002 01:14:34 +0000
(
01:14
+0000)
FS/FS/Record.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Record.pm
b/FS/FS/Record.pm
index
a23f37a
..
ebcbbb4
100644
(file)
--- a/
FS/FS/Record.pm
+++ b/
FS/FS/Record.pm
@@
-208,34
+208,40
@@
sub qsearch {
$statement .= ' WHERE '. join(' AND ', map {
my $op = '=';
$statement .= ' WHERE '. join(' AND ', map {
my $op = '=';
+ my $column = $_;
if ( ref($record->{$_}) ) {
$op = $record->{$_}{'op'} if $record->{$_}{'op'};
if ( ref($record->{$_}) ) {
$op = $record->{$_}{'op'} if $record->{$_}{'op'};
- $op = 'LIKE' if $op =~ /^ILIKE$/i && driver_name ne 'Pg';
+ #$op = 'LIKE' if $op =~ /^ILIKE$/i && driver_name ne 'Pg';
+ if ( uc($op) eq 'ILIKE' ) {
+ $op = 'LIKE';
+ $record->{$_}{'value'} = lc($record->{$_}{'value'});
+ $column = "LOWER($_)";
+ }
$record->{$_} = $record->{$_}{'value'}
}
if ( ! defined( $record->{$_} ) || $record->{$_} eq '' ) {
if ( $op eq '=' ) {
if ( driver_name eq 'Pg' ) {
$record->{$_} = $record->{$_}{'value'}
}
if ( ! defined( $record->{$_} ) || $record->{$_} eq '' ) {
if ( $op eq '=' ) {
if ( driver_name eq 'Pg' ) {
- qq-( $
_ IS NULL OR $_
= '' )-;
+ qq-( $
column IS NULL OR $column
= '' )-;
} else {
} else {
- qq-( $
_ IS NULL OR $_
= "" )-;
+ qq-( $
column IS NULL OR $column
= "" )-;
}
} elsif ( $op eq '!=' ) {
if ( driver_name eq 'Pg' ) {
}
} elsif ( $op eq '!=' ) {
if ( driver_name eq 'Pg' ) {
- qq-( $
_ IS NOT NULL AND $_
!= '' )-;
+ qq-( $
column IS NOT NULL AND $column
!= '' )-;
} else {
} else {
- qq-( $
_ IS NOT NULL AND $_
!= "" )-;
+ qq-( $
column IS NOT NULL AND $column
!= "" )-;
}
} else {
if ( driver_name eq 'Pg' ) {
}
} else {
if ( driver_name eq 'Pg' ) {
- qq-( $
_
$op '' )-;
+ qq-( $
column
$op '' )-;
} else {
} else {
- qq-( $
_
$op "" )-;
+ qq-( $
column
$op "" )-;
}
}
} else {
}
}
} else {
- "$
_
$op ?";
+ "$
column
$op ?";
}
} @fields );
}
}
} @fields );
}