[wp-trac] [WordPress Trac] #16697: WordPress up to version 3.1 does not work with MySQL sql_mode = TRADITIONAL
WordPress Trac
wp-trac at lists.automattic.com
Mon Feb 28 08:12:52 UTC 2011
#16697: WordPress up to version 3.1 does not work with MySQL sql_mode = TRADITIONAL
--------------------------+-----------------------------
Reporter: kupokomapa | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version: 3.1
Severity: normal | Keywords:
--------------------------+-----------------------------
Being bitten up several times by this problem. If you use MariaDB as a
MySQL server you would notice that their default settings for sql_mode
(http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html) is set to
NO_ENGINE_SUBSTITUTION,TRADITIONAL
This does not work with many of the SQL queries in WordPress, expecially
the ones that insert null values for date columns. So two choices here:
1. is to make the sql_mode less strict byt choosing the optimal value for
wordpress (I put this in the __construct() method of WP_DB)
mysql_query($this->prepare("SET sql_mode = '';"), $this->dbh);
2. Fix the queries which insert non valid data to table fields (the dates
are just one example)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/16697>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list