Fix: Works with mysql 5.5

This commit is contained in:
Laurent Destailleur 2011-01-16 01:56:12 +00:00
parent 1c2d166b14
commit f02b3743b6
2 changed files with 3 additions and 5 deletions

View File

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

View File

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