2011-08-25 Sergio Martin <sergio.martin@artica.es>

* 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



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4822 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-08-25 16:13:51 +00:00
parent 9a42657eb4
commit e742c3cf26
3 changed files with 12 additions and 2 deletions
pandora_console

View File

@ -1,3 +1,11 @@
2011-08-25 Sergio Martin <sergio.martin@artica.es>
* 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 <javier.lanz@artica.es>
* include/functions_config.php: Fixed checking if remote configuration

View File

@ -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');
}
/**

View File

@ -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;