Oracle related fixes.

This commit is contained in:
Ramon Novoa 2015-05-05 15:34:03 +02:00
parent 615231eafd
commit 550f834e34
2 changed files with 8 additions and 9 deletions

View File

@ -4502,7 +4502,7 @@ sub pandora_module_unknown ($$) {
}
my $do_event = 0;
if ($module->{'disabled_types_event'} eq "") {
if (!defined($module->{'disabled_types_event'}) || $module->{'disabled_types_event'} eq "") {
$do_event = 1;
}
else {
@ -4776,6 +4776,8 @@ sub pandora_get_os ($$) {
sub load_module_macros ($$) {
my ($macros, $macro_hash) = @_;
return if (!defined($macros));
# Decode and parse module macros
my $decoded_macros = {};
eval {

View File

@ -779,12 +779,11 @@ sub db_process_insert($$$$;@) {
}
$wildcards = '('.$wildcards.')';
my $columns_string = join($RDBMS_QUOTE . ',' . $RDBMS_QUOTE,
@columns_array);
my $columns_string = join(',', @columns_array);
my $res = db_insert ($dbh,
$index,
"INSERT INTO $table (" . $RDBMS_QUOTE . $columns_string . $RDBMS_QUOTE . ") VALUES " . $wildcards, @values_array);
"INSERT INTO $table ($columns_string) VALUES " . $wildcards, @values_array);
return $res;
@ -854,10 +853,8 @@ sub add_address ($$) {
sub add_new_address_agent ($$$) {
my ($dbh, $addr_id, $agent_id) = @_;
db_do ($dbh, 'INSERT INTO taddress_agent (' .
$RDBMS_QUOTE . 'id_a' . $RDBMS_QUOTE . ', ' .
$RDBMS_QUOTE. 'id_agent' . $RDBMS_QUOTE. ')
VALUES (?, ?)', $addr_id, $agent_id);
db_do ($dbh, 'INSERT INTO taddress_agent (id_a, id_agent)
VALUES (?, ?)', $addr_id, $agent_id);
}
########################################################################
@ -1028,7 +1025,7 @@ sub db_insert_get_values ($) {
# Not value for the given column
next if (! defined ($value));
$columns .= $PandoraFMS::DB::RDBMS_QUOTE . "$key" . $PandoraFMS::DB::RDBMS_QUOTE . ",";
$columns .= $key . ",";
push (@values, $value);
}