summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-01-18 22:56:53 +0100
committermkanat%bugzilla.org <>2008-01-18 22:56:53 +0100
commit793c103590ff0742b6163dca25cfc6250c68f803 (patch)
tree854667752ad8e4377c7bc18c2b40177e7f3083da /Bugzilla/DB
parent2c8316b9f30ca3ab96b7e8acd1275253ae3e272f (diff)
downloadbugzilla-793c103590ff0742b6163dca25cfc6250c68f803.tar.gz
bugzilla-793c103590ff0742b6163dca25cfc6250c68f803.tar.xz
Bug 408172: [Oracle] Bug lists longer than 1000 bugs fail
Patch By Xiaoou Wu <xiaoou.wu@oracle.com> r=mkanat, a=mkanat
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r--Bugzilla/DB/Oracle.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm
index f89a72ab0..169550087 100644
--- a/Bugzilla/DB/Oracle.pm
+++ b/Bugzilla/DB/Oracle.pm
@@ -165,6 +165,22 @@ sub sql_position {
my ($self, $fragment, $text) = @_;
return "INSTR($text, $fragment)";
}
+
+sub sql_in {
+ my ($self, $column_name, $in_list_ref) = @_;
+ my @in_list = @$in_list_ref;
+ return $self->SUPER::sql_in($column_name, $in_list_ref) if $#in_list < 1000;
+ my @in_str;
+ while (@in_list) {
+ my $length = $#in_list + 1;
+ my $splice = $length > 1000 ? 1000 : $length;
+ my @sub_in_list = splice(@in_list, 0, $splice);
+ push(@in_str,
+ $self->SUPER::sql_in($column_name, \@sub_in_list));
+ }
+ return "( " . join(" OR ", @in_str) . " )";
+}
+
sub _fix_empty {
my ($string) = @_;
$string = '' if $string eq EMPTY_STRING;