diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index ac0be567043..2acc1a5cad5 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7693 \ No newline at end of file +7694 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Sqlite.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Sqlite.pm index 2c3448acf3a..e40a264f0a2 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Sqlite.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Sqlite.pm @@ -48,6 +48,8 @@ use constant WORD_END => '(?:$|\W)'; # not accent-insensitive). sub _sqlite_collate_ci { lc($_[0]) cmp lc($_[1]) } +sub _sqlite_mod { $_[0] % $_[1] } + sub _sqlite_now { my $now = DateTime->now(time_zone => Bugzilla->local_timezone); return $now->ymd . ' ' . $now->hms; @@ -135,6 +137,7 @@ sub new { # so that's what we use, and I don't know of any way in SQLite to # alias the SQL "substr" function to be called "SUBSTRING". $self->sqlite_create_function('substring', 3, \&CORE::substr); + $self->sqlite_create_function('mod', 2, \&_sqlite_mod); $self->sqlite_create_function('now', 0, \&_sqlite_now); $self->sqlite_create_function('localtimestamp', 1, \&_sqlite_now); $self->sqlite_create_function('floor', 1, \&POSIX::floor);