2011-03-01 Miguel de Dios <miguel.dedios@artica.es>
* include/db/postgresql.php, include/db/mysql.php, include/functions_db.php: separate the function "process_sql_rollback" into the two version for MySQL and PostgreSQL engine. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4042 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
7291f6f491
commit
310ee18ac1
|
@ -1,3 +1,9 @@
|
||||||
|
2011-03-01 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/db/postgresql.php, include/db/mysql.php, include/functions_db.php:
|
||||||
|
separate the function "process_sql_rollback" into the two version for
|
||||||
|
MySQL and PostgreSQL engine.
|
||||||
|
|
||||||
2011-03-01 Miguel de Dios <miguel.dedios@artica.es>
|
2011-03-01 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* index.php: cleaned source code.
|
* index.php: cleaned source code.
|
||||||
|
|
|
@ -928,4 +928,12 @@ function mysql_process_sql_commit() {
|
||||||
mysql_query ('COMMIT');
|
mysql_query ('COMMIT');
|
||||||
mysql_query ('SET AUTOCOMMIT = 0');
|
mysql_query ('SET AUTOCOMMIT = 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rollbacks a database transaction.
|
||||||
|
*/
|
||||||
|
function mysql_process_sql_rollback() {
|
||||||
|
mysql_query ('ROLLBACK ');
|
||||||
|
mysql_query ('SET AUTOCOMMIT = 0');
|
||||||
|
}
|
||||||
?>
|
?>
|
|
@ -943,6 +943,13 @@ function postgresql_process_sql_begin() {
|
||||||
* Commits a database transaction.
|
* Commits a database transaction.
|
||||||
*/
|
*/
|
||||||
function postgresql_process_sql_commit() {
|
function postgresql_process_sql_commit() {
|
||||||
pg_query('COMMIT');
|
pg_query('COMMIT TRANSACTION');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rollbacks a database transaction.
|
||||||
|
*/
|
||||||
|
function postgresql_process_sql_rollback() {
|
||||||
|
pg_query('ROLLBACK TRANSACTION');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
|
@ -437,24 +437,6 @@ function get_profiles () {
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Selects profiles filtered
|
|
||||||
*
|
|
||||||
* @return array List of profiles filtered
|
|
||||||
*/
|
|
||||||
function get_profiles_filter ($filter) {
|
|
||||||
$sql = sprintf('SELECT * FROM tperfil WHERE %s', $filter);
|
|
||||||
$profiles = get_db_all_rows_sql ($sql);
|
|
||||||
$return = array ();
|
|
||||||
if ($profiles === false) {
|
|
||||||
return $return;
|
|
||||||
}
|
|
||||||
foreach ($profiles as $profile) {
|
|
||||||
$return[$profile["id_perfil"]] = $profile["name"];
|
|
||||||
}
|
|
||||||
return $return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Profile for User
|
* Create Profile for User
|
||||||
|
@ -3361,9 +3343,17 @@ function process_sql_commit() {
|
||||||
/**
|
/**
|
||||||
* Rollbacks a database transaction.
|
* Rollbacks a database transaction.
|
||||||
*/
|
*/
|
||||||
function process_sql_rollback () {
|
function process_sql_rollback() {
|
||||||
mysql_query ('ROLLBACK');
|
global $config;
|
||||||
mysql_query ('SET AUTOCOMMIT = 0');
|
|
||||||
|
switch ($config["dbtype"]) {
|
||||||
|
case "mysql":
|
||||||
|
return mysql_process_sql_rollback();
|
||||||
|
break;
|
||||||
|
case "postgresql":
|
||||||
|
return postgresql_process_sql_rollback();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue