alain.roger Posted April 10, 2013 Share Posted April 10, 2013 (edited) Hi, During my first installation of prestashop using MySQL MyiSAM engine i got an error message as in the attached file. I tried to find a log somewhere, but i didn't find some file written by prestashop. Any idea where could i look for or what is it ? thx. Edited April 10, 2013 by alain.roger (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted April 10, 2013 Share Posted April 10, 2013 ii think that this error occur because installator trying to use primary / foregin keys, which aren't available in myisam engine Link to comment Share on other sites More sharing options...
alain.roger Posted April 10, 2013 Author Share Posted April 10, 2013 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 More sharing options...
vekia Posted April 10, 2013 Share Posted April 10, 2013 can you check how it works with innoDB ? im not sure about that what i said above, but i think that this is main issue in this case. Link to comment Share on other sites More sharing options...
alain.roger Posted April 10, 2013 Author Share Posted April 10, 2013 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 More sharing options...
alain.roger Posted April 10, 2013 Author Share Posted April 10, 2013 to be more accurate, in fact we can use $sql = "SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE LIKE 'INNO%'"; and check if return DEFAULT or YES... and that's it Link to comment Share on other sites More sharing options...
alain.roger Posted April 10, 2013 Author Share Posted April 10, 2013 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 1 Link to comment Share on other sites More sharing options...
vekia Posted April 10, 2013 Share Posted April 10, 2013 many thanks for sharing your know how - i must said that this was a very interesting analysis of the issue, I am grateful to you :-) Link to comment Share on other sites More sharing options...
benjamin utterback Posted April 10, 2013 Share Posted April 10, 2013 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 More sharing options...
alain.roger Posted April 10, 2013 Author Share Posted April 10, 2013 (edited) Hi Benjamin, i'm going there right now and submit my idea. What about the 2 other files ? because you suggested only 1 file change... If i can further help no problem... that's my goal Alain Edited April 10, 2013 by alain.roger (see edit history) Link to comment Share on other sites More sharing options...
alain.roger Posted April 11, 2013 Author Share Posted April 11, 2013 Ok suggestion done to GIT 1 Link to comment Share on other sites More sharing options...
Recommended Posts