diff options
| author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-09 11:17:50 +0000 |
|---|---|---|
| committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2008-04-09 11:17:50 +0000 |
| commit | 967bde43d4c97821fbeb56f555f419d8a566de73 (patch) | |
| tree | b96d8464b829f534b6215f4173b3780eff28f6fa /frontends/php/include/db.inc.php | |
| parent | 20c868daba2e67f316f7a73258a10e2996e55859 (diff) | |
| download | zabbix-967bde43d4c97821fbeb56f555f419d8a566de73.tar.gz zabbix-967bde43d4c97821fbeb56f555f419d8a566de73.tar.xz zabbix-967bde43d4c97821fbeb56f555f419d8a566de73.zip | |
- [ZBX-350] fixed processing in_condition under Oracle (Sasha)
[merged from branches/1.4 5599:5600]
git-svn-id: svn://svn.zabbix.com/trunk@5601 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/db.inc.php')
| -rw-r--r-- | frontends/php/include/db.inc.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index 6a4a86b6..074c5b76 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -718,4 +718,28 @@ else { function remove_nodes_from_id($id){ return bcmod($id,'100000000000'); } + + function DBin_condition($fieldname, $array) + { + global $DB_TYPE; + + $condition = $fieldname.' IN ('; + + switch($DB_TYPE) { + case 'ORACLE': + $items = array_chunk($array, 1000); + $chunks = count($items); + for ($i = 0; $i < $chunks; $i++) { + if ($i > 0) + $condition .= ') OR '.$fieldname.' IN ('; + $condition .= implode(",",$items[$i]); + } + $condition .= ')'; + if ($chunks > 1) + $condition = '('.$condition.')'; + return $condition; + default: + return $condition.implode(",",$array).')'; + } + } ?> |
