Skip to content

Commit

Permalink
[bug-OpenMage#1011] Installation does not work with MySQL 8
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmollenhour authored and edannenberg committed Aug 24, 2020
1 parent 3398593 commit 53c151a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public function convertOldColumnDefinition($column)
break;
case 'tinyint':
case 'smallint':
case 'smallint unsigned':
$type = Varien_Db_Ddl_Table::TYPE_SMALLINT;
break;
case 'mediumint':
Expand Down
3 changes: 3 additions & 0 deletions app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public function getDdlTypeByColumnType($columnType)
case 'tinyint':
$columnType = 'smallint';
break;
case 'int unsigned':
$columnType = 'int';
break;
}

return array_search($columnType, $this->_ddlColumnTypes);
Expand Down
4 changes: 4 additions & 0 deletions lib/Varien/Db/Adapter/Pdo/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -1884,12 +1884,16 @@ protected function _getColumnTypeByDdl($column)
case 'longblob':
return Varien_Db_Ddl_Table::TYPE_BLOB;
case 'tinyint':
case 'tinyint unsigned':
case 'smallint':
case 'smallint unsigned':
return Varien_Db_Ddl_Table::TYPE_SMALLINT;
case 'mediumint':
case 'int':
case 'int unsigned':
return Varien_Db_Ddl_Table::TYPE_INTEGER;
case 'bigint':
case 'bigint unsigned':
return Varien_Db_Ddl_Table::TYPE_BIGINT;
case 'datetime':
return Varien_Db_Ddl_Table::TYPE_DATETIME;
Expand Down

0 comments on commit 53c151a

Please sign in to comment.