aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db/dbal.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2012-05-31 11:44:41 +0200
committerAndreas Fischer <bantu@phpbb.com>2012-05-31 12:15:46 +0200
commit643a86504a30f6b9fbe0f073bb03009b4fbd0f43 (patch)
tree39813fa12a560736d7bc6e18d78b447b567db3a5 /phpBB/includes/db/dbal.php
parent275dabbc4f7e412d6f21266d43708635f63384e2 (diff)
downloadforums-643a86504a30f6b9fbe0f073bb03009b4fbd0f43.tar
forums-643a86504a30f6b9fbe0f073bb03009b4fbd0f43.tar.gz
forums-643a86504a30f6b9fbe0f073bb03009b4fbd0f43.tar.bz2
forums-643a86504a30f6b9fbe0f073bb03009b4fbd0f43.tar.xz
forums-643a86504a30f6b9fbe0f073bb03009b4fbd0f43.zip
[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
Diffstat (limited to 'phpBB/includes/db/dbal.php')
-rw-r--r--phpBB/includes/db/dbal.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index 358df50402..9cc337955b 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -501,6 +501,18 @@ class dbal
}
/**
+ * Run LOWER() on DB column of type text (i.e. neither varchar nor char).
+ *
+ * @param string $column_name The column name to use
+ *
+ * @return string A SQL statement like "LOWER($column_name)"
+ */
+ function sql_lower_text($column_name)
+ {
+ return "LOWER($column_name)";
+ }
+
+ /**
* Run more than one insert statement.
*
* @param string $table table name to run the statements on