diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 5dbbb3bd3f..97afe38827 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2011-08-25 Sergio Martin + + * include/db/mysql.php: Fixed a bug in the sql_commit + function to reset the database to autocommit mode + + * include/functions_tags.php: Added a missed sql_begin call + to the tags creation function + 2011-08-25 Javier Lanz * include/functions_config.php: Fixed checking if remote configuration diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index e2870ce508..75126b3953 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -929,7 +929,7 @@ function mysql_db_process_sql_begin() { */ function mysql_db_process_sql_commit() { mysql_query ('COMMIT'); - mysql_query ('SET AUTOCOMMIT = 0'); + mysql_query ('SET AUTOCOMMIT = 1'); } /** diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index b28d09419d..0f59283965 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -302,6 +302,8 @@ function tags_insert_module_tag ($id_agent_module, $tags){ function tags_insert_policy_module_tag ($id_agent_module, $tags){ $errn = 0; + db_process_sql_begin(); + $values = array(); foreach ($tags as $tag){ //Protect against default insert @@ -314,7 +316,7 @@ function tags_insert_policy_module_tag ($id_agent_module, $tags){ if ($result_tag === false) $errn++; } - + if ($errn > 0){ db_process_sql_rollback(); return false;