Skip to content

Commit 1acc48e

Browse files
committed
Add debugging info
1 parent 1067274 commit 1acc48e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

features/db-query.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Feature: Query the database with WordPress' MySQL config
9696
Scenario: SQL modes do not include any of the modes incompatible with WordPress
9797
Given a WP install
9898

99-
When I run `wp db query 'SELECT @@SESSION.sql_mode;'`
99+
When I try `wp db query 'SELECT @@SESSION.sql_mode;' --debug`
100100
Then STDOUT should not contain:
101101
"""
102102
NO_ZERO_DATE

src/DB_Command.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,6 +1807,14 @@ protected function get_sql_mode_query( $assoc_args, $modes = [] ) {
18071807
return '';
18081808
}
18091809

1810+
WP_CLI::debug(
1811+
sprintf(
1812+
'SQL mode adaptation is needed: %s => %s',
1813+
$this->get_current_sql_modes( $assoc_args ),
1814+
$modes
1815+
)
1816+
);
1817+
18101818
$modes_str = implode( ',', $modes );
18111819

18121820
return "SET SESSION sql_mode='{$modes_str}';";

0 commit comments

Comments
 (0)