[wp-trac] [WordPress Trac] #21212: MySQL tables should use utf8mb4 character set

WordPress Trac noreply at wordpress.org
Thu Nov 20 20:47:44 UTC 2014


#21212: MySQL tables should use utf8mb4 character set
----------------------------+-----------------------
 Reporter:  pento           |       Owner:
     Type:  task (blessed)  |      Status:  reopened
 Priority:  normal          |   Milestone:  4.1
Component:  Database        |     Version:  3.4.1
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+-----------------------

Comment (by mnelson4):

 Replying to [comment:42 morgantocker]:
 > Sorry to complicate things:
 >
 > MySQL 5.7 will enable STRICT_TRANS_TABLE,NO_ENGINE_SUBSTITUTION and
 ONLY_FULL_GROUP_BY by default.  Modes ERROR_FOR_DIVISION_BY_ZERO,
 NO_ZERO_DATE and NO_ZERO_IN_DATE have also been merged into the
 definitions of STRICT_TRANS_TABLES or STRICT_ALL_TABLES, and thus will
 also be enabled by default.
 >
 > So this means that these three columns will all violate the
 STRICT_ALL_TABLES goal:
 >
 > {{{
 >  DTT_description TEXT NOT NULL default '',
 >  DTT_EVT_start datetime NOT NULL default '0000-00-00 00:00:00',
 >  DTT_EVT_end datetime NOT NULL default '0000-00-00 00:00:00',
 > }}}
 >
 > The more future proof alternative:
 >
 > {{{
 >  DTT_description TEXT NOT NULL,
 >  DTT_EVT_start datetime NOT NULL,
 >  DTT_EVT_end datetime NOT NULL,
 > }}}
 >
 > (Disclaimer for those that don't know me yet: I work on the MySQL team @
 Oracle.)
 ya @morgantocker, we were made aware of our plugin's invalid SQL since
 `STRICT_ALL_TABLES` was enabled in WP core, and we are changing our code.
 But just as a reminder: the SQL @nerrad posted is specific to our plugin
 only, not WP core.

 Generally, enabling `STRICT_ALL_TABLES` has been useful for debugging like
 this which is why using it when WP_DEBUG is on may be handy.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/21212#comment:43>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list