]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 787687: SQLite doesn't support CHAR_LENGTH natively
authorFrédéric Buclin <LpSolit@gmail.com>
Tue, 4 Sep 2012 11:00:01 +0000 (13:00 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 4 Sep 2012 11:00:01 +0000 (13:00 +0200)
r=wicked a=LpSolit

Bugzilla/DB/Sqlite.pm

index f27ad71431061f5067bcff0d9a9382052a89e5e3..e0197402fa43afb58d3284dccadf5ce379bde6bf 100644 (file)
@@ -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);