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.
This commit is contained in:
Andreas Fischer 2011-03-11 01:45:45 +01:00
commit 33c38b37d8

View file

@ -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;