Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[+] MySQL 5.7 Compatibility #4507

Merged

Conversation

@julienbourdeau
Copy link
Contributor

commented Nov 23, 2015

MySQL 5.7 default modes

MySQL 5.7 default configuration is very different from MySQL < 5.6.
Few modes are activated and some are causing a lot of troubles in PrestaShop.

Mode Desc
NO_ZERO_DATE This mode disallow date and datetime like 0000-00-00. They are widely used in PrestaShop.
ONLY_FULL_GROUP_BY This mode changes the behavior of group by and break a lot of SQL request in PrestaShop

About ONLY_FULL_GROUP_BY: http://mysqlserverteam.com/mysql-5-7-only_full_group_by-improved-recognizing-functional-dependencies-enabled-by-default/

If you have the following error during install, this is the patch.

SQL error on query All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead

MySQL 5.7

mysql> SELECT @@GLOBAL.sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@GLOBAL.sql_mode                                                                                                                         |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL 5.6

mysql> SELECT @@GLOBAL.sql_mode;
+----------------------------------+
| @@GLOBAL.sql_mode                |
+----------------------------------+
|                                  |
+----------------------------------+
1 row in set (0.00 sec)

Thanks to @jnadaud for this fix #4468.

NOTE: I believe this can be cherry-picked easily to PrestaShop 1.6.1.x branch.

@gaillafr

This comment has been minimized.

Copy link
Contributor

commented Dec 3, 2015

+1

1 similar comment
@jnadaud

This comment has been minimized.

Copy link
Contributor

commented Dec 3, 2015

+1

// MySQL: desactivate all sql_modes
At least required for ONLY_FULL_GROUP_BY and NO_ZERO_DATE

@julienbourdeau julienbourdeau force-pushed the julienbourdeau:fix/primary-key-not-null branch to 6b53a81 Dec 8, 2015

@julienbourdeau

This comment has been minimized.

Copy link
Contributor Author

commented Dec 8, 2015

I removed the commit about the primary key as this PR is fixing it #4550

julienbourdeau added a commit that referenced this pull request Dec 22, 2015

@julienbourdeau julienbourdeau merged commit aef02c5 into PrestaShop:develop Dec 22, 2015

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@joseantgv

This comment has been minimized.

Copy link
Contributor

commented Jan 15, 2016

Why this fix has not been implemented in PS 1.6.1.4?

@julienbourdeau julienbourdeau deleted the julienbourdeau:fix/primary-key-not-null branch Oct 6, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.