From 697a1ccb3220f1cd907c686227d982595834713c Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 17 Oct 2011 13:08:20 +0200 Subject: [PATCH] Fixing bug when installing chamilo in a mysql server with engine innodb by default see #3975 (partial) --- main/inc/lib/database.lib.php | 11 +++++++---- main/install/index.php | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/main/inc/lib/database.lib.php b/main/inc/lib/database.lib.php index c496be182a..0ca280a060 100644 --- a/main/inc/lib/database.lib.php +++ b/main/inc/lib/database.lib.php @@ -699,7 +699,7 @@ class Database { //Check if the table contains a c_ (means a course id) if (strpos($query, 'c_')) { //Check if the table contains inner joins - if ( + if ( strpos($query, 'INNER JOIN') === false && strpos($query, 'inner join') === false && strpos($query, 'left join') === false && @@ -708,7 +708,11 @@ class Database { strpos($query, 'INSERT') === false && strpos($query, 'ALTER') === false && strpos($query, 'alter') === false && - strpos($query, 'c_id') === false + strpos($query, 'c_id') === false && + strpos($query, 'create table') === false && + strpos($query, 'CREATE TABLE') === false && + strpos($query, 'AUTO_INCREMENT') === false + ) { $limit_list = explode('LIMIT', $query); $limit = ''; @@ -730,8 +734,7 @@ class Database { if (isset($where_list[1])) { $where = $where_list[1].' AND c_id = '.api_get_course_int_id().' '; $query = $select.' WHERE '.$where.' '.$order.$group.$limit; - //echo ($query );var_dump('julio'); - //exit; + //echo ($query ); exit; } else { //check if order ? $query = $select. ' WHERE 1 AND c_id = '.api_get_course_int_id().' '.$order.$group.$limit; diff --git a/main/install/index.php b/main/install/index.php index 9f96812ed9..c2b14095de 100644 --- a/main/install/index.php +++ b/main/install/index.php @@ -709,6 +709,7 @@ if ($_POST['step2']) { } elseif ($_POST['step6']) { //STEP 6 : INSTALLATION PROCESS + Database::query("SET storage_engine MYISAM;"); if ($installType == 'update') {