diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-08-16 15:38:13 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-08-16 15:38:13 +0000 |
commit | 521dfdbb059b330e34d11e0fbfa96fbf831d1d20 (patch) | |
tree | 627fdebaebdcac0e32784d71699b6347ccb6ceae /phpBB/includes/db | |
parent | 0a7abb6b374d06524301e5a276983d1db5b17848 (diff) | |
download | forums-521dfdbb059b330e34d11e0fbfa96fbf831d1d20.tar forums-521dfdbb059b330e34d11e0fbfa96fbf831d1d20.tar.gz forums-521dfdbb059b330e34d11e0fbfa96fbf831d1d20.tar.bz2 forums-521dfdbb059b330e34d11e0fbfa96fbf831d1d20.tar.xz forums-521dfdbb059b330e34d11e0fbfa96fbf831d1d20.zip |
increase the odbc limit (64k is too low, the theme data itself is >64k)
git-svn-id: file:///svn/phpbb/trunk@8038 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r-- | phpBB/includes/db/mssql_odbc.php | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 290142103f..d3014f0e13 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -43,7 +43,28 @@ class dbal_mssql_odbc extends dbal $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; - @ini_set('odbc.defaultlrl', 65536); + $max_size = @ini_get('odbc.defaultlrl'); + if (!empty($max_size)) + { + $unit = strtolower(substr($max_size, -1, 1)); + $max_size = (int) $max_size; + + if ($unit == 'k') + { + $max_size = floor($max_size / 1024); + } + else if ($unit == 'g') + { + $max_size *= 1024; + } + else if (is_numeric($unit)) + { + $max_size = floor((int) ($max_size . $unit) / 1048576); + } + $max_size = max(8, $max_size) . 'M'; + + @ini_set('odbc.defaultlrl', $max_size); + } $this->db_connect_id = ($this->persistency) ? @odbc_pconnect($this->server, $this->user, $sqlpassword) : @odbc_connect($this->server, $this->user, $sqlpassword); |