mirror of
https://github.com/e107inc/e107.git
synced 2025-06-06 19:06:39 +02:00
db-verify make sure the correct ENGINE is used when fixing a missing table.
This commit is contained in:
parent
e52a660f24
commit
08004d56a7
@ -757,10 +757,10 @@ class db_verify
|
|||||||
* @param string $table eg. submitnews
|
* @param string $table eg. submitnews
|
||||||
* @param string $field eg. submitnews_id
|
* @param string $field eg. submitnews_id
|
||||||
* @param string $sqlFileData (after CREATE) eg. dblog_id int(10) unsigned NOT NULL auto_increment, ..... KEY....
|
* @param string $sqlFileData (after CREATE) eg. dblog_id int(10) unsigned NOT NULL auto_increment, ..... KEY....
|
||||||
* @param int $id
|
* @param string $engine MyISAM|InnoDB
|
||||||
* @return string SQL query
|
* @return string SQL query
|
||||||
*/
|
*/
|
||||||
function getFixQuery($mode,$table,$field,$sqlFileData)
|
function getFixQuery($mode, $table, $field, $sqlFileData, $engine = 'MyISAM' )
|
||||||
{
|
{
|
||||||
|
|
||||||
if(substr($mode,0,5)== 'index')
|
if(substr($mode,0,5)== 'index')
|
||||||
@ -787,12 +787,12 @@ class db_verify
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'drop':
|
case 'drop':
|
||||||
$query = "ALTER TABLE `".MPREFIX.$table."` DROP `$field` ";
|
$query = "ALTER TABLE `".MPREFIX.$table."` DROP `$field`";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'index':
|
case 'index':
|
||||||
$newval = str_replace("PRIMARY", "PRIMARY KEY", $newval);
|
$newval = str_replace("PRIMARY", "PRIMARY KEY", $newval);
|
||||||
$query = "ALTER TABLE `".MPREFIX.$table."` ADD $newval ";
|
$query = "ALTER TABLE `".MPREFIX.$table."` ADD ".$newval;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'indexdrop':
|
case 'indexdrop':
|
||||||
@ -800,7 +800,7 @@ class db_verify
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'create':
|
case 'create':
|
||||||
$query = "CREATE TABLE `".MPREFIX.$table."` (".$sqlFileData.") ENGINE=MyISAM;";
|
$query = "CREATE TABLE `".MPREFIX.$table."` (".$sqlFileData.") ENGINE=".$engine.";";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -839,7 +839,7 @@ class db_verify
|
|||||||
foreach($fixes as $mode)
|
foreach($fixes as $mode)
|
||||||
{
|
{
|
||||||
|
|
||||||
$query = $this->getFixQuery($mode,$table,$field,$this->sqlFileTables[$j]['data'][$id]);
|
$query = $this->getFixQuery($mode,$table,$field,$this->sqlFileTables[$j]['data'][$id],$this->sqlFileTables[$j]['engine'][$id]);
|
||||||
|
|
||||||
|
|
||||||
// $mes->addDebug("Query: ".$query);
|
// $mes->addDebug("Query: ".$query);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user