From: Frédéric Buclin Date: Tue, 4 Sep 2012 11:00:01 +0000 (+0200) Subject: Bug 787687: SQLite doesn't support CHAR_LENGTH natively X-Git-Tag: bugzilla-4.4rc1~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adfde263c6c42a7b6ce839829924e58d022ba800;p=thirdparty%2Fbugzilla.git Bug 787687: SQLite doesn't support CHAR_LENGTH natively r=wicked a=LpSolit --- diff --git a/Bugzilla/DB/Sqlite.pm b/Bugzilla/DB/Sqlite.pm index f27ad71431..e0197402fa 100644 --- a/Bugzilla/DB/Sqlite.pm +++ b/Bugzilla/DB/Sqlite.pm @@ -128,6 +128,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('char_length', 1, sub { length($_[0]) }); $self->sqlite_create_function('mod', 2, \&_sqlite_mod); $self->sqlite_create_function('now', 0, \&_sqlite_now); $self->sqlite_create_function('localtimestamp', 1, \&_sqlite_now);