Skip to content
Snippets Groups Projects
Commit f02b3743 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Works with mysql 5.5

parent 1c2d166b
Branches
No related tags found
No related merge requests found
...@@ -143,7 +143,6 @@ if ($_POST["action"] == "set") ...@@ -143,7 +143,6 @@ if ($_POST["action"] == "set")
{ {
// We always choose in mysql directory (Conversion is done by driver to translate SQL syntax) // We always choose in mysql directory (Conversion is done by driver to translate SQL syntax)
$dir = "mysql/tables/"; $dir = "mysql/tables/";
$versionmysql550=explode('.','5.5.0');
$ok = 0; $ok = 0;
$handle=opendir($dir); $handle=opendir($dir);
...@@ -184,10 +183,9 @@ if ($_POST["action"] == "set") ...@@ -184,10 +183,9 @@ if ($_POST["action"] == "set")
fclose($fp); fclose($fp);
$buffer=trim($buffer); $buffer=trim($buffer);
// For Mysql 5.5+, we must removed type=innodb if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') // For Mysql 5.5+, we must replace type=innodb
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
{ {
if (sizeof($versionarray) && versioncompare($versionarray,$versionmysql550) >= 0) $buffer=preg_replace('/type=innodb/i','',$buffer); $buffer=preg_replace('/type=innodb/i','ENGINE=innodb',$buffer);
} }
//print "<tr><td>Creation de la table $name/td>"; //print "<tr><td>Creation de la table $name/td>";
......
...@@ -88,7 +88,7 @@ CREATE TABLE llx_c_ziptown ...@@ -88,7 +88,7 @@ CREATE TABLE llx_c_ziptown
zip varchar(10) NOT NULL, zip varchar(10) NOT NULL,
town varchar(255) NOT NULL, town varchar(255) NOT NULL,
active tinyint NOT NULL DEFAULT 1 active tinyint NOT NULL DEFAULT 1
)type=innodb; ) ENGINE=innodb;
ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_fk_county (fk_county); ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_fk_county (fk_county);
ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_county FOREIGN KEY (fk_county) REFERENCES llx_c_departements (rowid); ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_county FOREIGN KEY (fk_county) REFERENCES llx_c_departements (rowid);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment