diff options
| author | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-28 13:44:14 +0000 |
|---|---|---|
| committer | artem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2007-12-28 13:44:14 +0000 |
| commit | 1d60e86ae09578cbb684975403f52ce80eb42ed0 (patch) | |
| tree | e3d5555b02254133ecf12e8ef7e30afb669bb406 /frontends/php/exp_imp.php | |
| parent | 6742b51b998f18ff3ab0ba0fb78d4c30913ebf7e (diff) | |
| download | zabbix-1d60e86ae09578cbb684975403f52ce80eb42ed0.tar.gz zabbix-1d60e86ae09578cbb684975403f52ce80eb42ed0.tar.xz zabbix-1d60e86ae09578cbb684975403f52ce80eb42ed0.zip | |
- [ZBX-237] fixed problem importing/exporting data (Artem)
- [DEV-90] fixes SQL for pgsql (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5207 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/exp_imp.php')
| -rw-r--r-- | frontends/php/exp_imp.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/frontends/php/exp_imp.php b/frontends/php/exp_imp.php index 42ee7cf5..19f7bcdc 100644 --- a/frontends/php/exp_imp.php +++ b/frontends/php/exp_imp.php @@ -207,7 +207,7 @@ include_once "include/page_header.php"; $el_table = new CTableInfo(S_ONLY_HOST_INFO); $sqls = array( S_TEMPLATE => !isset($templates[$host['hostid']]) ? null : - ' SELECT ht.hostid, h.host as info, count(distinct ht.hosttemplateid) as cnt '. + ' SELECT MIN(ht.hostid) as hostid, h.host as info, count(distinct ht.hosttemplateid) as cnt '. ' FROM hosts h, hosts_templates ht '. ' WHERE ht.templateid = h.hostid '. ' GROUP BY h.host', @@ -215,15 +215,17 @@ include_once "include/page_header.php"; ' select hostid, description as info, 1 as cnt from items'. ' where hostid='.$host['hostid'], S_TRIGGER => !isset($triggers[$host['hostid']]) ? null : - 'select i.hostid, t.description as info, count(distinct i.hostid) as cnt'. - ' from functions f, items i, triggers t'. - ' where t.triggerid=f.triggerid and f.itemid=i.itemid'. - ' group by f.triggerid, i.hostid, t.description', + 'SELECT i.hostid, t.description as info, count(distinct i.hostid) as cnt, f.triggerid '. + ' FROM functions f, items i, triggers t'. + ' WHERE t.triggerid=f.triggerid'. + ' AND f.itemid=i.itemid'. + ' GROUP BY f.triggerid, i.hostid, t.description', S_GRAPH => !isset($graphs[$host['hostid']]) ? null : - 'select g.name as info, i.hostid, count(distinct i.hostid) as cnt'. - ' from graphs_items gi, items i, graphs g '. - ' where g.graphid=gi.graphid and gi.itemid=i.itemid'. - ' group by gi.graphid, i.hostid' + 'SELECT MIN(g.name) as info, i.hostid, count(distinct i.hostid) as cnt, gi.graphid'. + ' FROM graphs_items gi, items i, graphs g '. + ' WHERE g.graphid=gi.graphid '. + ' AND gi.itemid=i.itemid'. + ' GROUP BY gi.graphid, i.hostid' ); foreach($sqls as $el_type => $sql) |
