diff --git a/htdocs/install/mysql/migration/2.8.0-2.9.0.sql b/htdocs/install/mysql/migration/2.8.0-2.9.0.sql index 4c92a763f27..0b6f5b31bad 100755 --- a/htdocs/install/mysql/migration/2.8.0-2.9.0.sql +++ b/htdocs/install/mysql/migration/2.8.0-2.9.0.sql @@ -161,7 +161,7 @@ INSERT INTO `llx_c_field_list` (`rowid`, `element`, `entity`, `name`, `alias`, ` (8, 'product_default', 1, 'p.envente', 'status', 'Status', 'right', 1, 0, '1', 8); -UPDATE llx_adherent SET pays = null where pays <= 0 and pays != '0'; +UPDATE llx_adherent SET pays = null where pays <= '0' and pays != '0'; ALTER table llx_adherent MODIFY pays integer; -- add milestone module diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index fb0f8369946..6ca50cb8b05 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -224,9 +224,9 @@ if (! isset($_GET["action"]) || preg_match('/upgrade/i',$_GET["action"])) } /* - * Remove deprecated indexes and constraints + * Remove deprecated indexes and constraints for Mysql */ - if ($ok) + if ($ok && preg_match('/mysql/',$db->type)) { $versioncommande=explode('.','4.0'); if (sizeof($versioncommande) && sizeof($versionarray) @@ -279,9 +279,7 @@ if (! isset($_GET["action"]) || preg_match('/upgrade/i',$_GET["action"])) */ if ($ok) { - if ($choix==1) $dir = "mysql/migration/"; - elseif ($choix==2) $dir = "pgsql/migration/"; - else $dir = "mssql/migration/"; + $dir = "mysql/migration/"; // We use mysql migration scripts whatever is database driver $filelist=array(); $i = 0; @@ -292,11 +290,18 @@ if (! isset($_GET["action"]) || preg_match('/upgrade/i',$_GET["action"])) # Recupere list fichier $filesindir=array(); $handle=opendir($dir); - while (($file = readdir($handle))!==false) + if ($handle) { - if (preg_match('/\.sql$/i',$file)) $filesindir[]=$file; + while (($file = readdir($handle))!==false) + { + if (preg_match('/\.sql$/i',$file)) $filesindir[]=$file; + } + sort($filesindir); + } + else + { + print '
'.$langs->trans("ErrorCanNotReadDir",$dir).'
'; } - sort($filesindir); # Define which file to run foreach($filesindir as $file) diff --git a/htdocs/lib/databases/pgsql.lib.php b/htdocs/lib/databases/pgsql.lib.php index 7aa15e909c1..e3d53047fc2 100644 --- a/htdocs/lib/databases/pgsql.lib.php +++ b/htdocs/lib/databases/pgsql.lib.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2005 Rodolphe Quiedeville - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2009 Regis Houssin @@ -479,7 +479,7 @@ class DoliDb else $loop=false; } - if ($usesavepoint) + if ($usesavepoint && $this->transaction_opened) { @pg_query($this->db, 'SAVEPOINT mysavepoint'); } @@ -497,7 +497,7 @@ class DoliDb //print "\n>> ".$query."
\n"; //print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."
\n"; - if ($usesavepoint) + if ($usesavepoint && $this->transaction_opened) { @pg_query($this->db, 'ROLLBACK TO SAVEPOINT mysavepoint'); }