summaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-17 07:40:11 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-04-17 07:40:11 +0000
commit9fd54f156ece1cf8cec230705fa14d6d75db8efb (patch)
treede97584cd85a3b8bfef77ed75ce5414c27fdcfa6 /frontends
parentd2bc020f9ba35863d298d46200c8349e0f1d4396 (diff)
downloadzabbix-9fd54f156ece1cf8cec230705fa14d6d75db8efb.tar.gz
zabbix-9fd54f156ece1cf8cec230705fa14d6d75db8efb.tar.xz
zabbix-9fd54f156ece1cf8cec230705fa14d6d75db8efb.zip
- [ZBX-360] fixed possible warning messages under Oracle while updating items
[svn merge svn://svn.zabbix.com/branches/1.4 -r5627:5628] git-svn-id: svn://svn.zabbix.com/trunk@5629 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends')
-rw-r--r--frontends/php/include/db.inc.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/frontends/php/include/db.inc.php b/frontends/php/include/db.inc.php
index a839c1ca..df9bd6bf 100644
--- a/frontends/php/include/db.inc.php
+++ b/frontends/php/include/db.inc.php
@@ -487,12 +487,23 @@
$result = pg_fetch_assoc($cursor);
break;
case "ORACLE":
- if(ocifetchinto($cursor, $row, (OCI_ASSOC+OCI_RETURN_NULLS))){
+ $text_datatypes = array('VARCHAR','VARCHAR2','CLOB','BLOB');
+ if(ocifetchinto($cursor, $row, OCI_ASSOC+OCI_RETURN_NULLS))
+ {
$result = array();
- foreach($row as $key => $value){
- $result[strtolower($key)] = (str_in_array(strtolower(ocicolumntype($cursor,$key)),array('varchar2','blob','clob')) && is_null($value))?'':$value;
+ $keys = (array_keys($row));
+ foreach ($keys as $k)
+ {
+ $field = is_int($k) ? $k + 1 : $k;
+ $column_type = ocicolumntype($cursor, $field);
+ $field_is_null = ocicolumnisnull($cursor, $field);
+
+ if ($field_is_null && str_in_array($column_type,$text_datatypes))
+ $result[strtolower($k)] = '';
+ else
+ $result[strtolower($k)] = $row[$k];
}
- }
+ }
break;
case "SQLITE3":
if($cursor){
@@ -731,4 +742,4 @@ else {
return '('.$fieldname.' IN ('.$condition.'))';
}
-?> \ No newline at end of file
+?>