diff options
| author | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-10-04 14:47:03 +0000 |
|---|---|---|
| committer | sasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-10-04 14:47:03 +0000 |
| commit | 32f3020adc55fc013f8064921fe4c0e10f4deaa4 (patch) | |
| tree | 9b6c35eb158938d602c9dd369a1705c6b4d480de /frontends/php/include/db.inc.php | |
| parent | a59cf78fe5046e8021167a80cc2c6912385c87e8 (diff) | |
- [ZBX-92] Distributed monitoring: overwriting new information (Sasha)
[svn merge svn://svn.zabbix.com/branches/1.4 -r4828:4832]
git-svn-id: svn://svn.zabbix.com/trunk@4833 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/db.inc.php')
| -rw-r--r-- | frontends/php/include/db.inc.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php index d142e309..4e82d072 100644 --- a/frontends/php/include/db.inc.php +++ b/frontends/php/include/db.inc.php @@ -545,11 +545,15 @@ if(isset($DB_TYPE) && $DB_TYPE == "ORACLE") { if(!$row || is_null($row["nextid"])) { - $row=DBfetch(DBselect("select max($field) as id from $table where ".DBin_node($field, $nodeid))); + global $ZBX_LOCALNODEID; + + $min=bcadd(bcmul($nodeid,"100000000000000"),bcmul($ZBX_LOCALNODEID,"100000000000")); + $max=bcadd(bcadd(bcmul($nodeid,"100000000000000"),bcmul($ZBX_LOCALNODEID,"100000000000")),"99999999999"); + $row=DBfetch(DBselect("select max($field) as id from $table where $field>=$min and $field<=$max")); if(!$row || is_null($row["id"])) { DBexecute("insert into ids (nodeid,table_name,field_name,nextid) ". - " values ($nodeid,'$table','$field',".bcadd(bcmul($nodeid,"100000000000000"),1).")"); + " values ($nodeid,'$table','$field',$min)"); } else { |
