Disclaimer
The following is a
temporary solution until the OpenCart Team releases a fix.
Moreover, this solution has been applied to a local development environment. After having applied this solution, the upgrade script has completed the process successfully. However, no testing has been performed in order to verify that fact.
The Solution
- Open the file: install/model/upgrade.php.
- Go to line 55 that reads:
Code: Select all
preg_match_all({regular expression}, $sql, $match)
where the regular expression tries to read all the column definitions of a table.
- Replace the regular expression with the following one:
Code: Select all
'#`(\w[\w\d]*)`\s+((tinyint|smallint|mediumint|bigint|int|tinytext|text|mediumtext|longtext|tinyblob|blob|mediumblob|longblob|varchar|char|datetime|date|float|double|decimal|timestamp|time|year|enum|set|binary|varbinary)(\(([\d\w\',]+)(,\s*(\d+))?\))?){1}\s*(collate (\w+)\s*)?(unsigned\s*)?((NOT\s*NULL\s*)|(NULL\s*))?(auto_increment\s*)?(default \'([^\']*)\'\s*)?#i'
Notice that the expression provided contains the quotation marks (') that denote the string, too.
- Save the file.
And that's it.
The Problem
As you will have probably guessed by now, the problem lies within the regular expression. The replacement that takes place essentially substitutes this part:
with this one:
A thorough explanation is beyond the goal of this reply. Suffice it to say that this part is responsible for extracting the
size of the column. For example, used upon a statement such as:
the above part of the expression would match the number along with the parentheses. That is: