mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[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
This commit is contained in:
parent
b3bbe57603
commit
032a9f58f9
1 changed files with 1 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue