aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-05-14 02:33:31 +0200
committerAndreas Fischer <bantu@phpbb.com>2010-05-14 02:33:31 +0200
commit032a9f58f9ce4dd9777f30a8856fb49e340df179 (patch)
tree971aa90b6153c5509f5c6bca3ad59bb3b75fb9ac /phpBB/includes/functions.php
parentb3bbe576035da528aa6e52775cbc60133a8a2c90 (diff)
downloadforums-032a9f58f9ce4dd9777f30a8856fb49e340df179.tar
forums-032a9f58f9ce4dd9777f30a8856fb49e340df179.tar.gz
forums-032a9f58f9ce4dd9777f30a8856fb49e340df179.tar.bz2
forums-032a9f58f9ce4dd9777f30a8856fb49e340df179.tar.xz
forums-032a9f58f9ce4dd9777f30a8856fb49e340df179.zip
[ticket/9173] No longer limit scope of numbers we store in the config table on
PostgreSQL and Firebird when using set_config_count(). Since we're using a VARCHAR(255) column to store the numbers we have to CAST the varchar string to a type we can do maths on. Using int4 or integer as the type however limits the scope to 4-byte-integer = 32-bit. Using DECIMAL(255, 0) allows the 'full' scope of decimals in varchar(255). PHPBB3-9173
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php5
1 files changed, 1 insertions, 4 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 4f52c7c2ce..026496bfb3 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -175,11 +175,8 @@ function set_config_count($config_name, $increment, $is_dynamic = false)
switch ($db->sql_layer)
{
case 'firebird':
- $sql_update = 'CAST(CAST(config_value as integer) + ' . (int) $increment . ' as VARCHAR(255))';
- break;
-
case 'postgres':
- $sql_update = 'int4(config_value) + ' . (int) $increment;
+ $sql_update = 'CAST(CAST(config_value as DECIMAL(255, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
break;
// MySQL, SQlite, mssql, mssql_odbc, oracle