1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/10751] Add sql_lower_text() to database abstraction layer.

On MSSQL, LOWER() can only be called on bounded strings (i.e. varchar or char).
So, in order to use it on a text column, we have to convert it to an
appropriate type. We do so using the SUBSTRING function.

PHPBB3-10751
This commit is contained in:
Andreas Fischer
2012-05-31 11:44:41 +02:00
parent 275dabbc4f
commit 643a86504a
4 changed files with 36 additions and 0 deletions

View File

@@ -492,6 +492,14 @@ class dbal_mssqlnative extends dbal
return str_replace(array("'", "\0"), array("''", ''), $msg);
}
/**
* {@inheritDoc}
*/
function sql_lower_text($column_name)
{
return "LOWER(SUBSTRING($column_name, 1, DATALENGTH($column_name)))";
}
/**
* Build LIKE expression
* @access private