aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2011-03-11 01:45:45 +0100
committerAndreas Fischer <bantu@phpbb.com>2011-03-11 01:45:45 +0100
commit33c38b37d886e56a60b5b144a1ab8eb8f42a8430 (patch)
tree1e2f6d667311ee9853aec33909fcec69d2830505 /phpBB/includes
parentaa8f4000d30a3f89cb876eb14e3b7522c68f90f0 (diff)
parent9cdeb51a5287844be1cd8671284d625d41e9b2fa (diff)
downloadforums-33c38b37d886e56a60b5b144a1ab8eb8f42a8430.tar
forums-33c38b37d886e56a60b5b144a1ab8eb8f42a8430.tar.gz
forums-33c38b37d886e56a60b5b144a1ab8eb8f42a8430.tar.bz2
forums-33c38b37d886e56a60b5b144a1ab8eb8f42a8430.tar.xz
forums-33c38b37d886e56a60b5b144a1ab8eb8f42a8430.zip
Merge branch 'ticket/p/10016' into develop-olympus
* ticket/p/10016: [ticket/10016] Add comment for text casting (for PostgreSQL 7.x) [ticket/10016] Leave Firebird unchanged. [ticket/10016] Fixed varchar to decimal cast on postgresql 7.x.
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 398a02380b..6a2d132175 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -175,10 +175,14 @@ function set_config_count($config_name, $increment, $is_dynamic = false)
switch ($db->sql_layer)
{
case 'firebird':
- case 'postgres':
$sql_update = 'CAST(CAST(config_value as DECIMAL(255, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
break;
+ case 'postgres':
+ // Need to cast to text first for PostgreSQL 7.x
+ $sql_update = 'CAST(CAST(config_value::text as DECIMAL(255, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
+ break;
+
// MySQL, SQlite, mssql, mssql_odbc, oracle
default:
$sql_update = 'config_value + ' . (int) $increment;