Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/DB_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ public function import( $args, $assoc_args ) {
? 'SOURCE %s;'
: 'SET autocommit = 0; SET unique_checks = 0; SET foreign_key_checks = 0; SOURCE %s; COMMIT;';

$query = $this->get_sql_mode_query( $assoc_args ) . $query;

$mysql_args['execute'] = sprintf( $query, $result_file );
} else {
$result_file = 'STDIN';
Expand Down Expand Up @@ -1834,16 +1836,12 @@ protected function get_current_sql_modes( $assoc_args ) {

// Make sure the provided arguments don't interfere with the expected
// output here.
$args = $assoc_args;
unset(
$args['column-names'],
$args['result-format'],
$args['json'],
$args['html'],
$args['table'],
$args['tabbed'],
$args['vertical']
);
$args = [];
foreach ( [] as $arg ) {
if ( isset( $assoc_args[ $arg ] ) ) {
$args[ $arg ] = $assoc_args[ $arg ];
}
}

if ( null === $modes ) {
$modes = [];
Expand Down