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:
@@ -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
|
||||
|
Reference in New Issue
Block a user