Skip to content

Commit efcf072

Browse files
Only unset defaults before running command. Allow defaults to be used in querying the SQL mode
1 parent e9c4e8a commit efcf072

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/DB_Command.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,6 +1768,10 @@ private static function run( $cmd, $assoc_args = [], $send_to_shell = true, $int
17681768
'pass' => DB_PASSWORD,
17691769
];
17701770

1771+
if ( array_key_exists( 'defaults', $assoc_args ) ) {
1772+
unset( $assoc_args['defaults'] );
1773+
}
1774+
17711775
if ( ! isset( $assoc_args['default-character-set'] )
17721776
&& defined( 'DB_CHARSET' ) && constant( 'DB_CHARSET' ) ) {
17731777
$required['default-character-set'] = constant( 'DB_CHARSET' );
@@ -2051,8 +2055,6 @@ protected function get_defaults_flag_string( &$assoc_args ) {
20512055
$flag_string = '';
20522056
}
20532057

2054-
unset( $assoc_args['defaults'] );
2055-
20562058
}
20572059

20582060
return $flag_string;

0 commit comments

Comments
 (0)