Skip to content

Commit

Permalink
Merge pull request #500 from gtoniser/master
Browse files Browse the repository at this point in the history
 Added SQL_MODE for copy and move operations to prevent import errors
  • Loading branch information
lem9 committed Jul 15, 2013
2 parents b7a5274 + 482d0de commit c38b6fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libraries/operations.lib.php
Expand Up @@ -377,6 +377,11 @@ function PMA_getSqlQueryAndCreateDbBeforeCopy()
$GLOBALS['dbi']->query($local_query); $GLOBALS['dbi']->query($local_query);
$GLOBALS['db'] = $original_db; $GLOBALS['db'] = $original_db;


// Set the SQL mode to NO_AUTO_VALUE_ON_ZERO to prevent MySQL from creating
// export statements it cannot import
$sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'";
PMA_DBI_query($sql_set_mode);

// rebuild the database list because PMA_Table::moveCopy // rebuild the database list because PMA_Table::moveCopy
// checks in this list if the target db exists // checks in this list if the target db exists
$GLOBALS['pma']->databases->build(); $GLOBALS['pma']->databases->build();
Expand Down

0 comments on commit c38b6fa

Please sign in to comment.