diff --git a/README.md b/README.md index 8ba809b8..38a83303 100644 --- a/README.md +++ b/README.md @@ -338,7 +338,7 @@ wp db cli [--database=] [--default-character-set=] [--d Executes a SQL query against the database. ~~~ -wp db query [] [--dbuser=] [--dbpass=] [--=] [--defaults] +wp db query [] [--dbuser=] [--dbpass=] [--=] [--defaults] [--skip-sql-mode-compat] ~~~ Executes an arbitrary SQL query using `DB_HOST`, `DB_NAME`, `DB_USER` @@ -365,6 +365,13 @@ entirely. [--defaults] Loads the environment's MySQL option files. Default behavior is to skip loading them to avoid failures due to misconfiguration. + [--skip-sql-mode-compat] + Run the query under the server's own SQL modes instead of adapting them to + be WordPress-compatible. By default, the incompatible modes that WordPress + disables in `wpdb` (such as `NO_ZERO_DATE` and `STRICT_TRANS_TABLES`) are + stripped for the session, so statements against WordPress's zero-date schema + behave the same as they do in WordPress itself. + **EXAMPLES** # Execute a query stored in a file @@ -523,7 +530,7 @@ Runs `mysqldump` utility using `DB_HOST`, `DB_NAME`, `DB_USER` and Imports a database from a file or from STDIN. ~~~ -wp db import [] [--dbuser=] [--dbpass=] [--=] [--skip-optimization] [--defaults] +wp db import [] [--dbuser=] [--dbpass=] [--=] [--skip-optimization] [--skip-sql-mode-compat] [--defaults] ~~~ Runs SQL queries using `DB_HOST`, `DB_NAME`, `DB_USER` and @@ -548,6 +555,9 @@ defined in the SQL. [--skip-optimization] When using an SQL file, do not include speed optimization such as disabling auto-commit and key checks. + [--skip-sql-mode-compat] + Do not adapt the session SQL mode for WordPress compatibility. By default, `wp db import` strips the SQL modes that WordPress Core disables (such as `STRICT_TRANS_TABLES` and `NO_ZERO_DATE`) so that dumps containing legacy values like `0000-00-00` import cleanly. Pass this flag to import under the server's own SQL modes instead. + [--defaults] Loads the environment's MySQL option files. Default behavior is to skip loading them to avoid failures due to misconfiguration.