]> 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 10:58:21 +0000 (12:58 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 4 Sep 2012 10:58:21 +0000 (12:58 +0200)
r=wicked a=LpSolit

Bugzilla/DB/Sqlite.pm

index 5564e21df40bad20e89b56902c3466c7e996150b..5810ab4d7afc62f71cc3d35e444a4a4b60886b1f 100644 (file)
@@ -131,6 +131,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);