Hello everyone,
In my latest project, I needed to connect Magento (v. 1.9.4.4) to Mysql 8 that I faced a problem during installation. I couldn't find any reference for it but I have fixed it.
It seems, in some cases, the describe method sometimes, add unsigned to int, tinyint, smallint, mediumint and bigint.
The files that I change fixed the issue for me, I just mentioned it here because if anyone else faced this issue, we can fix it for the next version.
These three files need to change in order to get the issue fix.
app/code/core/Mage/Core/Model/Resource/Helper/Abstract.php line 273
add
...
case 'tinyint':
case 'smallint':
case 'smallint unsigned':
lib/Varien/Db/Adapter/Pdo/Mysql.php between line 1886 and 1896 must add some new cases:
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':
app/code/core/Mage/Eav/Model/Resource/Helper/Mysql4.php line 85
...
case 'int unsigned':
$columnType = 'int';
break;
Hi
Can you provide a PR?
Also I would suggest we clean up the value "int unsigned" to "int" in the place we're getting it from DB, instead of patching all the places with "int unsigned".
@tmotyl I agree with your suggestion. I will take a look at code, and I'll send a PR
@tmotyl I had a deep dive into source code, and apparently column type is coming from different places during installation and during upgrade scripts (e.g. salesrule_setup.upgrade-1.6.0.0-1.6.0.1.php).
I suggest continuing with the changes I made because I'm currently using it in production and so far I haven't faced any issues.
If you agree I will send a PR for this.
Thanks
Hi
Please send a PR, then we will discuss the details.
From how many places the column type is comming from?
We had this same issue on a few of our existing sites running against Mysql 8. Mainly when running the flat catalog/product indexer.
These changes worked fine for us. We can create a PR for this.
Most helpful comment
We had this same issue on a few of our existing sites running against Mysql 8. Mainly when running the flat catalog/product indexer.
These changes worked fine for us. We can create a PR for this.