Jump to content

[SOLVED] Error during installation with MyISAM engine


Recommended Posts

In this case, why default installation of prestashop offers to select between 2 engines: MyISAM and InnoDB ?

this should be removed and administrator informed that ONLY InnoDB engine is allowed.

 

I checked in Apache logs and there's nothing special about an error :(

Link to comment
Share on other sites

Ok, so i found some interesting things.

 

1. validation test

First of all, i use MySQL v5.6.10 and since v5.1 'have_innodb' name doesn't exist anymore. Therefore, the test to check if innoDB engine is supported (in file /prestashop_1.5.4.0/prestashop/classes/db/DbMySQLi.php line 177) is not anymore valid...

 

function to check can't be:

$sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\'';

now it's SHOW ENGINES;

 

the same issue in file /prestashop_1.5.4.0/prestashop/classes/db/DbPDO.php line 212.

the same issue in file /prestashop_1.5.4.0/prestashop/classes/db/MySQL.php line 171.

Link to comment
Share on other sites

so here it is how i fixed it for MySQL v5.6.10:

if (strtolower($engine) == 'innodb')
 {
  //$sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\'';
  $sql='SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE LIKE \'INNODB\'';
  $result = $link->query($sql);
  if (!$result)
   return 4;
  $row = $result->fetch();
  if (!$row || (strtolower($row['SUPPORT']) != 'yes' && strtolower($row['SUPPORT']) != 'default'))
  //if (!$row || strtolower($row['Value']) != 'yes')
   return 4;

 

for sure, in order to improve back compatibility i invite prestashop developers to do an additional check on MySQL version and based on return to change the $sql as also the test : !$row ||

 

Hope that it help other developers :D

  • Like 1
Link to comment
Share on other sites

the same issue in file /prestashop_1.5.4.0/prestashop/classes/db/DbPDO.php line 212.

the same issue in file /prestashop_1.5.4.0/prestashop/classes/db/MySQL.php line 171.

 

Hello alain.roger, have you made these contributions to our Github page?

 

I found the files you are looking for. Simple click "edit" , edit the page, scroll down and "Propose File Change"

 

1.5 https://github.com/PrestaShop/PrestaShop/blob/development/classes/db/DbPDO.php

 

Thank you for the support!

Link to comment
Share on other sites

×
×
  • Create New...