I have an application working with mysql 5.6
Trying mysql 5.7 there are many problems with strictmode, but setting sql-mode = ""
let the app works again.
My doubt is: in future mysql version the feature sql-mode will be mantained? Or it's better try now to resolve all issues with strictmode?
Generally you'll want to run MySQL in the default mode unless you're hoping that these errors or warnings will produce valuable feedback. Historically MySQL has been a very lenient database, it truncates things without concern, it converts values to what it thought you meant, and it has a peculiar syntax for delimiting column and table names. Many applications have come to depend on this close enough type of handling where they're completely unprepared to deal with any blow-back from their ambiguity or lack of concern for strictness.
There are a number of SQL modes you can use which change this behaviour, sometimes in radical ways. There's no requirement to use them, but some of them may help identify problems if you're prepared to mitigate the errors by fixing the root cause. Sometimes bad data is just bad data and you don't care. Sometimes it's a critical problem you hadn't realized was so pervasive.
Things like NO_ZERO_DATE
may catch date conversion errors, many databases are filled with people who are 2017 years old for no reason other than bad data, but ANSI_QUOTES
changes the meaning of "
to how it's used in more conventional databases. That's probably a bad idea.
I'd cherry-pick those things you think will be useful, engage those on your test environment, and identify if they're exposing any bugs. It's entirely subjective as to if these things are important or not to your particular application.
It's worth noting that MySQL 5.7 did change how it handled aggregate grouping clauses and it now errors out if you're leaving some values as ambiguous. Previously it'd just pick a random row and give you that. Now you must specify which order you want them selected in. This is an unusual departure from their normally laisez-faire approach, so presumably there's a good reaason for it.